필터 지우기
필터 지우기

error in attached program

조회 수: 1 (최근 30일)
Balaji M. Sontakke
Balaji M. Sontakke 2018년 4월 15일
댓글: Balaji M. Sontakke 2018년 4월 17일
Index exceeds matrix dimensions.
Error in ext_vein (line 381) dist_m = dist2(minutiae(:,1:2), minutiae(:,1:2));
Error in build_db (line 22) traindata{id_train}=ext_vein(X,1);

채택된 답변

Walter Roberson
Walter Roberson 2018년 4월 15일
When minu_count is 0 then t_minuae will be left as [] and so will not have columns 1:2 to index into.
  댓글 수: 6
Balaji M. Sontakke
Balaji M. Sontakke 2018년 4월 16일
편집: Walter Roberson 2018년 4월 16일
Error using reshape
To RESHAPE the number of elements must not change.
Error in build_db (line 57)
reduced_testdata = reshape(reduced_testdata, 24, 60)
%%Training images
id_test = 0;
id_train = 0;
for folder_idx = 1 : 20 % no of classes
for i = 1 : 9 % no of images per class
thisfile = fullfile('train', num2str(folder_idx), [num2str(i) '.bmp ']);
B = imread(thisfile );
X = double(B);
X = imresize(X,[120 120],'bilinear'); %300 250
id_train = id_train+1;
traindata{id_train}=ext_vein(X,1);
end
end
%%Testing images
d=[];
for folder_idx = 1 : 20 %no of classes
for i = 1 : 3 % no of images per class
thisfile = fullfile('test', num2str(folder_idx), [num2str(i) '.bmp ']);
B = imread(thisfile );
X = double(B);
X = imresize(X,[120 120],'bilinear'); %300 250
id_test = id_test+1;
testdata{id_test}=ext_vein(X,1);
end
end
%%Reduced dimension of rows ( fixed to only 20 rows)
reduced_testdata = cellfun(@(M) M(1:min(end,4), :), testdata, 'uniform', 0);
reduced_traindata = cellfun(@(M) M(1:min(end,4), :), traindata, 'uniform', 0);
%%reshape
% reduced_testdata = reshape(reduced_testdata,1,[]);
reduced_testdata = reshape(reduced_testdata, 60,24);
reduced_traindata = reshape(reduced_traindata, 180,24);
%reduced_traindata = reshape(reduced_traindata,1,[]);
save('db1.mat','reduced_testdata');
save('db2.mat','reduced_traindata');
Balaji M. Sontakke
Balaji M. Sontakke 2018년 4월 17일
Sir, I tried a lot but am not able to reshape my cell array into 180 X 24, please help..

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by