graythresh_8_or_16b​it

A simple modification of MATLAB's "graythresh" to use 65536 levels for 16 bit images, rather than 256.
33 Downloads
Updated 3 Aug 2022

View License

A simple modification of MATLAB's "graythresh" to use 65536 levels for 16 bit images, rather than 256.
MATLAB's "graythresh" uses a histogram of 256 bins regardless of input image class. This can lead to poor choices for threshold values for, for example, 16-bit images that use a small fraction of the full range. Also, it's odd to avoid using the full bit depth. Therefore, this version uses 65536 bins for 16-bit images (uint16 or int16), and 256 for 8-bit, single, or double.

Cite As

Raghuveer Parthasarathy (2026). graythresh_8_or_16bit (https://www.mathworks.com/matlabcentral/fileexchange/115855-graythresh_8_or_16bit), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0