Пример #1
0
    def __init__(self):
        self.capture = opencv.VideoCapture(0)
        self.capture.set(opencv.CV_CAP_PROP_FRAME_HEIGHT, 1000)
        self.capture.set(opencv.CV_CAP_PROP_FRAME_WIDTH, 1000)
        opencv.namedWindow( "Video", opencv.CV_WINDOW_KEEPRATIO)
        opencv.namedWindow( "Track Window", opencv.CV_WINDOW_KEEPRATIO)

        opencv.setMouseCallback( "Video", self.on_mouse,None)

        self.drag_start = None      # Set to (x,y) when mouse starts drag
        self.track_window = None    # Set to rect when the mouse drag finishes

        print( "Keys:\n"
            "    ESC,q - quit the program\n"
            "To initialize the subwindow, drag across the image with the mouse\n" )
Пример #2
0
    def __init__(self):
        self.capture = opencv.VideoCapture(0)
        self.capture.set(opencv.CV_CAP_PROP_FRAME_HEIGHT, 1000)
        self.capture.set(opencv.CV_CAP_PROP_FRAME_WIDTH, 1000)
        opencv.namedWindow("Video", opencv.CV_WINDOW_KEEPRATIO)
        opencv.namedWindow("Track Window", opencv.CV_WINDOW_KEEPRATIO)

        opencv.setMouseCallback("Video", self.on_mouse, None)

        self.drag_start = None  # Set to (x,y) when mouse starts drag
        self.track_window = None  # Set to rect when the mouse drag finishes

        print(
            "Keys:\n"
            "    ESC,q - quit the program\n"
            "To initialize the subwindow, drag across the image with the mouse\n"
        )
Пример #3
0
 def __del__(self):
     opencv.setMouseCallback( "Video", None,None)
Пример #4
0
 def __del__(self):
     opencv.setMouseCallback("Video", None, None)