error in attached program
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
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
2018년 4월 15일
0 개 추천
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
2018년 4월 16일
편집: Walter Roberson
2018년 4월 16일
second error is
Error using knnclassify (line 96)
The length of GROUP must be equal to the number of rows in TRAINING.
Error in maintotaldemo (line 65)
predictlabel = knnclassify(P_test, P_train, train_label,1,'euclidean','nearest');
I have 20 classes 9 images for P_train class and 3 images for P_test classe. four minutie with 6 columns having x,y,Crossing Number,theta(orientation,flag and permissible minutie extracted from each image so I get P_train i.e 720 X 6 and my train label is 180 X 1, when I use knnclassify group length error occurred, sir is that possible to make group of rows and use index of that group in knnclassify ?
Walter Roberson
2018년 4월 16일
Those four minutiae for any one image: for the purpose of recognition do they need to all be matched, or is it enough to match any one of them?
If they all need to be matched then you should be using 180 x (6*4) rather than 720 x 6.
Balaji M. Sontakke
2018년 4월 16일
편집: Walter Roberson
2018년 4월 16일
Sir,is it possible 180 X (6*4) because I have used cell array e.g.
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
%%size of cell array is 1 X 180 like following
4x6 double 4x6 double....... 4x6 double
is it possible to provide cell array in knnclassify ? if possible then tain_label should be cell array or not
Walter Roberson
2018년 4월 16일
No you cannot give knn cell array. You should reshape it to a row vector, and the 180 samples would become a 180 x 24 array. The label would be 180 long and would be class number associated with the image.
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
2018년 4월 17일
Sir, I tried a lot but am not able to reshape my cell array into 180 X 24, please help..
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
