首页 > 解决方案 > Azure Kinect - 深度图像到具有一定距离的对象的多边形形状?

问题描述

目前我正在使用 Azure Kinect 开发一个应用程序。我的目标是确定与相机有一定距离的所有物体,并获得这些物体的多边形形状。但我被困在实现这个应用程序的第一步。

    k4a_device_t device = nullptr;
    int device_index = 0;
    k4a_device_open(device_index, &device);

    k4a_device_configuration_t camera_configuration = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL;
    camera_configuration.color_resolution = K4A_COLOR_RESOLUTION_1080P;
    camera_configuration.color_format = K4A_IMAGE_FORMAT_COLOR_BGRA32;
    camera_configuration.depth_mode = K4A_DEPTH_MODE_NFOV_UNBINNED;
    camera_configuration.camera_fps = K4A_FRAMES_PER_SECOND_30;
    

    k4a_device_start_cameras(device, &camera_configuration);

    k4a_calibration_t calibration;
    k4a_device_get_calibration(device, camera_configuration.depth_mode, camera_configuration.color_resolution, &calibration);


    k4a_capture_t capture;
    k4a_wait_result_t get_capture_result = k4a_device_get_capture(device, &capture, K4A_WAIT_INFINITE);


    k4a_image_t image = k4a_capture_get_depth_image(capture);


    uint8_t* buffer = k4a_image_get_buffer(image);


我写了一些 C++ 代码,但我不知道如何从那里继续。如何将 k4a_image_t 对象转换为可用于获得具有一定距离的对象的多边形形状的东西?我试过使用“k4a_image_get_buffer”,但“uint8_t* buffer”变量的大小只有 4 个字节。

有人有什么想法吗?

标签: c++kinectkinect-sdkazurekinect

解决方案


推荐阅读