tracking/homography.py
def calibration(source):
    """calibrate a source channel

    Arguments:
        source {int or str} -- int for camera channel str for video
    """
    cap = cv2.VideoCapture(source)

    cv2.namedWindow("Frame")

    def left_click(event, x, y, flags, params):
        if (event == cv2.EVENT_LBUTTONDOWN):
            coordinates.append((x, y))
            print((x, y))
        return()

    cv2.setMouseCallback("Frame", left_click)

    coordinates= []

    while True:
        _, frame = cap.read()

        for center_position in coordinates:
            cv2.circle(frame, center_position, 3, (0, 0, 255), -1)

        cv2.imshow("Frame", frame)

        key = cv2.waitKey(1)
        if cv2.waitKey(20) == ord('e'):
            # pour 'enregistrer'
            break
        elif (key == ord("d")):
            coordinates = []

    cap.release()
    cv2.destroyAllWindows()

    return(coordinates)
calibrate a source channel

    Arguments:
        source {int or str} -- int for camera channel str for video
    
calibrate a source channel
Arguments:
source {int or str} -- int for camera channel str for video
calibrate a source channel Arguments : source { int or str } -- int for camera channel str for video
def calibration(source):
    cap = cv2.VideoCapture(source)
    cv2.namedWindow("Frame")
    def left_click(event, x, y, flags, params):
        if (event == cv2.EVENT_LBUTTONDOWN):
            coordinates.append((x, y))
            print((x, y))
        return()
    cv2.setMouseCallback("Frame", left_click)
    coordinates= []
    while True:
        _, frame = cap.read()
        for center_position in coordinates:
            cv2.circle(frame, center_position, 3, (0, 0, 255), -1)
        cv2.imshow("Frame", frame)
        key = cv2.waitKey(1)
        if cv2.waitKey(20) == ord('e'):
            break
        elif (key == ord("d")):
            coordinates = []
    cap.release()
    cv2.destroyAllWindows()
    return(coordinates)
def calibration ( source ) : cap = cv2 . VideoCapture ( source ) cv2 . namedWindow ( "Frame" ) def left_click ( event , x , y , flags , params ) : if ( event == cv2 . EVENT_LBUTTONDOWN ) : coordinates . append ( ( x , y ) ) print ( ( x , y ) ) return ( ) cv2 . setMouseCallback ( "Frame" , left_click ) coordinates = [ ] while True : _ , frame = cap . read ( ) for center_position in coordinates : cv2 . circle ( frame , center_position , 3 , ( 0 , 0 , 255 ) , - 1 ) cv2 . imshow ( "Frame" , frame ) key = cv2 . waitKey ( 1 ) if cv2 . waitKey ( 20 ) == ord ( 'e' ) : break elif ( key == ord ( "d" ) ) : coordinates = [ ] cap . release ( ) cv2 . destroyAllWindows ( ) return ( coordinates )
calibrate a source channel
Arguments:
source {int or str} -- int for camera channel str for video
calibrate a source channel Arguments : source { int or str } -- int for camera channel str for video
"""calibrate a source channel

    Arguments:
        source {int or str} -- int for camera channel str for video
    """ # pour 'enregistrer'
source