Python cv2 模块,EVENT_LBUTTONDBLCLK 实例源码

我们从Python开源项目中,提取了以下25个代码示例,用于说明如何使用cv2.EVENT_LBUTTONDBLCLK

项目:Opencv_learning    作者:wjb711    | 项目源码 | 文件源码
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)
项目:Opencv_learning    作者:wjb711    | 项目源码 | 文件源码
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)
项目:Opencv_learning    作者:wjb711    | 项目源码 | 文件源码
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)
项目:pytomatic    作者:N0K0    | 项目源码 | 文件源码
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
项目:Immersive-collaboration-system-Based-on-colour-detection    作者:hackmaster0110    | 项目源码 | 文件源码
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)
项目:ShadowRemoval    作者:Orcuslc    | 项目源码 | 文件源码
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
项目:ShadowRemoval    作者:Orcuslc    | 项目源码 | 文件源码
def dbclick(event, x, y, flags, param):
    global seed_loc
    if event == cv2.EVENT_LBUTTONDBLCLK:
        seed_loc = (y, x)
项目:cv-lane    作者:kendricktan    | 项目源码 | 文件源码
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])
项目:OPEN_CV    作者:animeshsrivastava24    | 项目源码 | 文件源码
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
项目:Opencv_learning    作者:wjb711    | 项目源码 | 文件源码
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)
项目:Opencv_learning    作者:wjb711    | 项目源码 | 文件源码
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)
项目:Opencv_learning    作者:wjb711    | 项目源码 | 文件源码
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)
项目:Opencv_learning    作者:wjb711    | 项目源码 | 文件源码
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)
项目:Opencv_learning    作者:wjb711    | 项目源码 | 文件源码
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)
项目:Opencv_learning    作者:wjb711    | 项目源码 | 文件源码
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)
项目:Opencv_learning    作者:wjb711    | 项目源码 | 文件源码
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)
项目:Conquest_kshitij    作者:pigeon-kgp    | 项目源码 | 文件源码
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)
项目:Conquest_kshitij    作者:pigeon-kgp    | 项目源码 | 文件源码
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
项目:Conquest_kshitij    作者:pigeon-kgp    | 项目源码 | 文件源码
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))
项目:Opencv-drawing-with-mouse    作者:farcompen    | 项目源码 | 文件源码
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)
项目:Rapidly-Exploring-Random-Tree-Star-Scan    作者:vampcoder    | 项目源码 | 文件源码
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
项目:Rapidly-Exploring-Random-Tree-Star-Scan    作者:vampcoder    | 项目源码 | 文件源码
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
项目:Rapidly-Exploring-Random-Tree-Star-Scan    作者:vampcoder    | 项目源码 | 文件源码
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
项目:Rapidly-Exploring-Random-Tree-Star-Scan    作者:vampcoder    | 项目源码 | 文件源码
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
项目:Rapidly-Exploring-Random-Tree-Star-Scan    作者:vampcoder    | 项目源码 | 文件源码
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