@jakaskerl
Below is my current implementation. I feel like I'm missing some kind of "apply" API as I see no effect when the cropIn
and cropOut
calls are made. Do you see what I'm doing wrong?
This is my pipeline setup.
// 1. Create pipeline
dai::Pipeline corePipeline;
// 2. Define sources and outputs
colorCam = corePipeline.create<dai::node::ColorCamera>();
auto configIn = corePipeline.create<dai::node::XLinkIn>();
auto xLinkPreviewOut = corePipeline.create<dai::node::XLinkOut>();
// 3. Properties
colorCam->setPreviewSize(previewSize.width, previewSize.height);
colorCam->setResolution(dai::ColorCameraProperties::SensorResolution::THE_720_P);
configIn->setStreamName(STREAM_CONFIG_IN);
xLinkPreviewOut->setStreamName(STREAM_PREVIEW);
// 4. Linking
colorCam->preview.link(xLinkPreviewOut->input);
configIn->out.link(colorCam->inputConfig);
// 5. Connecting
device = std::shared_ptr<dai::Device>(new dai::Device(corePipeline, deviceInfo));
// 6. Queries
rgbQueue = device->getOutputQueue(STREAM_PREVIEW, 4, false);
configQueue = device->getInputQueue(STREAM_CONFIG_IN, 4, false);
The later calls to cropIn
and cropOut
are made, but I see no effect in the resulting preview image. I've confirmed the methods are executing and not erroring.
void CropIn()
{
dai::ImageManipConfig cfg;
cfg.setCenterCrop(.5);
configQueue->send(cfg);
std::cout << "crop in" << std::endl;
}
void CropOut()
{
dai::ImageManipConfig cfg;
cfg.setCenterCrop(1);
configQueue->send(cfg);
std::cout << "crop out" << std::endl;
}