필터 지우기
필터 지우기

imread seems to alter the image saturation?

조회 수: 5 (최근 30일)
Steven Pan
Steven Pan 2024년 2월 27일
댓글: Steven Pan 2024년 2월 28일
Why does the image read by imread() seem to have a reduced saturation compared to the original image? This also happens when the image is read through an imageDatastore object, I guess the underlying method is still imread(). The codes I used are included below:
img = imread("img_original.jpg");
figure, imshow(img)
which produce something like this:
while the original image file, open in FastStone looks like this:
You can also open the img_original.jpg to see it yourself.
While inspecting the histogram, I see that the blue channel has been altered the most when comparing to the histogram from FastStone. The original image seems to have a lot of blue pixels saturated at 0, while the Matlab's blue histogram shows a slight shift to the right. This is also evident from the red channel.
Factors I have investigated include:
  • bit-depth
  • JPG format
  • imread optional arguments
  • Monitor display setting: the colour histogram is evident that colour has changed
  • FastStone: I also tried the default Windows image viewer and it looks the same as in FastStone
Can someone please explain what may cause this colour discrepancy when I just simply read the image? Thank you!
  댓글 수: 3
Steven Pan
Steven Pan 2024년 2월 28일
I also tested with OpenCV. The result is the same, the colour discepancy is there too.
Steven Pan
Steven Pan 2024년 2월 28일
I believe I found the reason. Turns out the FastStone image viewer may have added extra saturation to enhance the image and makes it more appealing (like many other image viewing software do). However, if you try something like IrfanView you should see the same colour viewed in Matlab. I will attach a comparison here. Therefore, the slightly dull colour from Matlab is the "true" colour of this image.

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

답변 (0개)

카테고리

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

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by