etiennedub / pyk4a

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

issue with depth capture #171

Closed rosesolow closed 2 years ago

rosesolow commented 2 years ago

I'm unable to properly capture the depth values from the Kinect with pyk4a. I can capture an image no problem, but the depth values are all zeros. I installed pyk4a-bundle, because "pip install pyk4a" had an install error unable to build wheels.

My code is below, I tried playing with the pyk4a config settings but that did not help.

Also, I'm confused by the shape of the color capture and depth capture. Color captures are shape (720, 1280, 4), why is there 4 values for every pixel location? Shouldn't it just be RGB? Depth captures are shape (576, 640), I was expecting depth captures to be the same resolution as the color captures (720,1280).

Additionally in your depth example files you are using "from helpers import colorize" to color images based on depth values, what is the "helpers" library you are using to colorize with?

import open3d as o3d import cv2 import pyk4a from pyk4a import Config, PyK4A import numpy as np

config = Config() k4a = PyK4A(config) k4a.start() capture = k4a.get_capture() points = capture.depth_point_cloud.reshape((-1, 3))

cv2.imshow("k4a", colorize(capture.depth, (None, 5000), cv2.COLORMAP_HSV))

cv2.imshow('img', capture.color) key = cv2.waitKey(10) k4a.stop()

print(capture.depth.shape) print(capture.color.shape)

rajkundu commented 2 years ago

I'm not sure if I can answer all of your questions, but I'll try to help as much as I can!

lpasselin commented 2 years ago

reopen is problem persists