且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

OpenCV:如何在图像上绘制圆形轮廓

更新时间:2023-10-23 16:16:40

正在发生的事情是,您在discretized_circle_contour.

What's happening is, you're drawing a filled circle with radius 2 (which looks like a dot, because the radius is very small) in each point in discretized_circle_contour.

如果我正确理解了您的问题,那么您真正想要的只是一个跨过半径1/10的弧形. 您已经有了[0,36]度的拱门点,只需将其绘制为多段线即可:

If I understand your question correctly, what you actually want is just an arch spanning 1/10th of the radius. You already have the points for the arch in [0, 36] degrees, just draw it as a polyline instead:

cv2.polylines(frame, [discretized_circle_contour], False, 1)