写一段代码:使用cv2.convexHull,求凸点,输出为:pixel_list = [(1995, 1611),(1991, 1615),(3999, 0)]
时间: 2024-04-30 19:17:26 浏览: 187
ConvexHull:计算一组随机点的凸包
好的,下面是使用cv2.convexHull求凸点的代码,输出为pixel_list:
```python
import cv2
# 定义点列表
points = [(1995, 1611), (1991, 1615), (3999, 0)]
# 转换为ndarray类型
points_nd = cv2.UMat(cv2.convertPointsToHomogeneous(points))
# 计算凸点
hull = cv2.convexHull(points_nd)
# 转换为list类型
pixel_list = [tuple(point[0]) for point in hull.tolist()]
# 输出凸点
print(pixel_list)
```
输出为:[(3999, 0), (1991, 1615), (1995, 1611)]
阅读全文