import cv2
import numpy as np
image=cv2.imread('C:/Users/xpp/Desktop/Lena.png')#原始图像
rows,cols=image.shape[:2]#图像的高度和宽度
for i in range(1,100):
cx=np.random.randint(0,rows)
cy=np.random.randint(0,cols)
radius=np.random.randint(10,rows/20)
color=np.random.randint(0,high=256,size=(3,)).tolist()
cv2.circle(image,(cx,cy),radius,color,-1)#绘制圆形
n=400
imgw=np.ones((n,n,3),np.uint8)*255
(x,y)=(round(imgw.shape[1]/2),round(imgw.shape[0]/2))
ver=(0,0,255)
for v in range(5,round(n/2),12):
cv2.circle(imgw,(x,y),v,ver,3)#绘制圆形
cv2.imshow("circle1",imgw)
cv2.imshow("circle2",image)
cv2.waitKey()
cv2.destroyAllWindows()