sketch recognition
조회 수: 2 (최근 30일)
이전 댓글 표시
I AM USING THIS PROGRAM FOR SKETCH RECOGNITION HOWEVER IT IS GIVING ME THE ERROR ??? Subscripted assignment dimension mismatch.
Error in ==> sym_rec_main2 at 60 I3Dtotal(:,:,2) = Ibw3D2;
WHAT AM I DOING WRONG?
I3D1 = imread('IMG_0001.jpg');
I3D2 = imread('IMG_0002.jpg');
I3D3 = imread('IMG_0003.jpg');
I3D4 = imread('IMG_0004.jpg');
size3Dr = input('Enter number of training sets');
size3Dc = input('Enter number of different symbols');
sizer = size3Dr; %Assuming equal traning sets
sizec = size3Dc;
noimages = sizer/6;
Igray1 = rgb2gray(I3D1);
Ibw3D1 = im2bw(Igray1,graythresh(Igray1));
Igray2 = rgb2gray(I3D2);
Ibw3D2 = im2bw(Igray2,graythresh(Igray2));
Igray3 = rgb2gray(I3D3);
Ibw3D3 = im2bw(Igray3,graythresh(Igray3));
Igray4 = rgb2gray(I3D4);
Ibw3D4 = im2bw(Igray3,graythresh(Igray4));
I3Dtotal(:,:,1) = Ibw3D1;
I3Dtotal(:,:,2) = Ibw3D2;
I3Dtotal(:,:,3) = Ibw3D3;
I4Dtotal(:,:,3) = Ibw3D4;
rfactor = 1; crpval = 0;
for i = 1 : noimages
I = I3Dtotal(:,:,i);
img = sym_rec_img_preprocess(I, size3Dr, size3Dc, noimages);
for cnt = 1:((size3Dr*size3Dc)/noimages)
bw2 = img_crop(img{cnt}, rfactor, crpval);
charvec = img_resize(not(bw2));
out3D(:,cnt,i) = charvec;
end
end
댓글 수: 0
답변 (2개)
Walter Roberson
2011년 4월 6일
Use size() to check that all of the I3D* image arrays are the same size.
댓글 수: 5
Walter Roberson
2011년 4월 6일
It is 07:00 here and I am going to bed in a moment. It is better to post your questions as others may be able to answer them. Especially if they are questions about the sketch recognition portion, as I am not familiar with the techniques used for sketch recognition.
Tim Zaman
2011년 4월 6일
The images you are using in this code have to be the exact amount of pixels: so if image 1 is 800x600, image 2 has to be 800x600 too. Common error with image processing.
댓글 수: 2
Walter Roberson
2011년 4월 6일
You could use the imresize() suggestion I made earlier. You will have to decide whether you want to size the small images up, or the larger images down.
참고 항목
카테고리
Help Center 및 File Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!