Fu Xianjun. All Rights Reserved.
一、使用步骤
1.引入库
代码如下:
import cv2
2.读入数据
代码如下:
def draw_circle(event, x, y, flags, param):
if event == cv2.EVENT_LBUTTONDOWN:
cv2.circle(img, center=(x,y),radius = 5,color=(0, 255, 0),thickness=-1)
elif event == cv2.EVENT_RBUTTONDOWN:
cir.circle(img, center=(x,y), radius=5,color=(0, 255, 0), thickness=1)
img = cv2.imread("yiqing.png")
cv2.nameWindow(winname='drawing')
cv2.setMpuseCallback('drawing', draw_circle)
while True:
cv2.imshow('drawing',img)
if cv2.waitKey(1) & OxFF == ord('q'):
break
cv2.destroyAllWindows()