Normalized Cross Correlation for rgb image

Here is the code for to find normalized cross correlation between two images.
function NK = NormalizedCrossCorrelation(origImg, distImg)
origImg = double(origImg);
distImg = double(distImg);
NK = sum(sum(origImg .* distImg)) / sum(sum(origImg .* origImg));
But it works for grey scale images. When I run it for rgb image, error occurred: ??? Error using ==> mrdivide Inputs must be 2-D, or at least one input must be scalar.
Error in ==> NormalizedCrossCorrelation at 15 NK = sum(sum(origImg .* distImg)) / sum(sum(origImg .* origImg)); Can you please help me modify this code for rgb image. Thanks in advance.

2 件のコメント

Mohammad Abouali
Mohammad Abouali 2014 年 12 月 14 日
Sorry, but that is not Normalized cross correlation even for a gray scale image.
Nataliya
Nataliya 2014 年 12 月 14 日
Are you sure? Can you provide me the code for normalized cross correlation?

サインインしてコメントする。

 採用された回答

Image Analyst
Image Analyst 2014 年 12 月 14 日

0 投票

See my attached demo of it.

その他の回答 (0 件)

タグ

タグが未入力です。

質問済み:

2014 年 12 月 14 日

回答済み:

2014 年 12 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by