import numpy as np
import cv2
import matplotlib.pyplot as plt
a = np.array([[[10,10], [100,10], [100,100], [10,100]]], dtype = np.int32)
b = np.array([[[100,100], [200,230], [150,200], [100,220]]], dtype = np.int32)
print(a.shape)
im = np.zeros([240, 320], dtype = np.uint8)
cv2.polylines(im, a, 1, 255) # 绘制多边形
cv2.fillPoly(im, b, 255) # 绘制多边形 填充
plt.imshow(im)
plt.show()
python opencv绘制多边形和多边形填充
最新推荐文章于 2024-04-22 15:04:50 发布