[xcorr2()] Counting elements using autocorellation

1 回表示 (過去 30 日間)
Matthew Labstein
Matthew Labstein 2020 年 3 月 25 日
Hello everyone,
I'm trying to use the xcorr2() funtion to do an autocorrelation in order to count the number of objects on a picture. For example this one:
However, the result is not the one I expect. Here is the result of the autocorrelation:
There seems to be a sort of symmetry and a prominent central correlation (big spot in the middle) and I can't find out how to get rid of it... (even by looking further in the definition of autocorrelation)
Here is my code:
imageRGB = imread('birds.png');
imageGRAY = double(rgb2gray(imageRGB));
im = imageGRAY - mean(mean(imageGRAY));
icorr = xcorr2(im);
image(icorr);
Thanks in advance for your help!

回答 (0 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by