Borrar filtros
Borrar filtros

error in attached program

1 visualización (últimos 30 días)
Balaji M. Sontakke
Balaji M. Sontakke el 15 de Abr. de 2018
Comentada: Balaji M. Sontakke el 17 de Abr. de 2018
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);

Respuesta aceptada

Walter Roberson
Walter Roberson el 15 de Abr. de 2018
When minu_count is 0 then t_minuae will be left as [] and so will not have columns 1:2 to index into.
  6 comentarios
Balaji M. Sontakke
Balaji M. Sontakke el 16 de Abr. de 2018
Editada: Walter Roberson el 16 de Abr. de 2018
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 el 17 de Abr. de 2018
Sir, I tried a lot but am not able to reshape my cell array into 180 X 24, please help..

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by