Timestamp when image captured

Is there any way to get timestamp when image captured? In Is there a sensor.snapshot_into() - #2 by kwagyeman

So, when csi.snapshot() return an image, it may be captured serveral ms ago. Is there any way to get a timestamp when image captured? Thank you very much

If you are in triggered mode, then the timestamp is when the snapshot is called. If you are in regular triple-buffered mode, then there’s no way to tell. You could capture the current timestamp in the frame event callback and store it, similar to how triple buffering works, to mimic the behavior.

Otherwise, you’ll need to edit the C code for this. Note that when the frame is received by the CPU, it has nothing to do with when it was exposed. The hardware FSYNC exists for this purpose.

Thank you very much for helping

Did you mean use csi.vsync_callback()or csi.frame_callback()? But would it be possible that the frame returned from csi.snapshot() is not the one trigger callback? Thank you

In triggered mode frame_callback() will resolve to what snapshot captured. However, you can also just measure the time across snapshot to get the time it takes an image to be returned.

What are you trying to do exactly?

In any mode above single buffer or triggered mode it’s much harder to track timing.

Thank you for replying. I try to use AE3 for Visual-Inertial Odometry, so accurate timestamp for image and IMU is quite important

Capture the timestamp before the trigger via snapshot then.