Kinect for Azure: Get depth value at a pixel RRS feed

  • Question

  • I am tying to get depth value at a pixel of the color image. Since the depth and color image have different resolutions, I am trying to use function:


    to get the depth pixel. Is this the right approach?

    k4a_image_create( K4A_IMAGE_FORMAT_COLOR_BGRA32, 
    k4a_transformation_color_image_to_depth_camera(transform, depth_image, color_image, transformed_color_image)

    I get the error:

    [error] [t=4167] /home/vsts/work/1/s/extern/Azure-Kinect-Sensor-SDK/src/transformation/transformation.c (534): transformation_color_image_to_depth_camera(). Expect both depth camera and color camera are running to transform color image to depth camera.

    Currently, I m using one kinect device and the configuration for my camera is mentioned below from which I capture both the color and depth images. How can I get the depth value at a pixel of a color image?

    My camera configuration is given below:

    k4a_device_configuration_t config = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL;
    	config.camera_fps = K4A_FRAMES_PER_SECOND_30;
    	config.color_format = K4A_IMAGE_FORMAT_COLOR_BGRA32;
    	config.color_resolution = K4A_COLOR_RESOLUTION_2160P;
    	config.depth_mode = K4A_DEPTH_MODE_NFOV_UNBINNED;
    // Start the camera with the given configuration
    if (K4A_RESULT_SUCCEEDED != k4a_device_start_cameras(device, &config))

    Monday, July 29, 2019 10:41 PM

All replies