FastPointCloud example in the Azure Kinect SDK

wajih youssef 40 Reputation points
2023-01-20T14:36:20.0533333+00:00

So I am debugging the fastpointcloud example in the azure kinect SDK on visual studio and I want to ask whether when the kinect detectes an object and gives back its coordinates like shown before if I change the direction of the camera why doesnt the values change ( for the height y for example ) ? does it give all the coordiantes of points of the first object it detectes until the debug is finished ? thanks

point_cloud_data[i].xyz.x = xy_table_data[i].xy.x * (float)depth_data[i];
point_cloud_data[i].xyz.y = xy_table_data[i].xy.y * (float)depth_data[i];
point_cloud_data[i].xyz.z = (float)depth_data[i];
Azure Kinect DK
Azure Kinect DK
A Microsoft developer kit and peripheral device with advanced artificial intelligence sensors for sophisticated computer vision and speech models.
292 questions
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 14,831 Reputation points Microsoft Employee
    2023-01-26T00:55:06.8833333+00:00

    Hi Wajih, thank you for sharing the additional requested details. Could you please confirm if this is the GitHub repository your application is based on -- Fast point Cloud I don't see any loop in the code which lets it track the changes dynamically from the Azure Kinect device. Line 201 in the code is responsible for invoking the function to generate point cloud and it has a few parameters which are generated using the k4a commands. Please refer the line below

    
    depth_image = k4a_capture_get_depth_image(capture);
    if (depth_image == 0)
    {
        printf("Failed to get depth image from capture\n");
        goto Exit;
    }
    
    generate_point_cloud(depth_image, xy_table, point_cloud, &point_count);
    
    

    I would recommend putting a break point on the lines of code where the parameters for the function generate_point_cloud are measured and change the direction of the camera before the parameters are calculated to see if the code detects the change. Please note that the above code is not designed to respond to changes on Azure Kinect and the code exits after calculating the point cloud. For testing and debug purposes you can put a goto statement at Line 151 and call it after calibrating cloud point from Line 204 to validate if the code is responding to the changed Azure Kinect coordinates.

    Please let me know if the above information is helpful.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.