MATLAB: How to obtain the threshold 25% of the gray intensities

binarizeimage processingthresholding

Hi, i want to binarize an image by using thresholding.how to obtain threshold 25% of the gray intensities? (25% of the lower gray intensities are discarded) please gudie me.

Best Answer

Try this
binarizedImage = grayImage > 0.25 * intmax(class(grayImage));
That should work for uint8 or uint16 images and produce a logical image of the same size.