Unable to determine file format and Ground truth error... Help

조회 수: 2 (최근 30일)
devang bhatt
devang bhatt 2018년 4월 26일
댓글: devang bhatt 2018년 4월 27일
disp('sparce disctonary processing. . ');
model = cell(1,5);
modelLow = cell(1,5);
DHigh = cell(1,5);
DLow = cell (1,5);
lamda = 0.025;
max_level= 1;
windowSize=5;
skipSize=1;
DictionarySize =100;
%%%%lena Train
dirNameTrain = '.\Train\';
% % outputName = '.\Results2\';
DTrain = dir(dirNameTrain); % check dir command, in matlab documentation
i=3;
ground_truth = [dirNameTrain DTrain(i).name];
patchSize = windowSize ^2;
truth_img = imread(ground_truth);
end
  댓글 수: 2
Ameer Hamza
Ameer Hamza 2018년 4월 27일
Can you show the output of
disp(class(DTrain(3).name));
disp(DTrain(3).name);
devang bhatt
devang bhatt 2018년 4월 27일
code attach here.. Help to solve this error..

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2018년 4월 27일
You are blindly reading in everything in the directory, but your directory contains Thumbs.db as well as whatever content you are expecting. You should be making your dir() more specific.
  댓글 수: 3
Walter Roberson
Walter Roberson 2018년 4월 27일
Change
DTrain = dir(dirNameTrain); % check dir command, in matlab documentation
to
DTrain = dir(fullfile(dirNameTrain, '*.jpg')); % check dir command, in matlab documentation
devang bhatt
devang bhatt 2018년 4월 27일
Thank you so much..:) This will help me..

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by