我正在使用kinect 4 azure sdk和k4a python包装器。 深度的数据类型是uint16。它可以在Linux上工作,但不能在Windows上工作。 在Windows上,生成的图像似乎有锯齿。两个像素中有一个是黑色的。你知道吗
是什么使这些代码在linux和windows上的行为不同?你知道吗
这是包装器中的相关代码:
uint8_t* buffer = k4a_image_get_buffer(depth_image);
npy_intp dims[2];
dims[0] = k4a_image_get_height_pixels(depth_image);
dims[1] = k4a_image_get_width_pixels(depth_image);
PyArrayObject* np_depth_image = (PyArrayObject*)
PyArray_SimpleNewFromData(2, (npy_intp*) dims, NPY_UINT16, buffer);
return PyArray_Return(np_depth_image);
https://github.com/etiennedub/pyk4a/blob/master/pyk4a/pyk4a.cpp#L161
我试着改变第一行,就像我们在kinect 4 azure sdk中看到的那样
uint16_t* buffer = (uint16_t*)(void*) k4a_image_get_buffer(depth_image);
这可能可以通过位转移或类似的方法来解决,但我更愿意理解为什么windows上的行为是不同的。你知道吗
有什么想法吗?你知道吗
必须更新Surface Pro设备的gpu驱动程序。 https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/840
相关问题 更多 >
编程相关推荐