Orbbec SDK K4A Wrapper
|
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) |
Public functions of the API
|
related |
Transform a 2D pixel coordinate with an associated depth value of the source camera into a 2D pixel coordinate of the target camera.
calibration | Location to read the camera calibration obtained by k4a_device_get_calibration(). |
source_point2d | The 2D pixel in source_camera coordinates. |
source_depth_mm | The depth of source_point2d in millimeters. One way to derive the depth value in the color camera geometry is to use the function k4a_transformation_depth_image_to_color_camera(). |
source_camera | The current camera. |
target_camera | The target camera. |
target_point2d | The 2D pixel in target_camera coordinates. |
valid | The 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. |
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.source_point2d
and then using k4a_calibration_3d_to_2d() to map the 3D point into the coordinate system of the target_camera
.source_camera
and target_camera
are identical, the function immediately sets target_point2d
to source_point2d
and returns without computing any transformations.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.
|
related |
Transform a 2D pixel coordinate with an associated depth value of the source camera into a 3D point of the target coordinate system.
calibration | Location to read the camera calibration obtained by k4a_device_get_calibration(). |
source_point2d | The 2D pixel in source_camera coordinates. |
source_depth_mm | The depth of source_point2d in millimeters. One way to derive the depth value in the color camera geometry is to use the function k4a_transformation_depth_image_to_color_camera(). |
source_camera | The current camera. |
target_camera | The target camera. |
target_point3d_mm | Pointer to the output where the 3D coordinates of the input pixel in the coordinate system of target_camera is stored in millimeters. |
valid | The 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. |
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.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.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.
|
related |
Transform a 3D point of a source coordinate system into a 2D pixel coordinate of the target camera.
calibration | Location to read the camera calibration obtained by k4a_device_get_calibration(). |
source_point3d_mm | The 3D coordinates in millimeters representing a point in source_camera |
source_camera | The current camera. |
target_camera | The target camera. |
target_point2d | Pointer to the output where the 2D pixel in target_camera coordinates is stored. |
valid | The 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. |
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.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
.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.
|
related |
Transform a 3D point of a source coordinate system into a 3D point of the target coordinate system
calibration | Location to read the camera calibration data. |
source_point3d_mm | The 3D coordinates in millimeters representing a point in source_camera . |
source_camera | The current camera. |
target_camera | The target camera. |
target_point3d_mm | Pointer to the output where the new 3D coordinates of the input point in the coordinate space of target_camera is stored in millimeters. |
target_point3d_mm
was successfully written. K4A_RESULT_FAILED if calibration
contained invalid transformation parameters.source_camera
and target_camera
are the same, then target_point3d_mm
will be identical to source_point3d_mm
.
|
related |
Transform a 2D pixel coordinate from color camera into a 2D pixel coordinate of the depth camera.
calibration | Location to read the camera calibration obtained by k4a_device_get_calibration(). |
source_point2d | The 2D pixel in color camera coordinates. |
depth_image | Handle to input depth image. |
target_point2d | The 2D pixel in depth camera coordinates. |
valid | The 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. |
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.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.
|
related |
Get the camera calibration for a device from a raw calibration blob.
raw_calibration | Raw calibration blob obtained from a device or recording. The raw calibration must be NULL terminated. |
raw_calibration_size | The size, in bytes, of raw_calibration including the NULL termination. |
depth_mode | Mode in which depth camera is operated. |
color_resolution | Resolution in which color camera is operated. |
calibration | Location to write the calibration. |
calibration
was successfully written. K4A_RESULT_FAILED otherwise.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.calibration
output is used as input to all transformation functions.
|
related |
Create an empty capture object.
capture_handle | Pointer to a location to store the handle. |
The new capture is created with a reference count of 1.
|
related |
Get the color image associated with the given capture.
capture_handle | Capture handle containing the image. |
|
related |
Get the depth image associated with the given capture.
capture_handle | Capture handle containing the image. |
|
related |
Get the IR image associated with the given capture.
capture_handle | Capture handle containing the image. |
|
related |
Get the temperature associated with the capture.
capture_handle | Capture handle to retrieve the temperature from. |
|
related |
Add a reference to a capture.
capture_handle | Capture to add a reference to. |
|
related |
Release a capture.
capture_handle | Capture to release. |
|
related |
Set or add a color image to the associated capture.
capture_handle | Capture handle to hold the image. |
image_handle | Image handle containing the image. |
|
related |
Set or add a depth image to the associated capture.
capture_handle | Capture handle to hold the image. |
image_handle | Image handle containing the image. |
|
related |
Set or add an IR image to the associated capture.
capture_handle | Capture handle to hold the image. |
image_handle | Image handle containing the image. |
|
related |
Set the temperature associated with the capture.
capture_handle | Capture handle to set the temperature on. |
temperature_c | Temperature in Celsius to store. |
|
related |
Closes an Azure Kinect device.
device_handle | Handle obtained by k4a_device_open(). |
|
related |
Get the camera calibration for the entire Azure Kinect device.
device_handle | Handle obtained by k4a_device_open(). |
depth_mode | Mode in which depth camera is operated. |
color_resolution | Resolution in which color camera is operated. |
calibration | Location to write the calibration |
calibration
was successfully written. K4A_RESULT_FAILED otherwise.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.calibration
output is used as input to all calibration and transformation functions.
|
related |
Reads a sensor capture.
device_handle | Handle obtained by k4a_device_open(). |
capture_handle | If successful this contains a handle to a capture object. Caller must call k4a_capture_release() when its done using this capture. |
timeout_in_ms | Specifies 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. |
capture
. If a capture is not available in the configured timeout_in_ms
, then the API will return K4A_WAIT_RESULT_TIMEOUT.
|
related |
Get the Azure Kinect color sensor control value.
device_handle | Handle obtained by k4a_device_open(). |
command | Color sensor control command. |
mode | Location to store the color sensor's control mode. This mode represents whether the command is in automatic or manual mode. |
value | Location 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 . |
value
for each command.value
for that command is not valid.
|
related |
Get the Azure Kinect color sensor control capabilities.
device_handle | Handle obtained by k4a_device_open(). |
command | Color sensor control command. |
supports_auto | Location to store whether the color sensor's control support auto mode or not. true if it supports auto mode, otherwise false. |
min_value | Location to store the color sensor's control minimum value of /p command. |
max_value | Location to store the color sensor's control maximum value of /p command. |
step_value | Location to store the color sensor's control step value of /p command. |
default_value | Location to store the color sensor's control default value of /p command. |
default_mode | Location to store the color sensor's control default mode of /p command. |
|
related |
Reads an IMU sample.
device_handle | Handle obtained by k4a_device_open(). |
imu_sample | Pointer to the location for the API to write the IMU sample. |
timeout_in_ms | Specifies 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. |
imu_sample
. If a sample is not available in the configured timeout_in_ms
, then the API will return K4A_WAIT_RESULT_TIMEOUT.
|
related |
Gets the number of connected devices
|
related |
Get the raw calibration blob for the entire Azure Kinect device.
device_handle | Handle obtained by k4a_device_open(). |
data | Location 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_size | On 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. |
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.
|
related |
Get the Azure Kinect device serial number.
device_handle | Handle obtained by k4a_device_open(). |
serial_number | Location 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_size | On 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). |
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.serial_number
to get the needed size in the serial_number_size
output, and then again with the allocated buffer.serial_number
.
|
related |
Get the device jack status for the synchronization in and synchronization out connectors.
device_handle | Handle obtained by k4a_device_open(). |
sync_in_jack_connected | Upon successful return this value will be set to true if a cable is connected to this sync in jack. |
sync_out_jack_connected | Upon successful return this value will be set to true if a cable is connected to this sync out jack. |
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.
|
related |
Get the version numbers of the device's subsystems.
device_handle | Handle obtained by k4a_device_open(). |
version | Location to write the version info to. |
|
related |
Open an Azure Kinect device.
index | The index of the device to open, starting with 0. Optionally pass in K4A_DEVICE_DEFAULT. |
device_handle | Output parameter which on success will return a handle to the device. |
|
related |
Set the Azure Kinect color sensor control value.
device_handle | Handle obtained by k4a_device_open(). |
command | Color sensor control command. |
mode | Color sensor control mode to set. This mode represents whether the command is in automatic or manual mode. |
value | Value 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. |
value
for each command.value
for that command is not valid.
|
related |
Starts color and depth camera capture.
device_handle | Handle obtained by k4a_device_open(). |
config | The configuration we want to run the device in. This can be initialized with K4A_DEVICE_CONFIG_INIT_DISABLE_ALL. |
|
related |
Starts the IMU sample stream.
device_handle | Handle obtained by k4a_device_open(). |
|
related |
Stops the color and depth camera capture.
device_handle | Handle obtained by k4a_device_open(). |
|
related |
Stops the IMU capture.
device_handle | Handle obtained by k4a_device_open(). |
|
related |
Create an image.
format | The format of the image that will be stored in this image container. |
width_pixels | Width in pixels. |
height_pixels | Height in pixels. |
stride_bytes | The 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_handle | Pointer to store image handle in. |
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.
|
related |
Create an image from a pre-allocated buffer.
format | The format of the image that will be stored in this image container. |
width_pixels | Width in pixels. |
height_pixels | Height in pixels. |
stride_bytes | The number of bytes per horizontal line of the image. |
buffer | Pointer to a pre-allocated image buffer. |
buffer_size | Size in bytes of the pre-allocated image buffer. |
buffer_release_cb | Callback to the buffer free function, called when all references to the buffer have been released. This parameter is optional. |
buffer_release_cb_context | Context for the buffer free function. This value will be called as a parameter to buffer_release_cb when the callback is invoked. |
image_handle | Pointer to store image handle in. |
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
.
|
related |
Get the image buffer.
image_handle | Handle of the image for which the get operation is performed on. |
image_handle
is invalid.
|
related |
Get the image's device timestamp in microseconds.
image_handle | Handle of the image for which the get operation is performed on. |
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.
|
related |
Get the image exposure in microseconds.
image_handle | Handle of the image for which the get operation is performed on. |
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.
|
related |
Get the format of the image.
image_handle | Handle of the image for which the get operation is performed on. |
image_handle
is invalid, the function will return K4A_IMAGE_FORMAT_CUSTOM.
|
related |
Get the image height in pixels.
image_handle | Handle of the image for which the get operation is performed on. |
image_handle
is invalid, the function will return 0.
|
related |
Get the image ISO speed.
image_handle | Handle of the image for which the get operation is performed on. |
|
related |
Get the image buffer size.
image_handle | Handle of the image for which the get operation is performed on. |
image_handle
is invalid.
|
related |
Get the image stride in bytes.
image_handle | Handle of the image for which the get operation is performed on. |
image_handle
is invalid, or the image's format does not have a stride, the function will return 0.
|
related |
Get the image's system timestamp in nanoseconds.
image_handle | Handle of the image for which the get operation is performed on. |
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.
|
related |
Get the image's device timestamp in microseconds.
image_handle | Handle of the image for which the get operation is performed on. |
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.
|
related |
Get the image white balance.
image_handle | Handle of the image for which the get operation is performed on. |
image_handle
is invalid, or the white balance was not set or not applicable to the image, the function will return 0.
|
related |
Get the image width in pixels.
image_handle | Handle of the image for which the get operation is performed on. |
image_handle
is invalid, the function will return 0.
|
related |
Add a reference to the k4a_image_t.
image_handle | Handle of the image for which the get operation is performed on. |
|
related |
Remove a reference from the k4a_image_t.
image_handle | Handle of the image for which the get operation is performed on. |
|
related |
Set the device time stamp, in microseconds, of the image.
image_handle | Handle of the image to set the timestamp on. |
timestamp_usec | Device timestamp of the image in microseconds. |
|
related |
Set the exposure time, in microseconds, of the image.
image_handle | Handle of the image to set the exposure time on. |
exposure_usec | Exposure time of the image in microseconds. |
|
related |
Set the exposure time, in microseconds, of the image.
image_handle | Handle of the image to set the exposure time on. |
exposure_usec | Exposure time of the image in microseconds. |
|
related |
Set the ISO speed of the image.
image_handle | Handle of the image to set the ISO speed on. |
iso_speed | ISO speed of the image. |
|
related |
Set the system time stamp, in nanoseconds, of the image.
image_handle | Handle of the image to set the timestamp on. |
timestamp_nsec | Timestamp of the image in nanoseconds. |
|
related |
Set the device time stamp, in microseconds, of the image.
image_handle | Handle of the image to set the timestamp on. |
timestamp_usec | Device timestamp of the image in microseconds. |
|
related |
Set the white balance of the image.
image_handle | Handle of the image to set the white balance on. |
white_balance | White balance of the image in degrees Kelvin. |
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.
playback_handle | Handle obtained by k4a_playback_open(). |
track_name | The track name to be checked to see whether it exists or not. |
|
related |
Closes a recording playback handle.
playback_handle | Handle obtained by k4a_playback_open(). |
|
related |
Get the buffer of a data block.
data_block_handle | Handle obtained by k4a_playback_get_next_data_block() or k4a_playback_get_previous_data_block(). |
|
related |
Get the buffer size of a data block.
data_block_handle | Handle obtained by k4a_playback_get_next_data_block() or k4a_playback_get_previous_data_block(). |
|
related |
Get the device timestamp of a data block in microseconds.
data_block_handle | Handle obtained by k4a_playback_get_next_data_block() or k4a_playback_get_previous_data_block(). |
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.
|
related |
Release a data block handle.
data_block_handle | Handle obtained by k4a_playback_get_next_data_block() or k4a_playback_get_previous_data_block(). |
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.
playback_handle | Handle obtained by k4a_playback_open(). |
file_name | The attachment file name. |
data | Location 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_size | On input, the size of the data buffer. On output, this is set to the length of the attachment data. |
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.
|
related |
Get the camera calibration for Azure Kinect device used during recording. The output struct is used as input to all transformation functions.
playback_handle | Handle obtained by k4a_playback_open(). |
calibration | Location to write the calibration. |
calibration
was successfully written. K4A_RESULT_FAILED otherwise.
|
related |
Gets the last timestamp in a recording, relative to the start of the recording.
playback_handle | Handle obtained by k4a_playback_open(). |
|
related |
Read the next capture in the recording sequence.
playback_handle | Handle obtained by k4a_playback_open(). |
capture_handle | If successful this contains a handle to a capture object. Caller must call k4a_capture_release() when its done using this capture |
|
related |
Read the next data block for a particular track.
playback_handle | Handle obtained by k4a_playback_open(). |
track_name | The name of the track to read the next data block from. |
data_block_handle | The location to write the data block handle. |
|
related |
Read the next IMU sample in the recording sequence.
playback_handle | Handle obtained by k4a_playback_open(). |
imu_sample | The location to write the IMU sample. |
|
related |
Read the previous capture in the recording sequence.
playback_handle | Handle obtained by k4a_playback_open(). |
capture_handle | If successful this contains a handle to a capture object. Caller must call k4a_capture_release() when its done using this capture. |
|
related |
Read the previous data block for a particular track.
playback_handle | Handle obtained by k4a_playback_open(). |
track_name | The name of the track to read the previous data block from. |
data_block_handle | The location to write the data block. |
|
related |
Read the previous IMU sample in the recording sequence.
playback_handle | Handle obtained by k4a_playback_open(). |
imu_sample | [OUT] The location to write the IMU sample. |
|
related |
Get the raw calibration blob for the Azure Kinect device used during recording.
playback_handle | Handle obtained by k4a_playback_open(). |
data | Location 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_size | On 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. |
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.
|
related |
Get the device configuration used during recording.
playback_handle | Handle obtained by k4a_playback_open(). |
config | Location to write the recording configuration. |
config
was successfully written. K4A_RESULT_FAILED otherwise.
|
related |
Returns the length of the recording in microseconds.
playback_handle | Handle obtained by k4a_playback_open(). |
|
related |
Read the value of a tag from a recording.
playback_handle | Handle obtained by k4a_playback_open(). |
name | The name of the tag to read. |
value | Location 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_size | On input, the size of the value buffer. On output, this is set to the length of the tag value (including the null terminator). |
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.K4ARECORD_EXPORT size_t k4a_playback_get_track_count | ( | k4a_playback_t | playback_handle | ) |
Get the number of tracks in a playback file.
playback_handle | Handle obtained by k4a_playback_open(). |
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.
playback_handle | Handle obtained by k4a_playback_open(). |
track_index | The index of the track to read the name form. |
track_name | Location 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_size | On 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). |
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.
|
related |
Opens an existing recording file for reading.
path | Filesystem path of the existing recording. |
playback_handle | If successful, this contains a pointer to the recording handle. Caller must call k4a_playback_close() when finished with the recording. |
|
related |
Seek to a specific timestamp within a recording.
playback_handle | Handle obtained by k4a_playback_open(). |
offset_usec | The timestamp offset to seek to, relative to origin |
origin | Specifies 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. |
|
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.
playback_handle | Handle obtained by k4a_playback_open(). |
target_format | The target image format to be returned in captures. |
target_format
.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()
.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.
playback_handle | Handle obtained by k4a_playback_open(). |
track_name | The track name to read the codec context from. |
codec_context | Location 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_size | On input, the size of the codec_context buffer. On output, this is set to the length of the codec_context data. |
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.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.
playback_handle | Handle obtained by k4a_playback_open(). |
track_name | The track name to read the codec id from. |
codec_id | Location 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_size | On 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). |
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.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.
playback_handle | Handle obtained by k4a_playback_open(). |
track_name | The track name to read video settings from. |
video_settings | Location to write the track's video settings. |
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...
playback_handle | Handle obtained by k4a_playback_open(). |
track_name | The track name to be checked to see whether it is a built-in track. |
|
related |
Adds an attachment to the recording.
recording_handle | The handle of a new recording, obtained by k4a_record_create(). |
attachment_name | The name of the attachment to be stored in the recording file. This name should be a valid filename with an extension. |
buffer | The attachment data buffer. |
buffer_size | The size of the attachment data buffer. |
|
related |
Adds custom subtitle tracks to the recording.
recording_handle | The handle of a new recording, obtained by k4a_record_create(). |
track_name | The name of the custom subtitle track to be added. |
codec_id | A 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_context | 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 'CodecPrivate' element. |
codec_context_size | The size of the codec context buffer. |
track_settings | Additional metadata for the subtitle track. If NULL, the default settings will be used. |
|
related |
Adds custom video tracks to the recording.
recording_handle | The handle of a new recording, obtained by k4a_record_create(). |
track_name | The name of the custom video track to be added. |
codec_id | A 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_context | 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 'CodecPrivate' element. |
codec_context_size | The size of the codec context buffer. |
track_settings | Additional metadata for the video track such as resolution and framerate. |
|
related |
Adds the track header for recording IMU.
recording_handle | The handle of a new recording, obtained by k4a_record_create(). |
|
related |
Adds a tag to the recording.
recording_handle | The handle of a new recording, obtained by k4a_record_create(). |
name | The name of the tag to write. |
value | The string value to store in the tag. |
|
related |
Closes a recording handle.
recording_handle | Handle obtained by k4a_record_create(). |
|
related |
Opens a new recording file for writing.
path | Filesystem path for the new recording. |
device | The 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_config | The configuration the Azure Kinect device was started with. |
recording_handle | If successful, this contains a pointer to the new recording handle. Caller must call k4a_record_close() when finished with recording. |
device_config
.device_config
.
|
related |
Flushes all pending recording data to disk.
recording_handle | Handle obtained by k4a_record_create(). |
|
related |
Writes a camera capture to file.
recording_handle | The handle of a new recording, obtained by k4a_record_create(). |
capture_handle | The handle of a capture to write to file. |
|
related |
Writes data for a custom track to file.
recording_handle | The handle of a new recording, obtained by k4a_record_create(). |
track_name | The name of the custom track that the data is going to be written to. |
device_timestamp_usec | The 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_data | The buffer of custom track data. |
custom_data_size | The size of the custom track data buffer. |
|
related |
Writes the recording header and metadata to file.
recording_handle | The handle of a new recording, obtained by k4a_record_create(). |
|
related |
Writes an imu sample to file.
recording_handle | The handle of a new recording, obtained by k4a_record_create(). |
imu_sample | A structure containing the imu sample data and timestamps. |
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
allocate | The 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. |
free | The callback function to free memory. The SDK will call this function when memory allocated by allocate is no longer needed. |
allocate
and free
as NULL will clear the hook and reset to the default allocator.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.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.
message_cb | The callback function to receive messages from. Set to NULL to unregister the callback function. |
message_cb_context | The callback functions context. |
min_level | The least critical error the user wants to be notified about. |
min_level
, k4a_set_debug_message_handler
can be called with the same value message_cb
and by specifying a new min_level
.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
|
related |
Transforms a color image into the geometry of the depth camera.
transformation_handle | Transformation handle. |
depth_image | Handle to input depth image. |
color_image | Handle to input color image. |
transformed_color_image | Handle to output transformed color image. |
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().transformed_color_image
was successfully written and K4A_RESULT_FAILED otherwise.
|
related |
Get handle to transformation handle.
calibration | A calibration structure obtained by k4a_device_get_calibration(). |
|
related |
Transforms the depth map into the geometry of the color camera.
transformation_handle | Transformation handle. |
depth_image | Handle to input depth image. |
transformed_depth_image | Handle to output transformed depth image. |
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().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().transformed_depth_image
was successfully written and K4A_RESULT_FAILED otherwise.
|
related |
Transforms depth map and a custom image into the geometry of the color camera.
transformation_handle | Transformation handle. |
depth_image | Handle to input depth image. |
custom_image | Handle to input custom image. |
transformed_depth_image | Handle to output transformed depth image. |
transformed_custom_image | Handle to output transformed custom image. |
interpolation_type | Parameter 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_value | Defines 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. |
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
.transformed_depth_image
will be filled with the depth values derived from depth_image
in the color camera's coordinate space.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().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.transformed_depth_image
and transformed_custom_image
were successfully written and K4A_RESULT_FAILED otherwise.
|
related |
Transforms the depth image into 3 planar images representing X, Y and Z-coordinates of corresponding 3D points.
transformation_handle | Transformation handle. |
depth_image | Handle to input depth image. |
camera | Geometry in which depth map was computed. |
xyz_image | Handle to output xyz image. |
depth_image
must be of format K4A_IMAGE_FORMAT_DEPTH16.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.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.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().xyz_image
was successfully written and K4A_RESULT_FAILED otherwise.
|
related |
Destroy transformation handle.
transformation_handle | Transformation handle to destroy. |