Image thresholding classifies pixels by comparing their intensities with a threshold, often producing a binary image. A global threshold uses the same value throughout the image; adaptive thresholding permits the threshold to depend on position and nearby intensities.[ref]
Image Thresholding in the OpenCV documentation. Simple Thresholding; Adaptive Thresholding
For example, defineIntensities then become . The comparison at equality matters: a rule using would instead give . OpenCV's
THRESH_BINARY uses the strict greater-than rule, assigning its chosen maximum output value only above the threshold.[ref]Image Thresholding in the OpenCV documentation. Simple Thresholding, threshold equality and maxval
Threshold choice affects which distinctions survive. Two different bright intensities can become the same foreground value, while a small change near the boundary can change a pixel's classification. The resulting mask can then feed connected-component labeling, where pixel connectivity separately decides which selected pixels form a region.
A useful motivating experiment keeps one image of dark marks fixed while adding or recording a gradual illumination variation across the background. Compare a global threshold with a declared local-neighborhood rule, inspecting lost strokes and falsely selected background. OpenCV documents local mean and Gaussian-weighted rules with an offset; this addresses varying illumination rather than proving that every resulting region is a meaningful object.[ref]
Image Thresholding in the OpenCV documentation. Adaptive Thresholding, neighborhood-based thresholds and varying illumination
A histogram can guide global selection, but intensity statistics alone do not determine semantic identity. Noise and overlapping foreground/background intensities can make every threshold imperfect. Report the input representation, comparison convention and any filtering or local-window settings so that a thresholded result can be reproduced.
Articles by others on the same topic
There are currently no matching articles.