• DepthAI
  • Trouble capturing color images at 1200p

Hi,

Trying to capture color images at 1200p like so

import cv2
import depthai as dai

pipeline = dai.Pipeline()
cam_rgb = pipeline.create(dai.node.ColorCamera)
cam_rgb.setBoardSocket(dai.CameraBoardSocket.CAM_A)
cam_rgb.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1200_P)
xout = pipeline.create(dai.node.XLinkOut)
xout.setStreamName("video")
cam_rgb.video.link(xout.input)

with dai.Device(pipeline) as device:
    video_queue = device.getOutputQueue(name="video", maxSize=1, blocking=False)
    while True:
        frame = video_queue.get().getCvFrame()
        cv2.imshow("OAK-D Color Stream", frame)        
        if cv2.waitKey(1) == ord('q'):
            break
cv2.destroyAllWindows()

results in this error

[14442C10018BC6D600] [3.1] [1.043] [ColorCamera(0)] [critical] ColorCamera post-proc expected 1920x1200, received 1920x1080
[2025-03-30 22:08:48.342] [depthai] [error] Device with id 14442C10018BC6D600 has crashed. Crash dump logs are stored in: /home/tim/.cache/depthai/crashdumps/b7480451191da9e9c924a04b0c37a862f5e2276f/crash_dump.json - please report to developers.
Traceback (most recent call last):
  File "/home/tim/Glasses/test7.py", line 15, in <module>
    frame = video_queue.get().getCvFrame()
            ^^^^^^^^^^^^^^^^^
RuntimeError: Communication exception - possible device error/misconfiguration. Original message 'Couldn't read data from stream: 'video' (X_LINK_ERROR)'

Shouldn't this be possible? I'm using an OAK-D Pro and DepthAI 2.30.

Thanks for any help!

Tim

    Timm
    I think you might be using the IMX378 which doesn't natively support 1200p resolution. You'd have to use 4K then downscale/crop to achieve it.

    Thanks,
    Jaka

    Thanks for pointing that out.

    How should I best go about downscaling/cropping the image? With an ImageManip node?

    Thanks,
    Tim

      Timm
      Do isp downscale on ColorCamera with 5/9 factor (2160->1200) then set video size manually so the width is cropped as well to fit the 16:10 aspect ratio.

      Thanks,
      Jaka

      Ah, I see. Thanks!

      Tim