-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestCamera.py
More file actions
23 lines (21 loc) · 822 Bytes
/
testCamera.py
File metadata and controls
23 lines (21 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# from picamera import PiCamera
# from time import sleep
#
# camera = PiCamera()
#
# camera.start_preview()
# sleep(50000)
import cv2 # OpenCV
import cvzone # to show FPS and draw augmented reality, and display multiple outputs
# Create an object that displays the FPS
FPSC = cvzone.FPS()
CameraCapture = cv2.VideoCapture(0)#"Live ISS stream record short.mp4") # or import a video like '/dataset/All-Way Pedestrian Crossing.mp4'
# Acquire a frame from the source
while True:
(grabbed, frame) = CameraCapture.read()
hf, wf, cf = frame.shape
frame = cv2.resize(frame, (612, 393), interpolation=cv2.INTER_LINEAR)
# frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HLS)
# frame = FPSC.update(frame, pos=(wf - 50, 50), color=(0, 0, 255), scale=2, thickness=2)
cv2.imshow('frame', frame)
cv2.waitKey(1)