[][src]Function k4a_sys_temp::k4a_calibration_3d_to_2d

pub unsafe extern "C" fn k4a_calibration_3d_to_2d(
    calibration: *const k4a_calibration_t,
    source_point3d_mm: *const k4a_float3_t,
    source_camera: k4a_calibration_type_t,
    target_camera: k4a_calibration_type_t,
    target_point2d: *mut k4a_float2_t,
    valid: *mut c_int
) -> k4a_result_t

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

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

\param source_point3d_mm The 3D coordinates in millimeters representing a point in \p source_camera

\param source_camera The current camera.

\param target_camera The target camera.

\param target_point2d Pointer to the output where the 2D pixel in \p target_camera coordinates is stored.

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

\returns ::K4A_RESULT_SUCCEEDED if \p target_point2d 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_point2d are outside of the range of valid calibration and should be ignored.

\remarks If \p target_camera is different from \p source_camera, \p source_point3d_mm 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. The 3D point in the coordinate system of \p target_camera is then projected onto the image plane using the intrinsic calibration of \p target_camera.

\remarks If \p source_point3d_mm does not map to a valid 2D coordinate in the \p target_camera coordinate system, \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_point2d if \p valid was set to 0.

\relates k4a_calibration_t

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