_, thresh = cv2.threshold(image, 128, 255, cv2.THRESH_BINARY)
时间: 2024-05-25 22:12:57 浏览: 17
这段代码使用 OpenCV 库中的 threshold 函数对图片进行二值化处理。其中,image 表示输入的图片,128 表示阈值,255 表示最大值,cv2.THRESH_BINARY 表示采用二值化方法。函数的返回值为二值化后的图片和阈值。具体来说,大于阈值的像素点被设为最大值,小于阈值的像素点被设为0。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)