libfreenect  0.1-beta
libfreenect-registration.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OpenKinect Project. http://www.openkinect.org
3  *
4  * Copyright (c) 2011 individual OpenKinect contributors. See the CONTRIB file
5  * for details.
6  *
7  * This code is licensed to you under the terms of the Apache License, version
8  * 2.0, or, at your option, the terms of the GNU General Public License,
9  * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
10  * or the following URLs:
11  * http://www.apache.org/licenses/LICENSE-2.0
12  * http://www.gnu.org/licenses/gpl-2.0.txt
13  *
14  * If you redistribute this file in source form, modified or unmodified, you
15  * may:
16  * 1) Leave this header intact and distribute it under the same terms,
17  * accompanying it with the APACHE20 and GPL20 files, or
18  * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or
19  * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file
20  * In all cases you must keep the copyright notice intact and include a copy
21  * of the CONTRIB file.
22  *
23  * Binary distributions must follow the binary distribution requirements of
24  * either License.
25  */
26 
27 #ifndef LIBFREENECT_REGISTRATION_H
28 #define LIBFREENECT_REGISTRATION_H
29 
30 #include <libfreenect.h>
31 #include <stdint.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
40 typedef struct {
41  int32_t dx_center; // not used by mapping algorithm
42 
43  int32_t ax;
44  int32_t bx;
45  int32_t cx;
46  int32_t dx;
47 
48  int32_t dx_start;
49 
50  int32_t ay;
51  int32_t by;
52  int32_t cy;
53  int32_t dy;
54 
55  int32_t dy_start;
56 
57  int32_t dx_beta_start;
58  int32_t dy_beta_start;
59 
60  int32_t rollout_blank; // not used by mapping algorithm
61  int32_t rollout_size; // not used by mapping algorithm
62 
63  int32_t dx_beta_inc;
64  int32_t dy_beta_inc;
65 
66  int32_t dxdx_start;
67  int32_t dxdy_start;
68  int32_t dydx_start;
69  int32_t dydy_start;
70 
71  int32_t dxdxdx_start;
72  int32_t dydxdx_start;
73  int32_t dxdxdy_start;
74  int32_t dydxdy_start;
75 
76  int32_t back_comp1; // not used by mapping algorithm
77 
78  int32_t dydydx_start;
79 
80  int32_t back_comp2; // not used by mapping algorithm
81 
82  int32_t dydydy_start;
84 
86 typedef struct {
87  uint16_t start_lines;
88  uint16_t end_lines;
89  uint16_t cropping_lines;
91 
93 typedef struct {
94  float dcmos_emitter_dist; // Distance between IR camera and IR emitter, in cm.
95  float dcmos_rcmos_dist; // Distance between IR camera and RGB camera, in cm.
96  float reference_distance; // The focal length of the IR camera, in mm.
97  float reference_pixel_size; // The size of a single pixel on the zero plane, in mm.
99 
101 typedef struct {
105 
106  double const_shift;
107 
108  uint16_t* raw_to_mm_shift;
110  int32_t (*registration_table)[2]; // A table of 640*480 pairs of x,y values.
111  // Index first by pixel, then x:0 and y:1.
113 
114 
115 // These allow clients to export registration parameters; proper docs will
116 // come later
119 
120 // convenience function to convert a single x-y coordinate pair from camera
121 // to world coordinates
123  int cx, int cy, int wz, double* wx, double* wy);
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif // LIBFREENECT_REGISTRATION_H