I need to build a real-time system. However, I noticed that when I call grab(), I first record the current time (CURRENT_TIME), then obtain the image via grab(), and check the image’s timestamp (IMAGE_TIME). I found that IMAGE_TIME is earlier than CURRENT_TIME, which indicates the image was captured earlier than the moment I called grab(). How can I resolve this? What I need is an image exposed by the camera at the exact moment I invoke grab().
code:
_writeframe->timestamp = std::chrono::duration_caststd::chrono::milliseconds(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
_zedx.retrieveImage(img, VIEW::LEFT);
_zedx.grab(_runtime_parameters)
frame->zedtimestamp = img.timestamp.getMilliseconds();
_writeframe->timestamp is 1742878091686 ms
frame->zedtimestamp is 1742878091668 ms
IMAGE TIME < CURRENTIME