etiennedub / pyk4a

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

Question about pyk4a.PyK4APlayback () #213

Open xin4431 opened 1 year ago

xin4431 commented 1 year ago

`def main():

k4a_playback = pyk4a.PyK4APlayback("C:/AppData/output.mkv")

k4a_playback.open()
cv2.namedWindow('Azure Kinect RGB', cv2.WINDOW_NORMAL)
while True:
    capture = k4a_playback.get_next_capture()

    if capture is not None:
        color_image = capture.color
        if color_image is not None:
            color_image_data = color_image.data
            color_image_data = np.array(color_image_data, copy=False)
            color_image_bgr = cv2.cvtColor(color_image_data, cv2.COLOR_BGRA2BGR)
            cv2.imshow('Azure Kinect RGB', color_image_bgr)

` That's my code。 The problem arises when, on the first frame, the color result in the capture object is None image On the second frame, the color results in the capture object are shown below image The final realistic image is shown below image Why is that? Ask for Help

lpasselin commented 1 year ago

Is it possible that the depth sync is off? So first frame has depth but no color?

shagren commented 1 year ago

It's normal behavior. Very often first frame(s) missed color data. I think it can happens in middle of mkv too.