• DepthAI-v2
  • Full resolution still image from color camera

I'm trying to get a full resolution image from an Oak-D Lite using the C++ sdk.

I get something, but I'm not quite sure what. What do I need to change to get access to the RGB values? And what is the bit depth of the sensor? Can I access something better than RGB888 ? I noticed in the header that there was something called RAW16, how does the data look for that?

setType doesn't seem to do anything. I segfault if I read more bytes than getWidth()*getHeight()*1.5

I'll add some parts of the code I use below.

// Setup

std::shared_ptr<dai::Pipeline> pipeline;

std::shared_ptr<dai::node::ColorCamera> camRgb;

std::shared_ptr<dai::node::XLinkIn> controlIn;

std::shared_ptr<dai::node::XLinkOut> xoutStillRgb;

std::shared_ptr<dai::DataOutputQueue> qStillRgb;

std::shared_ptr<dai::DataInputQueue> controlQueue;

pipeline = std::make_shared<dai::Pipeline>();

camRgb = c.pipeline->create<dai::node::ColorCamera>();

//image

xoutStillRgb = c.pipeline->create<dai::node::XLinkOut>();

xoutStillRgb->setStreamName("still");

camRgb->setBoardSocket(dai::CameraBoardSocket::CAM_A);

camRgb->setResolution(dai::ColorCameraProperties::SensorResolution::THE_13_MP);

camRgb->setInterleaved(true);

camRgb->setColorOrder(dai::ColorCameraProperties::ColorOrder::RGB);

camRgb->still.link(c.xoutStillRgb->input);

// control

controlIn = c.pipeline->create<dai::node::XLinkIn>();

controlIn->setStreamName("control");

controlIn->out.link(c.camRgb->inputControl);

device = std::make_shared<dai::Device>(*c.pipeline, dai::UsbSpeed::SUPER);

qStillRgb = c.device->getOutputQueue("still");

controlQueue = c.device->getInputQueue("control");

//Get image

dai::CameraControl ctrl;

ctrl.setCaptureStill(true);

controlQueue->send(ctrl);

std::shared_ptr<dai::ImgFrame> inRgb = cam.qStillRgb->get<dai::ImgFrame>();

inRgb->setType(dai::RawImgFrame::Type::RGB888i); //this does nothing?

size_t im_w = inRgb->getWidth();

size_t im_h = inRgb->getHeight();

uint8_t* data_ptr = inRgb->getData().data();

I'm not quite sure, but it looks like I get NV12 format for the data, that matches up with the size as well. Could that be correct? Is it possible to change it?

    I see, that is a shame. Thanks for the info!

    a month later