4 #ifndef LIBREALSENSE_RSUTIL_H 5 #define LIBREALSENSE_RSUTIL_H 16 float x = point[0] / point[2],
y = point[1] / point[2];
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;
38 float x = (pixel[0] - intrin->
ppx) / intrin->
fx;
39 float y = (pixel[1] - intrin->
ppy) / intrin->
fy;
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);
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}
132 if(arr_values[preset][14] != -1)
rs_set_device_options(device, arr_options, 15, arr_values[preset], 0);
133 if(arr_values[preset][13] != -1)
rs_set_device_options(device, arr_options, 14, arr_values[preset], 0);
static void rs_apply_ivcam_preset(rs_device *device, rs_ivcam_preset preset)
GLint GLint GLint GLint GLint GLint y
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...
GLint GLint GLsizei GLsizei GLsizei depth
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_option
Defines general configuration controls.
static void rs_project_point_to_pixel(float pixel[2], const struct rs_intrinsics *intrin, const float point[3])
Exposes librealsense functionality for C compilers.
static void rs_transform_point_to_point(float to_point[3], const struct rs_extrinsics *extrin, const float from_point[3])
static void rs_apply_depth_control_preset(rs_device *device, int preset)
static void rs_deproject_pixel_to_point(float point[3], const struct rs_intrinsics *intrin, const float pixel[2], float depth)
Cross-stream extrinsics: encode the topology describing how the different devices are connected...
rs_ivcam_preset
For SR300 devices: provides optimized settings (presets) for specific types of usage.
GLint GLint GLint GLint GLint x
preset
Presets: general preferences that are translated by librealsense into concrete resolution and FPS...