cv2.circle(img, center, redius, color, thickness, lineType, shift)

  • img: 使用 imread 打开的图像
  • center: 圆心坐标, (x, y)
  • redius: 半径
  • color: 颜色, (0, 255, 0), 默认白色
  • thickness: 边框的粗细, 默认值 1, -1 为实心
  • lineType: 边框的线形, 默认 8 连通线
  • shift: 圆心坐标的小数点位数, 默认为 0

大部分参数和 rectangle 一样

import cv2
 
img = cv2.imread("image.jpg")
cv2.circle(img, (42, 42), 4.2, (0, 255, 0), 3)
 
# 预览
cv2.imshow("image", img)
cv2.waitKey(0)