Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I correlate two images excluding a specific value?

1 回表示 (過去 30 日間)
ariana salazar
ariana salazar 2020 年 2 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
My goal is to correlate these two images, but I need to exclude the values outside the red and blue squares. They are transparent in the original png, but get a value of 0 when imported to matlab.
Any help would be highly appreciated.
Screen Shot 2020-02-04 at 10.31.48 AM.png

回答 (1 件)

Vinai Datta Thatiparthi
Vinai Datta Thatiparthi 2020 年 2 月 7 日
Hey Ariana,
A simple workflow would be -
  • Crop the two images appropriately to exclude the dark areas (with intensity values 0) using the function imcrop
  • From the description of your question, it's a bit unclear what exactly it is that you want out of correlation. Typically, the function corr2 returns the 2-D correlation coefficient as a scalar, the function corrcoeff returns a matrix of correlation coefficients, or you could also use xcorr2 which would return the spatial correlation of image1 with respect to image2.
The function that you finally end up using depends on the kind of output that you want out of correlation.
Hope this helps!

Community Treasure Hunt

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

Start Hunting!

Translated by