| OrbbecSDK 1.5.7 OrbbecSDK: Software-Development-Kit for Orbbec 3D-Sensor devices

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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.

## Functions
uint64_t | ob_frame_index (ob_frame *frame, ob_error **error)
| Get the frame index. More...
ob_format | ob_frame_format (ob_frame *frame, ob_error **error)
| Get the frame format. More...
ob_frame_type | ob_frame_get_type (ob_frame *frame, ob_error **error)
| Get the frame type. More...
uint64_t | ob_frame_time_stamp (ob_frame *frame, ob_error **error)
| Get frame time stamp (hardware) More...
uint64_t | ob_frame_time_stamp_us (ob_frame *frame, ob_error **error)
| Get frame time stamp (hardware) us. More...
uint64_t | ob_frame_system_time_stamp (ob_frame *frame, ob_error **error)
| Get frame time stamp (system) More...
void * | ob_frame_data (ob_frame *frame, ob_error **error)
| Get frame data. More...
uint32_t | ob_frame_data_size (ob_frame *frame, ob_error **error)
| Get the frame data size. More...
uint32_t | ob_video_frame_width (ob_frame *frame, ob_error **error)
| Get video frame width. More...
uint32_t | ob_video_frame_height (ob_frame *frame, ob_error **error)
| Get video frame height. More...
void * | ob_video_frame_metadata (ob_frame *frame, ob_error **error)
| Get the metadata of the frame. More...
uint32_t | ob_video_frame_metadata_size (ob_frame *frame, ob_error **error)
| Get the metadata size of the frame. More...
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) More...
ob_sensor_type | ob_ir_frame_get_source_sensor_type (ob_frame *frame, ob_error **ob_error)
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 depth frame is multiplied by the scale to give a depth value in millimeter. such as valueScale=0.1, and a certain coordinate pixel value is pixelValue=10000, then the depth value = pixelValue*valueScale = 10000*0.1=1000mm。 More...
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 points frame is multiplied by the scale to give a position value in millimeter. such as 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. More...
void | ob_delete_frame (ob_frame *frame, ob_error **error)
| Delete frame. More...
uint32_t | ob_frameset_frame_count (ob_frame *frameset, ob_error **error)
| Get the number of frames contained in the frameset. More...
ob_frame * | ob_frameset_depth_frame (ob_frame *frameset, ob_error **error)
| Get the depth frame from the frameset. More...
ob_frame * | ob_frameset_color_frame (ob_frame *frameset, ob_error **error)
| Get the color frame from the frameset. More...
ob_frame * | ob_frameset_ir_frame (ob_frame *frameset, ob_error **error)
| Get the infrared frame from the frameset. More...
ob_frame * | ob_frameset_points_frame (ob_frame *frameset, ob_error **error)
| Get point cloud data from the frameset. More...
ob_frame * | ob_frameset_get_frame (ob_frame *frameset, ob_frame_type frame_type, ob_error **error)
ob_accel_value | ob_accel_frame_value (ob_frame *frame, ob_error **error)
| Get accelerometer frame data. More...
float | ob_accel_frame_temperature (ob_frame *frame, ob_error **error)
| Get the temperature when acquiring the accelerometer frame. More...
ob_gyro_value | ob_gyro_frame_value (ob_frame *frame, ob_error **error)
| Get gyroscope frame data. More...
float | ob_gyro_frame_temperature (ob_frame *frame, ob_error **error)
| Get the temperature when acquiring the gyroscope frame. More...
void | ob_frame_add_ref (ob_frame *frame, ob_error **error)
| 增加引用计数 More...
ob_frame * | ob_create_frame (ob_format frame_format, int width, int height, int stride_bytes, ob_frame_type frame_type, ob_error **error)
| 创建空的帧对象 More...
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)
| 根据外部创建的Buffer创建帧对象 More...
ob_frame * | ob_create_frameset (ob_error **error)
| 创建空的帧集合 More...
void | ob_frameset_push_frame (ob_frame *frameset, ob_frame_type type, ob_frame *frame, ob_error **error)
| push帧 More...
void | ob_frame_set_system_time_stamp (ob_frame *frame, uint64_t system_timestamp, ob_error **error)
| 设置帧的系统时间戳 More...
void | ob_frame_set_device_time_stamp (ob_frame *frame, uint64_t device_timestamp, ob_error **error)
| 设置帧的设备时间戳 More...
void | ob_frame_set_device_time_stamp_us (ob_frame *frame, uint64_t device_timestamp_us, ob_error **error)
| 设置帧的设备时间戳 More...

## Detailed Description

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

Definition in file Frame.h.

## Function Documentation

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 returns the frame index

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 returns the frame format

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 returns the frame type

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

Get frame time stamp (hardware)

Parameters

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

Returns
  uint64_t returns the frame hardware timestamp

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

Get frame time stamp (hardware) us.

Parameters

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

Returns
  uint64_t returns the frame hardware timestamp, unit us

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

Get frame time stamp (system)

Parameters

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

Returns
  uint64_t returns the frame system timestamp

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* * returns frame data pointer

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 returns the frame data size If it is point cloud data, it returns 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.

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 returns the frame width

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 returns the frame height

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

Get the metadata of the frame.

Parameters

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

Returns
  void* returns the metadata pointer of the frame

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

Get the metadata size of the frame.

Parameters

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

Returns
  uint32_t returns the metadata size of the frame

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_sensor_type ob_ir_frame_get_source_sensor_type | ( | ob_frame * | frame,
|  | ob_error ** | ob_error
| ) |  |

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 depth frame is multiplied by the scale to give a depth value in millimeter. such as 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 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 points frame is multiplied by the scale to give a position value in millimeter. such as 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 position value scale

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

Delete frame.

Parameters

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

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 returns the number of frames

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* returns the depth 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* returns the color 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* returns the infrared 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* returns the point cloud frame

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

获取指定类型的frame

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 accelerometer data

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 value

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

Get gyroscope frame data.

Parameters

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

Returns
  ob_gyro_value gyroscope data

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

Get the temperature when acquiring the gyroscope frame.

Parameters

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

Returns
  float return value

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

增加引用计数

Parameters

  [in] | frame | 要增加引用计数的帧对象
  [out] | error | 记录错误信息

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

创建空的帧对象

Parameters

  [in] | frame_format | 帧格式
  [in] | width | 帧宽度
  [in] | height | 帧高度
  [in] | stride_bytes | 数据行跨度
  [in] | frame_type | 帧类型
  [out] | error | 记录错误信息

Returns
  ob_frame* 返回创建的帧对象

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

根据外部创建的Buffer创建帧对象

Parameters

  [in] | frame_format | 帧格式
  [in] | frame_width | 帧宽度
  [in] | frame_height | 帧高度
  [in] | buffer | 帧数据
  [in] | buffer_size | 帧数据大小
  [in] | buffer_destroy_cb | 自定义销毁buffer回调
  [in] | buffer_destroy_context | 自定义销毁buffer回调用户数据
  [out] | error | 记录错误信息

Returns
  ob_frame* 返回创建的帧对象

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

创建空的帧集合

Parameters

  [out] | error | 记录错误信息

Returns
  ob_frame* 返回创建的帧集合对象

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

push帧

Parameters

  [in] | frameset | 帧集合对象
  [in] | type | 帧类型
  [in] | frame | 帧对象
  [out] | error | 记录错误信息

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

设置帧的系统时间戳

Parameters

  [in] | frame | 设置的帧对象
  [in] | systemTimestamp | 设置的系统时间戳
  [out] | error | 记录错误信息

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

设置帧的设备时间戳

Parameters

  [in] | frame | 设置的帧对象
  [in] | deviceTimestamp | 设置的设备时间戳
  [out] | error | 记录错误信息

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

设置帧的设备时间戳

Parameters

  [in] | frame | 设置的帧对象
  [in] | deviceTimestampUs | 设置的设备时间戳（Us）
  [out] | error | 记录错误信息