ibaiGorordo / pyKinectAzure

Python library to run Kinect Azure DK SDK functions
MIT License
460 stars 114 forks source link

Add APIs to get extrinsic/distortion matrix and timestamp, etc. #121

Open davidliyutong opened 4 months ago

davidliyutong commented 4 months ago

Timestamps are helpful for researchers of robotics

Changes:

davidliyutong commented 4 months ago

Here is an example to test:

import pykinect_azure as pykinect
pykinect.initialize_libraries()

def test_new_api(path: str):
    pb: pykinect.Playback = pykinect.start_playback(path)
    while True:
        ret, capture = pb.update()
        if ret:
            print("Extrinsic Matrix: ", capture.calibration.get_extrinsic_matrix())
            print("Distortion Matrix: ", capture.calibration.get_distortion_parameters())
            color_obj = capture.get_color_image_object()
            print("timestamp usec: ", color_obj.get_timestamp_usec())
            print("Device timestamp usec: ", color_obj.get_device_timestamp_usec())
            print("System timestamp nsec: ", color_obj.get_system_timestamp_nsec())
        else:
            break

test_new_api(r"recording.mkv")