필터 지우기
필터 지우기

How to do correlation between two tiff image files?

조회 수: 14 (최근 30일)
Thara C.S
Thara C.S 2019년 3월 7일
댓글: Image Analyst 2020년 3월 16일
Find the pixel-wise correlation between two tiff images and store it in a matrix?

답변 (2개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 3월 7일
편집: madhan ravi 2019년 3월 7일
im1=imread('image1.tif');
im2=imread('image2.tif');
result=corr2(im1,im2);
Note: If the input images are RGB, convert both images in gray and apply corr2.
Please ensure that both images having same size.
  댓글 수: 3
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 3월 8일
Direct corelation gives a number, if you are looking for matrics, please look on Correlation coefficients
im1=double(rgb2gray(imread('21_training.tif')));
im2=double(rgb2gray(imread('25_training.tif')));
R=corrcoef(im1,im2)
R =
1.0000 0.9419
0.9419 1.0000
But I dont know wheather it serves the main objective of your problem or not?
You can find the corrcoef of single matrix, which returns a matrix of coefficients.
im1=double(gray_image);
R=corrcoef(im1)
Thara C.S
Thara C.S 2019년 3월 11일
but,
i need a graphical representation of pixel wise correlation between two tiif images?

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2019년 3월 11일
Try xcorr2():
correlationImage = xcorr2(image1, image2);
imshow(correlationImage, []);
It will give an image of the spatial correlation of image1 with image2. From that you can get profiles if you want.
  댓글 수: 4
Yunus Emre SARI
Yunus Emre SARI 2020년 3월 16일
How to print the resulting tif file into a folder
Image Analyst
Image Analyst 2020년 3월 16일
You can use imwrite(). If correlationImage is double, then convert to uint8 and then call imwrite():
uint8Image = uint8(mat2gray(correlationImage));
imwrite(uint8Image, fileName);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by