我们从Python开源项目中,提取了以下25个代码示例,用于说明如何使用cv2.EVENT_LBUTTONDBLCLK。
def draw_circle(event,x,y,flags,param): #if event == cv2.EVENT_LBUTTONDBLCLK: if event == cv2.EVENT_LBUTTONDOWN: print ('mouse x and y is ') print (x,y) px = im1[y,x] print ('RGB Value:') print px px_hsv = cv2.cvtColor(im1, cv2.COLOR_BGR2HSV) H=px_hsv.item(y,x,0) S=px_hsv.item(y,x,1) V=px_hsv.item(y,x,2) print ('HSV Value: H?S??V') print (H,S,V)
def draw_circle(event,x,y,flags,param): #if event == cv2.EVENT_LBUTTONDBLCLK: if event == cv2.EVENT_LBUTTONDOWN: print ('mouse x and y is ') print (x,y) px = im1[y,x] print ('RGB Value:') print (px) px_hsv = cv2.cvtColor(im1, cv2.COLOR_BGR2HSV) H=px_hsv.item(y,x,0) S=px_hsv.item(y,x,1) V=px_hsv.item(y,x,2) print ('HSV Value: H?S??V') print (H,S,V)
def mouse_event(event, x, y, flags, param): if event == cv2.EVENT_LBUTTONDBLCLK: print(x, '--',y) size = 20 maxX,maxY, _ = param.shape tf = tempfile.NamedTemporaryFile(dir=path) if x < 0 + size: x = 0 + size if y < 0 + size: y = 0 + size if maxX < x - size: x = maxX - size if maxY < y - size: y = maxY + size img = param[y-size:y+size,x-size:x+size] cv2.imwrite(tf.name + '.png',img) return
def draw_circle(event,x,y,flags,param): if event == cv2.EVENT_LBUTTONDBLCLK: cv2.circle(img,(x,y),2,(25,200,100),-1) print(x,y)
def click(event, x, y, flags, param): if event == cv2.EVENT_LBUTTONDBLCLK: seed = (x, y) print(seed) seeds = detect(img, seed) cv2.imshow('seeds', seeds) while(1): k = 0xFF & cv2.waitKey(1) if k == 27: cv2.destroyAllWindows() break
def dbclick(event, x, y, flags, param): global seed_loc if event == cv2.EVENT_LBUTTONDBLCLK: seed_loc = (y, x)
def on_mouse(self, event, x, y, flag, param): if event == cv2.EVENT_LBUTTONDBLCLK: # Circle to indicate hsv location, and update frame cv2.circle(self.img_debug, (x, y), 3, (0, 0, 255)) cv2.imshow('hsv_extractor', self.img_debug) # Print values values = self.hsv_frame[y, x] print('H:', values[0], '\tS:', values[1], '\tV:', values[2])
def draw_circle(event,x,y,flags,param): if event == cv2.EVENT_LBUTTONDBLCLK: cv2.circle(img,(x,y),100,(255,0,0),-1) # Create a black image, a window and bind the function to window
def draw_circle(event,x,y,flags,param): #global ix,iy,drawing,mode if event == cv2.EVENT_LBUTTONDBLCLK: if mode==True: print (x,y) else: print (y,x)
def draw_circle(event,x,y,flags,param): #if event == cv2.EVENT_LBUTTONDBLCLK: if event == cv2.EVENT_LBUTTONDOWN: print ('mouse x and y is ') print (x,y) px = frame[y,x] print ('RGB Value:') print px px_hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) H=px_hsv.item(y,x,0) S=px_hsv.item(y,x,1) V=px_hsv.item(y,x,2) print ('HSV Value: H?S??V') print (H,S,V)
def getcolor(event,x,y,flags,param): if event == cv2.EVENT_LBUTTONDBLCLK: HSV = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) color=HSV[y,x] print color cv2.waitKey(0)
def getcolor(event,x,y,flags,param): if event == cv2.EVENT_LBUTTONDBLCLK: HSV = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) color=HSV[y,x] print color fle.write(str(color)+"\n") # Create a black image, a window and bind the function to window
def getcolor(event,x,y,flags,param): if event == cv2.EVENT_LBUTTONDBLCLK: print str([x,y])+" "+str(clearance(int(townList[0][0]),int(townList[0][1]),x,y))
def daire_ciz(event, x, y, flags, param): global onceki_x, onceki_y if event == cv2.EVENT_LBUTTONDBLCLK: cv2.circle(resim, (x, y), 50, (255, 0, 0), 1) onceki_x, onceki_y = x, y elif event == cv2.EVENT_RBUTTONDBLCLK: cv2.rectangle(resim, (onceki_x, onceki_y), (x, y), (0, 255, 0), 1)
def draw_circle(self, event, x, y, flags, param): global sx, sy, dx, dy, flag if event==cv2.EVENT_LBUTTONDBLCLK: #cv2.circle(img, (x, y), 100, (255, 0, 0), -1) if not flag: sx, sy = x, y print sx, sy flag = True else: dx, dy = x, y print dx, dy
def draw_circle(self, event, x, y, flags, param): global sx, sy, dx, dy, flag if event==cv2.EVENT_LBUTTONDBLCLK: #cv2.circle(img, (x, y), 100, (255, 0, 0), -1) if not flag: sx, sy = y, x print sx, sy flag = True else: dx, dy = y, x print dx, dy
def draw_circle(self, event, x, y, flags, param): global flag if event == cv2.EVENT_LBUTTONDBLCLK: # cv2.circle(img, (x, y), 100, (255, 0, 0), -1) if not flag: self.source = x, y print self.source flag = True else: self.goal = x, y print self.goal