필터 지우기
필터 지우기

Normalized 2D cross correlation

조회 수: 1 (최근 30일)
MING-CHANG CHIU
MING-CHANG CHIU 2015년 4월 5일
답변: Image Analyst 2015년 4월 5일
Hi, in this document normxcorr2, the example that Mathworks provide has the following snippet
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
Image Analyst 2015년 4월 5일
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.

Community Treasure Hunt

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

Start Hunting!

Translated by