从uint8_t到NPY_UINT16 PyArray_SimpleNewFromData.适用于Linux,但不适用于
PyArray_SimpleNewFromData from uint8_t to NPY_UINT16. Works on linux but not on windows
我正在使用带有k4a python包装器的kinect 4 azure sdk。 深度的 dtype 是 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);
https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/82b850ba3c6c5fcebb3e74679896546029379dc5/examples/undistort/main.cpp#L237
这可以通过位移或类似方法解决,但我更愿意了解为什么窗口上的行为不同。
有什么想法吗?
必须更新Surface Pro设备的GPU驱动程序。 https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/840
相关文章:
- 适用于 Linux 的 c++ 上的代理脚本
- 适用于win32、linux、mac的POSIX C包装器
- 从uint8_t到NPY_UINT16 PyArray_SimpleNewFromData.适用于Linux,但不适用于
- 如何在 C++ 中创建一个适用于 Windwos 和 Linux 的文件夹(目录)
- "undefined reference"(适用于Linux,但不适用于Windows上的Cygwin)
- 哪个浏览器插件框架适用于Linux中的所有浏览器
- C++适用于Windows,Linux和Mac的简单GUI
- 在C++std::streams中,失败后,如何获得失败原因?必需:线程安全,适用于Windows和Linux(或至少M
- 适用于Linux的免费并行(MPI)调试器
- Windows 上的 Cmake 不添加共享库路径(适用于 linux)
- 正则表达式适用于 Linux,但不适用于 Solaris
- 适用于Linux上Android的Poco C++
- 在 Linux 上使用 GCC 交叉编译适用于 Windows 的 Qt 应用程序
- 如何获取 Linux 中 mmap() 函数的 FileDescriptor 的内存地址,适用于 Video4Linux
- 适用于 Linux 和 Windows 的 C 和 C++
- 适用于 Linux 的内存分析工具
- random_shuffle() 适用于 Windows,但不能在 Linux 上编译
- 如何捆绑适用于 Linux 的应用程序
- C++服务器Linux机器上的分段故障-适用于Mac
- 适用于Linux的PostMessage