[][src]Function k4a_sys_temp::k4a_calibration_2d_to_3d

pub unsafe extern "C" fn k4a_calibration_2d_to_3d(
    calibration: *const k4a_calibration_t,
    source_point2d: *const k4a_float2_t,
    source_depth_mm: f32,
    source_camera: k4a_calibration_type_t,
    target_camera: k4a_calibration_type_t,
    target_point3d_mm: *mut k4a_float3_t,
    valid: *mut c_int
) -> k4a_result_t

Transform a 2D pixel coordinate with an associated depth value of the source camera into a 3D point of the target coordinate system.

\param calibration Location to read the camera calibration obtained by k4a_device_get_calibration().

\param source_point2d The 2D pixel in \p source_camera coordinates.

\param source_depth_mm The depth of \p source_point2d in millimeters. One way to derive the depth value in the color camera geometry is to use the function k4a_transformation_depth_image_to_color_camera().

\param source_camera The current camera.

\param target_camera The target camera.

\param target_point3d_mm Pointer to the output where the 3D coordinates of the input pixel in the coordinate system of \p target_camera is stored in millimeters.

\param valid The output parameter returns a value of 1 if the \p source_point2d is a valid coordinate, and will return 0 if the coordinate is not valid in the calibration model.

\returns ::K4A_RESULT_SUCCEEDED if \p target_point3d_mm was successfully written. ::K4A_RESULT_FAILED if \p calibration contained invalid transformation parameters. If the function returns ::K4A_RESULT_SUCCEEDED, but \p valid is 0, the transformation was computed, but the results in \p target_point3d_mm are outside of the range of valid calibration and should be ignored.

\remarks This function applies the intrinsic calibration of \p source_camera to compute the 3D ray from the focal point of the camera through pixel \p source_point2d. The 3D point on this ray is then found using \p source_depth_mm. If \p target_camera is different from \p source_camera, the 3D point is transformed to \p target_camera using k4a_calibration_3d_to_3d(). In practice, \p source_camera and \p target_camera will often be identical. In this case, no 3D to 3D transformation is applied.

\remarks If \p source_point2d is not considered as valid pixel coordinate according to the intrinsic camera model, \p valid is set to 0. If it is valid, \p valid will be set to 1. The user should not use the value of \p target_point3d_mm if \p valid was set to 0.

\relates k4a_calibration_t

\xmlonly k4a.h (include k4a/k4a.h) k4a.lib k4a.dll \endxmlonly