forked from lbeaucourt/Object-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit-openCV.py
More file actions
29 lines (23 loc) · 728 Bytes
/
init-openCV.py
File metadata and controls
29 lines (23 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from utils.app_utils import *
import numpy as np
import cv2
if __name__ == '__main__':
# created a *threaded* video stream, allow the camera sensor to warmup,
# and start the FPS counter
vs = WebcamVideoStream(src="inputs/test.mp4").start()
fps = FPS().start()
while fps._numFrames < 100:
# Capture frame-by-frame
ret, frame = vs.read()
if ret==True:
# Display the resulting frame
cv2.imshow('frame', frame)
fps.update()
if cv2.waitKey(1) & 0xFF == ord('q'):
break
else:
break
# When everything done, release the capture
fps.stop()
vs.stop()
cv2.destroyAllWindows()