4 #ifndef LIBREALSENSE_RSUTIL_H
5 #define LIBREALSENSE_RSUTIL_H
11 static void rs_project_point_to_pixel(
float pixel[2],
const struct rs_intrinsics * intrin,
const float point[3])
16 float x = point[0] / point[2], y = point[1] / point[2];
20 float f = 1 + intrin->
coeffs[0]*r2 + intrin->
coeffs[1]*r2*r2 + intrin->
coeffs[4]*r2*r2*r2;
23 float dx = x + 2*intrin->
coeffs[2]*x*y + intrin->
coeffs[3]*(r2 + 2*x*x);
24 float dy = y + 2*intrin->
coeffs[3]*x*y + intrin->
coeffs[2]*(r2 + 2*y*y);
28 pixel[0] = x * intrin->
fx + intrin->
ppx;
29 pixel[1] = y * intrin->
fy + intrin->
ppy;
33 static void rs_deproject_pixel_to_point(
float point[3],
const struct rs_intrinsics * intrin,
const float pixel[2],
float depth)
38 float x = (pixel[0] - intrin->
ppx) / intrin->
fx;
39 float y = (pixel[1] - intrin->
ppy) / intrin->
fy;
43 float f = 1 + intrin->
coeffs[0]*r2 + intrin->
coeffs[1]*r2*r2 + intrin->
coeffs[4]*r2*r2*r2;
44 float ux = x*f + 2*intrin->
coeffs[2]*x*y + intrin->
coeffs[3]*(r2 + 2*x*x);
45 float uy = y*f + 2*intrin->
coeffs[3]*x*y + intrin->
coeffs[2]*(r2 + 2*y*y);
55 static void rs_transform_point_to_point(
float to_point[3],
const struct rs_extrinsics * extrin,
const float from_point[3])
63 static void rs_apply_depth_control_preset(
rs_device * device,
int preset)
65 static const rs_option depth_control_options[10] = {
77 double depth_control_presets[6][10] = {
78 {5, 5, 192, 1, 512, 6, 24, 27, 7, 24},
79 {5, 5, 0, 0, 1023, 0, 0, 0, 0, 2047},
80 {5, 5, 115, 1, 512, 6, 18, 25, 3, 24},
81 {5, 5, 185, 5, 505, 6, 35, 45, 45, 14},
82 {5, 5, 175, 24, 430, 6, 48, 47, 24, 12},
83 {5, 5, 235, 27, 420, 8, 80, 70, 90, 12},
109 const double arr_values[][15] = {
110 {1, 1, 180, 303, 180, 2, 16, -1, 1000, 450, 1, 1, 5, 1, -1},
111 {1, 0, 303, 605, 303, -1, -1, -1, 1250, 975, 1, 1, 7, 0, -1},
112 {0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 16, 1, 6, 2, 22},
113 {1, 1, 100, 179, 100, 2, 16, -1, 1000, 450, 1, 1, 6, 3, -1},
114 {0, 1, -1, -1, -1, 2, 16, 16, 1000, 450, 1, 1, 3, 1, 9},
115 {0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 16, 1, 5, 1, 22},
116 {2, 0, 40, 1600, 800, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1},
117 {1, 1, 100, 179, 179, 2, 16, -1, 1000, 450, 1, 1, 6, 1, -1},
118 {0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 16, 1, 5, 3, 9},
119 {1, 1, 180, 605, 303, 2, 16, -1, 1250, 650, 1, 1, 5, 1, -1},
120 {2, 0, 40, 1600, 800, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1}
preset
Presets: general preferences that are translated by librealsense into concrete resolution and FPS.
Definition: rs.hpp:69
Exposes librealsense functionality for C compilers.
void rs_reset_device_options_to_default(rs_device *device, const rs_option *options, int count, rs_error **error)
Efficiently resets the value of an arbitrary number of options to default.
@ RS_DISTORTION_FTHETA
Definition: rs.h:104
@ RS_DISTORTION_MODIFIED_BROWN_CONRADY
Definition: rs.h:102
@ RS_DISTORTION_INVERSE_BROWN_CONRADY
Definition: rs.h:103
rs_option
Defines general configuration controls.
Definition: rs.h:129
@ RS_OPTION_SR300_AUTO_RANGE_ENABLE_LASER
Definition: rs.h:149
@ RS_OPTION_F200_LASER_POWER
Definition: rs.h:142
@ RS_OPTION_R200_DEPTH_CONTROL_LR_THRESHOLD
Definition: rs.h:185
@ RS_OPTION_SR300_AUTO_RANGE_UPPER_THRESHOLD
Definition: rs.h:156
@ RS_OPTION_R200_DEPTH_CONTROL_TEXTURE_DIFFERENCE_THRESHOLD
Definition: rs.h:182
@ RS_OPTION_SR300_AUTO_RANGE_MIN_LASER
Definition: rs.h:153
@ RS_OPTION_R200_DEPTH_CONTROL_SCORE_MINIMUM_THRESHOLD
Definition: rs.h:179
@ RS_OPTION_R200_DEPTH_CONTROL_NEIGHBOR_THRESHOLD
Definition: rs.h:184
@ RS_OPTION_R200_DEPTH_CONTROL_ESTIMATE_MEDIAN_DECREMENT
Definition: rs.h:176
@ RS_OPTION_SR300_AUTO_RANGE_MAX_MOTION_VERSUS_RANGE
Definition: rs.h:151
@ RS_OPTION_F200_MOTION_RANGE
Definition: rs.h:144
@ RS_OPTION_F200_ACCURACY
Definition: rs.h:143
@ RS_OPTION_SR300_AUTO_RANGE_START_LASER
Definition: rs.h:155
@ RS_OPTION_SR300_AUTO_RANGE_START_MOTION_VERSUS_RANGE
Definition: rs.h:152
@ RS_OPTION_SR300_AUTO_RANGE_MIN_MOTION_VERSUS_RANGE
Definition: rs.h:150
@ RS_OPTION_R200_DEPTH_CONTROL_SECOND_PEAK_THRESHOLD
Definition: rs.h:183
@ RS_OPTION_R200_DEPTH_CONTROL_SCORE_MAXIMUM_THRESHOLD
Definition: rs.h:180
@ RS_OPTION_SR300_AUTO_RANGE_ENABLE_MOTION_VERSUS_RANGE
Definition: rs.h:148
@ RS_OPTION_SR300_AUTO_RANGE_LOWER_THRESHOLD
Definition: rs.h:157
@ RS_OPTION_R200_DEPTH_CONTROL_ESTIMATE_MEDIAN_INCREMENT
Definition: rs.h:177
@ RS_OPTION_SR300_AUTO_RANGE_MAX_LASER
Definition: rs.h:154
@ RS_OPTION_F200_FILTER_OPTION
Definition: rs.h:145
@ RS_OPTION_R200_DEPTH_CONTROL_MEDIAN_THRESHOLD
Definition: rs.h:178
@ RS_OPTION_F200_CONFIDENCE_THRESHOLD
Definition: rs.h:146
@ RS_OPTION_R200_DEPTH_CONTROL_TEXTURE_COUNT_THRESHOLD
Definition: rs.h:181
void rs_set_device_options(rs_device *device, const rs_option *options, unsigned int count, const double *values, rs_error **error)
Efficiently sets the value of an arbitrary number of options, using minimal hardware IO.
rs_ivcam_preset
For SR300 devices: provides optimized settings (presets) for specific types of usage.
Definition: rs.h:110
@ RS_IVCAM_PRESET_DEFAULT
Definition: rs.h:119
Definition: rscore.hpp:65
Cross-stream extrinsics: encode the topology describing how the different devices are connected.
Definition: rs.h:333
float translation[3]
Definition: rs.h:335
float rotation[9]
Definition: rs.h:334
Video stream intrinsics.
Definition: rs.h:301
float fy
Definition: rs.h:307
float coeffs[5]
Definition: rs.h:309
rs_distortion model
Definition: rs.h:308
float ppy
Definition: rs.h:305
float fx
Definition: rs.h:306
float ppx
Definition: rs.h:304