官术网_书友最值得收藏!

  • Mastering OpenCV 4 with Python
  • Alberto Fernández Villán
  • 106字
  • 2021-07-02 12:07:21

Drawing circles

The signature for the cv2.circle() function is as follows:

img = circle(img, center, radius, color, thickness=1, lineType=8, shift=0)

This function draws a circle with a radius radius centered in the center position. Some circles are defined in the following code:

cv2.circle(image, (50, 50), 20, colors['green'], 3)
cv2.circle(image, (100, 100), 30, colors['blue'], -1)
cv2.circle(image, (200, 200), 40, colors['magenta'], 10)
cv2.circle(image, (300, 300), 40, colors['cyan'], -1)

After drawing these circles, we call the show_with_matplotlib(image, 'cv2.circle()')function. The result is shown in the next screenshot:

The full code of the examples of this section can be seen in basic_drawing.py.

主站蜘蛛池模板: 高唐县| 焉耆| 平谷区| 彩票| 浙江省| 诸城市| 织金县| 双柏县| 界首市| 五大连池市| 普陀区| 高邑县| 新津县| 松溪县| 平泉县| 巧家县| 柳江县| 乌拉特中旗| 霍城县| 西平县| 海晏县| 玉环县| 且末县| 萝北县| 永川市| 颍上县| 乐昌市| 大荔县| 长岭县| 扎鲁特旗| 远安县| 金阳县| 安新县| 唐河县| 剑阁县| 巴东县| 当阳市| 桐柏县| 鹤岗市| 乌兰浩特市| 鸡泽县|