Orbbec SDK K4A Wrapper
Loading...
Searching...
No Matches
Functions

Functions

K4A_EXPORT k4a_result_t k4a_set_debug_message_handler (k4a_logging_message_cb_t *message_cb, void *message_cb_context, k4a_log_level_t min_level)
 
K4A_EXPORT k4a_result_t k4a_set_allocator (k4a_memory_allocate_cb_t allocate, k4a_memory_destroy_cb_t free)
 
K4ARECORD_EXPORT bool k4a_playback_check_track_exists (k4a_playback_t playback_handle, const char *track_name)
 
K4ARECORD_EXPORT size_t k4a_playback_get_track_count (k4a_playback_t playback_handle)
 
K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_get_track_name (k4a_playback_t playback_handle, size_t track_index, char *track_name, size_t *track_name_size)
 
K4ARECORD_EXPORT bool k4a_playback_track_is_builtin (k4a_playback_t playback_handle, const char *track_name)
 
K4ARECORD_EXPORT k4a_result_t k4a_playback_track_get_video_settings (k4a_playback_t playback_handle, const char *track_name, k4a_record_video_settings_t *video_settings)
 
K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_track_get_codec_id (k4a_playback_t playback_handle, const char *track_name, char *codec_id, size_t *codec_id_size)
 
K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_track_get_codec_context (k4a_playback_t playback_handle, const char *track_name, uint8_t *codec_context, size_t *codec_context_size)
 
K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_get_attachment (k4a_playback_t playback_handle, const char *file_name, uint8_t *data, size_t *data_size)
 
K4A_EXPORT uint32_t k4a_device_get_installed_count (void)
 
K4A_EXPORT k4a_result_t k4a_device_open (uint32_t index, k4a_device_t *device_handle)
 
K4A_EXPORT void k4a_device_close (k4a_device_t device_handle)
 
K4A_EXPORT k4a_wait_result_t k4a_device_get_capture (k4a_device_t device_handle, k4a_capture_t *capture_handle, int32_t timeout_in_ms)
 
K4A_EXPORT k4a_wait_result_t k4a_device_get_imu_sample (k4a_device_t device_handle, k4a_imu_sample_t *imu_sample, int32_t timeout_in_ms)
 
K4A_EXPORT k4a_result_t k4a_capture_create (k4a_capture_t *capture_handle)
 
K4A_EXPORT void k4a_capture_release (k4a_capture_t capture_handle)
 
K4A_EXPORT void k4a_capture_reference (k4a_capture_t capture_handle)
 
K4A_EXPORT k4a_image_t k4a_capture_get_color_image (k4a_capture_t capture_handle)
 
K4A_EXPORT k4a_image_t k4a_capture_get_depth_image (k4a_capture_t capture_handle)
 
K4A_EXPORT k4a_image_t k4a_capture_get_ir_image (k4a_capture_t capture_handle)
 
K4A_EXPORT void k4a_capture_set_color_image (k4a_capture_t capture_handle, k4a_image_t image_handle)
 
K4A_EXPORT void k4a_capture_set_depth_image (k4a_capture_t capture_handle, k4a_image_t image_handle)
 
K4A_EXPORT void k4a_capture_set_ir_image (k4a_capture_t capture_handle, k4a_image_t image_handle)
 
K4A_EXPORT void k4a_capture_set_temperature_c (k4a_capture_t capture_handle, float temperature_c)
 
K4A_EXPORT float k4a_capture_get_temperature_c (k4a_capture_t capture_handle)
 
K4A_EXPORT k4a_result_t k4a_image_create (k4a_image_format_t format, int width_pixels, int height_pixels, int stride_bytes, k4a_image_t *image_handle)
 
K4A_EXPORT k4a_result_t k4a_image_create_from_buffer (k4a_image_format_t format, int width_pixels, int height_pixels, int stride_bytes, uint8_t *buffer, size_t buffer_size, k4a_memory_destroy_cb_t *buffer_release_cb, void *buffer_release_cb_context, k4a_image_t *image_handle)
 
K4A_EXPORT uint8_t * k4a_image_get_buffer (k4a_image_t image_handle)
 
K4A_EXPORT size_t k4a_image_get_size (k4a_image_t image_handle)
 
K4A_EXPORT k4a_image_format_t k4a_image_get_format (k4a_image_t image_handle)
 
K4A_EXPORT int k4a_image_get_width_pixels (k4a_image_t image_handle)
 
K4A_EXPORT int k4a_image_get_height_pixels (k4a_image_t image_handle)
 
K4A_EXPORT int k4a_image_get_stride_bytes (k4a_image_t image_handle)
 
K4A_DEPRECATED_EXPORT uint64_t k4a_image_get_timestamp_usec (k4a_image_t image_handle)
 
K4A_EXPORT uint64_t k4a_image_get_device_timestamp_usec (k4a_image_t image_handle)
 
K4A_EXPORT uint64_t k4a_image_get_system_timestamp_nsec (k4a_image_t image_handle)
 
K4A_EXPORT uint64_t k4a_image_get_exposure_usec (k4a_image_t image_handle)
 
K4A_EXPORT uint32_t k4a_image_get_white_balance (k4a_image_t image_handle)
 
K4A_EXPORT uint32_t k4a_image_get_iso_speed (k4a_image_t image_handle)
 
K4A_EXPORT void k4a_image_set_device_timestamp_usec (k4a_image_t image_handle, uint64_t timestamp_usec)
 
K4A_DEPRECATED_EXPORT void k4a_image_set_timestamp_usec (k4a_image_t image_handle, uint64_t timestamp_usec)
 
K4A_EXPORT void k4a_image_set_system_timestamp_nsec (k4a_image_t image_handle, uint64_t timestamp_nsec)
 
K4A_EXPORT void k4a_image_set_exposure_usec (k4a_image_t image_handle, uint64_t exposure_usec)
 
K4A_DEPRECATED_EXPORT void k4a_image_set_exposure_time_usec (k4a_image_t image_handle, uint64_t exposure_usec)
 
K4A_EXPORT void k4a_image_set_white_balance (k4a_image_t image_handle, uint32_t white_balance)
 
K4A_EXPORT void k4a_image_set_iso_speed (k4a_image_t image_handle, uint32_t iso_speed)
 
K4A_EXPORT void k4a_image_reference (k4a_image_t image_handle)
 
K4A_EXPORT void k4a_image_release (k4a_image_t image_handle)
 
K4A_EXPORT k4a_result_t k4a_device_start_cameras (k4a_device_t device_handle, const k4a_device_configuration_t *config)
 
K4A_EXPORT void k4a_device_stop_cameras (k4a_device_t device_handle)
 
K4A_EXPORT k4a_result_t k4a_device_start_imu (k4a_device_t device_handle)
 
K4A_EXPORT void k4a_device_stop_imu (k4a_device_t device_handle)
 
K4A_EXPORT k4a_buffer_result_t k4a_device_get_serialnum (k4a_device_t device_handle, char *serial_number, size_t *serial_number_size)
 
K4A_EXPORT k4a_result_t k4a_device_get_version (k4a_device_t device_handle, k4a_hardware_version_t *version)
 
K4A_EXPORT k4a_result_t k4a_device_get_color_control_capabilities (k4a_device_t device_handle, k4a_color_control_command_t command, bool *supports_auto, int32_t *min_value, int32_t *max_value, int32_t *step_value, int32_t *default_value, k4a_color_control_mode_t *default_mode)
 
K4A_EXPORT k4a_result_t k4a_device_get_color_control (k4a_device_t device_handle, k4a_color_control_command_t command, k4a_color_control_mode_t *mode, int32_t *value)
 
K4A_EXPORT k4a_result_t k4a_device_set_color_control (k4a_device_t device_handle, k4a_color_control_command_t command, k4a_color_control_mode_t mode, int32_t value)
 
K4A_EXPORT k4a_buffer_result_t k4a_device_get_raw_calibration (k4a_device_t device_handle, uint8_t *data, size_t *data_size)
 
K4A_EXPORT k4a_result_t k4a_device_get_calibration (k4a_device_t device_handle, const k4a_depth_mode_t depth_mode, const k4a_color_resolution_t color_resolution, k4a_calibration_t *calibration)
 
K4A_EXPORT k4a_result_t k4a_device_get_sync_jack (k4a_device_t device_handle, bool *sync_in_jack_connected, bool *sync_out_jack_connected)
 
K4A_EXPORT k4a_result_t k4a_calibration_get_from_raw (char *raw_calibration, size_t raw_calibration_size, const k4a_depth_mode_t depth_mode, const k4a_color_resolution_t color_resolution, k4a_calibration_t *calibration)
 
K4A_EXPORT k4a_result_t k4a_calibration_3d_to_3d (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_float3_t *target_point3d_mm)
 
K4A_EXPORT k4a_result_t k4a_calibration_2d_to_3d (const k4a_calibration_t *calibration, const k4a_float2_t *source_point2d, const float source_depth_mm, const k4a_calibration_type_t source_camera, const k4a_calibration_type_t target_camera, k4a_float3_t *target_point3d_mm, int *valid)
 
K4A_EXPORT 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)
 
K4A_EXPORT k4a_result_t k4a_calibration_2d_to_2d (const k4a_calibration_t *calibration, const k4a_float2_t *source_point2d, const float source_depth_mm, const k4a_calibration_type_t source_camera, const k4a_calibration_type_t target_camera, k4a_float2_t *target_point2d, int *valid)
 
K4A_EXPORT k4a_result_t k4a_calibration_color_2d_to_depth_2d (const k4a_calibration_t *calibration, const k4a_float2_t *source_point2d, const k4a_image_t depth_image, k4a_float2_t *target_point2d, int *valid)
 
K4A_EXPORT k4a_transformation_t k4a_transformation_create (const k4a_calibration_t *calibration)
 
K4A_EXPORT void k4a_transformation_destroy (k4a_transformation_t transformation_handle)
 
K4A_EXPORT k4a_result_t k4a_transformation_depth_image_to_color_camera (k4a_transformation_t transformation_handle, const k4a_image_t depth_image, k4a_image_t transformed_depth_image)
 
K4A_EXPORT k4a_result_t k4a_transformation_depth_image_to_color_camera_custom (k4a_transformation_t transformation_handle, const k4a_image_t depth_image, const k4a_image_t custom_image, k4a_image_t transformed_depth_image, k4a_image_t transformed_custom_image, k4a_transformation_interpolation_type_t interpolation_type, uint32_t invalid_custom_value)
 
K4A_EXPORT k4a_result_t k4a_transformation_color_image_to_depth_camera (k4a_transformation_t transformation_handle, const k4a_image_t depth_image, const k4a_image_t color_image, k4a_image_t transformed_color_image)
 
K4A_EXPORT k4a_result_t k4a_transformation_depth_image_to_point_cloud (k4a_transformation_t transformation_handle, const k4a_image_t depth_image, const k4a_calibration_type_t camera, k4a_image_t xyz_image)
 
K4ARECORD_EXPORT k4a_result_t k4a_playback_open (const char *path, k4a_playback_t *playback_handle)
 
K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_get_raw_calibration (k4a_playback_t playback_handle, uint8_t *data, size_t *data_size)
 
K4ARECORD_EXPORT k4a_result_t k4a_playback_get_calibration (k4a_playback_t playback_handle, k4a_calibration_t *calibration)
 
K4ARECORD_EXPORT k4a_result_t k4a_playback_get_record_configuration (k4a_playback_t playback_handle, k4a_record_configuration_t *config)
 
K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_get_tag (k4a_playback_t playback_handle, const char *name, char *value, size_t *value_size)
 
K4ARECORD_EXPORT k4a_result_t k4a_playback_set_color_conversion (k4a_playback_t playback_handle, k4a_image_format_t target_format)
 
K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_next_capture (k4a_playback_t playback_handle, k4a_capture_t *capture_handle)
 
K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_previous_capture (k4a_playback_t playback_handle, k4a_capture_t *capture_handle)
 
K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_next_imu_sample (k4a_playback_t playback_handle, k4a_imu_sample_t *imu_sample)
 
K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_previous_imu_sample (k4a_playback_t playback_handle, k4a_imu_sample_t *imu_sample)
 
K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_next_data_block (k4a_playback_t playback_handle, const char *track_name, k4a_playback_data_block_t *data_block_handle)
 
K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_previous_data_block (k4a_playback_t playback_handle, const char *track_name, k4a_playback_data_block_t *data_block_handle)
 
K4ARECORD_EXPORT uint64_t k4a_playback_data_block_get_device_timestamp_usec (k4a_playback_data_block_t data_block_handle)
 
K4ARECORD_EXPORT size_t k4a_playback_data_block_get_buffer_size (k4a_playback_data_block_t data_block_handle)
 
K4ARECORD_EXPORT uint8_t * k4a_playback_data_block_get_buffer (k4a_playback_data_block_t data_block_handle)
 
K4ARECORD_EXPORT void k4a_playback_data_block_release (k4a_playback_data_block_t data_block_handle)
 
K4ARECORD_EXPORT k4a_result_t k4a_playback_seek_timestamp (k4a_playback_t playback_handle, int64_t offset_usec, k4a_playback_seek_origin_t origin)
 
K4ARECORD_EXPORT uint64_t k4a_playback_get_recording_length_usec (k4a_playback_t playback_handle)
 
K4ARECORD_DEPRECATED_EXPORT uint64_t k4a_playback_get_last_timestamp_usec (k4a_playback_t playback_handle)
 
K4ARECORD_EXPORT void k4a_playback_close (k4a_playback_t playback_handle)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_create (const char *path, k4a_device_t device, const k4a_device_configuration_t device_config, k4a_record_t *recording_handle)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_add_tag (k4a_record_t recording_handle, const char *name, const char *value)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_add_imu_track (k4a_record_t recording_handle)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_add_attachment (const k4a_record_t recording_handle, const char *attachment_name, const uint8_t *buffer, size_t buffer_size)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_add_custom_video_track (const k4a_record_t recording_handle, const char *track_name, const char *codec_id, const uint8_t *codec_context, size_t codec_context_size, const k4a_record_video_settings_t *track_settings)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_add_custom_subtitle_track (const k4a_record_t recording_handle, const char *track_name, const char *codec_id, const uint8_t *codec_context, size_t codec_context_size, const k4a_record_subtitle_settings_t *track_settings)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_write_header (k4a_record_t recording_handle)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_write_capture (k4a_record_t recording_handle, k4a_capture_t capture_handle)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_write_imu_sample (k4a_record_t recording_handle, k4a_imu_sample_t imu_sample)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_write_custom_track_data (const k4a_record_t recording_handle, const char *track_name, uint64_t device_timestamp_usec, uint8_t *custom_data, size_t custom_data_size)
 
K4ARECORD_EXPORT k4a_result_t k4a_record_flush (k4a_record_t recording_handle)
 
K4ARECORD_EXPORT void k4a_record_close (k4a_record_t recording_handle)
 

Detailed Description

Public functions of the API

Function Documentation

◆ k4a_calibration_2d_to_2d()

K4A_EXPORT k4a_result_t k4a_calibration_2d_to_2d ( const k4a_calibration_t calibration,
const k4a_float2_t source_point2d,
const float  source_depth_mm,
const k4a_calibration_type_t  source_camera,
const k4a_calibration_type_t  target_camera,
k4a_float2_t target_point2d,
int *  valid 
)
related

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

Parameters
calibrationLocation to read the camera calibration obtained by k4a_device_get_calibration().
source_point2dThe 2D pixel in source_camera coordinates.
source_depth_mmThe 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_cameraThe current camera.
target_cameraThe target camera.
target_point2dThe 2D pixel in target_camera coordinates.
validThe output parameter returns a value of 1 if the source_point2d is a valid coordinate in the target_camera coordinate system, and will return 0 if the coordinate is not valid in the calibration model.
Returns
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.
Remarks
This function maps a pixel between the coordinate systems of the depth and color cameras. It is equivalent to calling k4a_calibration_2d_to_3d() to compute the 3D point corresponding to source_point2d and then using k4a_calibration_3d_to_2d() to map the 3D point into the coordinate system of the target_camera.
If source_camera and target_camera are identical, the function immediately sets target_point2d to source_point2d and returns without computing any transformations.
If source_point2d 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.

◆ k4a_calibration_2d_to_3d()

K4A_EXPORT k4a_result_t k4a_calibration_2d_to_3d ( const k4a_calibration_t calibration,
const k4a_float2_t source_point2d,
const float  source_depth_mm,
const k4a_calibration_type_t  source_camera,
const k4a_calibration_type_t  target_camera,
k4a_float3_t target_point3d_mm,
int *  valid 
)
related

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

Parameters
calibrationLocation to read the camera calibration obtained by k4a_device_get_calibration().
source_point2dThe 2D pixel in source_camera coordinates.
source_depth_mmThe 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_cameraThe current camera.
target_cameraThe target camera.
target_point3d_mmPointer to the output where the 3D coordinates of the input pixel in the coordinate system of target_camera is stored in millimeters.
validThe output parameter returns a value of 1 if the 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 target_point3d_mm 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_point3d_mm are outside of the range of valid calibration and should be ignored.
Remarks
This function applies the intrinsic calibration of source_camera to compute the 3D ray from the focal point of the camera through pixel source_point2d. The 3D point on this ray is then found using source_depth_mm. If target_camera is different from source_camera, the 3D point 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.
If source_point2d is not considered as valid pixel coordinate according to the intrinsic camera model, valid is set to 0. If it is valid, valid will be set to 1. The user should not use the value of target_point3d_mm if valid was set to 0.

◆ k4a_calibration_3d_to_2d()

K4A_EXPORT 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 
)
related

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

Parameters
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.
Returns
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.
Remarks
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.

◆ k4a_calibration_3d_to_3d()

K4A_EXPORT k4a_result_t k4a_calibration_3d_to_3d ( 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_float3_t target_point3d_mm 
)
related

Transform a 3D point of a source coordinate system into a 3D point of the target coordinate system

Parameters
calibrationLocation to read the camera calibration data.
source_point3d_mmThe 3D coordinates in millimeters representing a point in source_camera.
source_cameraThe current camera.
target_cameraThe target camera.
target_point3d_mmPointer to the output where the new 3D coordinates of the input point in the coordinate space of target_camera is stored in millimeters.
Returns
K4A_RESULT_SUCCEEDED if target_point3d_mm was successfully written. K4A_RESULT_FAILED if calibration contained invalid transformation parameters.
Remarks
This function is used to transform 3D points between depth and color camera coordinate systems. The function uses the extrinsic camera calibration. It computes the output via multiplication with a precomputed matrix encoding a 3D rotation and a 3D translation. If source_camera and target_camera are the same, then target_point3d_mm will be identical to source_point3d_mm.

◆ k4a_calibration_color_2d_to_depth_2d()

K4A_EXPORT k4a_result_t k4a_calibration_color_2d_to_depth_2d ( const k4a_calibration_t calibration,
const k4a_float2_t source_point2d,
const k4a_image_t  depth_image,
k4a_float2_t target_point2d,
int *  valid 
)
related

Transform a 2D pixel coordinate from color camera into a 2D pixel coordinate of the depth camera.

Parameters
calibrationLocation to read the camera calibration obtained by k4a_device_get_calibration().
source_point2dThe 2D pixel in color camera coordinates.
depth_imageHandle to input depth image.
target_point2dThe 2D pixel in depth camera coordinates.
validThe output parameter returns a value of 1 if the source_point2d is a valid coordinate in the target_camera coordinate system, and will return 0 if the coordinate is not valid in the calibration model.
Returns
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.
Remarks
This function represents an alternative to k4a_calibration_2d_to_2d() if the number of pixels that need to be transformed is small. This function searches along an epipolar line in the depth image to find the corresponding depth pixel. If a larger number of pixels need to be transformed, it might be computationally cheaper to call k4a_transformation_depth_image_to_color_camera() to get correspondence depth values for these color pixels, then call the function k4a_calibration_2d_to_2d().
If source_point2d 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.

◆ k4a_calibration_get_from_raw()

K4A_EXPORT k4a_result_t k4a_calibration_get_from_raw ( char *  raw_calibration,
size_t  raw_calibration_size,
const k4a_depth_mode_t  depth_mode,
const k4a_color_resolution_t  color_resolution,
k4a_calibration_t calibration 
)
related

Get the camera calibration for a device from a raw calibration blob.

Parameters
raw_calibrationRaw calibration blob obtained from a device or recording. The raw calibration must be NULL terminated.
raw_calibration_sizeThe size, in bytes, of raw_calibration including the NULL termination.
depth_modeMode in which depth camera is operated.
color_resolutionResolution in which color camera is operated.
calibrationLocation to write the calibration.
Returns
K4A_RESULT_SUCCEEDED if calibration was successfully written. K4A_RESULT_FAILED otherwise.
Remarks
The calibration represents the data needed to transform between the camera views and is different for each operating depth_mode and color_resolution the device is configured to operate in.
The calibration output is used as input to all transformation functions.
See also
k4a_calibration_2d_to_2d()
k4a_calibration_2d_to_3d()
k4a_calibration_3d_to_2d()
k4a_calibration_3d_to_3d()

◆ k4a_capture_create()

K4A_EXPORT k4a_result_t k4a_capture_create ( k4a_capture_t capture_handle)
related

Create an empty capture object.

Parameters
capture_handlePointer to a location to store the handle.
Remarks
Call this function to create a k4a_capture_t handle for a new capture. Release it with k4a_capture_release().

The new capture is created with a reference count of 1.

Returns
Returns K4A_RESULT_SUCCEEDED on success. Errors are indicated with K4A_RESULT_FAILED and error specific data can be found in the log.

◆ k4a_capture_get_color_image()

K4A_EXPORT k4a_image_t k4a_capture_get_color_image ( k4a_capture_t  capture_handle)
related

Get the color image associated with the given capture.

Parameters
capture_handleCapture handle containing the image.
Remarks
Call this function to access the color image part of this capture. Release the k4a_image_t with k4a_image_release();

◆ k4a_capture_get_depth_image()

K4A_EXPORT k4a_image_t k4a_capture_get_depth_image ( k4a_capture_t  capture_handle)
related

Get the depth image associated with the given capture.

Parameters
capture_handleCapture handle containing the image.
Remarks
Call this function to access the depth image part of this capture. Release the k4a_image_t with k4a_image_release();

◆ k4a_capture_get_ir_image()

K4A_EXPORT k4a_image_t k4a_capture_get_ir_image ( k4a_capture_t  capture_handle)
related

Get the IR image associated with the given capture.

Parameters
capture_handleCapture handle containing the image.
Remarks
Call this function to access the IR image part of this capture. Release the k4a_image_t with k4a_image_release();

◆ k4a_capture_get_temperature_c()

K4A_EXPORT float k4a_capture_get_temperature_c ( k4a_capture_t  capture_handle)
related

Get the temperature associated with the capture.

Attention
For the Orbbec SDK K4A wrapper, this function is not yet supported.
Parameters
capture_handleCapture handle to retrieve the temperature from.
Returns
This function returns the temperature of the device at the time of the capture in Celsius. If the temperature is unavailable, the function will return NAN.

◆ k4a_capture_reference()

K4A_EXPORT void k4a_capture_reference ( k4a_capture_t  capture_handle)
related

Add a reference to a capture.

Parameters
capture_handleCapture to add a reference to.
Remarks
Call this function to add an additional reference to a capture. This reference must be removed with k4a_capture_release().

◆ k4a_capture_release()

K4A_EXPORT void k4a_capture_release ( k4a_capture_t  capture_handle)
related

Release a capture.

Parameters
capture_handleCapture to release.
Remarks
Call this function when finished using the capture.

◆ k4a_capture_set_color_image()

K4A_EXPORT void k4a_capture_set_color_image ( k4a_capture_t  capture_handle,
k4a_image_t  image_handle 
)
related

Set or add a color image to the associated capture.

Parameters
capture_handleCapture handle to hold the image.
image_handleImage handle containing the image.
Remarks
When a k4a_image_t is added to a k4a_capture_t, the k4a_capture_t will automatically add a reference to the k4a_image_t.
If there is already a color image contained in the capture, the existing image will be dereferenced and replaced with the new image.
To remove a color image to the capture without adding a new image, this function can be called with a NULL image_handle.
Any k4a_image_t contained in this k4a_capture_t will automatically be dereferenced when all references to the k4a_capture_t are released with k4a_capture_release().

◆ k4a_capture_set_depth_image()

K4A_EXPORT void k4a_capture_set_depth_image ( k4a_capture_t  capture_handle,
k4a_image_t  image_handle 
)
related

Set or add a depth image to the associated capture.

Parameters
capture_handleCapture handle to hold the image.
image_handleImage handle containing the image.
Remarks
When a k4a_image_t is added to a k4a_capture_t, the k4a_capture_t will automatically add a reference to the k4a_image_t.
If there is already an image depth image contained in the capture, the existing image will be dereferenced and replaced with the new image.
To remove a depth image to the capture without adding a new image, this function can be called with a NULL image_handle.
Any k4a_image_t contained in this k4a_capture_t will automatically be dereferenced when all references to the k4a_capture_t are released with k4a_capture_release().

◆ k4a_capture_set_ir_image()

K4A_EXPORT void k4a_capture_set_ir_image ( k4a_capture_t  capture_handle,
k4a_image_t  image_handle 
)
related

Set or add an IR image to the associated capture.

Parameters
capture_handleCapture handle to hold the image.
image_handleImage handle containing the image.
Remarks
When a k4a_image_t is added to a k4a_capture_t, the k4a_capture_t will automatically add a reference to the k4a_image_t.
If there is already an IR image contained in the capture, the existing image will be dereferenced and replaced with the new image.
To remove a IR image to the capture without adding a new image, this function can be called with a NULL image_handle.
Any k4a_image_t contained in this k4a_capture_t will automatically be dereferenced when all references to the k4a_capture_t are released with k4a_capture_release().

◆ k4a_capture_set_temperature_c()

K4A_EXPORT void k4a_capture_set_temperature_c ( k4a_capture_t  capture_handle,
float  temperature_c 
)
related

Set the temperature associated with the capture.

Attention
For the Orbbec SDK K4A wrapper, this function is not yet supported.
Parameters
capture_handleCapture handle to set the temperature on.
temperature_cTemperature in Celsius to store.

◆ k4a_device_close()

K4A_EXPORT void k4a_device_close ( k4a_device_t  device_handle)
related

Closes an Azure Kinect device.

Parameters
device_handleHandle obtained by k4a_device_open().
Remarks
Once closed, the handle is no longer valid.
Before closing the handle to the device, ensure that all k4a_capture_t captures have been released with k4a_capture_release().

◆ k4a_device_get_calibration()

K4A_EXPORT k4a_result_t k4a_device_get_calibration ( k4a_device_t  device_handle,
const k4a_depth_mode_t  depth_mode,
const k4a_color_resolution_t  color_resolution,
k4a_calibration_t calibration 
)
related

Get the camera calibration for the entire Azure Kinect device.

Parameters
device_handleHandle obtained by k4a_device_open().
depth_modeMode in which depth camera is operated.
color_resolutionResolution in which color camera is operated.
calibrationLocation to write the calibration
Returns
K4A_RESULT_SUCCEEDED if calibration was successfully written. K4A_RESULT_FAILED otherwise.
Remarks
The calibration represents the data needed to transform between the camera views and may be different for each operating depth_mode and color_resolution the device is configured to operate in.
The calibration output is used as input to all calibration and transformation functions.
See also
k4a_calibration_2d_to_2d()
k4a_calibration_2d_to_3d()
k4a_calibration_3d_to_2d()
k4a_calibration_3d_to_3d()

◆ k4a_device_get_capture()

K4A_EXPORT k4a_wait_result_t k4a_device_get_capture ( k4a_device_t  device_handle,
k4a_capture_t capture_handle,
int32_t  timeout_in_ms 
)
related

Reads a sensor capture.

Parameters
device_handleHandle obtained by k4a_device_open().
capture_handleIf successful this contains a handle to a capture object. Caller must call k4a_capture_release() when its done using this capture.
timeout_in_msSpecifies the time in milliseconds the function should block waiting for the capture. If set to 0, the function will return without blocking. Passing a value of K4A_WAIT_INFINITE will block indefinitely until data is available, the device is disconnected, or another error occurs.
Returns
K4A_WAIT_RESULT_SUCCEEDED if a capture is returned. If a capture is not available before the timeout elapses, the function will return K4A_WAIT_RESULT_TIMEOUT. All other failures will return K4A_WAIT_RESULT_FAILED.
Remarks
Gets the next capture in the streamed sequence of captures from the camera. If a new capture is not currently available, this function will block until the timeout is reached. The SDK will buffer at least two captures worth of data before dropping the oldest capture. Callers needing to capture all data need to ensure they read the data as fast as the data is being produced on average.
Upon successfully reading a capture this function will return success and populate capture. If a capture is not available in the configured timeout_in_ms, then the API will return K4A_WAIT_RESULT_TIMEOUT.
If the call is successful and a capture is returned, callers must call k4a_capture_release() to return the allocated memory.
This function needs to be called while the device is in a running state; after k4a_device_start_cameras() is called and before k4a_device_stop_cameras() is called.
This function returns an error when an internal problem is encountered; such as loss of the USB connection, inability to allocate enough memory, and other unexpected issues. Any error returned by this function signals the end of streaming data, and caller should stop the stream using k4a_device_stop_cameras().
If this function is waiting for data (non-zero timeout) when k4a_device_stop_cameras() or k4a_device_close() is called on another thread, this function will return an error.
Returns
K4A_WAIT_RESULT_SUCCEEDED if a capture is returned. If a capture is not available before the timeout elapses, the function will return K4A_WAIT_RESULT_TIMEOUT. All other failures will return K4A_WAIT_RESULT_FAILED.

◆ k4a_device_get_color_control()

K4A_EXPORT k4a_result_t k4a_device_get_color_control ( k4a_device_t  device_handle,
k4a_color_control_command_t  command,
k4a_color_control_mode_t mode,
int32_t *  value 
)
related

Get the Azure Kinect color sensor control value.

Parameters
device_handleHandle obtained by k4a_device_open().
commandColor sensor control command.
modeLocation to store the color sensor's control mode. This mode represents whether the command is in automatic or manual mode.
valueLocation to store the color sensor's control value. This value is always written, but is only valid when the mode returned is K4A_COLOR_CONTROL_MODE_MANUAL for the current command.
Returns
K4A_RESULT_SUCCEEDED if the value was successfully returned, K4A_RESULT_FAILED if an error occurred
Remarks
Each control command may be set to manual or automatic. See the definition of k4a_color_control_command_t on how to interpret the value for each command.
Some control commands are only supported in manual mode. When a command is in automatic mode, the value for that command is not valid.
Control values set on a device are reset only when the device is power cycled. The device will retain the settings even if the k4a_device_t is closed or the application is restarted.

◆ k4a_device_get_color_control_capabilities()

K4A_EXPORT k4a_result_t k4a_device_get_color_control_capabilities ( k4a_device_t  device_handle,
k4a_color_control_command_t  command,
bool *  supports_auto,
int32_t *  min_value,
int32_t *  max_value,
int32_t *  step_value,
int32_t *  default_value,
k4a_color_control_mode_t default_mode 
)
related

Get the Azure Kinect color sensor control capabilities.

Parameters
device_handleHandle obtained by k4a_device_open().
commandColor sensor control command.
supports_autoLocation to store whether the color sensor's control support auto mode or not. true if it supports auto mode, otherwise false.
min_valueLocation to store the color sensor's control minimum value of /p command.
max_valueLocation to store the color sensor's control maximum value of /p command.
step_valueLocation to store the color sensor's control step value of /p command.
default_valueLocation to store the color sensor's control default value of /p command.
default_modeLocation to store the color sensor's control default mode of /p command.
Returns
K4A_RESULT_SUCCEEDED if the value was successfully returned, K4A_RESULT_FAILED if an error occurred

◆ k4a_device_get_imu_sample()

K4A_EXPORT k4a_wait_result_t k4a_device_get_imu_sample ( k4a_device_t  device_handle,
k4a_imu_sample_t imu_sample,
int32_t  timeout_in_ms 
)
related

Reads an IMU sample.

Parameters
device_handleHandle obtained by k4a_device_open().
imu_samplePointer to the location for the API to write the IMU sample.
timeout_in_msSpecifies the time in milliseconds the function should block waiting for the sample. If set to 0, the function will return without blocking. Passing a value of K4A_WAIT_INFINITE will block indefinitely until data is available, the device is disconnected, or another error occurs.
Returns
K4A_WAIT_RESULT_SUCCEEDED if a sample is returned. If a sample is not available before the timeout elapses, the function will return K4A_WAIT_RESULT_TIMEOUT. All other failures will return K4A_WAIT_RESULT_FAILED.
Remarks
Gets the next sample in the streamed sequence of IMU samples from the device. If a new sample is not currently available, this function will block until the timeout is reached. The API will buffer at least two camera capture intervals worth of samples before dropping the oldest sample. Callers needing to capture all data need to ensure they read the data as fast as the data is being produced on average.
Upon successfully reading a sample this function will return success and populate imu_sample. If a sample is not available in the configured timeout_in_ms, then the API will return K4A_WAIT_RESULT_TIMEOUT.
This function needs to be called while the device is in a running state; after k4a_device_start_imu() is called and before k4a_device_stop_imu() is called.
This function returns an error when an internal problem is encountered; such as loss of the USB connection, inability to allocate enough memory, and other unexpected issues. Any error returned by this function signals the end of streaming data, and caller should stop the stream using k4a_device_stop_imu().
If this function is waiting for data (non-zero timeout) when k4a_device_stop_imu() or k4a_device_close() is called on another thread, this function will return an error.
The memory the IMU sample is written to is allocated and owned by the caller, so there is no need to call an Azure Kinect API to free or release the sample.

◆ k4a_device_get_installed_count()

K4A_EXPORT uint32_t k4a_device_get_installed_count ( void  )
related

Gets the number of connected devices

Returns
Number of sensors connected to the PC.
Remarks
This API counts the number of Azure Kinect devices connected to the host PC.

◆ k4a_device_get_raw_calibration()

K4A_EXPORT k4a_buffer_result_t k4a_device_get_raw_calibration ( k4a_device_t  device_handle,
uint8_t *  data,
size_t *  data_size 
)
related

Get the raw calibration blob for the entire Azure Kinect device.

Parameters
device_handleHandle obtained by k4a_device_open().
dataLocation to write the calibration data to. This field may optionally be set to NULL for the caller to query for the needed data size.
data_sizeOn passing data_size into the function this variable represents the available size of the data buffer. On return this variable is updated with the amount of data actually written to the buffer, or the size required to store the calibration buffer if data is NULL.
Returns
K4A_BUFFER_RESULT_SUCCEEDED if data was successfully written. If data_size points to a buffer size that is too small to hold the output or data is NULL, K4A_BUFFER_RESULT_TOO_SMALL is returned and data_size is updated to contain the minimum buffer size needed to capture the calibration data.

◆ k4a_device_get_serialnum()

K4A_EXPORT k4a_buffer_result_t k4a_device_get_serialnum ( k4a_device_t  device_handle,
char *  serial_number,
size_t *  serial_number_size 
)
related

Get the Azure Kinect device serial number.

Parameters
device_handleHandle obtained by k4a_device_open().
serial_numberLocation to write the serial number to. If the function returns K4A_BUFFER_RESULT_SUCCEEDED, this will be a NULL terminated string of ASCII characters. If this input is NULL serial_number_size will still be updated to return the size of the buffer needed to store the string.
serial_number_sizeOn input, the size of the serial_number buffer if that pointer is not NULL. On output, this value is set to the actual number of bytes in the serial number (including the null terminator).
Returns
A return of K4A_BUFFER_RESULT_SUCCEEDED means that the serial_number has been filled in. If the buffer is too small the function returns K4A_BUFFER_RESULT_TOO_SMALL and the size of the serial number is returned in the serial_number_size parameter. All other failures return K4A_BUFFER_RESULT_FAILED.
Remarks
Queries the device for its serial number. If the caller needs to know the size of the serial number to allocate memory, the function should be called once with a NULL serial_number to get the needed size in the serial_number_size output, and then again with the allocated buffer.
Only a complete serial number will be returned. If the caller's buffer is too small, the function will return K4A_BUFFER_RESULT_TOO_SMALL without returning any data in serial_number.

◆ k4a_device_get_sync_jack()

K4A_EXPORT k4a_result_t k4a_device_get_sync_jack ( k4a_device_t  device_handle,
bool *  sync_in_jack_connected,
bool *  sync_out_jack_connected 
)
related

Get the device jack status for the synchronization in and synchronization out connectors.

Attention
The Orbbec device does not support retrieving the jack connection status, so this function will always return false (disconnected).
Parameters
device_handleHandle obtained by k4a_device_open().
sync_in_jack_connectedUpon successful return this value will be set to true if a cable is connected to this sync in jack.
sync_out_jack_connectedUpon successful return this value will be set to true if a cable is connected to this sync out jack.
Returns
K4A_RESULT_SUCCEEDED if the connector status was successfully read.
Remarks
If sync_out_jack_connected is true then k4a_device_configuration_t wired_sync_mode mode can be set to K4A_WIRED_SYNC_MODE_STANDALONE or K4A_WIRED_SYNC_MODE_MASTER. If sync_in_jack_connected is true then k4a_device_configuration_t wired_sync_mode mode can be set to K4A_WIRED_SYNC_MODE_STANDALONE or K4A_WIRED_SYNC_MODE_SUBORDINATE.
See also
k4a_device_start_cameras()

◆ k4a_device_get_version()

K4A_EXPORT k4a_result_t k4a_device_get_version ( k4a_device_t  device_handle,
k4a_hardware_version_t version 
)
related

Get the version numbers of the device's subsystems.

Parameters
device_handleHandle obtained by k4a_device_open().
versionLocation to write the version info to.
Returns
A return of K4A_RESULT_SUCCEEDED means that the version structure has been filled in. All other failures return K4A_RESULT_FAILED.

◆ k4a_device_open()

K4A_EXPORT k4a_result_t k4a_device_open ( uint32_t  index,
k4a_device_t device_handle 
)
related

Open an Azure Kinect device.

Parameters
indexThe index of the device to open, starting with 0. Optionally pass in K4A_DEVICE_DEFAULT.
device_handleOutput parameter which on success will return a handle to the device.
Returns
K4A_RESULT_SUCCEEDED if the device was opened successfully.
Remarks
If successful, k4a_device_open() will return a device handle in the device_handle parameter. This handle grants exclusive access to the device and may be used in the other Azure Kinect API calls.
When done with the device, close the handle with k4a_device_close()

◆ k4a_device_set_color_control()

K4A_EXPORT k4a_result_t k4a_device_set_color_control ( k4a_device_t  device_handle,
k4a_color_control_command_t  command,
k4a_color_control_mode_t  mode,
int32_t  value 
)
related

Set the Azure Kinect color sensor control value.

Parameters
device_handleHandle obtained by k4a_device_open().
commandColor sensor control command.
modeColor sensor control mode to set. This mode represents whether the command is in automatic or manual mode.
valueValue to set the color sensor's control to. The value is only valid if mode is set to K4A_COLOR_CONTROL_MODE_MANUAL, and is otherwise ignored.
Returns
K4A_RESULT_SUCCEEDED if the value was successfully set, K4A_RESULT_FAILED if an error occurred
Remarks
Each control command may be set to manual or automatic. See the definition of k4a_color_control_command_t on how to interpret the value for each command.
Some control commands are only supported in manual mode. When a command is in automatic mode, the value for that command is not valid.
Control values set on a device are reset only when the device is power cycled. The device will retain the settings even if the k4a_device_t is closed or the application is restarted.

◆ k4a_device_start_cameras()

K4A_EXPORT k4a_result_t k4a_device_start_cameras ( k4a_device_t  device_handle,
const k4a_device_configuration_t config 
)
related

Starts color and depth camera capture.

Parameters
device_handleHandle obtained by k4a_device_open().
configThe configuration we want to run the device in. This can be initialized with K4A_DEVICE_CONFIG_INIT_DISABLE_ALL.
Returns
K4A_RESULT_SUCCEEDED is returned on success.
Remarks
Individual sensors configured to run will now start to stream captured data.
It is not valid to call k4a_device_start_cameras() a second time on the same k4a_device_t until k4a_device_stop_cameras() has been called.

◆ k4a_device_start_imu()

K4A_EXPORT k4a_result_t k4a_device_start_imu ( k4a_device_t  device_handle)
related

Starts the IMU sample stream.

Parameters
device_handleHandle obtained by k4a_device_open().
Returns
K4A_RESULT_SUCCEEDED is returned on success. K4A_RESULT_FAILED if the sensor is already running or a failure is encountered
Remarks
Call this API to start streaming IMU data. It is not valid to call this function a second time on the same k4a_device_t until k4a_device_stop_imu() has been called.
This function is dependent on the state of the cameras. The color or depth camera must be started before the IMU. K4A_RESULT_FAILED will be returned if one of the cameras is not running.

◆ k4a_device_stop_cameras()

K4A_EXPORT void k4a_device_stop_cameras ( k4a_device_t  device_handle)
related

Stops the color and depth camera capture.

Parameters
device_handleHandle obtained by k4a_device_open().
Remarks
The streaming of individual sensors stops as a result of this call. Once called, k4a_device_start_cameras() may be called again to resume sensor streaming.
This function may be called while another thread is blocking in k4a_device_get_capture(). Calling this function while another thread is in that function will result in that function returning a failure.

◆ k4a_device_stop_imu()

K4A_EXPORT void k4a_device_stop_imu ( k4a_device_t  device_handle)
related

Stops the IMU capture.

Parameters
device_handleHandle obtained by k4a_device_open().
Remarks
The streaming of the IMU stops as a result of this call. Once called, k4a_device_start_imu() may be called again to resume sensor streaming, so long as the cameras are running.
This function may be called while another thread is blocking in k4a_device_get_imu_sample(). Calling this function while another thread is in that function will result in that function returning a failure.

◆ k4a_image_create()

K4A_EXPORT k4a_result_t k4a_image_create ( k4a_image_format_t  format,
int  width_pixels,
int  height_pixels,
int  stride_bytes,
k4a_image_t image_handle 
)
related

Create an image.

Parameters
formatThe format of the image that will be stored in this image container.
width_pixelsWidth in pixels.
height_pixelsHeight in pixels.
stride_bytesThe number of bytes per horizontal line of the image. If set to 0, the stride will be set to the minimum size given the format and width_pixels.
image_handlePointer to store image handle in.
Remarks
This function is used to create images of formats that have consistent stride. The function is not suitable for compressed formats that may not be represented by the same number of bytes per line.
For most image formats, the function will allocate an image buffer of size height_pixels * stride_bytes. Buffers K4A_IMAGE_FORMAT_COLOR_NV12 format will allocate an additional height_pixels / 2 set of lines (each of stride_bytes). This function cannot be used to allocate K4A_IMAGE_FORMAT_COLOR_MJPG buffers.
To create an image object without the API allocating memory, or to represent an image that has a non-deterministic stride, use k4a_image_create_from_buffer().
The k4a_image_t is created with a reference count of 1.
When finished using the created image, release it with k4a_image_release.
Returns
Returns K4A_RESULT_SUCCEEDED on success. Errors are indicated with K4A_RESULT_FAILED.

◆ k4a_image_create_from_buffer()

K4A_EXPORT k4a_result_t k4a_image_create_from_buffer ( k4a_image_format_t  format,
int  width_pixels,
int  height_pixels,
int  stride_bytes,
uint8_t *  buffer,
size_t  buffer_size,
k4a_memory_destroy_cb_t buffer_release_cb,
void *  buffer_release_cb_context,
k4a_image_t image_handle 
)
related

Create an image from a pre-allocated buffer.

Parameters
formatThe format of the image that will be stored in this image container.
width_pixelsWidth in pixels.
height_pixelsHeight in pixels.
stride_bytesThe number of bytes per horizontal line of the image.
bufferPointer to a pre-allocated image buffer.
buffer_sizeSize in bytes of the pre-allocated image buffer.
buffer_release_cbCallback to the buffer free function, called when all references to the buffer have been released. This parameter is optional.
buffer_release_cb_contextContext for the buffer free function. This value will be called as a parameter to buffer_release_cb when the callback is invoked.
image_handlePointer to store image handle in.
Remarks
This function creates a k4a_image_t from a pre-allocated buffer. When all references to this object reach zero the provided buffer_release_cb callback function is called so that the memory can be released. If this function fails, the API will not use the memory provided in buffer, and the API will not call buffer_release_cb.
The k4a_image_t is created with a reference count of 1.
Release the reference on this function with k4a_image_release().
Returns
Returns K4A_RESULT_SUCCEEDED on success. Errors are indicated with K4A_RESULT_FAILED and error specific data can be found in the log.

◆ k4a_image_get_buffer()

K4A_EXPORT uint8_t * k4a_image_get_buffer ( k4a_image_t  image_handle)
related

Get the image buffer.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
Use this buffer to access the raw image data.
Returns
The function will return NULL if there is an error, and will normally return a pointer to the image buffer. Since all k4a_image_t instances are created with an image buffer, this function should only return NULL if the image_handle is invalid.

◆ k4a_image_get_device_timestamp_usec()

K4A_EXPORT uint64_t k4a_image_get_device_timestamp_usec ( k4a_image_t  image_handle)
related

Get the image's device timestamp in microseconds.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
Returns the device timestamp of the image, as captured by the hardware. Timestamps are recorded by the device and represent the mid-point of exposure. They may be used for relative comparison, but their absolute value has no defined meaning.
Returns
If the image_handle is invalid or if no timestamp was set for the image, this function will return 0. It is also possible for 0 to be a valid timestamp originating from the beginning of a recording or the start of streaming.

◆ k4a_image_get_exposure_usec()

K4A_EXPORT uint64_t k4a_image_get_exposure_usec ( k4a_image_t  image_handle)
related

Get the image exposure in microseconds.

Attention
For the Orbbec SDK K4A wrapper, this function is not yet supported.
Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
Returns an exposure time in microseconds. This is only supported on color image formats.
Returns
If the image_handle is invalid, or no exposure was set on the image, the function will return 0. Otherwise, it will return the image exposure time in microseconds.

◆ k4a_image_get_format()

K4A_EXPORT k4a_image_format_t k4a_image_get_format ( k4a_image_t  image_handle)
related

Get the format of the image.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
Use this function to determine the format of the image buffer.
Returns
This function is not expected to fail, all k4a_image_t's are created with a known format. If the image_handle is invalid, the function will return K4A_IMAGE_FORMAT_CUSTOM.

◆ k4a_image_get_height_pixels()

K4A_EXPORT int k4a_image_get_height_pixels ( k4a_image_t  image_handle)
related

Get the image height in pixels.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Returns
This function is not expected to fail, all k4a_image_t's are created with a known height. If the image_handle is invalid, the function will return 0.

◆ k4a_image_get_iso_speed()

K4A_EXPORT uint32_t k4a_image_get_iso_speed ( k4a_image_t  image_handle)
related

Get the image ISO speed.

Attention
For the Orbbec SDK K4A wrapper, this function is not yet supported.
Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
This function is only valid for color captures, and not for depth or IR captures.
Returns
Returns the ISO speed of the image. 0 indicates the ISO speed was not available or an error occurred.

◆ k4a_image_get_size()

K4A_EXPORT size_t k4a_image_get_size ( k4a_image_t  image_handle)
related

Get the image buffer size.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
Use this function to know what the size of the image buffer is returned by k4a_image_get_buffer().
Returns
The function will return 0 if there is an error, and will normally return the image size. Since all k4a_image_t instances are created with an image buffer, this function should only return 0 if the image_handle is invalid.

◆ k4a_image_get_stride_bytes()

K4A_EXPORT int k4a_image_get_stride_bytes ( k4a_image_t  image_handle)
related

Get the image stride in bytes.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Returns
This function is not expected to fail, all k4a_image_t's are created with a known stride. If the image_handle is invalid, or the image's format does not have a stride, the function will return 0.

◆ k4a_image_get_system_timestamp_nsec()

K4A_EXPORT uint64_t k4a_image_get_system_timestamp_nsec ( k4a_image_t  image_handle)
related

Get the image's system timestamp in nanoseconds.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
Returns the system timestamp of the image. Timestamps are recorded by the host. They may be used for relative comparision, as they are relative to the corresponding system clock. The absolute value is a monotonic count from an arbitrary point in the past.
The system timestamp is captured at the moment host PC finishes receiving the image.
On Linux the system timestamp is read from clock_gettime(CLOCK_MONOTONIC), which measures realtime and is not impacted by adjustments to the system clock. It starts from an arbitrary point in the past. On Windows the system timestamp is read from QueryPerformanceCounter(), it also measures realtime and is not impacted by adjustments to the system clock. It also starts from an arbitrary point in the past.
Returns
If the image_handle is invalid or if no timestamp was set for the image, this function will return 0. It is also possible for 0 to be a valid timestamp originating from the beginning of a recording or the start of streaming.

◆ k4a_image_get_timestamp_usec()

K4A_DEPRECATED_EXPORT uint64_t k4a_image_get_timestamp_usec ( k4a_image_t  image_handle)
related

Get the image's device timestamp in microseconds.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
Returns the device timestamp of the image. Timestamps are recorded by the device and represent the mid-point of exposure. They may be used for relative comparison, but their absolute value has no defined meaning.
Returns
If the image_handle is invalid or if no timestamp was set for the image, this function will return 0. It is also possible for 0 to be a valid timestamp originating from the beginning of a recording or the start of streaming.
Deprecated:
Deprecated starting in 1.2.0. Please use k4a_image_get_device_timestamp_usec().

◆ k4a_image_get_white_balance()

K4A_EXPORT uint32_t k4a_image_get_white_balance ( k4a_image_t  image_handle)
related

Get the image white balance.

Attention
For the Orbbec SDK K4A wrapper, this function is not yet supported.
Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
Returns the image's white balance. This function is only valid for color captures, and not for depth or IR captures.
Returns
Returns the image white balance in Kelvin. If image_handle is invalid, or the white balance was not set or not applicable to the image, the function will return 0.

◆ k4a_image_get_width_pixels()

K4A_EXPORT int k4a_image_get_width_pixels ( k4a_image_t  image_handle)
related

Get the image width in pixels.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Returns
This function is not expected to fail, all k4a_image_t's are created with a known width. If the image_handle is invalid, the function will return 0.

◆ k4a_image_reference()

K4A_EXPORT void k4a_image_reference ( k4a_image_t  image_handle)
related

Add a reference to the k4a_image_t.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
References manage the lifetime of the object. When the references reach zero the object is destroyed. A caller must not access the object after its reference is released.

◆ k4a_image_release()

K4A_EXPORT void k4a_image_release ( k4a_image_t  image_handle)
related

Remove a reference from the k4a_image_t.

Parameters
image_handleHandle of the image for which the get operation is performed on.
Remarks
References manage the lifetime of the object. When the references reach zero the object is destroyed. A caller must not access the object after its reference is released.

◆ k4a_image_set_device_timestamp_usec()

K4A_EXPORT void k4a_image_set_device_timestamp_usec ( k4a_image_t  image_handle,
uint64_t  timestamp_usec 
)
related

Set the device time stamp, in microseconds, of the image.

Parameters
image_handleHandle of the image to set the timestamp on.
timestamp_usecDevice timestamp of the image in microseconds.
Remarks
Use this function in conjunction with k4a_image_create() or k4a_image_create_from_buffer() to construct a k4a_image_t.
The device timestamp represents the mid-point of exposure of the image, as captured by the hardware.

◆ k4a_image_set_exposure_time_usec()

K4A_DEPRECATED_EXPORT void k4a_image_set_exposure_time_usec ( k4a_image_t  image_handle,
uint64_t  exposure_usec 
)
related

Set the exposure time, in microseconds, of the image.

Parameters
image_handleHandle of the image to set the exposure time on.
exposure_usecExposure time of the image in microseconds.
Remarks
Use this function in conjunction with k4a_image_create() or k4a_image_create_from_buffer() to construct a k4a_image_t. An exposure time of 0 is considered invalid. Only color image formats are expected to have a valid exposure time.
Deprecated:
Deprecated starting in 1.2.0. Please use k4a_image_set_exposure_usec().

◆ k4a_image_set_exposure_usec()

K4A_EXPORT void k4a_image_set_exposure_usec ( k4a_image_t  image_handle,
uint64_t  exposure_usec 
)
related

Set the exposure time, in microseconds, of the image.

Attention
For the Orbbec SDK K4A wrapper, this function is not yet supported.
Parameters
image_handleHandle of the image to set the exposure time on.
exposure_usecExposure time of the image in microseconds.
Remarks
Use this function in conjunction with k4a_image_create() or k4a_image_create_from_buffer() to construct a k4a_image_t. An exposure time of 0 is considered invalid. Only color image formats are expected to have a valid exposure time.

◆ k4a_image_set_iso_speed()

K4A_EXPORT void k4a_image_set_iso_speed ( k4a_image_t  image_handle,
uint32_t  iso_speed 
)
related

Set the ISO speed of the image.

Attention
For the Orbbec SDK K4A wrapper, this function is not yet supported.
Parameters
image_handleHandle of the image to set the ISO speed on.
iso_speedISO speed of the image.
Remarks
Use this function in conjunction with k4a_image_create() or k4a_image_create_from_buffer() to construct a k4a_image_t. An ISO speed of 0 is considered invalid. Only color images are expected to have a valid ISO speed.

◆ k4a_image_set_system_timestamp_nsec()

K4A_EXPORT void k4a_image_set_system_timestamp_nsec ( k4a_image_t  image_handle,
uint64_t  timestamp_nsec 
)
related

Set the system time stamp, in nanoseconds, of the image.

Parameters
image_handleHandle of the image to set the timestamp on.
timestamp_nsecTimestamp of the image in nanoseconds.
Remarks
Use this function in conjunction with k4a_image_create() or k4a_image_create_from_buffer() to construct a k4a_image_t.
The system timestamp is a high performance and increasing clock (from boot). The timestamp represents the time immediately after the image buffer was read by the host PC.

◆ k4a_image_set_timestamp_usec()

K4A_DEPRECATED_EXPORT void k4a_image_set_timestamp_usec ( k4a_image_t  image_handle,
uint64_t  timestamp_usec 
)
related

Set the device time stamp, in microseconds, of the image.

Parameters
image_handleHandle of the image to set the timestamp on.
timestamp_usecDevice timestamp of the image in microseconds.
Remarks
Use this function in conjunction with k4a_image_create() or k4a_image_create_from_buffer() to construct a k4a_image_t.
The device timestamp represents the mid-point of exposure of the image, as captured by the hardware.
Deprecated:
Deprecated starting in 1.2.0. Please use k4a_image_set_device_timestamp_usec().

◆ k4a_image_set_white_balance()

K4A_EXPORT void k4a_image_set_white_balance ( k4a_image_t  image_handle,
uint32_t  white_balance 
)
related

Set the white balance of the image.

Attention
For the Orbbec SDK K4A wrapper, this function is not yet supported.
Parameters
image_handleHandle of the image to set the white balance on.
white_balanceWhite balance of the image in degrees Kelvin.
Remarks
Use this function in conjunction with k4a_image_create() or k4a_image_create_from_buffer() to construct a k4a_image_t. A white balance of 0 is considered invalid. White balance is only meaningful for color images, and not expected on depth or IR images.

◆ k4a_playback_check_track_exists()

K4ARECORD_EXPORT bool k4a_playback_check_track_exists ( k4a_playback_t  playback_handle,
const char *  track_name 
)

Checks whether a track with the given track name exists in the playback file.

Parameters
playback_handleHandle obtained by k4a_playback_open().
track_nameThe track name to be checked to see whether it exists or not.
Returns
true if the track exists.

◆ k4a_playback_close()

K4ARECORD_EXPORT void k4a_playback_close ( k4a_playback_t  playback_handle)
related

Closes a recording playback handle.

Parameters
playback_handleHandle obtained by k4a_playback_open().

◆ k4a_playback_data_block_get_buffer()

K4ARECORD_EXPORT uint8_t * k4a_playback_data_block_get_buffer ( k4a_playback_data_block_t  data_block_handle)
related

Get the buffer of a data block.

Parameters
data_block_handleHandle obtained by k4a_playback_get_next_data_block() or k4a_playback_get_previous_data_block().
Remarks
Use this buffer to access the data written to a custom recording track.
Returns
Returns a pointer to the data block buffer, or NULL if the data block is invalid.

◆ k4a_playback_data_block_get_buffer_size()

K4ARECORD_EXPORT size_t k4a_playback_data_block_get_buffer_size ( k4a_playback_data_block_t  data_block_handle)
related

Get the buffer size of a data block.

Parameters
data_block_handleHandle obtained by k4a_playback_get_next_data_block() or k4a_playback_get_previous_data_block().
Returns
Returns the buffer size of the data block, or 0 if the data block is invalid.

◆ k4a_playback_data_block_get_device_timestamp_usec()

K4ARECORD_EXPORT uint64_t k4a_playback_data_block_get_device_timestamp_usec ( k4a_playback_data_block_t  data_block_handle)
related

Get the device timestamp of a data block in microseconds.

Parameters
data_block_handleHandle obtained by k4a_playback_get_next_data_block() or k4a_playback_get_previous_data_block().
Returns
Returns the device timestamp of the data block. If the data_block_handle is invalid this function will return 0. It is also possible for 0 to be a valid timestamp originating from when a device was first powered on.

◆ k4a_playback_data_block_release()

K4ARECORD_EXPORT void k4a_playback_data_block_release ( k4a_playback_data_block_t  data_block_handle)
related

Release a data block handle.

Parameters
data_block_handleHandle obtained by k4a_playback_get_next_data_block() or k4a_playback_get_previous_data_block().
Remarks
Release the memory of a data block. The caller must not access the object after it is released.

◆ k4a_playback_get_attachment()

K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_get_attachment ( k4a_playback_t  playback_handle,
const char *  file_name,
uint8_t *  data,
size_t *  data_size 
)

Reads an attachment file from a recording.

Parameters
playback_handleHandle obtained by k4a_playback_open().
file_nameThe attachment file name.
dataLocation to write the attachment data. If a NULL buffer is specified, data_size will be set to the size of buffer needed to store the data.
data_sizeOn input, the size of the data buffer. On output, this is set to the length of the attachment data.
Returns
A return of K4A_BUFFER_RESULT_SUCCEEDED means that the data has been filled in. If the buffer is too small the function returns K4A_BUFFER_RESULT_TOO_SMALL and the needed size of the data buffer is returned in the data_size parameter. K4A_BUFFER_RESULT_FAILED is returned if the attachment file_name does not exist. All other failures return K4A_BUFFER_RESULT_FAILED.

◆ k4a_playback_get_calibration()

K4ARECORD_EXPORT k4a_result_t k4a_playback_get_calibration ( k4a_playback_t  playback_handle,
k4a_calibration_t calibration 
)
related

Get the camera calibration for Azure Kinect device used during recording. The output struct is used as input to all transformation functions.

Parameters
playback_handleHandle obtained by k4a_playback_open().
calibrationLocation to write the calibration.
Returns
K4A_RESULT_SUCCEEDED if calibration was successfully written. K4A_RESULT_FAILED otherwise.
Remarks
The calibration may not exist if the device was not specified during recording.

◆ k4a_playback_get_last_timestamp_usec()

K4ARECORD_DEPRECATED_EXPORT uint64_t k4a_playback_get_last_timestamp_usec ( k4a_playback_t  playback_handle)
related

Gets the last timestamp in a recording, relative to the start of the recording.

Parameters
playback_handleHandle obtained by k4a_playback_open().
Returns
The file timestamp of the last capture image or IMU sample in microseconds.
Remarks
This function returns a file timestamp, not an absolute device timestamp, meaning it is relative to the start of the recording. This function is equivalent to the length of the recording.
Deprecated:
Deprecated starting in 1.2.0. Please use k4a_playback_get_recording_length_usec().

◆ k4a_playback_get_next_capture()

K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_next_capture ( k4a_playback_t  playback_handle,
k4a_capture_t capture_handle 
)
related

Read the next capture in the recording sequence.

Parameters
playback_handleHandle obtained by k4a_playback_open().
capture_handleIf successful this contains a handle to a capture object. Caller must call k4a_capture_release() when its done using this capture
Returns
K4A_STREAM_RESULT_SUCCEEDED if a capture is returned, or K4A_STREAM_RESULT_EOF if the end of the recording is reached. All other failures will return K4A_STREAM_RESULT_FAILED.
Remarks
k4a_playback_get_next_capture() always returns the next capture in sequence after the most recently returned capture.
The first call to k4a_playback_get_next_capture() after k4a_playback_seek_timestamp() will return the capture in the recording closest to the seek time with an image timestamp greater than or equal to the seek time.
If a call was made to k4a_playback_get_previous_capture() that returned K4A_STREAM_RESULT_EOF, the playback position is at the beginning of the stream and k4a_playback_get_next_capture() will return the first capture in the recording.
Capture objects returned by the playback API will always contain at least one image, but may have images missing if frames were dropped in the original recording. When calling k4a_capture_get_color_image(), k4a_capture_get_depth_image(), or k4a_capture_get_ir_image(), the image should be checked for NULL.

◆ k4a_playback_get_next_data_block()

K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_next_data_block ( k4a_playback_t  playback_handle,
const char *  track_name,
k4a_playback_data_block_t data_block_handle 
)
related

Read the next data block for a particular track.

Parameters
playback_handleHandle obtained by k4a_playback_open().
track_nameThe name of the track to read the next data block from.
data_block_handleThe location to write the data block handle.
Returns
K4A_STREAM_RESULT_SUCCEEDED if a data block is returned, or K4A_STREAM_RESULT_EOF if the end of the recording is reached. All other failures will return K4A_STREAM_RESULT_FAILED.
Remarks
k4a_playback_get_next_data_block() always returns the data block after the most recently returned data block for a particular track.
If a call was made to k4a_playback_get_previous_data_block() which returned K4A_STREAM_RESULT_EOF, then the playback position is at the beginning of the recording and calling k4a_playback_get_next_data_block() with the same track will return the first data block in the track.
The first call to k4a_playback_get_next_data_block() after k4a_playback_seek_timestamp() will return the data block in the recording closest to the seek time with a timestamp greater than or equal to the seek time.
k4a_playback_get_next_data_block() cannot be used with the built-in tracks: "COLOR", "DEPTH", etc... k4a_playback_track_is_builtin() can be used to determine if a track is a built-in track.
If the call is successful, callers must call k4a_playback_data_block_release() to return the allocated memory for data_block_handle.

◆ k4a_playback_get_next_imu_sample()

K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_next_imu_sample ( k4a_playback_t  playback_handle,
k4a_imu_sample_t imu_sample 
)
related

Read the next IMU sample in the recording sequence.

Parameters
playback_handleHandle obtained by k4a_playback_open().
imu_sampleThe location to write the IMU sample.
Returns
K4A_STREAM_RESULT_SUCCEEDED if a sample is returned, or K4A_STREAM_RESULT_EOF if the end of the recording is reached. All other failures will return K4A_STREAM_RESULT_FAILED.
Remarks
k4a_playback_get_next_imu_sample() always returns the IMU sample after the most recently returned sample.
If a call was made to k4a_playback_get_previous_imu_sample() which returned K4A_STREAM_RESULT_EOF, then the playback position is at the beginning of the recording and k4a_playback_get_next_imu_sample() will return the first IMU sample in the recording.
The first call to k4a_playback_get_next_imu_sample() after k4a_playback_seek_timestamp() will return the IMU sample in the recording closest to the seek time with a timestamp greater than or equal to the seek time.

◆ k4a_playback_get_previous_capture()

K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_previous_capture ( k4a_playback_t  playback_handle,
k4a_capture_t capture_handle 
)
related

Read the previous capture in the recording sequence.

Parameters
playback_handleHandle obtained by k4a_playback_open().
capture_handleIf successful this contains a handle to a capture object. Caller must call k4a_capture_release() when its done using this capture.
Returns
K4A_STREAM_RESULT_SUCCEEDED if a capture is returned, or K4A_STREAM_RESULT_EOF if the start of the recording is reached. All other failures will return K4A_STREAM_RESULT_FAILED.
Remarks
k4a_playback_get_previous_capture() always returns the previous capture in the sequence before the most recently returned capture.
If a call was made to k4a_playback_get_next_capture() that returned K4A_STREAM_RESULT_EOF, the playback position is at the end of the stream and k4a_playback_get_previous_capture() will return the last capture in the recording.
The first call to k4a_playback_get_previous_capture() after k4a_playback_seek_timestamp() will return the capture in the recording closest to the seek time with all image timestamps less than the seek time.
Capture objects returned by this API will always contain at least one image, but may have images missing if frames were dropped in the original recording. When calling k4a_capture_get_color_image(), k4a_capture_get_depth_image(), or k4a_capture_get_ir_image(), the image should be checked for NULL.

◆ k4a_playback_get_previous_data_block()

K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_previous_data_block ( k4a_playback_t  playback_handle,
const char *  track_name,
k4a_playback_data_block_t data_block_handle 
)
related

Read the previous data block for a particular track.

Parameters
playback_handleHandle obtained by k4a_playback_open().
track_nameThe name of the track to read the previous data block from.
data_block_handleThe location to write the data block.
Returns
K4A_STREAM_RESULT_SUCCEEDED if a sample is returned, or K4A_STREAM_RESULT_EOF if the start of the recording is reached. All other failures will return K4A_STREAM_RESULT_FAILED.
Remarks
k4a_playback_get_previous_data_block() always returns the data block before the most recently returned data block for a particular track.
If a call was made to to k4a_playback_get_next_data_block() which returned K4A_STREAM_RESULT_EOF, then the playback position is at the end of the recording and calling k4a_playback_get_previous_data_block() with the same track will return the last data block in the track.
The first call to k4a_playback_get_previous_data_block() after k4a_playback_seek_timestamp() will return the data block closest to the seek time with a timestamp less than the seek time.
If the call is successful, callers must call k4a_playback_data_block_release() to return the allocated memory for data_block_handle.
k4a_playback_get_previous_data_block() cannot be used with the built-in tracks: "COLOR", "DEPTH", etc... k4a_playback_track_is_builtin() can be used to determine if a track is a built-in track.

◆ k4a_playback_get_previous_imu_sample()

K4ARECORD_EXPORT k4a_stream_result_t k4a_playback_get_previous_imu_sample ( k4a_playback_t  playback_handle,
k4a_imu_sample_t imu_sample 
)
related

Read the previous IMU sample in the recording sequence.

Parameters
playback_handleHandle obtained by k4a_playback_open().
imu_sample[OUT] The location to write the IMU sample.
Returns
K4A_STREAM_RESULT_SUCCEEDED if a sample is returned, or K4A_STREAM_RESULT_EOF if the start of the recording is reached. All other failures will return K4A_STREAM_RESULT_FAILED.
Remarks
k4a_playback_get_previous_imu_sample() always returns the IMU sample before the most recently returned sample.
If a call was made to to k4a_playback_get_next_imu_sample() which returned K4A_STREAM_RESULT_EOF, then the playback position is at the end of the recording and k4a_playback_get_previous_imu_sample() will return the last IMU sample in the recording.
The first call to k4a_playback_get_previous_imu_sample() after k4a_playback_seek_timestamp() will return the IMU sample closest to the seek time with a timestamp less than the seek time.

◆ k4a_playback_get_raw_calibration()

K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_get_raw_calibration ( k4a_playback_t  playback_handle,
uint8_t *  data,
size_t *  data_size 
)
related

Get the raw calibration blob for the Azure Kinect device used during recording.

Parameters
playback_handleHandle obtained by k4a_playback_open().
dataLocation to write the calibration data to. This field may optionally be set to NULL if the caller wants to query for the needed data size.
data_sizeOn passing data_size into the function this variable represents the available size to write the raw data to. On return this variable is updated with the amount of data actually written to the buffer.
Returns
K4A_BUFFER_RESULT_SUCCEEDED if data was successfully written. If data_size points to a buffer size that is too small to hold the output, K4A_BUFFER_RESULT_TOO_SMALL is returned and data_size is updated to contain the minimum buffer size needed to capture the calibration data.
Remarks
The raw calibration may not exist if the device was not specified during recording.

◆ k4a_playback_get_record_configuration()

K4ARECORD_EXPORT k4a_result_t k4a_playback_get_record_configuration ( k4a_playback_t  playback_handle,
k4a_record_configuration_t config 
)
related

Get the device configuration used during recording.

Parameters
playback_handleHandle obtained by k4a_playback_open().
configLocation to write the recording configuration.
Returns
K4A_RESULT_SUCCEEDED if config was successfully written. K4A_RESULT_FAILED otherwise.

◆ k4a_playback_get_recording_length_usec()

K4ARECORD_EXPORT uint64_t k4a_playback_get_recording_length_usec ( k4a_playback_t  playback_handle)
related

Returns the length of the recording in microseconds.

Parameters
playback_handleHandle obtained by k4a_playback_open().
Returns
The recording length, calculated as the difference between the first and last timestamp in the file.
Remarks
The recording length may be longer than an individual track if, for example, the IMU continues to run after the last color image is recorded.

◆ k4a_playback_get_tag()

K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_get_tag ( k4a_playback_t  playback_handle,
const char *  name,
char *  value,
size_t *  value_size 
)
related

Read the value of a tag from a recording.

Parameters
playback_handleHandle obtained by k4a_playback_open().
nameThe name of the tag to read.
valueLocation to write the tag value. This will be a UTF8 null terminated string. If a NULL buffer is specified, value_size will be set to the size of buffer needed to store the string.
value_sizeOn input, the size of the value buffer. On output, this is set to the length of the tag value (including the null terminator).
Returns
A return of K4A_BUFFER_RESULT_SUCCEEDED means that the value has been filled in. If the buffer is too small the function returns K4A_BUFFER_RESULT_TOO_SMALL and the needed size of the value buffer is returned in the value_size parameter. K4A_BUFFER_RESULT_FAILED is returned if the tag does not exist. All other failures return K4A_BUFFER_RESULT_FAILED.
Remarks
Tags are global to a file, and should store data related to the entire recording, such as camera configuration or recording location.

◆ k4a_playback_get_track_count()

K4ARECORD_EXPORT size_t k4a_playback_get_track_count ( k4a_playback_t  playback_handle)

Get the number of tracks in a playback file.

Parameters
playback_handleHandle obtained by k4a_playback_open().
Returns
the number of tracks in the playback file.

◆ k4a_playback_get_track_name()

K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_get_track_name ( k4a_playback_t  playback_handle,
size_t  track_index,
char *  track_name,
size_t *  track_name_size 
)

Gets the name of a track at a specific index.

Parameters
playback_handleHandle obtained by k4a_playback_open().
track_indexThe index of the track to read the name form.
track_nameLocation to write the track name. This will be a UTF8 null terminated string. If a NULL buffer is specified, track_name_size will be set to the size of buffer needed to store the string.
track_name_sizeOn input, the size of the track_name buffer. On output, this is set to the length of the track_name value (including the null terminator).
Returns
A return of K4A_BUFFER_RESULT_SUCCEEDED means that the track_name has been filled in. If the buffer is too small the function returns K4A_BUFFER_RESULT_TOO_SMALL and the needed size of the track_name buffer is returned in the track_name_size parameter. K4A_BUFFER_RESULT_FAILED is returned if the track index does not exist. All other failures return K4A_BUFFER_RESULT_FAILED.
Remarks
When used along with k4a_playback_get_track_count(), this function can be used to enumerate all the available tracks in a playback file. Additionally k4a_playback_track_is_builtin() can be used to filter custom tracks.

◆ k4a_playback_open()

K4ARECORD_EXPORT k4a_result_t k4a_playback_open ( const char *  path,
k4a_playback_t playback_handle 
)
related

Opens an existing recording file for reading.

Parameters
pathFilesystem path of the existing recording.
playback_handleIf successful, this contains a pointer to the recording handle. Caller must call k4a_playback_close() when finished with the recording.
Returns
K4A_RESULT_SUCCEEDED is returned on success

◆ k4a_playback_seek_timestamp()

K4ARECORD_EXPORT k4a_result_t k4a_playback_seek_timestamp ( k4a_playback_t  playback_handle,
int64_t  offset_usec,
k4a_playback_seek_origin_t  origin 
)
related

Seek to a specific timestamp within a recording.

Parameters
playback_handleHandle obtained by k4a_playback_open().
offset_usecThe timestamp offset to seek to, relative to origin
originSpecifies how the given timestamp should be interpreted. Seek can be done relative to the beginning or end of the recording, or using an absolute device timestamp.
Returns
K4A_RESULT_SUCCEEDED if the seek operation was successful, or K4A_RESULT_FAILED if an error occurred. The current seek position is left unchanged if a failure is returned.
Remarks
The first device timestamp in a recording is usually non-zero. The recording file starts at the device timestamp defined by start_timestamp_offset_usec, which is accessible via k4a_playback_get_record_configuration().
The first call to k4a_playback_get_next_capture() after k4a_playback_seek_timestamp() will return the first capture containing an image timestamp greater than or equal to the seek time.
The first call to k4a_playback_get_previous_capture() after k4a_playback_seek_timestamp() will return the first capture with all image timestamps less than the seek time.
The first call to k4a_playback_get_next_imu_sample() after k4a_playback_seek_timestamp() will return the first imu sample with a timestamp greter than or equal to the seek time.
The first call to k4a_playback_get_previous_imu_sample() after k4a_playback_seek_timestamp() will return the first imu sample with a timestamp less than the seek time.

◆ k4a_playback_set_color_conversion()

K4ARECORD_EXPORT k4a_result_t k4a_playback_set_color_conversion ( k4a_playback_t  playback_handle,
k4a_image_format_t  target_format 
)
related

Set the image format that color captures will be converted to. By default the conversion format will be the same as the image format stored in the recording file, and no conversion will occur.

Parameters
playback_handleHandle obtained by k4a_playback_open().
target_formatThe target image format to be returned in captures.
Returns
K4A_RESULT_SUCCEEDED if the format conversion is supported. K4A_RESULT_FAILED otherwise.
Remarks
After the color conversion format is set, all k4a_capture_t objects returned from the playback handle will have their color images converted to the target_format.
Color format conversion occurs in the user-thread, so setting target_format to anything other than the format stored in the file may significantly increase the latency of k4a_playback_get_next_capture() and k4a_playback_get_previous_capture().

◆ k4a_playback_track_get_codec_context()

K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_track_get_codec_context ( k4a_playback_t  playback_handle,
const char *  track_name,
uint8_t *  codec_context,
size_t *  codec_context_size 
)

Gets the codec context for a particular track.

The codec context is a codec-specific buffer that contains any required codec metadata that is only known to the codec. It is mapped to the matroska Codec Private field.

Parameters
playback_handleHandle obtained by k4a_playback_open().
track_nameThe track name to read the codec context from.
codec_contextLocation to write the codec context data. If a NULL buffer is specified, codec_context_size will be set to the size of buffer needed to store the data.
codec_context_sizeOn input, the size of the codec_context buffer. On output, this is set to the length of the codec_context data.
Returns
A return of K4A_BUFFER_RESULT_SUCCEEDED means that the codec_context has been filled in. If the buffer is too small the function returns K4A_BUFFER_RESULT_TOO_SMALL and the needed size of the codec_context buffer is returned in the codec_context_size parameter. K4A_BUFFER_RESULT_FAILED is returned if the track_name does not exist. All other failures return K4A_BUFFER_RESULT_FAILED.

◆ k4a_playback_track_get_codec_id()

K4ARECORD_EXPORT k4a_buffer_result_t k4a_playback_track_get_codec_id ( k4a_playback_t  playback_handle,
const char *  track_name,
char *  codec_id,
size_t *  codec_id_size 
)

Gets the codec id string for a particular track.

The codec ID is a string that corresponds to the codec of the track's data. Some of the existing formats are listed here: https://www.matroska.org/technical/specs/codecid/index.html. It can also be custom defined by the user.

Parameters
playback_handleHandle obtained by k4a_playback_open().
track_nameThe track name to read the codec id from.
codec_idLocation to write the codec id. This will be a UTF8 null terminated string. If a NULL buffer is specified, codec_id_size will be set to the size of buffer needed to store the string.
codec_id_sizeOn input, the size of the codec_id buffer. On output, this is set to the length of the codec_id value (including the null terminator).
Returns
A return of K4A_BUFFER_RESULT_SUCCEEDED means that the codec_id has been filled in. If the buffer is too small the function returns K4A_BUFFER_RESULT_TOO_SMALL and the needed size of the codec_id buffer is returned in the codec_id_size parameter. K4A_BUFFER_RESULT_FAILED is returned if the track_name does not exist. All other failures return K4A_BUFFER_RESULT_FAILED.

◆ k4a_playback_track_get_video_settings()

K4ARECORD_EXPORT k4a_result_t k4a_playback_track_get_video_settings ( k4a_playback_t  playback_handle,
const char *  track_name,
k4a_record_video_settings_t video_settings 
)

Gets the video-specific track information for a particular video track.

Parameters
playback_handleHandle obtained by k4a_playback_open().
track_nameThe track name to read video settings from.
video_settingsLocation to write the track's video settings.
Returns
K4A_RESULT_SUCCEEDED is returned on success, K4A_RESULT_FAILED is returned if the specified track does not exist or is not a video track.

◆ k4a_playback_track_is_builtin()

K4ARECORD_EXPORT bool k4a_playback_track_is_builtin ( k4a_playback_t  playback_handle,
const char *  track_name 
)

Checks whether a track is one of the built-in tracks: "COLOR", "DEPTH", etc...

Parameters
playback_handleHandle obtained by k4a_playback_open().
track_nameThe track name to be checked to see whether it is a built-in track.
Returns
true if the track is built-in. If the provided track name does not exist, false will be returned.

◆ k4a_record_add_attachment()

K4ARECORD_EXPORT k4a_result_t k4a_record_add_attachment ( const k4a_record_t  recording_handle,
const char *  attachment_name,
const uint8_t *  buffer,
size_t  buffer_size 
)
related

Adds an attachment to the recording.

Parameters
recording_handleThe handle of a new recording, obtained by k4a_record_create().
attachment_nameThe name of the attachment to be stored in the recording file. This name should be a valid filename with an extension.
bufferThe attachment data buffer.
buffer_sizeThe size of the attachment data buffer.
Returns
K4A_RESULT_SUCCEEDED is returned on success
Remarks
All attachments need to be added before the recording header is written.

◆ k4a_record_add_custom_subtitle_track()

K4ARECORD_EXPORT k4a_result_t k4a_record_add_custom_subtitle_track ( const k4a_record_t  recording_handle,
const char *  track_name,
const char *  codec_id,
const uint8_t *  codec_context,
size_t  codec_context_size,
const k4a_record_subtitle_settings_t track_settings 
)
related

Adds custom subtitle tracks to the recording.

Parameters
recording_handleThe handle of a new recording, obtained by k4a_record_create().
track_nameThe name of the custom subtitle track to be added.
codec_idA UTF8 null terminated string containing the codec ID of the track. Some of the existing formats are listed here: https://www.matroska.org/technical/specs/codecid/index.html. The codec ID can also be custom defined by the user. Subtitle codec ID's should start with 'S_'.
codec_contextThe codec context is a codec-specific buffer that contains any required codec metadata that is only known to the codec. It is mapped to the matroska 'CodecPrivate' element.
codec_context_sizeThe size of the codec context buffer.
track_settingsAdditional metadata for the subtitle track. If NULL, the default settings will be used.
Returns
K4A_RESULT_SUCCEEDED is returned on success
Remarks
Built-in subtitle tracks like the IMU track will be created automatically when the k4a_record_add_imu_track() API is called. This API can be used to add additional subtitle tracks to save custom data.
Track names must be ALL CAPS and may only contain A-Z, 0-9, '-' and '_'.
All tracks need to be added before the recording header is written.
Call k4a_record_write_custom_track_data() with the same track_name to write data to this track.

◆ k4a_record_add_custom_video_track()

K4ARECORD_EXPORT k4a_result_t k4a_record_add_custom_video_track ( const k4a_record_t  recording_handle,
const char *  track_name,
const char *  codec_id,
const uint8_t *  codec_context,
size_t  codec_context_size,
const k4a_record_video_settings_t track_settings 
)
related

Adds custom video tracks to the recording.

Parameters
recording_handleThe handle of a new recording, obtained by k4a_record_create().
track_nameThe name of the custom video track to be added.
codec_idA UTF8 null terminated string containing the codec ID of the track. Some of the existing formats are listed here: https://www.matroska.org/technical/specs/codecid/index.html. The codec ID can also be custom defined by the user. Video codec ID's should start with 'V_'.
codec_contextThe codec context is a codec-specific buffer that contains any required codec metadata that is only known to the codec. It is mapped to the matroska 'CodecPrivate' element.
codec_context_sizeThe size of the codec context buffer.
track_settingsAdditional metadata for the video track such as resolution and framerate.
Returns
K4A_RESULT_SUCCEEDED is returned on success
Remarks
Built-in video tracks like the DEPTH, IR, and COLOR tracks will be created automatically when the k4a_record_create() API is called. This API can be used to add additional video tracks to save custom data.
Track names must be ALL CAPS and may only contain A-Z, 0-9, '-' and '_'.
All tracks need to be added before the recording header is written.
Call k4a_record_write_custom_track_data() with the same track_name to write data to this track.

◆ k4a_record_add_imu_track()

K4ARECORD_EXPORT k4a_result_t k4a_record_add_imu_track ( k4a_record_t  recording_handle)
related

Adds the track header for recording IMU.

Parameters
recording_handleThe handle of a new recording, obtained by k4a_record_create().
Returns
K4A_RESULT_SUCCEEDED is returned on success
Remarks
The track needs to be added before the recording header is written.

◆ k4a_record_add_tag()

K4ARECORD_EXPORT k4a_result_t k4a_record_add_tag ( k4a_record_t  recording_handle,
const char *  name,
const char *  value 
)
related

Adds a tag to the recording.

Parameters
recording_handleThe handle of a new recording, obtained by k4a_record_create().
nameThe name of the tag to write.
valueThe string value to store in the tag.
Returns
K4A_RESULT_SUCCEEDED is returned on success.
Remarks
Tags are global to a file, and should store data related to the entire recording, such as camera configuration or recording location.
Tag names must be ALL CAPS and may only contain A-Z, 0-9, '-' and '_'.
All tags need to be added before the recording header is written.

◆ k4a_record_close()

K4ARECORD_EXPORT void k4a_record_close ( k4a_record_t  recording_handle)
related

Closes a recording handle.

Parameters
recording_handleHandle obtained by k4a_record_create().
Remarks
If there is any unwritten data it will be flushed to disk before closing the recording.

◆ k4a_record_create()

K4ARECORD_EXPORT k4a_result_t k4a_record_create ( const char *  path,
k4a_device_t  device,
const k4a_device_configuration_t  device_config,
k4a_record_t recording_handle 
)
related

Opens a new recording file for writing.

Parameters
pathFilesystem path for the new recording.
deviceThe Azure Kinect device that is being recorded. The device handle is used to store device calibration and serial number information. May be NULL if recording user-generated data.
device_configThe configuration the Azure Kinect device was started with.
recording_handleIf successful, this contains a pointer to the new recording handle. Caller must call k4a_record_close() when finished with recording.
Remarks
The file will be created if it doesn't exist, or overwritten if an existing file is specified.
Streaming does not need to be started on the device at the time this function is called, but when it is started it should be started with the same configuration provided in device_config.
Subsequent calls to k4a_record_write_capture() will need to have images in the resolution and format defined in device_config.
Returns
K4A_RESULT_SUCCEEDED is returned on success

◆ k4a_record_flush()

K4ARECORD_EXPORT k4a_result_t k4a_record_flush ( k4a_record_t  recording_handle)
related

Flushes all pending recording data to disk.

Parameters
recording_handleHandle obtained by k4a_record_create().
Returns
K4A_RESULT_SUCCEEDED is returned on success, or K4A_RESULT_FAILED if an error occurred.
Remarks
k4a_record_flush() ensures that all data passed to the recording API prior to calling flush is written to disk. If continuing to write recording data, care must be taken to ensure no new timestamps are added from before the flush.
If an error occurs, best effort is made to flush as much data to disk as possible, but the integrity of the file is not guaranteed.

◆ k4a_record_write_capture()

K4ARECORD_EXPORT k4a_result_t k4a_record_write_capture ( k4a_record_t  recording_handle,
k4a_capture_t  capture_handle 
)
related

Writes a camera capture to file.

Parameters
recording_handleThe handle of a new recording, obtained by k4a_record_create().
capture_handleThe handle of a capture to write to file.
Returns
K4A_RESULT_SUCCEEDED is returned on success
Remarks
Captures must be written in increasing order of timestamp, and the file's header must already be written.
k4a_record_write_capture() will write all images in the capture to the corresponding tracks in the recording file. If any of the images fail to write, other images will still be written before a failure is returned.

◆ k4a_record_write_custom_track_data()

K4ARECORD_EXPORT k4a_result_t k4a_record_write_custom_track_data ( const k4a_record_t  recording_handle,
const char *  track_name,
uint64_t  device_timestamp_usec,
uint8_t *  custom_data,
size_t  custom_data_size 
)
related

Writes data for a custom track to file.

Parameters
recording_handleThe handle of a new recording, obtained by k4a_record_create().
track_nameThe name of the custom track that the data is going to be written to.
device_timestamp_usecThe timestamp in microseconds for the custom track data. This timestamp should be in the same time domain as the device timestamp used for recording.
custom_dataThe buffer of custom track data.
custom_data_sizeThe size of the custom track data buffer.
Returns
K4A_RESULT_SUCCEEDED is returned on success
Remarks
Custom track data must be written in increasing order of timestamp, and the file's header must already be written. When writing custom track data at the same time as captures or IMU data, the custom data should be within 1 second of the most recently written timestamp.

◆ k4a_record_write_header()

K4ARECORD_EXPORT k4a_result_t k4a_record_write_header ( k4a_record_t  recording_handle)
related

Writes the recording header and metadata to file.

Parameters
recording_handleThe handle of a new recording, obtained by k4a_record_create().
Returns
K4A_RESULT_SUCCEEDED is returned on success
Remarks
This must be called before captures or any track data can be written.

◆ k4a_record_write_imu_sample()

K4ARECORD_EXPORT k4a_result_t k4a_record_write_imu_sample ( k4a_record_t  recording_handle,
k4a_imu_sample_t  imu_sample 
)
related

Writes an imu sample to file.

Parameters
recording_handleThe handle of a new recording, obtained by k4a_record_create().
imu_sampleA structure containing the imu sample data and timestamps.
Returns
K4A_RESULT_SUCCEEDED is returned on success
Remarks
Samples must be written in increasing order of timestamp, and the file's header must already be written.
When writing imu samples at the same time as captures, the samples should be within 1 second of the most recently written capture.

◆ k4a_set_allocator()

K4A_EXPORT k4a_result_t k4a_set_allocator ( k4a_memory_allocate_cb_t  allocate,
k4a_memory_destroy_cb_t  free 
)

Sets the callback functions for the SDK allocator

Attention
For the Orbbec SDK K4A wrapper, this function is not yet supported.
Parameters
allocateThe callback function to allocate memory. When the SDK requires memory allocation this callback will be called and the application can provide a buffer and a context.
freeThe callback function to free memory. The SDK will call this function when memory allocated by allocate is no longer needed.
Returns
K4A_RESULT_SUCCEEDED if the callback function was set or cleared successfully. K4A_RESULT_FAILED if an error is encountered or the callback function has already been set.
Remarks
Call this function to hook memory allocation by the SDK. Calling with both allocate and free as NULL will clear the hook and reset to the default allocator.
If this function is called after memory has been allocated, the previous version of free function may still be called in the future. The SDK will always call the free function that was set at the time that the memory was allocated.
Not all memory allocation by the SDK is performed by this allocate function. Small allocations or allocations from special pools may come from other sources.

◆ k4a_set_debug_message_handler()

K4A_EXPORT k4a_result_t k4a_set_debug_message_handler ( k4a_logging_message_cb_t message_cb,
void *  message_cb_context,
k4a_log_level_t  min_level 
)

Sets and clears the callback function to receive debug messages from the Azure Kinect device.

Parameters
message_cbThe callback function to receive messages from. Set to NULL to unregister the callback function.
message_cb_contextThe callback functions context.
min_levelThe least critical error the user wants to be notified about.
Returns
K4A_RESULT_SUCCEEDED if the callback function was set or cleared successfully. K4A_RESULT_FAILED if an error is encountered or the callback function has already been set.
Remarks
Call this function to set or clear the callback function that is used to deliver debug messages to the caller. This callback may be called concurrently, it is up to the implementation of the callback function to ensure the parallelization is handled.
Clearing the callback function will block until all pending calls to the callback function have completed.
To update min_level, k4a_set_debug_message_handler can be called with the same value message_cb and by specifying a new min_level.
Logging provided via this API is independent of the logging controlled by the environmental variable controls K4A_ENABLE_LOG_TO_STDOUT, K4A_ENABLE_LOG_TO_A_FILE, and K4A_LOG_LEVEL. However there is a slight change in default behavior when using this function. By default, when k4a_set_debug_message_handler() has not been used to register a message callback, the default for environmental variable controls is to send debug messages as if K4A_ENABLE_LOG_TO_STDOUT=1 were set. If k4a_set_debug_message_handler registers a callback function before k4a_device_open() is called, then the default for environmental controls is as if K4A_ENABLE_LOG_TO_STDOUT=0 was specified. Physically specifying the environmental control will override the default.

min_level

◆ k4a_transformation_color_image_to_depth_camera()

K4A_EXPORT k4a_result_t k4a_transformation_color_image_to_depth_camera ( k4a_transformation_t  transformation_handle,
const k4a_image_t  depth_image,
const k4a_image_t  color_image,
k4a_image_t  transformed_color_image 
)
related

Transforms a color image into the geometry of the depth camera.

Parameters
transformation_handleTransformation handle.
depth_imageHandle to input depth image.
color_imageHandle to input color image.
transformed_color_imageHandle to output transformed color image.
Remarks
This produces a color image for which each pixel matches the corresponding pixel coordinates of the depth camera.
depth_image and color_image need to represent the same moment in time. The depth data will be applied to the color image to properly warp the color data to the perspective of the depth camera.
depth_image must be of type K4A_IMAGE_FORMAT_DEPTH16. color_image must be of format K4A_IMAGE_FORMAT_COLOR_BGRA32.
transformed_color_image image must be of format K4A_IMAGE_FORMAT_COLOR_BGRA32. transformed_color_image must have the width and height of the depth camera in the mode specified by the k4a_calibration_t used to create the transformation_handle with k4a_transformation_create().
transformed_color_image should be created by the caller using k4a_image_create() or k4a_image_create_from_buffer().
Returns
K4A_RESULT_SUCCEEDED if transformed_color_image was successfully written and K4A_RESULT_FAILED otherwise.

◆ k4a_transformation_create()

K4A_EXPORT k4a_transformation_t k4a_transformation_create ( const k4a_calibration_t calibration)
related

Get handle to transformation handle.

Parameters
calibrationA calibration structure obtained by k4a_device_get_calibration().
Returns
A transformation handle. A NULL is returned if creation fails.
Remarks
The transformation handle is used to transform images from the coordinate system of one camera into the other. Each transformation handle requires some pre-computed resources to be allocated, which are retained until the handle is destroyed.
The transformation handle must be destroyed with k4a_transformation_destroy() when it is no longer to be used.

◆ k4a_transformation_depth_image_to_color_camera()

K4A_EXPORT k4a_result_t k4a_transformation_depth_image_to_color_camera ( k4a_transformation_t  transformation_handle,
const k4a_image_t  depth_image,
k4a_image_t  transformed_depth_image 
)
related

Transforms the depth map into the geometry of the color camera.

Parameters
transformation_handleTransformation handle.
depth_imageHandle to input depth image.
transformed_depth_imageHandle to output transformed depth image.
Remarks
This produces a depth image for which each pixel matches the corresponding pixel coordinates of the color camera.
depth_image and transformed_depth_image must be of format K4A_IMAGE_FORMAT_DEPTH16.
transformed_depth_image must have a width and height matching the width and height of the color camera in the mode specified by the k4a_calibration_t used to create the transformation_handle with k4a_transformation_create().
The contents transformed_depth_image will be filled with the depth values derived from depth_image in the color camera's coordinate space.
transformed_depth_image should be created by the caller using k4a_image_create() or k4a_image_create_from_buffer().
Returns
K4A_RESULT_SUCCEEDED if transformed_depth_image was successfully written and K4A_RESULT_FAILED otherwise.

◆ k4a_transformation_depth_image_to_color_camera_custom()

K4A_EXPORT k4a_result_t k4a_transformation_depth_image_to_color_camera_custom ( k4a_transformation_t  transformation_handle,
const k4a_image_t  depth_image,
const k4a_image_t  custom_image,
k4a_image_t  transformed_depth_image,
k4a_image_t  transformed_custom_image,
k4a_transformation_interpolation_type_t  interpolation_type,
uint32_t  invalid_custom_value 
)
related

Transforms depth map and a custom image into the geometry of the color camera.

Parameters
transformation_handleTransformation handle.
depth_imageHandle to input depth image.
custom_imageHandle to input custom image.
transformed_depth_imageHandle to output transformed depth image.
transformed_custom_imageHandle to output transformed custom image.
interpolation_typeParameter that controls how pixels in custom_image should be interpolated when transformed to color camera space. K4A_TRANSFORMATION_INTERPOLATION_TYPE_LINEAR if linear interpolation should be used. K4A_TRANSFORMATION_INTERPOLATION_TYPE_NEAREST if nearest neighbor interpolation should be used.
invalid_custom_valueDefines the custom image pixel value that should be written to transformed_custom_image in case the corresponding depth pixel can not be transformed into the color camera space.
Remarks
This produces a depth image and a corresponding custom image for which each pixel matches the corresponding pixel coordinates of the color camera.
depth_image and transformed_depth_image must be of format K4A_IMAGE_FORMAT_DEPTH16.
custom_image and transformed_custom_image must be of format K4A_IMAGE_FORMAT_CUSTOM8 or K4A_IMAGE_FORMAT_CUSTOM16.
transformed_depth_image and transformed_custom_image must have a width and height matching the width and height of the color camera in the mode specified by the k4a_calibration_t used to create the transformation_handle with k4a_transformation_create().
custom_image must have a width and height matching the width and height of depth_image.
The contents transformed_depth_image will be filled with the depth values derived from depth_image in the color camera's coordinate space.
The contents transformed_custom_image will be filled with the values derived from custom_image in the color camera's coordinate space.
transformed_depth_image and transformed_custom_image should be created by the caller using k4a_image_create() or k4a_image_create_from_buffer().
Using K4A_TRANSFORMATION_INTERPOLATION_TYPE_LINEAR for interpolation_type could create new values to transformed_custom_image which do no exist in custom_image. Using K4A_TRANSFORMATION_INTERPOLATION_TYPE_NEAREST will prevent this from happenning but will result in a less smooth image.
Returns
K4A_RESULT_SUCCEEDED if transformed_depth_image and transformed_custom_image were successfully written and K4A_RESULT_FAILED otherwise.

◆ k4a_transformation_depth_image_to_point_cloud()

K4A_EXPORT k4a_result_t k4a_transformation_depth_image_to_point_cloud ( k4a_transformation_t  transformation_handle,
const k4a_image_t  depth_image,
const k4a_calibration_type_t  camera,
k4a_image_t  xyz_image 
)
related

Transforms the depth image into 3 planar images representing X, Y and Z-coordinates of corresponding 3D points.

Parameters
transformation_handleTransformation handle.
depth_imageHandle to input depth image.
cameraGeometry in which depth map was computed.
xyz_imageHandle to output xyz image.
Remarks
depth_image must be of format K4A_IMAGE_FORMAT_DEPTH16.
The camera parameter tells the function what the perspective of the depth_image is. If the depth_image was captured directly from the depth camera, the value should be K4A_CALIBRATION_TYPE_DEPTH. If the depth_image is the result of a transformation into the color camera's coordinate space using k4a_transformation_depth_image_to_color_camera(), the value should be K4A_CALIBRATION_TYPE_COLOR.
The format of xyz_image must be K4A_IMAGE_FORMAT_CUSTOM. The width and height of xyz_image must match the width and height of depth_image. xyz_image must have a stride in bytes of at least 6 times its width in pixels.
Each pixel of the xyz_image consists of three int16_t values, totaling 6 bytes. The three int16_t values are the X, Y, and Z values of the point.
xyz_image should be created by the caller using k4a_image_create() or k4a_image_create_from_buffer().
Returns
K4A_RESULT_SUCCEEDED if xyz_image was successfully written and K4A_RESULT_FAILED otherwise.

◆ k4a_transformation_destroy()

K4A_EXPORT void k4a_transformation_destroy ( k4a_transformation_t  transformation_handle)
related

Destroy transformation handle.

Parameters
transformation_handleTransformation handle to destroy.