我需要从 Azure Kinect 中提取颜色和深度数据并将其保存到文件中。我浏览了 SDK 示例,但无法弄清楚。
设置完所有内容后,我可以通过以下方式获取颜色数据:
k4a_device_configuration_t config = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL;
config.color_format = K4A_IMAGE_FORMAT_COLOR_BGRA32;
config.color_resolution = K4A_COLOR_RESOLUTION_720P;
config.depth_mode = K4A_DEPTH_MODE_NFOV_UNBINNED;
config.camera_fps = K4A_FRAMES_PER_SECOND_30;
k4a_device_start_cameras(device, &config);
k4a_device_get_capture(device, &capture, TIMEOUT_IN_MS)
k4a_image_t image;
image = k4a_capture_get_color_image(capture);
uint8_t* color_data = (uint8_t*)(void*)k4a_image_get_buffer(image);
然后什么?如何解析每个像素的颜色值?
这对我来说都是新的,所以任何帮助将不胜感激。提前致谢, 圭多