• DepthAI-v2
  • OakD-W PoE Intrinsics Matrix, and resolutions

We are trying to get low resolution, MJPEG from the camera, and we have written some code to do that, BUT it seems like I can only set down to a 1080P resolution using the method in the camera object.
color_camera->setResolution(dai::ColorCameraProperties::SensorResolution::THE_1080_P);

Ideally, we would like to see if we can get 480P. Can you provide some guidance on how you reccomend doing that? I realized I can make an ImageManip object, and resize the camera frames that way, however, won't that make our camera intrinsic matrix invalid?

Secondly (and related, but not strictly), I see that the DAI image calibration tool is only using the camera socket name to get the calibration. Does that mean the calibration is only valid for the full 12MP resolution, or am I able to trust that the calibration is still valid for the modified 1080P resolution.

  auto converter = dai::ros::ImageConverter(frame_name, false);
  auto info_msg = converter.calibrationToCameraInfo(
    device->readCalibration(), dai::CameraBoardSocket::RGB);
  publisher->publish(info_msg);
}

I hope these questions make sense. Please let me know if I can clarify!

  • erik replied to this.

    Hi VinnyRuia ,
    You could use isp downscaling (eg. colorCam.ispScale(2,3) == 1080p->720p). Regarding intrinsics, you can specify the size with topLeft/bottomRight pixel ids, API below (from CalibrationHandler);

    std::vector<std::vector<float>> getCameraIntrinsics(CameraBoardSocket cameraId,
                                                            std::tuple<int, int> destShape,
                                                            Point2f topLeftPixelId = Point2f(),
                                                            Point2f bottomRightPixelId = Point2f(),
                                                            bool keepAspectRatio = true) const;

    Regarding 12MP/1080P - it was calibrated for 1080P (or 4k, but that's the same aspect ratio).
    Thoughts?
    Thanks,Erik

    Ok thanks for pointing that out. That makes a lot of sense!

    12MP/1080P - it was calibrated for 1080P (or 4k, but that's the same aspect ratio).

    So is this to say, the calibration done at the factory for 4k resolution will be applicable to any image with the same aspect ratio?

      Hi VinnyRuia ,
      Yep, it's the same aspect ratio so intrinsics scaling wouldn't be a problem. But if you have encountered any issues please let us know and we will take a look at it 🙂
      Thanks, Erik

      18 days later

      So if I set the sensor resolution to THE_12_MP (4056 x 3040), and then set ISP scale to 1/2 (which would give me 2028x1520, i.e.

      color_camera->setBoardSocket(dai::CameraBoardSocket::RGB);
      color_camera->setResolution(dai::ColorCameraProperties::SensorResolution::THE_12_MP);
      color_camera->setIspScale(1, 2);

      then I should call

      getCameraIntrinsics(
        dai::CameraBoardSocket::RGB,
        2028,
        1520,
        Point2f(0.0, 0.0),
        Point2f(2028.0, 1520.0)
      );

      I'm having trouble understanding the difference between the resizeWidth, resizeHeight parameters, and the topLeftPixelId and bottomRightPixelId parameters.

      In this context, you don't need the topLeftPixelId and bottomRightPixelId parameters. Those parameters are only required when you want the intrinsics of a cropped region. SInce you are just scaling it resizeWidth and resizeHeight should do the job considering the calibration was done at 12MP for the respective device. Since at the moment we don't have the upscaling to 12MP scaling from 16:9 1080p resolution calibration.