The Guide to Hardware Timestamp
Timestamping, as part of the key features of GigE Vision cameras, is often paired with Precision Time Protocol to accurately synchronize/trigger multiple cameras in industrial imaging systems.
For camera modules with on-device clocks, timestamps can be produced to mark frames or to calculate intervals. Timestamped frames provide additional information on when each and every frame is captured, an experienced vision system developer can utilize such information to build more sophisticated multi-camera applications, or to design highly coordinated machine vision solutions where the image/video data can be combined with various signals from other sensors to deliver better results and higher efficiency.
A camera project or system is guaranteed to be cost-intensive whenever industrial cameras are involved. If there’s a way to bring key features like timestamping down to camera modules that offer nearly identical specifications and cost less, we can create more affordable camera solutions for many industrial applications.
The good news is, Arducam has prepared to fill this gap.
The latest SDK and USB3 camera shield Plus adds hardware timestamping support. By using the module’s internal device clock and synchronizing it with the UTC time system from the host PC’s SDK, every single frame is appended with accurate global timestamp. Everyone can synchronize Arducam cameras and any other sensors within the system, and specific frames with historical timestamp data can be easily post-processed for cross-references or integrated into other applications.
For more introduction, you can go to the blog. This document shows examples to get the current timestamp.
Table Of Contents
- 1.Timestamp format
- 3.1 Geting the current timestamp using C++
- 3.2 Geting the current timestamp using Python
The current timestamp format:
FILETIME: 100-nanoseconds since Jan 1 1601
132702865451985472 is Friday, July 9, 2021 6:42:25am
First of all, you only need have one USB3.0 Shield Plus and ensure the firmware version is 3.20+
3.1 Geting the current timestamp using C++
After calling the
ArduCam_readImage function, the frameData is filled. The type of frameData is ArduCamOutData, and is defined as follows:
The u64Time member of frameData is the timestamp.
3.2 Geting the current timestamp using Python
Py_ArduCam_readImage has three return values, which respectively represent: status code (status), image data (data), and dictionary containing image information (cfg).
The timestamp information is contained in cfg, and the key is u64Time: