Normalized 2D cross correlation
이전 댓글 표시
c = normxcorr2(onion,peppers);
[ypeak, xpeak] = find(c==max(c(:)));
yoffSet = ypeak-size(onion,1);
xoffSet = xpeak-size(onion,2);
Does anyone know why the dimension of "c" is about (size(onion,1)+size(peppers,1)*)(size(onion,2)+size(peppers,2))? and what are the meanings of xoffset and yoffset? why do they need to be acquired like that?
In the example in the URL, the template is exactly croped from A. But what if my template and image are of different scales? How do I get the desired area?
thanks,
답변 (1개)
Image Analyst
2015년 4월 5일
1 개 추천
When you correlate or convolve two images, the result is bigger because you will still have overlap even if only part of the images overlap, like one image is mostly outside the other image and only the right column of the left image overlap the left column of the right image.
By the way, I've attached my demo on template finding using normxcorr2.
카테고리
도움말 센터 및 File Exchange에서 Template Matching에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!