#!/usr/bin/python3 import numpy as np import cv2 from math import sqrt, atan2 def vector_visualizer(vidIn,vidOut,frameSampleRate,frameSampleSize): cap = cv2.VideoCapture(vidIn) # Define the codec and create VideoWriter object fourcc = cv2.VideoWriter_fourcc(*'XVID') frameRate = cap.get(cv2.CAP_PROP_FPS) framesize=(round(cap.get(cv2.CAP_PROP_FRAME_WIDTH))//frameSampleSize,round(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))//frameSampleSize) out = cv2.VideoWriter(vidOut,fourcc, frameRate/frameSampleRate, framesize) count=0 frameCount = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) averages={} counts={} lastDir=0 while(cap.isOpened() and count