
Python演示投影法分割图像示例(一)。
5星
- 浏览量: 0
- 大小:None
- 文件类型:None
简介:
投影法常被应用于图像的阈值分割操作。 接下来,我们将通过Python编程语言来演示其具体应用。以下是相应的代码:
```python
import cv2
import numpy
img = cv2.imread(rD:/0.jpg, cv2.COLOR_BGR2GRAY)
height, width = img.shape[:2]
#resized = cv2.resize(img, (3*width,3*height), interpolation=cv2.INTER_CUBIC)
#二值化
_, thresh = cv2.threshold(img, 150, 255, cv2.THRESH_BINARY)
cv2.imshow(threshold, thresh)
```
全部评论 (0)
还没有任何评论哟~


