Azure Kinect Sensor SDK  refs/heads/master
Documentation for https://github.com/Microsoft/Azure-Kinect-Sensor-SDK
Functions

Public functions of the API. More...

Details

Public functions of the API.

Functions

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. More...
 
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. More...
 
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. More...
 
size_t k4a_playback_get_track_count (k4a_playback_t playback_handle)
 Get the number of tracks in a playback file. More...
 
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. More...
 
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... More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
uint32_t k4a_device_get_installed_count (void)
 Gets the number of connected devices. More...
 
k4a_result_t k4a_device_open (uint32_t index, k4a_device_t *device_handle)
 Open an Azure Kinect device. More...
 
void k4a_device_close (k4a_device_t device_handle)
 Closes an Azure Kinect device. More...
 
k4a_wait_result_t k4a_device_get_capture (k4a_device_t device_handle, k4a_capture_t *capture_handle, int32_t timeout_in_ms)
 Reads a sensor capture. More...
 
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)
 Reads an IMU sample. More...
 
k4a_result_t k4a_capture_create (k4a_capture_t *capture_handle)
 Create an empty capture object. More...
 
void k4a_capture_release (k4a_capture_t capture_handle)
 Release a capture. More...
 
void k4a_capture_reference (k4a_capture_t capture_handle)
 Add a reference to a capture. More...
 
k4a_image_t k4a_capture_get_color_image (k4a_capture_t capture_handle)
 Get the color image associated with the given capture. More...
 
k4a_image_t k4a_capture_get_depth_image (k4a_capture_t capture_handle)
 Get the depth image associated with the given capture. More...
 
k4a_image_t k4a_capture_get_ir_image (k4a_capture_t capture_handle)
 Get the IR image associated with the given capture. More...
 
void k4a_capture_set_color_image (k4a_capture_t capture_handle, k4a_image_t image_handle)
 Set or add a color image to the associated capture. More...
 
void k4a_capture_set_depth_image (k4a_capture_t capture_handle, k4a_image_t image_handle)
 Set or add a depth image to the associated capture. More...
 
void k4a_capture_set_ir_image (k4a_capture_t capture_handle, k4a_image_t image_handle)
 Set or add an IR image to the associated capture. More...
 
void k4a_capture_set_temperature_c (k4a_capture_t capture_handle, float temperature_c)
 Set the temperature associated with the capture. More...
 
float k4a_capture_get_temperature_c (k4a_capture_t capture_handle)
 Get the temperature associated with the capture. More...
 
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)
 Create an image. More...
 
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)
 Create an image from a pre-allocated buffer. More...
 
uint8_t * k4a_image_get_buffer (k4a_image_t image_handle)
 Get the image buffer. More...
 
size_t k4a_image_get_size (k4a_image_t image_handle)
 Get the image buffer size. More...
 
k4a_image_format_t k4a_image_get_format (k4a_image_t image_handle)
 Get the format of the image. More...
 
int k4a_image_get_width_pixels (k4a_image_t image_handle)
 Get the image width in pixels. More...
 
int k4a_image_get_height_pixels (k4a_image_t image_handle)
 Get the image height in pixels. More...
 
int k4a_image_get_stride_bytes (k4a_image_t image_handle)
 Get the image stride in bytes. More...
 
K4A_DEPRECATED_EXPORT uint64_t k4a_image_get_timestamp_usec (k4a_image_t image_handle)
 Get the image's device timestamp in microseconds. More...
 
uint64_t k4a_image_get_device_timestamp_usec (k4a_image_t image_handle)
 Get the image's device timestamp in microseconds. More...
 
uint64_t k4a_image_get_system_timestamp_nsec (k4a_image_t image_handle)
 Get the image's system timestamp in nanoseconds. More...
 
uint64_t k4a_image_get_exposure_usec (k4a_image_t image_handle)
 Get the image exposure in microseconds. More...
 
uint32_t k4a_image_get_white_balance (k4a_image_t image_handle)
 Get the image white balance. More...
 
uint32_t k4a_image_get_iso_speed (k4a_image_t image_handle)
 Get the image ISO speed. More...
 
void k4a_image_set_device_timestamp_usec (k4a_image_t image_handle, uint64_t timestamp_usec)
 Set the device time stamp, in microseconds, of the image. More...
 
K4A_DEPRECATED_EXPORT void k4a_image_set_timestamp_usec (k4a_image_t image_handle, uint64_t timestamp_usec)
 Set the device time stamp, in microseconds, of the image. More...
 
void k4a_image_set_system_timestamp_nsec (k4a_image_t image_handle, uint64_t timestamp_nsec)
 Set the system time stamp, in nanoseconds, of the image. More...
 
void k4a_image_set_exposure_usec (k4a_image_t image_handle, uint64_t exposure_usec)
 Set the exposure time, in microseconds, of the image. More...
 
K4A_DEPRECATED_EXPORT void k4a_image_set_exposure_time_usec (k4a_image_t image_handle, uint64_t exposure_usec)
 Set the exposure time, in microseconds, of the image. More...
 
void k4a_image_set_white_balance (k4a_image_t image_handle, uint32_t white_balance)
 Set the white balance of the image. More...
 
void k4a_image_set_iso_speed (k4a_image_t image_handle, uint32_t iso_speed)
 Set the ISO speed of the image. More...
 
void k4a_image_reference (k4a_image_t image_handle)
 Add a reference to the k4a_image_t. More...
 
void k4a_image_release (k4a_image_t image_handle)
 Remove a reference from the k4a_image_t. More...
 
k4a_result_t k4a_device_start_cameras (k4a_device_t device_handle, const k4a_device_configuration_t *config)
 Starts color and depth camera capture. More...
 
void k4a_device_stop_cameras (k4a_device_t device_handle)
 Stops the color and depth camera capture. More...
 
k4a_result_t k4a_device_start_imu (k4a_device_t device_handle)
 Starts the IMU sample stream. More...
 
void k4a_device_stop_imu (k4a_device_t device_handle)
 Stops the IMU capture. More...
 
k4a_buffer_result_t k4a_device_get_serialnum (k4a_device_t device_handle, char *serial_number, size_t *serial_number_size)
 Get the Azure Kinect device serial number. More...
 
k4a_result_t k4a_device_get_version (k4a_device_t device_handle, k4a_hardware_version_t *version)
 Get the version numbers of the device's subsystems. More...
 
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)
 Get the Azure Kinect color sensor control capabilities. More...
 
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)
 Get the Azure Kinect color sensor control value. More...
 
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)
 Set the Azure Kinect color sensor control value. More...
 
k4a_buffer_result_t k4a_device_get_raw_calibration (k4a_device_t device_handle, uint8_t *data, size_t *data_size)
 Get the raw calibration blob for the entire Azure Kinect device. More...
 
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)
 Get the camera calibration for the entire Azure Kinect device. More...
 
k4a_result_t k4a_device_get_sync_jack (k4a_device_t device_handle, bool *sync_in_jack_connected, bool *sync_out_jack_connected)
 Get the device jack status for the synchronization in and synchronization out connectors. More...
 
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)
 Get the camera calibration for a device from a raw calibration blob. More...
 
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)
 Transform a 3D point of a source coordinate system into a 3D point of the target coordinate system. More...
 
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)
 Transform a 2D pixel coordinate with an associated depth value of the source camera into a 3D point of the target coordinate system. More...
 
k4a_result_t k4a_calibration_3d_to_2d (const k4a_calibration_t *calibration, const k4a_float3_t *source_point3d_mm, const k4a_calibration_type_t source_camera, const k4a_calibration_type_t target_camera, k4a_float2_t *target_point2d, int *valid)
 Transform a 3D point of a source coordinate system into a 2D pixel coordinate of the target camera. More...
 
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)
 Transform a 2D pixel coordinate with an associated depth value of the source camera into a 2D pixel coordinate of the target camera. More...
 
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)
 Transform a 2D pixel coordinate from color camera into a 2D pixel coordinate of the depth camera. More...
 
k4a_transformation_t k4a_transformation_create (const k4a_calibration_t *calibration)
 Get handle to transformation handle. More...
 
void k4a_transformation_destroy (k4a_transformation_t transformation_handle)
 Destroy transformation handle. More...
 
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)
 Transforms the depth map into the geometry of the color camera. More...
 
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)
 Transforms depth map and a custom image into the geometry of the color camera. More...
 
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)
 Transforms a color image into the geometry of the depth camera. More...
 
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)
 Transforms the depth image into 3 planar images representing X, Y and Z-coordinates of corresponding 3D points. More...
 
k4a_result_t k4a_playback_open (const char *path, k4a_playback_t *playback_handle)
 Opens an existing recording file for reading. More...
 
k4a_buffer_result_t k4a_playback_get_raw_calibration (k4a_playback_t playback_handle, uint8_t *data, size_t *data_size)
 Get the raw calibration blob for the Azure Kinect device used during recording. More...
 
k4a_result_t k4a_playback_get_calibration (k4a_playback_t playback_handle, k4a_calibration_t *calibration)
 Get the camera calibration for Azure Kinect device used during recording. More...
 
k4a_result_t k4a_playback_get_record_configuration (k4a_playback_t playback_handle, k4a_record_configuration_t *config)
 Get the device configuration used during recording. More...
 
k4a_buffer_result_t k4a_playback_get_tag (k4a_playback_t playback_handle, const char *name, char *value, size_t *value_size)
 Read the value of a tag from a recording. More...
 
k4a_result_t k4a_playback_set_color_conversion (k4a_playback_t playback_handle, k4a_image_format_t target_format)
 Set the image format that color captures will be converted to. More...
 
k4a_stream_result_t k4a_playback_get_next_capture (k4a_playback_t playback_handle, k4a_capture_t *capture_handle)
 Read the next capture in the recording sequence. More...
 
k4a_stream_result_t k4a_playback_get_previous_capture (k4a_playback_t playback_handle, k4a_capture_t *capture_handle)
 Read the previous capture in the recording sequence. More...
 
k4a_stream_result_t k4a_playback_get_next_imu_sample (k4a_playback_t playback_handle, k4a_imu_sample_t *imu_sample)
 Read the next IMU sample in the recording sequence. More...
 
k4a_stream_result_t k4a_playback_get_previous_imu_sample (k4a_playback_t playback_handle, k4a_imu_sample_t *imu_sample)
 Read the previous IMU sample in the recording sequence. More...
 
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)
 Read the next data block for a particular track. More...
 
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)
 Read the previous data block for a particular track. More...
 
uint64_t k4a_playback_data_block_get_device_timestamp_usec (k4a_playback_data_block_t data_block_handle)
 Get the device timestamp of a data block in microseconds. More...
 
size_t k4a_playback_data_block_get_buffer_size (k4a_playback_data_block_t data_block_handle)
 Get the buffer size of a data block. More...
 
uint8_t * k4a_playback_data_block_get_buffer (k4a_playback_data_block_t data_block_handle)
 Get the buffer of a data block. More...
 
void k4a_playback_data_block_release (k4a_playback_data_block_t data_block_handle)
 Release a data block handle. More...
 
k4a_result_t k4a_playback_seek_timestamp (k4a_playback_t playback_handle, int64_t offset_usec, k4a_playback_seek_origin_t origin)
 Seek to a specific timestamp within a recording. More...
 
uint64_t k4a_playback_get_recording_length_usec (k4a_playback_t playback_handle)
 Returns the length of the recording in microseconds. More...
 
K4ARECORD_DEPRECATED_EXPORT uint64_t k4a_playback_get_last_timestamp_usec (k4a_playback_t playback_handle)
 Gets the last timestamp in a recording, relative to the start of the recording. More...
 
void k4a_playback_close (k4a_playback_t playback_handle)
 Closes a recording playback handle. More...
 
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)
 Opens a new recording file for writing. More...
 
k4a_result_t k4a_record_add_tag (k4a_record_t recording_handle, const char *name, const char *value)
 Adds a tag to the recording. More...
 
k4a_result_t k4a_record_add_imu_track (k4a_record_t recording_handle)
 Adds the track header for recording IMU. More...
 
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)
 Adds an attachment to the recording. More...
 
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)
 Adds custom video tracks to the recording. More...
 
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)
 Adds custom subtitle tracks to the recording. More...
 
k4a_result_t k4a_record_write_header (k4a_record_t recording_handle)
 Writes the recording header and metadata to file. More...
 
k4a_result_t k4a_record_write_capture (k4a_record_t recording_handle, k4a_capture_t capture_handle)
 Writes a camera capture to file. More...
 
k4a_result_t k4a_record_write_imu_sample (k4a_record_t recording_handle, k4a_imu_sample_t imu_sample)
 Writes an imu sample to file. More...
 
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)
 Writes data for a custom track to file. More...
 
k4a_result_t k4a_record_flush (k4a_record_t recording_handle)
 Flushes all pending recording data to disk. More...
 
void k4a_record_close (k4a_record_t recording_handle)
 Closes a recording handle. More...