Time-of-Flight Library(ToF)  3.2.2
calibration.h
1 #ifndef _CHRONOPTICS_TOF_CALIBRATION_H_
2 #define _CHRONOPTICS_TOF_CALIBRATION_H_
3 
4 #include <chronoptics/tof/error.h>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 /** This class contains all the calibration information
11  */
12 typedef struct tof_calibration* tof_calibration_t;
13 
14 /** Destruct tof_calibration */
15 TOF_EXPORT void tof_calibration_delete(tof_calibration_t ptr);
16 
17 /** Read calibration from disk
18  * @param ptr Pointer to class
19  * @param file_location Location of calibration file
20  * @param error Pointer to error
21  * @return New object
22  */
23 TOF_EXPORT tof_calibration_t tof_calibration_new_from_disk(const char* file_location, tof_error_t *error);
24 
25 /** Write calibration to disk
26  * @param ptr Pointer to class
27  * @param file_location Location to save the calibration file to
28  * @param error Pointer to error
29  */
30 TOF_EXPORT void tof_calibration_write(const tof_calibration_t ptr, const char* file_location, tof_error_t *error);
31 
32 /** The the calibrated frequencies in the calibration file
33  * @param ptr Pointer to class
34  * @param calibrated_frequencies The calibrated modulation frequencies
35  * @param capacity The amount of data the above pointer can hold
36  * @param error Pointer to error
37  * @return Number of pointers filled or complete array size
38  */
39 TOF_EXPORT size_t tof_calibration_get_calibrated_frequencies(const tof_calibration_t ptr, float* calibrated_frequencies, size_t capacity, tof_error_t *error);
40 
41 /** Get focal length x
42  * @param ptr Pointer to class
43  * @param error Pointer to error
44  * @return Focal length
45  */
46 TOF_EXPORT double tof_calibration_get_focal_length_x(const tof_calibration_t ptr, tof_error_t *error);
47 
48 /** Get focal length y
49  * @param ptr Pointer to class
50  * @param error Pointer to error
51  * @return Focal length
52  */
53 TOF_EXPORT double tof_calibration_get_focal_length_y(const tof_calibration_t ptr, tof_error_t *error);
54 
55 /** Get principal point x
56  * @param ptr Pointer to class
57  * @param error Pointer to error
58  * @return Principal point
59  */
60 TOF_EXPORT double tof_calibration_get_principal_point_x(const tof_calibration_t ptr, tof_error_t *error);
61 
62 /** Get principal point y
63  * @param ptr Pointer to class
64  * @param error Pointer to error
65  * @return Principal point
66  */
67 TOF_EXPORT double tof_calibration_get_principal_point_y(const tof_calibration_t ptr, tof_error_t *error);
68 
69 /** Get the camera matrix of the depth sensor and lens
70  * @param ptr Pointer to class
71  * @param error Pointer to error
72  * @return[9] Camera matrix, 3x3 matrix
73  */
74 TOF_EXPORT double* tof_calibration_get_depth_camera_matrix(tof_calibration_t ptr, tof_error_t *error);
75 
76 /** Get the distortion coefficients of the depth lens
77  * @param ptr Pointer to class
78  * @param error Pointer to error
79  * @return[5] Distortion coefficients, 5x1 matrix
80  */
81 TOF_EXPORT double* tof_calibration_get_depth_distortion_coefficients(tof_calibration_t ptr, tof_error_t *error);
82 
83 /** Get the camera matrix of the rgb sensor and lens
84  * @param ptr Pointer to class
85  * @param error Pointer to error
86  * @return[9] Camera matrix, 3x3 matrix
87  */
88 TOF_EXPORT double* tof_calibration_get_rgb_camera_matrix(tof_calibration_t ptr, tof_error_t *error);
89 
90 /** Get the distortion coefficients of the rgb lens
91  * @param ptr Pointer to class
92  * @param error Pointer to error
93  * @return[5] Distortion coefficients, 5x1 matrix
94  */
95 TOF_EXPORT double* tof_calibration_get_rgb_distortion_coefficients(tof_calibration_t ptr, tof_error_t *error);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif