【发布时间】:2016-10-15 22:42:08
【问题描述】:
如您所见,轮廓远小于拟合椭圆。下面是我用来生成椭圆的相关代码。有人可以告诉我我做错了什么吗?谢谢。
cv2.drawContours(orig, contour,-1, (0, 255, 0),3) #draw the green contour on image "orig"
(center, size, angle) = cv2.fitEllipse(contour) #get best fit Ellipse from contour
cv2.ellipse(grey_scale,(int(round(center[0])),int(round(center[1]))),(int(round(size[0])),int(round(size[1]))),int(round(angle)),0,360,(0,255,0),1) # draw ellipse on image "grey_scale" with the statistics gathered from second line
【问题讨论】:
标签: python-2.7 opencv contour