フィルターのクリア

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 Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by