Beispiel #1
0
            if k == 27 or k == ord('m'):
                break

    if k == ord('f'):
        print('showing frame')
        frame = W.getFrame()
        cv2.imshow('webcam', frame)

    if k == ord('d'):
        print('showing merge of 10 frames')
        frame = W.getFrame(10)
        cv2.imshow('webcam', frame)

    if k == ord('s'):  # 'save'
        points = W.getWebcamZoom()
        print('Here are the coordinates of 4 corners of webcam zoom')
        for i in range(4):
            print('Corner %i = (%f,%f)', i, points[2 * i], points[2 * i + 1])

    if k == ord('l'):  # 'load'
        delx = 0.1
        dely = 0.2
        frame = W.getFrame()
        width = frame.shape[1]
        height = frame.shape[0]

        W.setWebcamZoom(delx * width, dely * height, (1 - delx) * width,
                        dely * height, (1 - delx) * width, (1 - dely) * height,
                        delx * width, (1 - dely) * height)
        print("zoom defined... type 'm' to see mapped capture")