Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
rsutil.h
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory.
2  Copyright(c) 2015 Intel Corporation. All Rights Reserved. */
3 
4 #ifndef LIBREALSENSE_RSUTIL2_H
5 #define LIBREALSENSE_RSUTIL2_H
6 
7 #include <stdlib.h>
8 #include <stdbool.h>
9 #include <stdint.h>
10 #include <math.h>
11 #include <float.h>
12 #include "h/rs_types.h"
13 #include "h/rs_sensor.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /* Given a point in 3D space, compute the corresponding pixel coordinates in an image with no distortion or forward distortion coefficients produced by the same camera */
20 void rs2_project_point_to_pixel(float pixel[2], const rs2_intrinsics* intrin, const float point[3]);
21 
22 /* Given pixel coordinates and depth in an image with no distortion or inverse distortion coefficients, compute the corresponding point in 3D space relative to the same camera */
23 void rs2_deproject_pixel_to_point(float point[3], const rs2_intrinsics* intrin, const float pixel[2], float depth);
24 
25 /* Transform 3D coordinates relative to one sensor to 3D coordinates relative to another viewpoint */
26 void rs2_transform_point_to_point(float to_point[3], const rs2_extrinsics* extrin, const float from_point[3]);
27 
28 /* Calculate horizontal and vertical feild of view, based on video intrinsics */
29 void rs2_fov(const rs2_intrinsics* intrin, float to_fov[2]);
30 
31 /* Find projected pixel with unknown depth search along line. */
32 void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2],
33  const uint16_t* data, float depth_scale,
34  float depth_min, float depth_max,
35  const struct rs2_intrinsics* depth_intrin,
36  const struct rs2_intrinsics* color_intrin,
37  const struct rs2_extrinsics* color_to_depth,
38  const struct rs2_extrinsics* depth_to_color,
39  const float from_pixel[2]);
40 
41 
42 #ifdef __cplusplus
43 }
44 #endif
45 
46 #endif // LIBREALSENSE_RSUTIL2_H
Exposes RealSense structs.
void rs2_project_color_pixel_to_depth_pixel(float to_pixel[2], const uint16_t *data, float depth_scale, float depth_min, float depth_max, const struct rs2_intrinsics *depth_intrin, const struct rs2_intrinsics *color_intrin, const struct rs2_extrinsics *color_to_depth, const struct rs2_extrinsics *depth_to_color, const float from_pixel[2])
void rs2_project_point_to_pixel(float pixel[2], const rs2_intrinsics *intrin, const float point[3])
void rs2_fov(const rs2_intrinsics *intrin, float to_fov[2])
Exposes RealSense sensor functionality for C compilers.
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
Definition: rs_sensor.h:102
Video stream intrinsics.
Definition: rs_types.h:60
void rs2_deproject_pixel_to_point(float point[3], const rs2_intrinsics *intrin, const float pixel[2], float depth)
void rs2_transform_point_to_point(float to_point[3], const rs2_extrinsics *extrin, const float from_point[3])