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