def init(): global axes_, lines_ global box_, fps_ global cap_, args_ videoFile = args_['video_file'] cap_ = cv2.VideoCapture(videoFile) fps_ = cap_.get(cv2.cv.CV_CAP_PROP_FPS) ret, fstFrame = cap_.read() box_ = webcam.get_bounding_box(fstFrame) cv2.destroyWindow('Bound_eye') cv2.destroyAllWindows() cv2.waitKey(1) cv2.destroyAllWindows() return lines_.values()
def init(): # global axes_, lines_ global box_, fps_ global cap_, args_ cap_ = cv2.VideoCapture(args_['camera']) fps_ = cap_.get(cv2.cv.CV_CAP_PROP_FPS) if fps_ < 1: print('[WARN] failed to get FPS. Setting to 15') fps_ = 15 ret, fstFrame = cap_.read() box_ = webcam.get_bounding_box(fstFrame) cv2.destroyWindow('Bound_eye') cv2.destroyAllWindows() cv2.waitKey(1) cv2.destroyAllWindows()
def init(): # global axes_, lines_ global box_, fps_ global cap_, args_ cap_ = cv2.VideoCapture( args_['camera'] ) fps_ = cap_.get(cv2.cv.CV_CAP_PROP_FPS) if fps_ < 1: print('[WARN] failed to get FPS. Setting to 15') fps_ = 15 ret, fstFrame = cap_.read() box_ = webcam.get_bounding_box(fstFrame) cv2.destroyWindow('Bound_eye') cv2.destroyAllWindows() cv2.waitKey(1) cv2.destroyAllWindows()
def init(): global axes_, lines_ global box_, fps_ global cap_, args_ videoFile = args_['video_file'] if os.path.isfile(videoFile): cap_ = cv2.VideoCapture(videoFile) else: print("Probably camera index") cap_ = cv2.VideoCapture(int(videoFile)) fps_ = get_fps(cap_) ret, fstFrame = cap_.read() box_ = webcam.get_bounding_box(fstFrame) cv2.destroyWindow('Bound_eye') cv2.destroyAllWindows() cv2.waitKey(1) cv2.destroyAllWindows() return lines_.values()