1
0
Fork 0

just show opencv video, not preview

master
jebba 2021-07-15 13:01:21 -06:00
parent 1f55452bab
commit 7943cd3d2d
1 changed files with 0 additions and 8 deletions

View File

@ -9,13 +9,10 @@ pipeline = dai.Pipeline()
# Define source and outputs
camRgb = pipeline.createColorCamera()
xoutVideo = pipeline.createXLinkOut()
xoutPreview = pipeline.createXLinkOut()
xoutVideo.setStreamName("video")
xoutPreview.setStreamName("preview")
# Properties
camRgb.setPreviewSize(300, 300)
camRgb.setBoardSocket(dai.CameraBoardSocket.RGB)
camRgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
camRgb.setInterleaved(True)
@ -23,22 +20,17 @@ camRgb.setColorOrder(dai.ColorCameraProperties.ColorOrder.BGR)
# Linking
camRgb.video.link(xoutVideo.input)
camRgb.preview.link(xoutPreview.input)
# Connect to device and start pipeline
with dai.Device(pipeline) as device:
video = device.getOutputQueue('video')
preview = device.getOutputQueue('preview')
while True:
videoFrame = video.get()
previewFrame = preview.get()
# Get BGR frame from NV12 encoded video frame to show with opencv
cv2.imshow("video", videoFrame.getCvFrame())
# Show 'preview' frame as is (already in correct format, no copy is made)
cv2.imshow("preview", previewFrame.getFrame())
if cv2.waitKey(1) == ord('q'):
break