Saturation limit on 16 bit image in MATLAB

22 vues (au cours des 30 derniers jours)
Happy PhD
Happy PhD le 6 Oct 2022
I have a series of images and I am trying to decide if its saturated or not. This is the intensity levels i got with code below after uploading iamges. The images are grayscale mono:
34960 of 65535a.u.
34608 of 65535a.u.
34976 of 65535a.u.
34912 of 65535a.u.
48528 of 65535a.u.
65504 of 65535a.u.
65504 of 65535a.u.
65504 of 65535a.u.
63792 of 65535a.u.
34912 of 65535a.u.
34784 of 65535a.u.
It seems to me that maybe 3 of the images might be at saturation but I am not sure. The images was saved as 16 bit (although camera only allows 12 bit). The Vimba program (Allied Vision GiGE camera) allows images to be saved as 16 bit tiff images. I want to use 16 bit becuase something weird happens to 12 bit images uploaded into 8 or 16 bit in MATLAB. I use imread to upload image into uint16 matrix.
With 16 bit we have the range 2^16 = 65536.
I used this code to check saturation levels:
int_value = max(max(grayImage_orig));
if int_value < 2^(bitValue)-2
disp('image not saturated')
disp([num2str(int_value),' of ',num2str(2^(bitValue)-1), 'a.u.'])
else
disp(['image is saturated',' max value:',num2str(2^(bitValue)-2)])
return
end
I am a little worried that 65504 might be maximal value but it should be 65536. Am I wrong?
Thanks!
  3 commentaires
Happy PhD
Happy PhD le 11 Oct 2022
Modifié(e) : Happy PhD le 11 Oct 2022
Yes, the pictures I looked at was saturated at an value lower value than 65535, so there must be something gone wrong in the conversion. I switched camera now which includes 16 bit images, so that should now work better. New camera also allows me to see max intensity live, so I don't wonder if its saturated or not. Thanks for input!
Bjorn Gustavsson
Bjorn Gustavsson le 13 Oct 2022
Was the intensities up to 2^12-1 in your saturated image? Then that seems like a natural upper limit if you read out the image with 12 bits AD.

Connectez-vous pour commenter.

Réponses (1)

Bjorn Gustavsson
Bjorn Gustavsson le 11 Oct 2022
To just look at the maximum pixel-intensity is not the best of ways to handle this. For science-grade cameras you typically get the proper image out (compared to regular photography-cameras where no one outside of the producers knows what goes on in terms of image-processing before we get our hands on the images). That means that the raw images typically have a couple of dead and hot pixels, there might be a couple of pixels impaced by "cosmic rays" that lead to full-well-intensities, In my field of research we sometimes have a couple of bright stars saturating the images, etc. These few-pixel imperfections will all lead to false positives in your max-intensity-test. What you have to do instead is to look at how large fraction of the images are within a couple of counts from 65535, and then judge the saturation from that number.
HTH

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by