Azure Kinect Sensor SDK  refs/heads/master
Documentation for

◆ k4a_calibration_3d_to_2d()

k4a_result_t k4a_calibration_3d_to_2d ( const k4a_calibration_t calibration,
const k4a_float3_t source_point3d_mm,
const k4a_calibration_type_t  source_camera,
const k4a_calibration_type_t  target_camera,
k4a_float2_t target_point2d,
int *  valid 

Transform a 3D point of a source coordinate system into a 2D pixel coordinate of the target camera.

calibrationLocation to read the camera calibration obtained by k4a_device_get_calibration().
source_point3d_mmThe 3D coordinates in millimeters representing a point in source_camera
source_cameraThe current camera.
target_cameraThe target camera.
target_point2dPointer to the output where the 2D pixel in target_camera coordinates is stored.
validThe output parameter returns a value of 1 if the source_point3d_mm is a valid coordinate in the target_camera coordinate system, and will return 0 if the coordinate is not valid in the calibration model.
K4A_RESULT_SUCCEEDED if target_point2d was successfully written. K4A_RESULT_FAILED if calibration contained invalid transformation parameters. If the function returns K4A_RESULT_SUCCEEDED, but valid is 0, the transformation was computed, but the results in target_point2d are outside of the range of valid calibration and should be ignored.
If target_camera is different from source_camera, source_point3d_mm is transformed to target_camera using k4a_calibration_3d_to_3d(). In practice, source_camera and target_camera will often be identical. In this case, no 3D to 3D transformation is applied. The 3D point in the coordinate system of target_camera is then projected onto the image plane using the intrinsic calibration of target_camera.
If source_point3d_mm does not map to a valid 2D coordinate in the target_camera coordinate system, valid is set to 0. If it is valid, valid will be set to 1. The user should not use the value of target_point2d if valid was set to 0.