etiennedub / pyk4a

Python 3 wrapper for Azure-Kinect-Sensor-SDK
MIT License
290 stars 81 forks source link

Misalignment of depth and video frames #128

Closed tquintudelft-source closed 3 years ago

tquintudelft-source commented 3 years ago

I'm having this problem where the capture window for the lidar sensor and visual sensor are out of alignment:

image

I've worked with pyrealsense on the Intel L515 before and it has its own methods for frame alignment like so:

aligned_frames = self.align.process(frames)
color_frame = aligned_frames.get_color_frame()

Is there a similar solution in pyk4a or am I just doing something totally wrong?

This is how I am creating the camera object if it helps:

k4a = PyK4A(
            Config(
                color_resolution=pyk4a.ColorResolution.RES_720P,
                depth_mode=pyk4a.DepthMode.NFOV_UNBINNED,
                synchronized_images_only=True,
            )
        )
        k4a.start()
shagren commented 3 years ago

https://github.com/etiennedub/pyk4a/blob/8a2fb92f73067b97c35d82b337bc0d0920ffb5b7/example/viewer_transformation.py#L22

shagren commented 3 years ago

you can use capture.transformed_color + capture.depth or capture.transformed_depth + capture.color

tquintudelft-source commented 3 years ago

Thanks!