Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ExamplePMatrixBase.cpp
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 /**
26  @example ExamplePMatrixBase.cpp
27  @relates PMatrixBase
28  @brief Example PMatrixBase usage
29  @ingroup g_examples
30  @author MIP
31 */
32 
33 #include <Base/Geometry/PMatrixBase.hh>
34 
35 using namespace BIAS;
36 using namespace std;
37 
38 int main()
39 {
40  PMatrixBase P("497.9905512 1.440355214e-05 164.9405861 -1502.278858 79.17947938 415.6922058 226.56256 -2063.531797 0.3299144974 8.243640548e-08 0.9440108179 -8.59805053 ");
41 
42  PMatrixBase P2("286.845486 2.8e-05 164.940829 -1502.281035 -79.17938 415.692207 226.562599 -2063.53244 -0.329914 0 0.944011 -8.598052");
43 
44  HomgPoint3D p3d(3.664444685, -9.783601761, 26.40313911);
45 
46  HomgPoint2D p2d;
47 
48  p2d=P * p3d;
49 
50  p2d.Homogenize();
51 
52  cerr <<"p2d: "<<p2d<<endl;
53 
54 
55  p2d=P2 * p3d;
56 
57  p2d.Homogenize();
58 
59  cerr <<"p2d: "<<p2d<<endl;
60 
61  return 0;
62 
63 }
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
Definition: HomgPoint2D.hh:67
HomgPoint2D & Homogenize()
homogenize class data member elements to W==1 by divison by W
Definition: HomgPoint2D.hh:215
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
Definition: HomgPoint3D.hh:61
describes a projective 3D -&gt; 2D mapping in homogenous coordinates
Definition: PMatrixBase.hh:74