Grayscale image - saturation value

13 views (last 30 days)
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 Comments
Walter Roberson
Walter Roberson on 3 Nov 2015
I do not understand what the reference is to C# ? This is a resource about MATLAB.
jane thony
jane thony on 3 Nov 2015
I have edited the question. Thanks!

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 3 Nov 2015
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 Comments
jane thony
jane thony on 3 Nov 2015
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.

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 3 Nov 2015
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.)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!