% I can read in an image and calculate a threshold for which the pixels are above some value, i.e., 6000.
Threshold=Q>6000;
% I can count the number of those pixels above that value
PixelCount = sum(Threshold(:))
% ratio the PixelCount over the total # of pixels in an image with dimensions X1, Y1 to determine a fraction, or percent of pixels above that value
Fraction=PixelCount/(X1*Y1)
But if I wish to calculate the intensity value that represents a desired fraction, i.e. 0.001, - instead of choosing an arbitrary number, like 6000........... how do I program to extract the intensity value that represents cutoff for which 99.9% of pixels have a lower intensity ?
I should mention these are uint16 images.
1 Comment
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/630984-determine-the-intensity-value-t-in-a-2d-image-for-which-99-9-of-all-intensity-values-are-less-t#comment_1096989
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/630984-determine-the-intensity-value-t-in-a-2d-image-for-which-99-9-of-all-intensity-values-are-less-t#comment_1096989
Sign in to comment.