matching template with image

조회 수: 1 (최근 30일)
lama riad
lama riad 2012년 6월 16일
I = imread('man.bmp'); % Load initial figure
a = imcrop(I,[50 40 150 100]);
m=imrotate(a,180);
%(Convolution is equivalent to correlation if you rotate the convolution kernel by 180.) To match the template to the image, use the fft2 and ifft2 functions.
C = real(ifft2(fft2(I).* fft2(m(a,2),256,256)));
I'm getting this error: ??? Subscript indices must either be real positive integers or logicals.
how to fix it ????

답변 (2개)

Walter Roberson
Walter Roberson 2012년 6월 16일
You are trying to index your rotated image at your cropped image -- m(a,2)
I do not know what you intend that to mean.
  댓글 수: 5
lama riad
lama riad 2012년 6월 16일
pardon me I mean I was seeking for help in matlab from people not necessarily in mathworks only n no one is replying I donno why I'm not professional in matlab that's why I'm asking..... some people published their works in mathwork n since I ask them regarding such a point in their work they r not replying
lama riad
lama riad 2012년 6월 16일
n thank u for the reply

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


Image Analyst
Image Analyst 2012년 6월 16일
"a" is a matrix. So is "m" - in fact it is the rotated version of "a". So you cannot do m(a,2). The first index must be an integer number or array or a logical value or array. You cannot have a 2D or 3D matrix (an image) for an index. I haven't replied to anyone in the past 8 days because I was way out in the wilderness. I don't work for Mathworks, by the way.

카테고리

Help CenterFile Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by