Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
|
#include <rs_device.hpp>
Public Member Functions | |
auto_calibrated_device (device d) | |
template<class T > | |
calibration_table | run_on_chip_calibration (std::string json_content, float *health, T callback, int timeout_ms=5000) const |
calibration_table | run_on_chip_calibration (std::string json_content, float *health, int timeout_ms=5000) const |
template<class T > | |
calibration_table | run_tare_calibration (float ground_truth_mm, std::string json_content, float *health, T callback, int timeout_ms=5000) const |
calibration_table | run_tare_calibration (float ground_truth_mm, std::string json_content, float *health, int timeout_ms=5000) const |
template<class T > | |
calibration_table | process_calibration_frame (rs2::frame f, float *const health, T callback, int timeout_ms=5000) const |
calibration_table | process_calibration_frame (rs2::frame f, float *const health, int timeout_ms=5000) const |
calibration_table | get_calibration_table () |
void | set_calibration_table (const calibration_table &calibration) |
rs2_calibration_config | json_string_to_calibration_config (const std::string &json_str) const |
std::string | calibration_config_to_json_string (const rs2_calibration_config &calib_config) const |
std::vector< uint8_t > | run_focal_length_calibration (rs2::frame_queue left, rs2::frame_queue right, float target_w, float target_h, int adjust_both_sides, float *ratio, float *angle) const |
template<class T > | |
std::vector< uint8_t > | run_focal_length_calibration (rs2::frame_queue left, rs2::frame_queue right, float target_w, float target_h, int adjust_both_sides, float *ratio, float *angle, T callback) const |
std::vector< uint8_t > | run_uv_map_calibration (rs2::frame_queue left, rs2::frame_queue color, rs2::frame_queue depth, int py_px_only, float *health, int health_size) const |
template<class T > | |
std::vector< uint8_t > | run_uv_map_calibration (rs2::frame_queue left, rs2::frame_queue color, rs2::frame_queue depth, int py_px_only, float *health, int health_size, T callback) const |
float | calculate_target_z (rs2::frame_queue queue1, rs2::frame_queue queue2, rs2::frame_queue queue3, float target_width, float target_height) const |
template<class T > | |
float | calculate_target_z (rs2::frame_queue queue1, rs2::frame_queue queue2, rs2::frame_queue queue3, float target_width, float target_height, T callback) const |
rs2_calibration_config | get_calibration_config () const |
void | set_calibration_config (const rs2_calibration_config &calib_config) |
Public Member Functions inherited from rs2::calibrated_device | |
calibrated_device (device d) | |
void | write_calibration () const |
void | reset_to_factory_calibration () |
Public Member Functions inherited from rs2::device | |
std::vector< sensor > | query_sensors () const |
std::string | get_type () const |
std::string | get_description () const |
template<class T > | |
T | first () const |
bool | supports (rs2_camera_info info) const |
const char * | get_info (rs2_camera_info info) const |
void | hardware_reset () |
device & | operator= (const std::shared_ptr< rs2_device > dev) |
device & | operator= (const device &dev) |
device () | |
operator bool () const | |
const std::shared_ptr< rs2_device > & | get () const |
bool | operator< (device const &other) const |
bool | is_connected () const |
template<class T > | |
bool | is () const |
template<class T > | |
T | as () const |
virtual | ~device () |
operator std::shared_ptr< rs2_device > () | |
device (std::shared_ptr< rs2_device > dev) | |
Additional Inherited Members | |
Protected Attributes inherited from rs2::device | |
std::shared_ptr< rs2_device > | _dev |
|
inline |
|
inline |
Calculate Z for calibration target - distance to the target's plane
[in] | queue1-3 | Frame queues of raw images used to calculate and extract the distance to a predefined target pattern. For D400 the indexes 1-3 correspond to Left IR, Right IR and Depth with only the Left IR being used |
[in] | target_width | expected target's horizontal dimension in mm |
[in] | target_height | expected target's vertical dimension in mm |
|
inline |
Calculate Z for calibration target - distance to the target's plane
[in] | queue1-3 | Frame queues of raw images used to calculate and extract the distance to a predefined target pattern. For D400 the indexes 1-3 correspond to Left IR, Right IR and Depth with only the Left IR being used |
[in] | target_width | expected target's horizontal dimension in mm |
[in] | target_height | expected target's vertical dimension in mm |
[in] | callback | Optional callback for reporting progress status |
|
inline |
calibration_config_to_json_string
[in] | calib_config | Calibration config struct to convert to JSON string |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
|
inline |
get_calibration_config
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
|
inline |
Read current calibration table from flash.
|
inline |
json_string_to_calibration_config
[in] | json_str | JSON string to convert to calibration config struct |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
|
inline |
When doing a host-assited calibration (Tare or on-chip) add frame to the calibration process
[in] | f | The next depth frame. |
[in] | callback | Optional callback to get progress notifications |
[in] | timeout_ms | Timeout in ms |
[out] | health | The health check numbers before and after calibration |
|
inline |
When doing a host-assited calibration (Tare or on-chip) add frame to the calibration process
[in] | f | The next depth frame. |
[in] | timeout_ms | Timeout in ms |
[out] | health | The health check numbers before and after calibration |
|
inline |
Run target-based focal length calibration for D400 Stereo Cameras
[in] | left_queue | container for left IR frames with resoluton of 1280x720 and the target in the center of 320x240 pixels ROI. |
[in] | right_queue | container for right IR frames with resoluton of 1280x720 and the target in the center of 320x240 pixels ROI |
[in] | target_w | the rectangle width in mm on the target |
[in] | target_h | the rectangle height in mm on the target |
[in] | adjust_both_sides | 1 for adjusting both left and right camera calibration tables and 0 for adjusting right camera calibraion table only |
[out] | ratio | the corrected ratio from the calibration |
[out] | angle | the target's tilt angle |
|
inline |
Run target-based focal length calibration for D400 Stereo Cameras
[in] | left_queue | container for left IR frames with resoluton of 1280x720 and the target in the center of 320x240 pixels ROI. |
[in] | right_queue | container for right IR frames with resoluton of 1280x720 and the target in the center of 320x240 pixels ROI |
[in] | target_w | the rectangle width in mm on the target |
[in] | target_h | the rectangle height in mm on the target |
[in] | adjust_both_sides | 1 for adjusting both left and right camera calibration tables and 0 for adjusting right camera calibraion table only |
[out] | ratio | the corrected ratio from the calibration |
[out] | angle | the target's tilt angle |
|
inline |
On-chip calibration intended to reduce the Depth noise. Applies to D400 Depth cameras
[in] | json_content | Json string to configure regular speed on chip calibration parameters: { "calib type" : 0, "speed": 3, "scan parameter": 0, "adjust both sides": 0, "white wall mode": 0, "host assistance": 0 } calib_type - calibraton type: 0 = regular, 1 = focal length, 2 = both regular and focal length in order speed - for regular calibration. value can be one of: Very fast = 0, Fast = 1, Medium = 2, Slow = 3, White wall = 4, default is Slow for type 0 and Fast for type 2 scan_parameter - for regular calibration. value can be one of: Py scan (default) = 0, Rx scan = 1 adjust_both_sides - for focal length calibration. value can be one of: 0 = adjust right only, 1 = adjust both sides white_wall_mode - white wall mode: 0 for normal mode and 1 for white wall mode host_assistance: 0 for no assistance, 1 for starting with assistance, 2 for first part feeding host data to firmware, 3 for second part of feeding host data to firmware (calib_type 2 only) if json is nullptr it will be ignored and calibration will use the default parameters |
[out] | health | The absolute value of regular calibration Health-Check captures how far camera calibration is from the optimal one [0, 0.25) - Good [0.25, 0.75) - Can be Improved [0.75, ) - Requires Calibration The absolute value of focal length calibration Health-Check captures how far camera calibration is from the optimal one [0, 0.15) - Good [0.15, 0.75) - Can be Improved [0.75, ) - Requires Calibration The two health numbers are encoded in one integer as follows for calib_type 2: Regular health number times 1000 are bits 0 to 11 Regular health number is negative if bit 24 is 1 Focal length health number times 1000 are bits 12 to 23 Focal length health number is negative if bit 25 is 1 |
[in] | callback | Optional callback to get progress notifications |
[in] | timeout_ms | Timeout in ms |
|
inline |
On-chip calibration intended to reduce the Depth noise. Applies to D400 Depth cameras
[in] | json_content | Json string to configure regular speed on chip calibration parameters: { "focal length" : 0, "speed": 3, "scan parameter": 0, "adjust both sides": 0, "white wall mode": 0, "host assistance": 0 } focal_length - calibraton type: 0 = regular, 1 = focal length, 2 = both regular and focal length in order speed - for regular calibration. value can be one of: Very fast = 0, Fast = 1, Medium = 2, Slow = 3, White wall = 4, default is Slow for type 0 and Fast for type 2 scan_parameter - for regular calibration. value can be one of: Py scan (default) = 0, Rx scan = 1 adjust_both_sides - for focal length calibration. value can be one of: 0 = adjust right only, 1 = adjust both sides white_wall_mode - white wall mode: 0 for normal mode and 1 for white wall mode host_assistance: 0 for no assistance, 1 for starting with assistance, 2 for first part feeding host data to firmware, 3 for second part of feeding host data to firmware (calib_type 2 only) if json is nullptr it will be ignored and calibration will use the default parameters |
[out] | health | The absolute value of regular calibration Health-Check captures how far camera calibration is from the optimal one [0, 0.25) - Good [0.25, 0.75) - Can be Improved [0.75, ) - Requires Calibration The absolute value of focal length calibration Health-Check captures how far camera calibration is from the optimal one [0, 0.15) - Good [0.15, 0.75) - Can be Improved [0.75, ) - Requires Calibration The two health numbers are encoded in one integer as follows for calib_type 2: Regular health number times 1000 are bits 0 to 11 Regular health number is negative if bit 24 is 1 Focal length health number times 1000 are bits 12 to 23 Focal length health number is negative if bit 25 is 1 |
[in] | timeout_ms | Timeout in ms |
|
inline |
Tare calibration adjusts the camera absolute distance to flat target. Applies to D400 Depth cameras User needs to enter the known ground truth.
[in] | ground_truth_mm | Ground truth in mm must be between 60 and 10000 |
[in] | json_content | Json string to configure tare calibration parameters: { "average step count": 20, "step count": 20, "accuracy": 2, "scan parameter": 0, "data sampling": 0, "host assistance": 0, "depth" : 0 } average step count - number of frames to average, must be between 1 - 30, default = 20 step count - max iteration steps, must be between 5 - 30, default = 10 accuracy - Subpixel accuracy level, value can be one of: Very high = 0 (0.025%), High = 1 (0.05%), Medium = 2 (0.1%), Low = 3 (0.2%), Default = Very high (0.025%), default is Medium scan_parameter - value can be one of: Py scan (default) = 0, Rx scan = 1 data_sampling - value can be one of:polling data sampling = 0, interrupt data sampling = 1 host_assistance: 0 for no assistance, 1 for starting with assistance, 2 for feeding host data to firmware depth: 0 for not relating to depth, > 0 for feeding depth from host to firmware, -1 for ending to feed depth from host to firmware if json is nullptr it will be ignored and calibration will use the default parameters |
[in] | content_size | Json string size if its 0 the json will be ignored and calibration will use the default parameters |
[out] | health | The absolute value of regular calibration Health-Check captures how far camera calibration is from the optimal one [0, 0.25) - Good [0.25, 0.75) - Can be Improved [0.75, ) - Requires Calibration |
[in] | callback | Optional callback to get progress notifications |
[in] | timeout_ms | Timeout in ms |
|
inline |
Tare calibration adjusts the camera absolute distance to flat target. Applies to D400 Depth cameras User needs to enter the known ground truth.
[in] | ground_truth_mm | Ground truth in mm must be between 60 and 10000 |
[in] | json_content | Json string to configure tare calibration parameters: { "average step count": 20, "step count": 20, "accuracy": 2, "scan parameter": 0, "data sampling": 0, "host assistance": 0, "depth" : 0 } average step count - number of frames to average, must be between 1 - 30, default = 20 step count - max iteration steps, must be between 5 - 30, default = 10 accuracy - Subpixel accuracy level, value can be one of: Very high = 0 (0.025%), High = 1 (0.05%), Medium = 2 (0.1%), Low = 3 (0.2%), Default = Very high (0.025%), default is Medium scan_parameter - value can be one of: Py scan (default) = 0, Rx scan = 1 data_sampling - value can be one of:polling data sampling = 0, interrupt data sampling = 1 host_assistance: 0 for no assistance, 1 for starting with assistance, 2 for feeding host data to firmware depth: 0 for not relating to depth, > 0 for feeding depth from host to firmware, -1 for ending to feed depth from host to firmware if json is nullptr it will be ignored and calibration will use the default parameters |
[in] | content_size | Json string size if its 0 the json will be ignored and calibration will use the default parameters |
[out] | health | The absolute value of regular calibration Health-Check captures how far camera calibration is from the optimal one [0, 0.25) - Good [0.25, 0.75) - Can be Improved [0.75, ) - Requires Calibration |
[in] | timeout_ms | Timeout in ms |
|
inline |
Depth-RGB UV-Map calibration. Applicable for D400 cameras
[in] | left | container for left IR frames with resoluton of 1280x720 and the target in the center of 320x240 pixels ROI. |
[in] | color | container for RGB frames with resoluton of 1280x720 and the target in the center of 320x240 pixels ROI |
[in] | depth | container for Depth frames with resoluton of 1280x720 and the target in the center of 320x240 pixels ROI |
[in] | py_px_only | 1 for calibrating color camera py and px only, 1 for calibrating color camera py, px, fy, and fx. |
[out] | health | The four health check numbers int the oorder of px, py, fx, fy for the calibration |
[in] | health_size | number of health check numbers, which is 4 by default |
[in] | callback | Optional callback for update progress notifications, the progress value is normailzed to 1 |
|
inline |
Depth-RGB UV-Map calibration. Applicable for D400 cameras
[in] | left | container for left IR frames with resoluton of 1280x720 and the target in the center of 320x240 pixels ROI. |
[in] | color | container for RGB frames with resoluton of 1280x720 and the target in the center of 320x240 pixels ROI |
[in] | depth | container for Depth frames with resoluton of 1280x720 and the target in the center of 320x240 pixels ROI |
[in] | py_px_only | 1 for calibrating color camera py and px only, 1 for calibrating color camera py, px, fy, and fx. |
[out] | health | The four health check numbers in order of px, py, fx, fy for the calibration |
[in] | health_size | number of health check numbers, which is 4 by default |
[in] | callback | Optional callback for update progress notifications, the progress value is normailzed to 1 |
[in] | client_data | Optional client data for the callback |
|
inline |
set_calibration_config
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
|
inline |
Set current table to dynamic area.
[in] | Calibration | table |