Image.threshold_adaptive#
- Image.threshold_adaptive(C: int = 0, h: int = 3, method: str = 'mean', blocksize: int | None = None) Image[source]#
Adaptive threshold
- Parameters:
C (int, optional) – _description_, defaults to 0
h (int, optional) – half-width of window, defaults to 3
- Returns:
thresholded image
- Return type:
The threshold at each pixel is the mean over a \(w \times w, w=2h+1\) window minus
C.hshould reflect the scale of the objects that are to be segmented from the background.- References:
P. Corke, Robotics, Vision & Control for Python, Springer, 2023, Section 12.1.1.1.
Important
Uses OpenCV function
cv2.adaptiveThresholdwhich accepts single-channel, CV_8U images.