Grayscale image - saturation value

조회 수: 2 (최근 30일)
jane thony
jane thony 2015년 11월 3일
댓글: Image Analyst 2015년 11월 3일
How to calculate saturation value for a gray scale image? Is there a way or is it always zero? if zero, why? My problem here is, when I pass a gray scale image to the program...due to some activity that happens on this image, there is excess of saturated pixels, either black or white. How can i diagnose that image is highly saturated without having to make a comparison to the reference image? I am actually new handling these image statistics and any help will be really appreciated.
Thanks.
  댓글 수: 2
Walter Roberson
Walter Roberson 2015년 11월 3일
I do not understand what the reference is to C# ? This is a resource about MATLAB.
jane thony
jane thony 2015년 11월 3일
I have edited the question. Thanks!

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

채택된 답변

Image Analyst
Image Analyst 2015년 11월 3일
A pixel is saturated if the pixel value is at the upper or lower limit because the sensor or the digitizer cannot take any more or less light. For an 8 bit uint8 unsigned integer image, the most common, it's saturated if the pixel value is 0 or 255. Often you can tell if the image is saturated by looking at the histogram. If you see a spike in a single bin at either end of the histogram that doesn't look right, then it's saturated.
  댓글 수: 4
jane thony
jane thony 2015년 11월 3일
Unfortunately, I don't have the images with me now. I want to have the right direction pointed to me so that I can work on the approach before I hit the lab again.
Image Analyst
Image Analyst 2015년 11월 3일
Then try this
histogram(yourImage);

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 3일
It is common for Black and White to be coded as 0 and 255 respectively, and you cannot really call that "saturated".
If you only have a small number of different values in the image (say 8 or 16) then your should probably assume that it has been "painted" or otherwise deliberately manipulated to change the distribution of values, and in that case you should probably guess that it is not saturated.
If you have a broader range of values, then you could do something like take the median of the counts between (say) 240 and 254 and take the ratio of the count at 255 to that. A ratio near 1.0 would be common, but if the ratio is substantially higher than 1 then 255 is "over-represented" . You could make this more concrete by assuming a normal distribution and calculating probabilities, but you have to be careful because images are not necessarily normal distribution (and sum-of-normals would probably be pretty common.)

Community Treasure Hunt

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

Start Hunting!

Translated by