阈值处理 (thresholding)
API
| 函数 | 说明 |
|---|---|
vision_threshold(v, threshold, type) | 阈值化 |
vision_inrange(v, lower, upper) | 范围检测,返回二值图像 |
阈值类型
| 类型 | 说明 |
|---|---|
"binary" | 像素 > threshold → 255,否则 0 |
"binary-invert" | 像素 > threshold → 0,否则 255 |
"tozero" | 像素 ≤ threshold → 0,否则不变 |
"tozero-invert" | 像素 > threshold → 0,否则不变 |
"truncate" | 像素 > threshold → threshold,否则不变 |