Calibration

class pykinect_recorder.main.pyk4a.k4a.calibration.Calibration(calibration_handle: pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_calibration_t)

Bases: object

Wrapper for k4a_calibration_t.

Provides member functions for k4a_calibration_t.

convert_2d_to_2d(source_point2d: pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_float2_t, source_depth: float, source_camera: ctypes.c_int, target_camera: ctypes.c_int) pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_float2_t
Parameters
  • source_point2d (_k4a.k4a_float2_t) – _description_

  • source_depth (float) – _description_

  • source_camera (_k4a.k4a_calibration_type_t) – _description_

  • target_camera (_k4a.k4a_calibration_type_t) – _description_

Returns

_description_

Return type

_k4a.k4a_float2_t

convert_2d_to_3d(source_point2d: pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_float2_t, source_depth: float, source_camera: ctypes.c_int, target_camera: ctypes.c_int) pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_float3_t

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

Returns false if the point is invalid in the target coordinate system (and therefore target_point3d should not be used) Throws error if calibration contains invalid data.

Parameters
  • source_point2d (_k4a.k4a_float2_t) – The 2D pixel in source_camera coordinates.

  • source_depth (float) – The depth of 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().

  • source_camera (_k4a.k4a_calibration_type_t) – The current camera.

  • target_camera (_k4a.k4a_calibration_type_t) – The target camera.

Returns

Three dimensional floating point vector.

Return type

_k4a.k4a_float3_t

convert_3d_to_2d(source_point3d: pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_float3_t, source_camera: ctypes.c_int, target_camera: ctypes.c_int) pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_float2_t

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

Returns false if the point is invalid in the target coordinate system (and therefore target_point2d should not be used) Throws error if calibration contains invalid data.

Parameters
  • source_point3d (_k4a.k4a_float3_t) – The 3D coordinates in millimeters representing a point in source_camera.

  • source_camera (_k4a.k4a_calibration_type_t) – _description_

  • target_camera (_k4a.k4a_calibration_type_t) – _description_

Returns

_description_

Return type

_k4a.k4a_float2_t

convert_3d_to_3d(source_point3d: pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_float3_t, source_camera: ctypes.c_int, target_camera: ctypes.c_int) pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_float3_t

Transform a 3d point of a source coordinate system into a 3d point of the target coordinate system.

Throws error on failure.

Note

See also k4a_calibration_3d_to_3d().

Parameters
  • source_point3d (k4a_float3_t) – The 3D coordinates in millimeters representing a point in source_camera.

  • source_camera (k4a_calibration_type_t) – The current camera.

  • target_camera (k4a_calibration_type_t) – The target camera.

Returns

Three dimensional floating point vector.

Return type

k4a_float3_t

convert_color_2d_to_depth_2d(source_point2d: pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_float2_t, depth_image: pykinect_recorder.main.pyk4a.k4a._k4atypes.LP__handle_k4a_image_t) pykinect_recorder.main.pyk4a.k4a._k4atypes._k4a_float2_t
get_matrix(camera: ctypes.c_int)
handle()
is_valid()
reset()