python函数画圆
import numpy as np
import cv2
d = 400
img = np.ones((d,d,3),dtype='uint8')*255
(centerx,centery) = (round(img.shape[1]/2),round(img.shape[0]/2))#图像半径,round函数是获取浮点数的四舍五入值
red = (0,0,255)
for r in range(5,round(d/2),12):#步长12个像素点
cv2.circle(img,(centerx,centery),r,red,3)
cv2.imshow("demo",img)
cv2.waitKey()
cv2.destoryAllWidnows()
结果: