How to find the entropy value of an RGB image after histogra equalization in Y plane.?

조회 수: 3 (최근 30일)
I am finding entropy value of an RGB image after histogram processing in Y plane, as follows:
i % the original image
y1=rgb2ycbcr(i); y=y1(:,:,1);cb=y1(:,:,2);cr=y1(:,:,3); he1=histeq(y); r1=cat(3,he1,cb,cr); r1=ycbcr2rgb(r1);
g1=rgb2gray(r1); e1=entropy(g1):
Now I followed the procedure:
imwrite(r1,'temp1.jpg'); i2=imread('temp1.jpg'); g2=rgb2gray(i2); e2=entropy(g2)
But now e1 and e2 are different. Why it is so?

채택된 답변

Guillaume
Guillaume 2015년 12월 17일
How much different?
Do you know that the jpg format is a lossy compression format? Every time you save an image as jpg, some of the pixel values are slightly changed.
If you use a non-lossy compression format such as png, does the entropy change?
  댓글 수: 1
arun kumar
arun kumar 2015년 12월 17일
Thank you so much Guillaume. Now I saved the image with 'jpg' extension in 'lossless' mode. Now getting the same values of e1 and e2. Even with 'png' also I can get same values.
Thank you once again

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by