isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.21k stars 2.28k forks source link

Kinect for Azure python interface. How to get image timestamp #2224

Open bumbastic opened 4 years ago

bumbastic commented 4 years ago

I need to synchronize the images with an external odometry input. But I can't find a way to get to the sensor image timestamps in the python interface.

In the cpp api(open3d/io/sensor/azure_kinect/AzureKinectSensor.cpp) it looks like I could do something like this:

k4a_capture_t capture = CaptureRawFrame();
k4a_image_t depth_image = k4a_capture_get_depth_image(capture);

# timestamps retrieved
uint64_t image_device_timestamp = k4a_image_get_device_timestamp_usec (depth_image);
uint64_t image_system_timestamp = k4a_image_get_system_timestamp_nsec (depth_image);

# The RGDB image type retrieved
auto rgbd = DecompressCapture( capture, true); 

k4a_plugin::k4a_capture_release(capture);  

If above looks right for the cpp interface, how could I achieve the same with the python interface?

bumbastic commented 4 years ago

Never mind. I switched to C++ I had to modify AzureKinectSensor.h. The following two lines are no longer protected when i build: _k4a_transformation_t transform_depth_tocolor; _k4a_capture_t CaptureRawFrame() const;

tostercx commented 3 years ago

Same issue, could really use the timestamp info. One of my cameras seems to be dropping frames every now and then, so I'd need to identify the frames and process them accordingly.

edit

Got the timestamps out like so: https://github.com/tostercx/Open3D/commit/bd653b9af9328b52ed2e5cb2c55ef9d2398d1c66 This is specifically for reading Azure's MKVs tho.

tiborcamargo commented 2 years ago

I also switched to C++, but this would be a highly desirable feature for the Python interface.