Hello,

I am using a digital trigger to take pictures of a moving transport belt with products, I set the trigger up as in the example:

//ext trigger

camRgb->initialControl.setFrameSyncMode(dai::CameraControl::FrameSyncMode::INPUT);

camRgb->initialControl.setExternalTrigger(4, 3);

How can I retreive only the last taken image? Using the following code results in two images per trigger:

int LuxonisCam::Get_img(Mat& Color, Mat& Depth) {

auto inRgb = qRgb->get<dai::ImgFrame>();

auto inDepth = qDepth->get<dai::ImgFrame>();

if (inDepth && inRgb) {

Color = inRgb->getCvFrame();

Depth = inDepth->getCvFrame();

rotate(Color, Color, ROTATE_180);

rotate(Depth, Depth, ROTATE_180);

return 1;

}

return 0;

}

Thanks,

Pim

    Pim

    (source)

    You can set the queue size to 1 and blocking to false. This will allow you to only get the latest message sent to the queue.

    Thanks,
    Jaka

    Hello Jaka,

    Thanks for your reply.

    When setting que to size 1 and blocking to false I still get two images for each trigger. However if I set the external trigger as follows:

    camRgb->initialControl.setExternalTrigger(4, 4);

    I only get one image. But this feels a bit strange as the amount of images taken in a burst is the same amount as you delete.

    Any ideas?