vis/display.py
def process_video(src, action, skip_frames=0):
    """
    Process a video frame by frame, executing the action on every frame.
    :param src: Path to the video file OR int signifying camera
    :param action: Function to be called, must have 2 parameters (frame and skip_frames)
    :param skip_frames: 
    :return: 
    """
    cap = cv2.VideoCapture()
    if not cap.isOpened():
        cap.open(src)

    global FRAME_COUNT
    FRAME_COUNT = 0
    while cap.isOpened():
        ret, frame = cap.read()
        FRAME_COUNT += 1

        action(frame, skip_frames)

        if cv2.waitKey(1) & 0xFF == ord('q'):
            break

    cap.release()
    cv2.destroyAllWindows()

    Process a video frame by frame, executing the action on every frame.
    :param src: Path to the video file OR int signifying camera
    :param action: Function to be called, must have 2 parameters (frame and skip_frames)
    :param skip_frames: 
    :return: 
    
Process a video frame by frame, executing the action on every frame.
Process a video frame by frame executing the action on every frame .
def process_video(src, action, skip_frames=0):
    cap = cv2.VideoCapture()
    if not cap.isOpened():
        cap.open(src)
    global FRAME_COUNT
    FRAME_COUNT = 0
    while cap.isOpened():
        ret, frame = cap.read()
        FRAME_COUNT += 1
        action(frame, skip_frames)
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    cap.release()
    cv2.destroyAllWindows()
def process_video ( src , action , skip_frames = 0 ) : cap = cv2 . VideoCapture ( ) if not cap . isOpened ( ) : cap . open ( src ) global FRAME_COUNT FRAME_COUNT = 0 while cap . isOpened ( ) : ret , frame = cap . read ( ) FRAME_COUNT += 1 action ( frame , skip_frames ) if cv2 . waitKey ( 1 ) & 0xFF == ord ( 'q' ) : break cap . release ( ) cv2 . destroyAllWindows ( )
Process a video frame by frame, executing the action on every frame.
Process a video frame by frame executing the action on every frame .
"""
    Process a video frame by frame, executing the action on every frame.
    :param src: Path to the video file OR int signifying camera
    :param action: Function to be called, must have 2 parameters (frame and skip_frames)
    :param skip_frames: 
    :return: 
    """
None
src
Path to the video file OR int signifying camera
Path to the video file OR int signifying camera
action
Function to be called, must have 2 parameters (frame and skip_frames)
Function to be called must have 2 parameters ( frame and skip_frames )
skip_frames
None