ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
icp.h
Go to the documentation of this file.
1/*
2 * icp.h
3 * artoolkitX
4 *
5 * This file is part of artoolkitX.
6 *
7 * artoolkitX is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * artoolkitX is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with artoolkitX. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * As a special exception, the copyright holders of this library give you
21 * permission to link this library with independent modules to produce an
22 * executable, regardless of the license terms of these independent modules, and to
23 * copy and distribute the resulting executable under terms of your choice,
24 * provided that you also meet, for each linked independent module, the terms and
25 * conditions of the license of that module. An independent module is a module
26 * which is neither derived from nor based on this library. If you modify this
27 * library, you may extend this exception to your version of the library, but you
28 * are not obligated to do so. If you do not wish to do so, delete this exception
29 * statement from your version.
30 *
31 * Copyright 2018 Realmax, Inc.
32 * Copyright 2015 Daqri, LLC.
33 * Copyright 2004-2015 ARToolworks, Inc.
34 *
35 * Author(s): Hirokazu Kato
36 *
37 */
38
39#ifndef ICP_H
40#define ICP_H
41
42#include <stdio.h>
43#include <ARX/AR/icpCore.h>
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49#define ICP_TRANS_MAT_IDENTITY NULL
50
51
52/*
53 * Point Data
54 */
55typedef struct {
58 int num;
59} ICPDataT;
60
61typedef struct {
64 int numL;
67 int numR;
69
70
71
72/*
73 * Handle
74 */
75typedef struct {
76 ARdouble matXc2U[3][4];
83
84typedef struct {
85 ARdouble matXcl2Ul[3][4];
86 ARdouble matXcr2Ur[3][4];
87 ARdouble matC2L[3][4];
88 ARdouble matC2R[3][4];
95
96
97
98
99/*------------ icpUtil.c --------------*/
100int icpGetInitXw2Xc_from_PlanarData( ARdouble matXc2U[3][4], ICP2DCoordT screenCoord[], ICP3DCoordT worldCoord[], int num, ARdouble initMatXw2Xc[3][4] );
101
102
103/*------------ icpPoint.c --------------*/
104ICPHandleT *icpCreateHandle ( const ARdouble matXc2U[3][4] );
105int icpDeleteHandle ( ICPHandleT **handle );
106int icpSetMatXc2U ( ICPHandleT *handle, const ARdouble matXc2U[3][4] );
107int icpGetMatXc2U ( ICPHandleT *handle, ARdouble matXc2U[3][4] );
108int icpSetMaxLoop ( ICPHandleT *handle, int maxLoop );
109int icpGetMaxLoop ( ICPHandleT *handle, int *maxLoop );
110int icpSetBreakLoopErrorThresh ( ICPHandleT *handle, ARdouble breakLoopErrorThresh );
111int icpGetBreakLoopErrorThresh ( ICPHandleT *handle, ARdouble *breakLoopErrorThresh );
112int icpSetBreakLoopErrorRatioThresh ( ICPHandleT *handle, ARdouble breakLoopErrorThresh );
113int icpGetBreakLoopErrorRatioThresh ( ICPHandleT *handle, ARdouble *breakLoopErrorThresh );
114int icpSetBreakLoopErrorThresh2 ( ICPHandleT *handle, ARdouble breakLoopErrorThresh2 );
115int icpGetBreakLoopErrorThresh2 ( ICPHandleT *handle, ARdouble *breakLoopErrorThresh2 );
116int icpSetInlierProbability ( ICPHandleT *handle, ARdouble inlierProbability );
117ICP_EXTERN int icpGetInlierProbability ( ICPHandleT *handle, ARdouble *inlierProbability );
118int icpPoint ( ICPHandleT *handle, ICPDataT *data, ARdouble initMatXw2Xc[3][4], ARdouble matXw2Xc[3][4], ARdouble *err );
119int icpPointRobust ( ICPHandleT *handle, ICPDataT *data, ARdouble initMatXw2Xc[3][4], ARdouble matXw2Xc[3][4], ARdouble *err );
120
121
122/*------------ icpPointStereo.c --------------*/
123ICPStereoHandleT *icpStereoCreateHandle ( const ARdouble matXcl2Ul[3][4], const ARdouble matXcr2Ur[3][4], const ARdouble matC2L[3][4], const ARdouble matC2R[3][4] );
125int icpStereoSetMatXcl2Ul ( ICPStereoHandleT *handle, ARdouble matXcl2Ul[3][4] );
126int icpStereoSetMatXcr2Ur ( ICPStereoHandleT *handle, ARdouble matXcr2Ur[3][4] );
127int icpStereoGetMatXcl2Ul ( ICPStereoHandleT *handle, ARdouble matXcl2Ul[3][4] );
128int icpStereoGetMatXcr2Ur ( ICPStereoHandleT *handle, ARdouble matXcr2Ur[3][4] );
129int icpStereoSetMatC2L ( ICPStereoHandleT *handle, ARdouble matC2L[3][4] );
130int icpStereoSetMatC2R ( ICPStereoHandleT *handle, ARdouble matC2R[3][4] );
131int icpStereoGetMatC2L ( ICPStereoHandleT *handle, ARdouble matC2L[3][4] );
132int icpStereoGetMatC2R ( ICPStereoHandleT *handle, ARdouble matC2R[3][4] );
133int icpStereoSetMaxLoop ( ICPStereoHandleT *handle, int maxLoop );
134int icpStereoGetMaxLoop ( ICPStereoHandleT *handle, int *maxLoop );
135int icpStereoSetBreakLoopErrorThresh ( ICPStereoHandleT *handle, ARdouble breakLoopErrorThresh );
136int icpStereoGetBreakLoopErrorThresh ( ICPStereoHandleT *handle, ARdouble *breakLoopErrorThresh );
137int icpStereoSetBreakLoopErrorRatioThresh ( ICPStereoHandleT *handle, ARdouble breakLoopErrorThresh );
138int icpStereoGetBreakLoopErrorRatioThresh ( ICPStereoHandleT *handle, ARdouble *breakLoopErrorThresh );
139int icpStereoSetBreakLoopErrorThresh2 ( ICPStereoHandleT *handle, ARdouble breakLoopErrorThresh2 );
140int icpStereoGetBreakLoopErrorThresh2 ( ICPStereoHandleT *handle, ARdouble *breakLoopErrorThresh2 );
141int icpStereoSetInlierProbability ( ICPStereoHandleT *handle, ARdouble inlierProbability );
142int icpStereoGetInlierProbability ( ICPStereoHandleT *handle, ARdouble *inlierProbability );
143int icpStereoPoint ( ICPStereoHandleT *handle, ICPStereoDataT *data, ARdouble initMatXw2Xc[3][4], ARdouble matXw2Xc[3][4], ARdouble *err );
144int icpStereoPointRobust ( ICPStereoHandleT *handle, ICPStereoDataT *data, ARdouble initMatXw2Xc[3][4], ARdouble matXw2Xc[3][4], ARdouble *err );
145
146
147#if 0
148int icpRobustGetXw2Xc( ICPHandleT *handle,
149 ICPDataT *data,
150 ARdouble initMatXw2Xc[3][4],
151 ARdouble matXw2Xc[3][4],
152 ARdouble *err );
153
154int icpGetXw2XcFromLineAndPoint( ICPHandleT *handle,
155 ICPLinesDataT *linesData,
156 ICPDataT *pointData,
157 ARdouble initMatXw2Xc[3][4],
158 ARdouble matXw2Xc[3][4],
159 ARdouble *err );
160
161
162int icpStereoCheckErr( ARdouble S[6], ARdouble matXcl2Ul[3][4], ARdouble matXcl2Ur[3][4], ICPStereoDataT *data, ARdouble *err );
163int icpRobustCheckErr( ARdouble S[6], ARdouble matXc2U[3][4], ICPDataT *data, ARdouble *weight, ARdouble *err );
164int icpRobustUpdateWeight( ARdouble S[6], ARdouble matXc2U[3][4], ICPDataT *data, ARdouble sd2, ARdouble *weight );
165
166
167int icpGetJ_E_S( ARdouble J_E_S[6], ICP2DLineT *line, ICP2DLineSegT *lineSeg, ARdouble matXc2U[3][4], ARdouble q[7], ARdouble s[6],
168 ICP3DLineSegT *cameraCoord, ICP3DLineSegT *worldCoord, ICP2DCoordT *observedScreenCoord );
169int icpGetJ_E_L( ARdouble J_E_L[3], ICP2DLineT *line, ICP2DCoordT *screenCoord );
170int icpGetJ_L_X( ARdouble J_L_X[3][4], ICP2DLineSegT *lineSeg );
171int icpGetLine( ICP2DLineT *line, ICP2DLineSegT *lineSeg );
172int icpGetdE( ARdouble *dE, ICP2DLineT *line, ICP2DCoordT *screenCoord );
173int icpLineCheckErr( ARdouble S[6], ARdouble matXc2U[3][4], ICPLinesDataT *data, ARdouble *err );
174#endif
175
176
177
178#ifdef __cplusplus
179}
180#endif
181#endif
double ARdouble
Definition: ar.h:99
int icpStereoSetInlierProbability(ICPStereoHandleT *handle, ARdouble inlierProbability)
Definition: icpStereoHandle.c:244
int icpStereoGetMatXcl2Ul(ICPStereoHandleT *handle, ARdouble matXcl2Ul[3][4])
Definition: icpStereoHandle.c:168
int icpStereoGetMatC2R(ICPStereoHandleT *handle, ARdouble matC2R[3][4])
Definition: icpStereoHandle.c:201
int icpStereoSetMatC2R(ICPStereoHandleT *handle, ARdouble matC2R[3][4])
Definition: icpStereoHandle.c:133
int icpStereoSetMatXcr2Ur(ICPStereoHandleT *handle, ARdouble matXcr2Ur[3][4])
Definition: icpStereoHandle.c:111
int icpStereoGetBreakLoopErrorThresh(ICPStereoHandleT *handle, ARdouble *breakLoopErrorThresh)
Definition: icpStereoHandle.c:220
int icpStereoGetMaxLoop(ICPStereoHandleT *handle, int *maxLoop)
Definition: icpStereoHandle.c:212
int icpStereoGetMatXcr2Ur(ICPStereoHandleT *handle, ARdouble matXcr2Ur[3][4])
Definition: icpStereoHandle.c:179
int icpPointRobust(ICPHandleT *handle, ICPDataT *data, ARdouble initMatXw2Xc[3][4], ARdouble matXw2Xc[3][4], ARdouble *err)
Definition: icpPointRobust.c:54
int icpPoint(ICPHandleT *handle, ICPDataT *data, ARdouble initMatXw2Xc[3][4], ARdouble matXw2Xc[3][4], ARdouble *err)
Definition: icpPoint.c:49
int icpStereoSetMaxLoop(ICPStereoHandleT *handle, int maxLoop)
Definition: icpStereoHandle.c:144
int icpGetBreakLoopErrorRatioThresh(ICPHandleT *handle, ARdouble *breakLoopErrorThresh)
Definition: icpHandle.c:152
int icpSetMaxLoop(ICPHandleT *handle, int maxLoop)
Definition: icpHandle.c:91
int icpStereoPointRobust(ICPStereoHandleT *handle, ICPStereoDataT *data, ARdouble initMatXw2Xc[3][4], ARdouble matXw2Xc[3][4], ARdouble *err)
Definition: icpStereoPointRobust.c:50
int icpDeleteHandle(ICPHandleT **handle)
Definition: icpHandle.c:68
ICPStereoHandleT * icpStereoCreateHandle(const ARdouble matXcl2Ul[3][4], const ARdouble matXcr2Ur[3][4], const ARdouble matC2L[3][4], const ARdouble matC2R[3][4])
Definition: icpStereoHandle.c:46
int icpSetBreakLoopErrorThresh2(ICPHandleT *handle, ARdouble breakLoopErrorThresh2)
Definition: icpHandle.c:115
ICP_EXTERN int icpGetInlierProbability(ICPHandleT *handle, ARdouble *inlierProbability)
Definition: icpHandle.c:179
int icpStereoGetMatC2L(ICPStereoHandleT *handle, ARdouble matC2L[3][4])
Definition: icpStereoHandle.c:190
int icpStereoSetMatXcl2Ul(ICPStereoHandleT *handle, ARdouble matXcl2Ul[3][4])
Definition: icpStereoHandle.c:100
int icpSetMatXc2U(ICPHandleT *handle, const ARdouble matXc2U[3][4])
Definition: icpHandle.c:78
int icpStereoGetInlierProbability(ICPStereoHandleT *handle, ARdouble *inlierProbability)
Definition: icpStereoHandle.c:236
int icpGetInitXw2Xc_from_PlanarData(ARdouble matXc2U[3][4], ICP2DCoordT screenCoord[], ICP3DCoordT worldCoord[], int num, ARdouble initMatXw2Xc[3][4])
Definition: icpUtil.c:72
int icpSetBreakLoopErrorThresh(ICPHandleT *handle, ARdouble breakLoopErrorThresh)
Definition: icpHandle.c:99
int icpStereoSetBreakLoopErrorThresh2(ICPStereoHandleT *handle, ARdouble breakLoopErrorThresh2)
int icpSetInlierProbability(ICPHandleT *handle, ARdouble inlierProbability)
Definition: icpHandle.c:168
int icpGetMatXc2U(ICPHandleT *handle, ARdouble matXc2U[3][4])
Definition: icpHandle.c:123
int icpStereoSetBreakLoopErrorThresh(ICPStereoHandleT *handle, ARdouble breakLoopErrorThresh)
Definition: icpStereoHandle.c:152
int icpStereoGetBreakLoopErrorRatioThresh(ICPStereoHandleT *handle, ARdouble *breakLoopErrorThresh)
Definition: icpStereoHandle.c:228
int icpGetMaxLoop(ICPHandleT *handle, int *maxLoop)
Definition: icpHandle.c:136
int icpGetBreakLoopErrorThresh2(ICPHandleT *handle, ARdouble *breakLoopErrorThresh2)
Definition: icpHandle.c:160
ICPHandleT * icpCreateHandle(const ARdouble matXc2U[3][4])
Definition: icpHandle.c:46
int icpSetBreakLoopErrorRatioThresh(ICPHandleT *handle, ARdouble breakLoopErrorThresh)
Definition: icpHandle.c:107
int icpStereoGetBreakLoopErrorThresh2(ICPStereoHandleT *handle, ARdouble *breakLoopErrorThresh2)
int icpStereoDeleteHandle(ICPStereoHandleT **handle)
Definition: icpStereoHandle.c:89
int icpStereoSetBreakLoopErrorRatioThresh(ICPStereoHandleT *handle, ARdouble breakLoopErrorThresh)
Definition: icpStereoHandle.c:160
int icpStereoPoint(ICPStereoHandleT *handle, ICPStereoDataT *data, ARdouble initMatXw2Xc[3][4], ARdouble matXw2Xc[3][4], ARdouble *err)
Definition: icpStereoPoint.c:48
int icpGetBreakLoopErrorThresh(ICPHandleT *handle, ARdouble *breakLoopErrorThresh)
Definition: icpHandle.c:144
int icpStereoSetMatC2L(ICPStereoHandleT *handle, ARdouble matC2L[3][4])
Definition: icpStereoHandle.c:122
#define ICP_EXTERN
Definition: icpCore.h:57
Definition: icpCore.h:71
Definition: icpCore.h:88
Definition: icpCore.h:82
Definition: icpCore.h:76
Definition: icpCore.h:93
Definition: icp.h:55
ICP2DCoordT * screenCoord
Definition: icp.h:56
ICP3DCoordT * worldCoord
Definition: icp.h:57
int num
Definition: icp.h:58
Definition: icp.h:75
ARdouble breakLoopErrorThresh
Definition: icp.h:78
int maxLoop
Definition: icp.h:77
ARdouble breakLoopErrorRatioThresh
Definition: icp.h:79
ARdouble inlierProb
Definition: icp.h:81
ARdouble breakLoopErrorThresh2
Definition: icp.h:80
Definition: icp.h:61
ICP2DCoordT * screenCoordR
Definition: icp.h:65
int numR
Definition: icp.h:67
ICP3DCoordT * worldCoordR
Definition: icp.h:66
ICP2DCoordT * screenCoordL
Definition: icp.h:62
ICP3DCoordT * worldCoordL
Definition: icp.h:63
int numL
Definition: icp.h:64
Definition: icp.h:84
ARdouble breakLoopErrorThresh
Definition: icp.h:90
ARdouble inlierProb
Definition: icp.h:93
int maxLoop
Definition: icp.h:89
ARdouble breakLoopErrorThresh2
Definition: icp.h:92
ARdouble breakLoopErrorRatioThresh
Definition: icp.h:91