learning opencv3: 十:Threshold Operations_随笔

learning opencv3: 十:Threshold Operations_随笔_02

 

Adaptive Threshold
cv::adaptiveThreshold() allows for two different adaptive threshold types depend‐
ing on the settings of adaptiveMethod. In both cases, we set the adaptive threshold
T(x, y) on a pixel-by-pixel basis by computing a weighted average of the b × b region
around each pixel location minus a constant, where b is given by blockSize and the
constant is given by C. If the method is set to cv::ADAPTIVE_THRESH_MEAN_C, then all
pixels in the area are weighted equally. If it is set to cv::ADAPTIVE_THRESH_GAUS
SIAN_C, then the pixels in the region around (x, y) are weighted according to a Gaus‐
sian function of their distance from that center point.
 

The adaptive threshold technique is useful when there are strong illumination or
reflectance gradients that you need to threshold relative to the general intensity gra‐
dient. This function handles only single-channel 8-bit or floating-point images, and it
requires that the source and destination images be distinct.