MATLAB: Insignificant Changes in mean value of RGB for Different Images with contrary color

color differencecolor spacedelta efishImage Processing Toolboxlab colorrgb

Hello.I'm newbie here.I want to ask opinion about my coding.My project is to detect color changes in fish body segment with different level concentration of water impurities.Color changes are defined through mean value of RGB .Below are the codes
RGB1=imread('C:\Users\user\Documents\MATLAB\C330min1crop.jpg');
A=RGB1;
R=A(:,:,1);
I2=histeq(R);
Pixel_Values_Imred=single(I2);
mean_I2= mean(Pixel_Values_Imred(:))
G=A(:,:,2);
I3=histeq(G);
Pixel_Values_Imgreen=single(I3);
mean_I3= mean(Pixel_Values_Imgreen(:))
B=A(:,:,3);
I4=histeq(B);
Pixel_Values_Imblue=single(I4);
mean_I4= mean(Pixel_Values_Imblue(:))
figure, subplot(3,1,1),imhist(R),title('Red Color Histogram');
subplot(3,1,2),imhist(G),title('Green Color Histogram');
subplot(3,1,3),imhist(B),title('Blue Color Histogram');
After running the codes,results show just a little changes in mean value for rgb histogram which only changes in point value.I expect the results will show significant changes since even just looking at the images with naked eyes, the color differences between images are in contrary.For example RED histogram,mean value of (concentration 1)Image1=127.6574 and (concentration 2)image 2=127.4563.Changes are insignificant.My question is is it normal for the value to only change in point or there are errors in my coding?Please correct me if I'm wrong :)Thank you

Best Answer

I was just consulting with someone on a similar situation. They wanted to know why a rainbow/oil-slick-like corrosion/etching on metal did not show any meaningful difference in the delta E color change despite the surfaces looking quite different from nearly gray to pastel rainbows to vivid rainbows. Obviously one is a lot more colored than the other so delta E should show that right? No, not necessarily. When you use a colorimeter, spectrophotometer, radiometer, or digital image, you're calculating the location of the centroid color. Well two gamuts (clusters of points in RGB space or LAB color space) could have the same centroid but the cluster could be different widths, right? Look at my icon to the left. Imagine you had a point in that coordinate system for every pixel in your image. That collection of points is called the "gamut." So you can't just compare the distance between the centroids (the mean color) - you also have to look at the distance between every pixel and the mean color. That distance WILL be different if the cluster is larger or smaller. Attach your images and we can discuss in more detail.
Related Question