Find size of template in image cross correlation

조회 수: 1 (최근 30일)
mustafa alnasser
mustafa alnasser 2016년 1월 7일
답변: Image Analyst 2016년 1월 11일
Dear All;
I am using image cross correlation to determine the displacement of moving object but i have trouble to determine the size of the template . each time i change the size of the template i got something different . how can i resolve this problem .
Best Regards
  댓글 수: 1
Tushar Sinha
Tushar Sinha 2016년 1월 11일
Hi Mustafa,
Could you please share a small example showing where exactly you are seeing the issue? Also, could you please clarify what you mean by changing the size of the template?
-Tushar

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

답변 (1개)

Image Analyst
Image Analyst 2016년 1월 11일
Hopefully you're using normalized cross correlation, normxcorr2(), and not xcorr2(). It's a common misconception that regular correlation will locate a template. It can but it's not very robust. You can easily think of situations where the template won't be found, like where you have a dark template and bright other areas. And of course if you threshold the correlation then it's possible that there may be several possible areas that the template exists in the image. But you need to threshold because of the presence of noise - you can't just go for an exact match, though taking the highest value would get the location in most situations I believe. See my attached demo.

Community Treasure Hunt

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

Start Hunting!

Translated by