Spatial Correlation Coefficient between two RGB images

6 ビュー (過去 30 日間)
Julia Merta
Julia Merta 2022 年 10 月 18 日
回答済み: Poorna 2023 年 8 月 29 日
Hello, I'm looking for the function which will help me to find Spatial Correlation Coefficient (SCC) between two RGB images and it will return me one double value. I have two images one is original .tif fille and the second is the same file but compressed with JPG algorithm (Q=30%). Each file is 1024x1360x3 uint8 matrix.
Should I convert the images to gray scale? I tried to do that with this function: im_gray=mat2gray(im); but the image is still three dimensional.
I'd really appreciate your help

回答 (1 件)

Poorna
Poorna 2023 年 8 月 29 日
Hi Julia Merta,
I understand that you would like to find SCC between two RGB Images. First, An RGB Image can be converted to gray scale using the rgb2gray function.
After this, corr2 can be used to find the correlation coefficient between the two images.
In short you can do this.
im1 = imread('image1.jpg');
im2 = imread('image2.jpg');
im1_gray = rgb2gray(im1);
im2_gray = rgb2gray(im2);
result = corr2(im1_gray, im2_gray);
Hope this helps!

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by