Whenever a resolution greater than 4K (THE_13_MP
for me) is set on a ColorCamera node, setIspScale
has strange behavior.
- Setting the ISP scale to certain values will cause the camera to fail and not produce any output. Code to reproduce (should set the ISP size to 3682x2730, but doesn't produce any output):
import cv2
import depthai as dai
pipeline = dai.Pipeline()
camRGB = pipeline.createColorCamera()
out = pipeline.createXLinkOut()
out.setStreamName("out")
camRGB.setBoardSocket(dai.CameraBoardSocket.RGB)
camRGB.setResolution(dai.ColorCameraProperties.SensorResolution.THE_13_MP)
camRGB.setIspScale(7, 8)
camRGB.setPreviewKeepAspectRatio(False)
camRGB.setPreviewSize(416, 416)
camRGB.setInterleaved(False)
camRGB.setColorOrder(dai.ColorCameraProperties.ColorOrder.BGR)
camRGB.preview.link(out.input)
with dai.Device(pipeline) as device:
qRgb = device.getOutputQueue(name="out", maxSize=4, blocking=False)
while True:
inRgb = qRgb.get()
cv2.imshow("img", inRgb.getCvFrame())
if cv2.waitKey(1) == ord('q'):
break
- Other ISP scale values will work, but the resulting image will have color issues. Code to reproduce (should set the ISP size to 3419x2535):
import cv2
import depthai as dai
pipeline = dai.Pipeline()
camRGB = pipeline.createColorCamera()
out = pipeline.createXLinkOut()
out.setStreamName("out")
camRGB.setBoardSocket(dai.CameraBoardSocket.RGB)
camRGB.setResolution(dai.ColorCameraProperties.SensorResolution.THE_13_MP)
camRGB.setIspScale(13, 16)
camRGB.setPreviewKeepAspectRatio(False)
camRGB.setPreviewSize(416, 416)
camRGB.setInterleaved(False)
camRGB.setColorOrder(dai.ColorCameraProperties.ColorOrder.BGR)
camRGB.preview.link(out.input)
with dai.Device(pipeline) as device:
qRgb = device.getOutputQueue(name="out", maxSize=4, blocking=False)
while True:
inRgb = qRgb.get()
cv2.imshow("img", inRgb.getCvFrame())
if cv2.waitKey(1) == ord('q'):
break
Here's what it looks like:
The color issues may be similar to what's shown in this issue on GitHub.
Camera: OAK-D Lite
DepthAI Version: 2.21.2.0
Pipeline Graph: