Hi Alain
import cv2
import depthai as dai
# Create pipeline
pipeline = dai.Pipeline()
# Define source and output
camRgb = pipeline.create(dai.node.ColorCamera)
xoutRgb = pipeline.create(dai.node.XLinkOut)
xoutRgb.setStreamName("rgb")
# Properties
camRgb.setPreviewSize(300, 300)
camRgb.setInterleaved(False)
# Linking
camRgb.preview.link(xoutRgb.input)
# Connect to device and start pipeline
with dai.Device(pipeline) as device:
# Output queue will be used to get the rgb frames from the output defined above
qRgb = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)
while True:
inRgb = qRgb.get() # blocking call, will wait until a new data has arrived
# Retrieve 'bgr' (opencv format) frame
cv2.imshow("rgb", inRgb.getCvFrame())
if cv2.waitKey(1) == ord('q'):
break
Thanks,
Jaka