draw_circle_param.py 本是古典 何须时尚 2022-07-14 15:26 94阅读 0赞 \# -\*- coding: utf-8 -\*- """ Created on Sun Jan 5 11:31:53 2014 @author: duan """ import cv2 import numpy as np \#mouse callback function def draw\_circle(event,x,y,flags,param): if event==cv2.EVENT\_LBUTTONDBLCLK: cv2.circle(param,(x,y),100,(255,0,0),-1) \# 创建图像与窗口并将窗口与回调函数绑定 img=np.zeros((512,512,3),np.uint8) cv2.namedWindow('image') cv2.setMouseCallback('image',draw\_circle,img) while(1): cv2.imshow('image',img) if cv2.waitKey(20)&0xFF==27: break cv2.destroyAllWindows()
还没有评论,来说两句吧...