| OrbbecSDK 1.10.18 OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras

Loading...
Searching...
No Matches
Macros | Functions
Frame.h File Reference

Frame related function is mainly used to obtain frame data and frame information. More...

`#include "ObTypes.h"`

Go to the source code of this file.

## Macros
#define | ob_video_frame_metadata ob_frame_metadata
#define | ob_video_frame_metadata_size ob_frame_metadata_size

## Functions
uint64_t | ob_frame_index (ob_frame *frame, ob_error **error)
| Get the frame index.
ob_format | ob_frame_format (ob_frame *frame, ob_error **error)
| Get the frame format.
ob_frame_type | ob_frame_get_type (ob_frame *frame, ob_error **error)
| Get the frame type.
uint64_t | ob_frame_time_stamp (ob_frame *frame, ob_error **error)
| Get the hardware timestamp of the frame in milliseconds.
uint64_t | ob_frame_time_stamp_us (ob_frame *frame, ob_error **error)
| Get the hardware timestamp of the frame in microseconds.
uint64_t | ob_frame_system_time_stamp (ob_frame *frame, ob_error **error)
| Get the system timestamp of the frame in milliseconds.
uint64_t | ob_frame_system_time_stamp_us (ob_frame *frame, ob_error **error)
| Get the system timestamp of the frame in microseconds.
uint64_t | ob_frame_global_time_stamp_us (ob_frame *frame, ob_error **error)
| Get the global timestamp of the frame in microseconds.
void * | ob_frame_data (ob_frame *frame, ob_error **error)
| Get frame data.
uint32_t | ob_frame_data_size (ob_frame *frame, ob_error **error)
| Get the frame data size.
void * | ob_frame_metadata (ob_frame *frame, ob_error **error)
| Get the metadata of the frame.
uint32_t | ob_frame_metadata_size (ob_frame *frame, ob_error **error)
| Get the metadata size of the frame.
bool | ob_frame_has_metadata (ob_frame *frame, ob_frame_metadata_type type, ob_error **error)
| check if the frame contains the specified metadata
int64_t | ob_frame_get_metadata_value (ob_frame *frame, ob_frame_metadata_type type, ob_error **error)
| Get the metadata value of the frame.
ob_stream_profile * | ob_frame_get_stream_profile (ob_frame *frame, ob_error **error)
| Get the stream profile of the frame.
ob_sensor * | ob_frame_get_sensor (ob_frame *frame, ob_error **error)
| Get the sensor of the frame.
ob_device * | ob_frame_get_device (ob_frame *frame, ob_error **error)
| Get the device of the frame.
uint32_t | ob_video_frame_width (ob_frame *frame, ob_error **error)
| Get video frame width.
uint32_t | ob_video_frame_height (ob_frame *frame, ob_error **error)
| Get video frame height.
uint8_t | ob_video_frame_pixel_available_bit_size (ob_frame *frame, ob_error **error)
| Get the effective number of pixels (such as Y16 format frame, but only the lower 10 bits are effective bits, and the upper 6 bits are filled with 0)
ob_sensor_type | ob_ir_frame_get_source_sensor_type (ob_frame *frame, ob_error **ob_error)
| Get the source sensor type of the ir frame (left or right for dual camera)
float | ob_depth_frame_get_value_scale (ob_frame *frame, ob_error **error)
| Get the value scale of the depth frame. The pixel value of the depth frame is multiplied by the scale to give a depth value in millimeters. For example, if valueScale=0.1 and a certain coordinate pixel value is pixelValue=10000, then the depth value = pixelValue*valueScale = 10000*0.1=1000mm.
float | ob_points_frame_get_position_value_scale (ob_frame *frame, ob_error **error)
| Get the point position value scale of the points frame. The point position value of the points frame is multiplied by the scale to give a position value in millimeters. For example, if scale=0.1, the x-coordinate value of a point is x = 10000, which means that the actual x-coordinate value = x*scale = 10000*0.1 = 1000mm.
void | ob_delete_frame (ob_frame *frame, ob_error **error)
| Delete a frame object.
uint32_t | ob_frameset_frame_count (ob_frame *frameset, ob_error **error)
| Get the number of frames contained in the frameset.
ob_frame * | ob_frameset_depth_frame (ob_frame *frameset, ob_error **error)
| Get the depth frame from the frameset.
ob_frame * | ob_frameset_color_frame (ob_frame *frameset, ob_error **error)
| Get the color frame from the frameset.
ob_frame * | ob_frameset_ir_frame (ob_frame *frameset, ob_error **error)
| Get the infrared frame from the frameset.
ob_frame * | ob_frameset_points_frame (ob_frame *frameset, ob_error **error)
| Get point cloud data from the frameset.
ob_frame * | ob_frameset_get_frame (ob_frame *frameset, ob_frame_type frame_type, ob_error **error)
| Get a frame of a specific type from the frameset.
ob_frame * | ob_frameset_get_frame_by_index (ob_frame *frameset, int index, ob_error **error)
| Get a frame at a specific index from the FrameSet.
ob_accel_value | ob_accel_frame_value (ob_frame *frame, ob_error **error)
| Get accelerometer frame data.
float | ob_accel_frame_temperature (ob_frame *frame, ob_error **error)
| Get the temperature when acquiring the accelerometer frame.
ob_gyro_value | ob_gyro_frame_value (ob_frame *frame, ob_error **error)
| Get gyroscope frame data.
float | ob_gyro_frame_temperature (ob_frame *frame, ob_error **error)
| Get the temperature when acquiring the gyroscope frame.
void | ob_frame_add_ref (ob_frame *frame, ob_error **error)
| Increase the reference count of a frame object.
ob_frame * | ob_create_frame (ob_format frame_format, int width, int height, int stride_bytes, ob_frame_type frame_type, ob_error **error)
| Create an empty frame object based on the specified parameters.
ob_frame * | ob_create_frame_from_buffer (ob_format frame_format, uint32_t frame_width, uint32_t frame_height, uint8_t *buffer, uint32_t buffer_size, ob_frame_destroy_callback *buffer_destroy_cb, void *buffer_destroy_context, ob_error **error)
| Create a frame object based on an externally created buffer.
ob_frame * | ob_create_frameset (ob_error **error)
| Create an empty frameset object.
void | ob_frameset_push_frame (ob_frame *frameset, ob_frame_type type, ob_frame *frame, ob_error **error)
| Add a frame of the specified type to the frameset.
void | ob_frame_set_system_time_stamp (ob_frame *frame, uint64_t system_timestamp, ob_error **error)
| Set the system timestamp of a frame object.
void | ob_frame_set_device_time_stamp (ob_frame *frame, uint64_t device_timestamp, ob_error **error)
| Set the device timestamp of a frame object.
void | ob_frame_set_device_time_stamp_us (ob_frame *frame, uint64_t device_timestamp_us, ob_error **error)
| Set the device timestamp of a frame object.

## Detailed Description

Frame related function is mainly used to obtain frame data and frame information.

Definition in file Frame.h.

## Macro Definition Documentation

## ◆ ob_video_frame_metadata

#define ob_video_frame_metadata ob_frame_metadata

Definition at line 123 of file Frame.h.

## ◆ ob_video_frame_metadata_size

#define ob_video_frame_metadata_size ob_frame_metadata_size

Definition at line 133 of file Frame.h.

## Function Documentation

## ◆ ob_frame_index()

uint64_t ob_frame_index | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the frame index.

Parameters

  [in] | frame | Frame object
  [out] | error | Log wrong message

Returns
  uint64_t return the frame index

## ◆ ob_frame_format()

ob_format ob_frame_format | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the frame format.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  ob_format return the frame format

## ◆ ob_frame_get_type()

ob_frame_type ob_frame_get_type | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the frame type.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  ob_frame_type return the frame type

## ◆ ob_frame_time_stamp()

uint64_t ob_frame_time_stamp | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the hardware timestamp of the frame in milliseconds.

The hardware timestamp is the time point when the frame was captured by the device, on device clock domain.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  uint64_t return the frame hardware timestamp in milliseconds

## ◆ ob_frame_time_stamp_us()

uint64_t ob_frame_time_stamp_us | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the hardware timestamp of the frame in microseconds.

The hardware timestamp is the time point when the frame was captured by the device, on device clock domain.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  uint64_t return the frame hardware timestamp in microseconds

## ◆ ob_frame_system_time_stamp()

uint64_t ob_frame_system_time_stamp | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the system timestamp of the frame in milliseconds.

The system timestamp is the time point when the frame was received by the host, on host clock domain.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  uint64_t return the frame system timestamp in milliseconds

## ◆ ob_frame_system_time_stamp_us()

uint64_t ob_frame_system_time_stamp_us | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the system timestamp of the frame in microseconds.

The system timestamp is the time point when the frame was received by the host, on host clock domain.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  uint64_t return the frame system timestamp in microseconds

## ◆ ob_frame_global_time_stamp_us()

uint64_t ob_frame_global_time_stamp_us | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the global timestamp of the frame in microseconds.

The global timestamp is the time point when the frame was was captured by the device, and has been converted to the host clock domain. The conversion process base on the device timestamp and can eliminate the timer drift of the device

Attention
  Only some devices support getting the global timestamp. If the device does not support it, this function will return 0. Check the device support status by ob_device_is_global_timestamp_supported() function.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  uint64_t The global timestamp of the frame in microseconds.

## ◆ ob_frame_data()

void * ob_frame_data | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get frame data.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  void* * return frame data pointer

## ◆ ob_frame_data_size()

uint32_t ob_frame_data_size | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the frame data size.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  uint32_t return the frame data size If it is point cloud data, it return the number of bytes occupied by all point sets. If you need to find the number of points, you need to divide dataSize by the structure size of the corresponding point type.

## ◆ ob_frame_metadata()

void * ob_frame_metadata | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the metadata of the frame.

Parameters

  [in] | frame | frame object
  [out] | error | Log error messages

Returns
  void* return the metadata pointer of the frame

## ◆ ob_frame_metadata_size()

uint32_t ob_frame_metadata_size | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the metadata size of the frame.

Parameters

  [in] | frame | frame object
  [out] | error | Log error messages

Returns
  uint32_t return the metadata size of the frame

## ◆ ob_frame_has_metadata()

bool ob_frame_has_metadata | ( | ob_frame * | frame,
|  | ob_frame_metadata_type | type,
|  | ob_error ** | error
| ) |  |

check if the frame contains the specified metadata

Parameters

  [in] | frame | frame object
  [in] | type | metadata type, refer to ob_frame_metadata_type
  [out] | error | Log error messages

## ◆ ob_frame_get_metadata_value()

int64_t ob_frame_get_metadata_value | ( | ob_frame * | frame,
|  | ob_frame_metadata_type | type,
|  | ob_error ** | error
| ) |  |

Get the metadata value of the frame.

Parameters

  [in] | frame | frame object
  [in] | type | metadata type, refer to ob_frame_metadata_type
  [out] | error | Log error messages

Returns
  int64_t return the metadata value of the frame

## ◆ ob_frame_get_stream_profile()

ob_stream_profile * ob_frame_get_stream_profile | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the stream profile of the frame.

Attention
  Require ob_delete_stream_profile() to release the return stream profile.

Parameters

  frame | frame object
  error | Log error messages

Returns
  ob_stream_profile* Return the stream profile of the frame, if the frame is not captured by a sensor stream, it will return NULL

## ◆ ob_frame_get_sensor()

ob_sensor * ob_frame_get_sensor | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the sensor of the frame.

Attention
  Require ob_delete_sensor() to release the return sensor.

Parameters

  [in] | frame | frame object
  [out] | error | Log error messages

Returns
  ob_sensor* return the sensor of the frame, if the frame is not captured by a sensor or the sensor stream has been destroyed, it will return NULL

## ◆ ob_frame_get_device()

ob_device * ob_frame_get_device | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the device of the frame.

Attention
  Require ob_delete_device() to release the return device.

Parameters

  | frame | frame object
  [out] | error | Log error messages

Returns
  ob_device* return the device of the frame, if the frame is not captured by a sensor stream or the device has been destroyed, it will return NULL

## ◆ ob_video_frame_width()

uint32_t ob_video_frame_width | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get video frame width.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  uint32_t return the frame width

## ◆ ob_video_frame_height()

uint32_t ob_video_frame_height | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get video frame height.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  uint32_t return the frame height

## ◆ ob_video_frame_pixel_available_bit_size()

uint8_t ob_video_frame_pixel_available_bit_size | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the effective number of pixels (such as Y16 format frame, but only the lower 10 bits are effective bits, and the upper 6 bits are filled with 0)

Attention
  Only valid for Y8/Y10/Y11/Y12/Y14/Y16 format

Parameters

  [in] | frame | video frame object
  [out] | error | log error messages

Returns
  uint8_t return the effective number of pixels in the pixel, or 0 if it is an unsupported format

## ◆ ob_ir_frame_get_source_sensor_type()

ob_sensor_type ob_ir_frame_get_source_sensor_type | ( | ob_frame * | frame,
|  | ob_error ** | ob_error
| ) |  |

Get the source sensor type of the ir frame (left or right for dual camera)

Parameters

  frame | Frame object
  ob_error | Log error messages

Returns
  ob_sensor_type return the source sensor type of the ir frame

## ◆ ob_depth_frame_get_value_scale()

float ob_depth_frame_get_value_scale | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the value scale of the depth frame. The pixel value of the depth frame is multiplied by the scale to give a depth value in millimeters. For example, if valueScale=0.1 and a certain coordinate pixel value is pixelValue=10000, then the depth value = pixelValue*valueScale = 10000*0.1=1000mm.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  float The value scale of the depth frame

## ◆ ob_points_frame_get_position_value_scale()

float ob_points_frame_get_position_value_scale | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the point position value scale of the points frame. The point position value of the points frame is multiplied by the scale to give a position value in millimeters. For example, if scale=0.1, the x-coordinate value of a point is x = 10000, which means that the actual x-coordinate value = x*scale = 10000*0.1 = 1000mm.

Parameters

  [in] | frame | Frame object
  [out] | error | Log error messages

Returns
  float The position value scale of the points frame

## ◆ ob_delete_frame()

void ob_delete_frame | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Delete a frame object.

Parameters

  [in] | frame | The frame object to delete
  [out] | error | Log error messages

## ◆ ob_frameset_frame_count()

uint32_t ob_frameset_frame_count | ( | ob_frame * | frameset,
|  | ob_error ** | error
| ) |  |

Get the number of frames contained in the frameset.

Parameters

  [in] | frameset | frameset object
  [out] | error | Log error messages

Returns
  uint32_t return the number of frames

## ◆ ob_frameset_depth_frame()

ob_frame * ob_frameset_depth_frame | ( | ob_frame * | frameset,
|  | ob_error ** | error
| ) |  |

Get the depth frame from the frameset.

Parameters

  [in] | frameset | Frameset object.
  [out] | error | Log error messages.

Returns
  ob_frame* Return the depth frame.

## ◆ ob_frameset_color_frame()

ob_frame * ob_frameset_color_frame | ( | ob_frame * | frameset,
|  | ob_error ** | error
| ) |  |

Get the color frame from the frameset.

Parameters

  [in] | frameset | Frameset object.
  [out] | error | Log error messages.

Returns
  ob_frame* Return the color frame.

## ◆ ob_frameset_ir_frame()

ob_frame * ob_frameset_ir_frame | ( | ob_frame * | frameset,
|  | ob_error ** | error
| ) |  |

Get the infrared frame from the frameset.

Parameters

  [in] | frameset | Frameset object.
  [out] | error | Log error messages.

Returns
  ob_frame* Return the infrared frame.

## ◆ ob_frameset_points_frame()

ob_frame * ob_frameset_points_frame | ( | ob_frame * | frameset,
|  | ob_error ** | error
| ) |  |

Get point cloud data from the frameset.

Parameters

  [in] | frameset | Frameset object.
  [out] | error | Log error messages.

Returns
  ob_frame* Return the point cloud frame.

## ◆ ob_frameset_get_frame()

ob_frame * ob_frameset_get_frame | ( | ob_frame * | frameset,
|  | ob_frame_type | frame_type,
|  | ob_error ** | error
| ) |  |

Get a frame of a specific type from the frameset.

Parameters

  [in] | frameset | Frameset object.
  [in] | frame_type | Frame type.
  [out] | error | Log error messages.

Returns
  ob_frame* Return the frame of the specified type, or nullptr if it does not exist.

## ◆ ob_frameset_get_frame_by_index()

ob_frame * ob_frameset_get_frame_by_index | ( | ob_frame * | frameset,
|  | int | index,
|  | ob_error ** | error
| ) |  |

Get a frame at a specific index from the FrameSet.

Parameters

  [in] | frameset | Frameset object.
  [in] | index | The index of the frame.
  [out] | error | Log error messages.

Returns
  ob_frame* Return the frame at the specified index, or nullptr if it does not exist.

## ◆ ob_accel_frame_value()

ob_accel_value ob_accel_frame_value | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get accelerometer frame data.

Parameters

  [in] | frame | Accelerometer frame.
  [out] | error | Log error messages.

Returns
  ob_accel_value Return the accelerometer data.

## ◆ ob_accel_frame_temperature()

float ob_accel_frame_temperature | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the temperature when acquiring the accelerometer frame.

Parameters

  [in] | frame | Accelerometer frame.
  [out] | error | Log error messages.

Returns
  float Return the temperature value.

## ◆ ob_gyro_frame_value()

ob_gyro_value ob_gyro_frame_value | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get gyroscope frame data.

Parameters

  [in] | frame | Gyroscope frame.
  [out] | error | Log error messages.

Returns
  ob_gyro_value Return the gyroscope data.

## ◆ ob_gyro_frame_temperature()

float ob_gyro_frame_temperature | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Get the temperature when acquiring the gyroscope frame.

Parameters

  [in] | frame | Gyroscope frame.
  [out] | error | Log error messages.

Returns
  float Return the temperature value.

## ◆ ob_frame_add_ref()

void ob_frame_add_ref | ( | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Increase the reference count of a frame object.

Parameters

  [in] | frame | Frame object to increase the reference count.
  [out] | error | Log error messages.

## ◆ ob_create_frame()

ob_frame * ob_create_frame | ( | ob_format | frame_format,
|  | int | width,
|  | int | height,
|  | int | stride_bytes,
|  | ob_frame_type | frame_type,
|  | ob_error ** | error
| ) |  |

Create an empty frame object based on the specified parameters.

Parameters

  [in] | frame_format | Frame object format.
  [in] | width | Frame object width.
  [in] | height | Frame object height.
  [in] | stride_bytes | Buffer row span.
  [in] | frame_type | Frame object type.
  [out] | error | Log error messages.

Returns
  ob_frame* Return an empty frame object.

## ◆ ob_create_frame_from_buffer()

ob_frame * ob_create_frame_from_buffer | ( | ob_format | frame_format,
|  | uint32_t | frame_width,
|  | uint32_t | frame_height,
|  | uint8_t * | buffer,
|  | uint32_t | buffer_size,
|  | ob_frame_destroy_callback * | buffer_destroy_cb,
|  | void * | buffer_destroy_context,
|  | ob_error ** | error
| ) |  |

Create a frame object based on an externally created buffer.

Parameters

  [in] | frame_format | Frame object format.
  [in] | frame_width | Frame object width.
  [in] | frame_height | Frame object height.
  [in] | buffer | Frame object buffer.
  [in] | buffer_size | Frame object buffer size.
  [in] | buffer_destroy_cb | Destroy callback.
  [in] | buffer_destroy_context | Destroy context.
  [out] | error | Log error messages.

Returns
  ob_frame* Return the frame object.

## ◆ ob_create_frameset()

ob_frame * ob_create_frameset | ( | ob_error ** | error | ) |

Create an empty frameset object.

Parameters

  [out] | error | Log error messages.

Returns
  ob_frame* Return the frameset object.

## ◆ ob_frameset_push_frame()

void ob_frameset_push_frame | ( | ob_frame * | frameset,
|  | ob_frame_type | type,
|  | ob_frame * | frame,
|  | ob_error ** | error
| ) |  |

Add a frame of the specified type to the frameset.

Parameters

  [in] | frameset | Frameset object.
  [in] | type | Type of frame to add.
  [in] | frame | Frame object to add.
  [out] | error | Log error messages.

## ◆ ob_frame_set_system_time_stamp()

void ob_frame_set_system_time_stamp | ( | ob_frame * | frame,
|  | uint64_t | system_timestamp,
|  | ob_error ** | error
| ) |  |

Set the system timestamp of a frame object.

Parameters

  [in] | frame | Frame object to set the system timestamp for.
  [in] | system_timestamp | System timestamp to set in milliseconds.
  [out] | error | Log error messages.

## ◆ ob_frame_set_device_time_stamp()

void ob_frame_set_device_time_stamp | ( | ob_frame * | frame,
|  | uint64_t | device_timestamp,
|  | ob_error ** | error
| ) |  |

Set the device timestamp of a frame object.

Parameters

  [in] | frame | Frame object to set the device timestamp.
  [in] | device_timestamp | Device timestamp to set in milliseconds.
  [out] | error | Log error messages.

## ◆ ob_frame_set_device_time_stamp_us()

void ob_frame_set_device_time_stamp_us | ( | ob_frame * | frame,
|  | uint64_t | device_timestamp_us,
|  | ob_error ** | error
| ) |  |

Set the device timestamp of a frame object.

Parameters

  [in] | frame | Frame object to set the device timestamp for.
  [in] | device_timestamp_us | Device timestamp to set in microseconds.
  [out] | error | Log error messages.