Comparing RGB pixel values of two .tiff images

조회 수: 1 (최근 30일)
Vespi
Vespi 2016년 3월 3일
댓글: Vespi 2016년 3월 4일
I have two TIFF files that represent a region but for two separate years. The TIFF files were downloaded as 1 band, but I converted then to RGB (3 band) via ArcGIS. I have extracted the RGB channels using the code below for both images:
R1=im1(:,:,1);
G1=im1(:,:,2);
B1=im1(:,:,3);
So now that I have 3 matrices for each image I want to compare the RGB values between the two images (two years). What would be the most efficient way to compare RGB values by pixel between these two images?

답변 (2개)

Walter Roberson
Walter Roberson 2016년 3월 3일
isequal()
  댓글 수: 1
Vespi
Vespi 2016년 3월 4일
Thank you Mr. Roberson. I failed to mention that I would like to extract the pixel numbers where the images are different to obtain the rgb values within those pixels. I have a separate file that identifies the type of land use based on RGB code. Could I save these rgb values where there are differences detected in excel?

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


Image Analyst
Image Analyst 2016년 3월 3일
What does "compare" mean to you? Find the difference? See if they're equal?
diffImage = double(R1) - double(R2);
subplot(1,2,1);
imshow(diffImage, []);
subplot(1,2,2);
notEqual = R1 ~= R2;
imshow(notEqual);
  댓글 수: 1
Vespi
Vespi 2016년 3월 4일
By compare I mean find the differences between the two images. I would like to extract the pixel numbers where the images are different to obtain the rgb values within those pixels. I have a separate file that identifies the type of land use based on RGB code. Could I save these rgb values where there are differences detected in excel?

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

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by