在两个图像之间找到相关性

34次观看(最近30天)
假设我想在两个图像之间执行相关性。我知道有一个函数normXcorr2可以用来查找两个图像(IMG1,img2)之间的相关性
When I run the imfilter command and use the imshow() command to output the resulting image, I can see that it is different from what I get when I output the resulting image using normxcorr2 command.The image generated through normxcorr2 looks more like what i would expect from the correlation of the two images. What's the difference between these two methods?
C = normxcorr2(img1, img2)
但是我可以使用Imfilter找到相关性吗?此命令执行相关性吗?
corr = imfilter(img1,img2,'corr',,,,'replicate');
When I run the imfilter command and use the imshow() command to output the resulting image, I can see that it is different from what I get when I output the resulting image using normxcorr2 command.
imshow(C);
数字
imshow(corr);
通过NormXcorr2生成的图像看起来更像是我对这两个图像的相关性的期望。这两种方法有什么区别?甚至逻辑上都使用Imfilter吗?
2条评论
穆罕默德·萨奎布·汗(Mohammad Saquib Khan)
我还没有研究过该文档,但我一定会现在这样做。如果在计算我的变量corr后,我将其归一化呢?然后,这两个结果图像会相同吗?

登录发表评论。

接受的答案

Image Analyst
Image Analyst on 24 Sep 2021
NormXcorr2()用窗口扫描图像,并在每个位置进行标准化。Imfilter()不。它简单地将窗口移动,将像素乘以并总和 - 没有归一化。您无法将XCorr2()或Imfilter()输出图像归一化,以使其看起来像将每个位置的子映射标准化的样子。
4 Comments
Image Analyst
Image Analyst on 25 Sep 2021
如果您的输出是浮点图像,则必须确保其在0-1范围内,否则任何值都超过1的值将显示为白色。在显示前尝试铸造到UINT8。如果是灰度浮点图像,请尝试
imshow(yourImage, []);

登录发表评论。

更多答案(0)

社区寻宝

在Matlab Central中找到宝藏,发现社区如何为您提供帮助!

Start Hunting!

被某某人翻译