librpp.h
Go to the documentation of this file.
1 /* ========================================================================
2  * PROJECT: ARToolKitPlus
3  * ========================================================================
4  *
5  * The robust pose estimator algorithm has been provided by G. Schweighofer
6  * and A. Pinz (Inst.of El.Measurement and Measurement Signal Processing,
7  * Graz University of Technology). Details about the algorithm are given in
8  * a Technical Report: TR-EMT-2005-01, available at:
9  * http://www.emt.tu-graz.ac.at/publications/index.htm
10  *
11  * Ported from MATLAB to C by T.Pintaric (Vienna University of Technology).
12  *
13  * Copyright of the derived and new portions of this work
14  * (C) 2006 Graz University of Technology
15  *
16  * This framework is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 2 of the License, or
19  * (at your option) any later version.
20  *
21  * This framework is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this framework; if not, write to the Free Software
28  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29  *
30  * For further information please contact
31  * Dieter Schmalstieg
32  * <schmalstieg@icg.tu-graz.ac.at>
33  * Graz University of Technology,
34  * Institut for Computer Graphics and Vision,
35  * Inffeldgasse 16a, 8010 Graz, Austria.
36  * ========================================================================
37  ** @author Thomas Pintaric
38  *
39  * $Id: librpp.h 162 2006-04-19 21:28:10Z grabner $
40  * @file
41  * ======================================================================== */
42 
43 #if defined(_MSC_VER) || defined(_WIN32_WCE)
44 
45 #ifdef LIBRPP_STATIC
46 # define LIBRPP_API
47 #elif LIBRPP_DLL
48 # ifdef LIBRPP_EXPORTS
49 # define LIBRPP_API __declspec(dllexport)
50 # else
51 # define LIBRPP_API __declspec(dllimport)
52 # endif
53 #else
54 # pragma error ("please define either LIBRPP_STATIC or LIBRPP_DLL")
55 #endif
56 
57 #else
58 // for linux
59 #define LIBRPP_API
60 
61 #endif
62 
63 typedef double rpp_float;
64 typedef double rpp_vec[3];
65 typedef double rpp_mat[3][3];
66 
68  rpp_mat &R,
69  rpp_vec &t,
70  const rpp_float cc[2],
71  const rpp_float fc[2],
72  const rpp_vec *model,
73  const rpp_vec *iprts,
74  const unsigned int model_iprts_size,
75  const rpp_mat R_init,
76  const bool estimate_R_init,
77  const rpp_float epsilon,
78  const rpp_float tolerance,
79  const unsigned int max_iterations);
80 /*
81 
82  [OUTPUT]
83 
84  err: squared reprojection error
85  R: rotation matrix (iprts[n] = R*model[n]+t)
86  t: translation vector (iprts[n] = R*model[n]+t)
87 
88  [INPUT]
89 
90  cc: camera's principal point [x,y]
91  fc: camera's focal length [x,y]
92  model: 3d points [x,y,z]
93  iprts: 2d projections [x,y,1]
94 
95  model_iprts_size: number of 2d/3d point correspondences
96  R_init: initial estimate of the rotation matrix R
97  estimate_R_init: when true, the estimate in R_init is ignored
98  epsilon*: see below (default: 1E-8)
99  tolerance*: see below (default: 1E-5)
100  max_iterations*: max. number of iterations (0 = infinite)
101 
102  *) the following code fragment illustrates the use of epsilon,
103  tolerance and max_iterations:
104 
105  while((ABS(( old_err - new_err ) / old_err) > tolerance) &&
106  ( new_err > epsilon ) &&
107  ( max_iterations == 0 || iterations < max_iterations ))
108  {
109  NEW ITERATION
110  }
111 
112 */
double rpp_float
Definition: librpp.h:63
LIBRPP_API void robustPlanarPose(rpp_float &err, rpp_mat &R, rpp_vec &t, const rpp_float cc[2], const rpp_float fc[2], const rpp_vec *model, const rpp_vec *iprts, const unsigned int model_iprts_size, const rpp_mat R_init, const bool estimate_R_init, const rpp_float epsilon, const rpp_float tolerance, const unsigned int max_iterations)
Definition: librpp.cpp:71
double rpp_vec[3]
Definition: librpp.h:64
#define LIBRPP_API
Definition: librpp.h:59
double rpp_mat[3][3]
Definition: librpp.h:65


tuw_artoolkitplus
Author(s): Markus Bader
autogenerated on Sun Sep 4 2016 03:24:33