Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TestProjectionParametersBase.cpp
1 /* This file is part of the BIAS library (Basic ImageAlgorithmS).
2 
3  Copyright (C) 2003-2009 (see file CONTACT for details)
4  Multimediale Systeme der Informationsverarbeitung
5  Institut fuer Informatik
6  Christian-Albrechts-Universitaet Kiel
7 
8  BIAS is free software; you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation; either version 2.1 of the License, or
11  (at your option) any later version.
12 
13  BIAS is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License
19  along with BIAS; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
21 
22 
23 /**
24  @file TestProjectionParametersBase.cpp
25  @brief Unit test for basic functionality of projection parameters.
26  @relates ProjectionParametersBase
27  @ingroup g_tests
28  @author MIP
29 */
30 
31 
32 #include <Base/Common/CompareFloatingPoint.hh>
33 #include <Geometry/CoordinateTransform3D.hh>
34 #include <Geometry/ProjectionParametersBase.hh>
35 #include <Geometry/ProjectionParametersBufferedRay.hh>
36 #include <Geometry/ProjectionParametersCylindric.hh>
37 #include <Geometry/ProjectionParametersFactory.hh>
38 #include <Geometry/ProjectionParametersGreatCircles.hh>
39 #include <Geometry/ProjectionParametersIO.hh>
40 #include <Geometry/ProjectionParametersPerspective.hh>
41 #include <Geometry/ProjectionParametersPerspectiveDepth.hh>
42 #include <Geometry/ProjectionParametersSpherical.hh>
43 #include <Geometry/ProjectionParametersSphericalSimple.hh>
44 #include <Geometry/ProjectionParametersZoom.hh>
45 #include <Base/Image/Image.hh>
46 #include <Base/Image/ImageIO.hh>
47 #include <Base/Math/Random.hh>
48 #include <string>
49 #include <vector>
50 
51 #ifdef BIAS_HAVE_XML2
52 #include <Base/Common/XMLIO.hh>
53 #endif
54 
55 using namespace BIAS;
56 using namespace std;
57 
58 
59 #define MAX_C 10.0
60 #define MAX_COORDS_3D 100.0
61 #define EPSILON 1e-9
62 
63 bool verbose = false;
64 
65 int main(int argc, char *argv[])
66 {
67  // Default values
68  const unsigned int width = 1000;
69  const unsigned int height = 1000;
70  const unsigned int radius = min(width,height);
71  const double phi = M_PI;
72  const double theta = M_PI;
73 
74  // Create instances of different projection parameters
75  ProjectionParametersPerspective pp_persp(width, height);
76  pp_persp.SetSimplePerspective(0.5*phi, width, height);
77  ProjectionParametersSpherical pp_sph(radius, theta, width, height);
79  pp_sph_smp(-0.5*phi, 0, phi/(double)radius,
80  theta/(double)radius, width, height);
82  pp_cyl(-10.0, 10.0, -0.5*phi, 0.5*phi, width, height);
83  ProjectionParametersBufferedRay pp_buf_ray(&pp_persp);
84  ProjectionParametersGreatCircles pp_gr_circ(width, height);
85  pp_gr_circ.SetInternals(-0.5*phi, 0.5*phi, 0, theta, width, height);
86  ProjectionParametersZoom pp_zoom(width, height);
87  std::vector<ProjectionParametersBase*> projections;
88  std::vector<std::string> names;
89  projections.push_back(&pp_persp);
90  names.push_back("ProjectionParametersPerspective");
91  projections.push_back(&pp_sph);
92  names.push_back("ProjectionParametersSpherical");
93  projections.push_back(&pp_sph_smp);
94  names.push_back("ProjectionParametersSphericalSimple");
95  projections.push_back(&pp_cyl);
96  names.push_back("ProjectionParametersCylindric");
97  projections.push_back(&pp_buf_ray);
98  names.push_back("ProjectionParametersBufferedRay");
99  projections.push_back(&pp_gr_circ);
100  names.push_back("ProjectionParametersGreatCircles");
101  projections.push_back(&pp_zoom);
102  names.push_back("ProjectionParametersZoom");
103  const unsigned int projs_num = projections.size();
104  BIASASSERT(projections.size() == names.size());
105 
106  // Create randomizer instance
107  Random random;
108 
109  // Test pose interface
110  cout << "Start pose interface tests...\n";
111  for (unsigned int proj_id = 0; proj_id < projs_num; proj_id++)
112  {
113  cout << "- Testing " << names[proj_id] << "... ";
114  if (verbose) cout << endl;
115 
116  ProjectionParametersBase *ppb = projections[proj_id];
117  Vector3<double> C(0,0,0);
118  Vector3<double> rad(0,0,0);
119  Quaternion<double> q(0,0,0,1);
121 
122  // create random pose
123  for (unsigned int k = 0; k < 3; k++)
124  C[k] = random.GetUniformDistributed (-MAX_C, MAX_C);
125  for (unsigned int k = 0; k < 3; k++)
126  rad[k] = random.GetUniformDistributed (-M_PI, M_PI);
127  q.SetXYZ(rad[0], rad[1], rad[2]);
128  R.SetFromQuaternion(q);
129  if (verbose) cout << " - created random pose C = " << C << ", q = "
130  << q << ", R = " << R << endl;
131 
132  // test initial validity
133  if (ppb->PoseValid() || ppb->CValid() || ppb->QValid()) {
134  cout << names[proj_id] << " pose should be initially invalid!\n";
135  BIASABORT;
136  }
137 
138  // set position and test validity
139  ppb->SetC(C);
140  if (!ppb->CValid()) {
141  cout << names[proj_id] << " CValid() failed after setting position!\n";
142  BIASABORT;
143  }
144  if (ppb->PoseValid()) {
145  cout << names[proj_id] << " pose should stay invalid after setting "
146  << "position only, but is valid!\n";
147  BIASABORT;
148  }
149 
150  // set orientation and test validity
151  ppb->SetQ(q);
152  if (!ppb->QValid()) {
153  cout << names[proj_id] << " QValid() failed after setting orientation!\n";
154  BIASABORT;
155  }
156  if (!ppb->PoseValid()) {
157  cout << names[proj_id] << " pose should be valid after setting position "
158  << "and orientation, but is invalid!\n";
159  BIASABORT;
160  }
161 
162  // test invalidate/validate
163  ppb->InvalidatePose();
164  if (ppb->PoseValid() || ppb->CValid() || ppb->QValid()) {
165  cout << names[proj_id] << " pose should be invalid after Invalidate()!\n";
166  BIASABORT;
167  }
168  ppb->ValidatePose();
169  if (!ppb->PoseValid() || !ppb->CValid() || !ppb->QValid()) {
170  cout << names[proj_id] << " pose should be valid after Validate()!\n";
171  BIASABORT;
172  }
173 
174  // test position and orientation
175  Vector3<double> test_C = ppb->GetC();
176  Quaternion<double> test_q = ppb->GetQ();
177  Quaternion<double> test_q_neg;
178  Matrix3x3<double> test_R = Matrix3x3<double>(ppb->GetR());
179  test_q.Multiply(-1.0, test_q_neg);
180  if (verbose) cout << " GetC() : " << C << ", GetQ() : " << q
181  << ", GetR() : " << R << endl;
182  if (!BIAS::Equal(C.Dist(test_C), 0.0, EPSILON)) {
183  cout << names[proj_id] << " position differs after Set()/Get()!\n";
184  cout << "expected C = " << C << "\tfound C = " << test_C << endl;
185  BIASABORT;
186  }
187  if (!BIAS::Equal(q.Dist(test_q), 0.0, EPSILON) &&
188  !BIAS::Equal(q.Dist(test_q_neg), 0.0, EPSILON)) {
189  cout << names[proj_id] << " orientation differs after Set()/Get()!\n";
190  cout << "expected q = +-" << q << "\tfound q = " << test_q << endl;
191  BIASABORT;
192  }
193  if (!BIAS::Equal((R-test_R).NormL2(), 0.0, EPSILON)) {
194  cout << names[proj_id] << " rotation matrix differs after Set()/Get()!\n";
195  cout << "expected R = " << R << "\tfound R = " << test_R << endl;
196  BIASABORT;
197  }
198 
199  // test pose parametrization
201  if (verbose) cout << " - GetPoseParametrization() : " << pose << endl;
202  test_C = pose.GetPosition();
203  test_q = pose.GetOrientation();
204  test_q.Multiply(-1.0, test_q_neg);
205  if (!BIAS::Equal(C.Dist(test_C), 0.0, EPSILON)) {
206  cout << names[proj_id] << " position differs from pose parametrization!\n";
207  cout << "expected C = " << C << "\tfound C = " << test_C << endl;
208  BIASABORT;
209  }
210  if (!BIAS::Equal(q.Dist(test_q), 0.0, EPSILON) &&
211  !BIAS::Equal(q.Dist(test_q_neg), 0.0, EPSILON)) {
212  cout << names[proj_id] << " orientation differs from pose parametrization!\n";
213  cout << "expected q = +-" << q << "\tfound q = " << test_q << endl;
214  BIASABORT;
215  }
216 
217  // test external parameters
218  Matrix3x4<double> T = ppb->GetExternals();
219  if (verbose) cout << " - GetExternals() : " << T << endl;
220  test_R.SetFromRowVectors(T.GetCol(0), T.GetCol(1), T.GetCol(2));
221  test_R.Mult(T.GetCol(3), test_C);
222  test_C.MultIP(-1.0);
223  if (!BIAS::Equal(C.Dist(test_C), 0.0, EPSILON)) {
224  cout << names[proj_id] << " position differs from externals!\n";
225  cout << "expected C = " << C << "\tfound C = " << test_C << endl;
226  BIASABORT;
227  }
228  if (!BIAS::Equal((R-test_R).NormL2(), 0.0, EPSILON)) {
229  cout << names[proj_id] << " rotation matrix differs from externals!\n";
230  cout << "expected R = " << R << "\tfound R = " << test_R << endl;
231  BIASABORT;
232  }
233 
234  // test intrinsics/extrinsics comparison
235  if (ppb->ProjectionParametersBase::DoIntrinsicsDiffer(ppb)) {
236  cout << names[proj_id] << " intrinsics differ from themselves!\n";
237  BIASABORT;
238  }
239  if (ppb->DoExtrinsicsDiffer(ppb)) {
240  cout << names[proj_id] << " extrinsics differ from themselves!\n";
241  BIASABORT;
242  }
243 
244  // test cloning
245  ProjectionParametersBase *ppb_copy = ppb->Clone();
246  if (ppb->ProjectionParametersBase::DoIntrinsicsDiffer(ppb_copy)) {
247  cout << names[proj_id] << " intrinsics differ after Clone()!\n";
248  BIASABORT;
249  }
250  if (ppb->DoExtrinsicsDiffer(ppb_copy)) {
251  cout << names[proj_id] << " extrinsics differ after Clone()!\n";
252  BIASABORT;
253  }
254  delete ppb_copy;
255 
256  if (verbose) cout << " -> "; cout << "OK\n";
257  }
258 
259 #ifdef BIAS_HAVE_XML2
260  // Test XMLIO interface
261  cout << "Start XML input/output tests...\n";
262 
263  for (unsigned int proj_id = 0; proj_id < projs_num; proj_id++)
264  {
265  cout << "- Testing " << names[proj_id] << "... ";
266  if (verbose) cout << endl;
267 
268  ProjectionParametersBase *ppb = projections[proj_id];
269  ProjectionParametersBase *ppb_copy = ppb->Clone();
270 
271  // write to xml file
272  std::string filename = "Test";
273  filename.append(names[proj_id]);
274  filename.append(".xml");
275  XMLIO xmlIO;
276  std::string xmlName;
277  double xmlVersion;
278  ppb->XMLGetClassName(xmlName, xmlVersion);
279  xmlNodePtr xmlNode = xmlIO.create(xmlName);
280  xmlIO.addAttribute(xmlNode, "Version", xmlVersion);
281  if (ppb->XMLOut(xmlNode, xmlIO) != 0) {
282  cout << names[proj_id] << " failed to export XML node with XMLOut()!\n";
283  BIASABORT;
284  }
285  if (xmlIO.write(filename) != 0) {
286  cout << names[proj_id] << " failed to write XML to " << filename << "!\n";
287  BIASABORT;
288  }
289 
290  // read from xml file
291  xmlNode = xmlIO.read(filename);
292  if (xmlNode == NULL) {
293  cout << names[proj_id] << " failed to read XML from " << filename << "!\n";
294  BIASABORT;
295  }
296  if (ppb_copy->XMLIn(xmlNode, xmlIO) != 0) {
297  cout << names[proj_id] << " failed to import XML node with XMLIn()!\n";
298  BIASABORT;
299  }
300 
301  // compare original and loaded projection parameters
302  if (ppb->ProjectionParametersBase::DoIntrinsicsDiffer(ppb_copy)) {
303  cout << names[proj_id] << " intrinsics differ after importing XML!\n";
304  BIASABORT;
305  }
306  if (ppb->DoExtrinsicsDiffer(ppb_copy)) {
307  cout << names[proj_id] << " extrinsics differ after importing XML!\n";
308  BIASABORT;
309  }
310  delete ppb_copy;
311 
312  if (verbose) cout << " -> "; cout << "OK\n";
313  }
314 #endif
315 
316  // Test projection interface
317  cout << "Start projection tests...\n";
318 
319  const unsigned int points_num = 100;
320  for (unsigned int proj_id = 0; proj_id < projs_num; proj_id++)
321  {
322  cout << "- Testing " << names[proj_id] << "... ";
323  if (verbose) cout << endl;
324 
325  ProjectionParametersBase *ppb = projections[proj_id];
326 
327  // skip for buffered ray projection parameters...
328  if (ppb == &pp_buf_ray || ppb == &pp_zoom) {
329  if (verbose) cout << " -> "; cout << "Skipped\n";
330  continue;
331  }
332 
333 /*
334  // obtain spherical viewing range for visibility check
335  CoordinateTransform3D sphericalReferenceFrame;
336  double minPhi, maxPhi, centerPhi, minTheta, maxTheta;
337  ppb->GetSphericalViewingRange(sphericalReferenceFrame,
338  minPhi, maxPhi, centerPhi, minTheta, maxTheta);
339  if (verbose) {
340  cout << "- min. phi = " << minPhi*180.0/M_PI << " degree" << endl
341  << "- max. phi = " << maxPhi*180.0/M_PI << " degree" << endl
342  << "- center phi = " << centerPhi*180.0/M_PI << " degree" << endl
343  << "- min. theta = " << minTheta*180.0/M_PI << " degree" << endl
344  << "- max. theta = " << maxTheta*180.0/M_PI << " degree" << endl;
345  }
346 */
347 
348  // create 2d/3d correspondences
349  std::vector<HomgPoint2D> points2D;
350  std::vector<HomgPoint3D> points3D;
351  HomgPoint2D point2D(0,0,1);
352  HomgPoint3D point3D(0,0,0,1);
353  Vector3<double> C(ppb->GetC());
354 
355  if (verbose) cout << "C = " << C << endl;
356  for (unsigned int i = 0; i < points_num; i++)
357  {
358  for (unsigned int k = 0; k < 3; k++)
359  point3D[k] =
360  random.GetUniformDistributed(C[k]-MAX_COORDS_3D, C[k]+MAX_COORDS_3D);
361  points3D.push_back(point3D);
362  point2D = ppb->Project(point3D);
363  if (BIAS_ISNAN(point2D[0]) || BIAS_ISNAN(point2D[1]) || BIAS_ISNAN(point2D[2]))
364  point2D.Set(0,0,0); // invalidate 2d point if it yields NaN
365  points2D.push_back(point2D);
366  if (verbose)
367  cout << "[" << i << "] " << points2D[i] << " <-> " << points3D[i] << endl;
368  }
369 
370  // test unprojection/reprojection
371  double depth, diff;
372  Vector3<double> ray3D, eucl3D, pos;
373  unsigned int invisible_num = 0;
374  for (unsigned int i = 0; i < points_num; i++)
375  {
376  // skip if point is not visible in image
377  point2D = points2D[i];
378  if (BIAS::Equal(point2D.NormL2(), 0.0)) {
379  invisible_num++;
380  continue;
381  }
382 
383  // compare unprojected 3D point
384  eucl3D = points3D[i].GetEuclidean();
385  depth = C.Dist(eucl3D);
386  ppb->UnProjectToRay(point2D, pos, ray3D);
387  point3D = ppb->UnProjectToPoint(point2D, depth);
388  diff = point3D.Dist(points3D[i]);
389  if (!BIAS::Equal(diff, 0.0, 1e-10)) {
390  cout << names[proj_id] << " unprojection yield inconsistent results!\n";
391  cout << "3D point " << points3D[i] << " -> 2D point " << point2D
392  << " -> 3D point " << point3D << " (difference = "
393  << diff << ")" << endl;
394  BIASABORT;
395  }
396 
397  // compare unprojected ray
398  diff = ray3D.Dist((eucl3D-C).GetNormalized());
399  if (!BIAS::Equal(diff, 0.0, 1e-12)) {
400  cout << names[proj_id] << " unprojection yield inconsistent results!\n";
401  cout << "3D ray " << (eucl3D-C).GetNormalized() << " -> 2D point "
402  << point2D << " -> 3D ray " << ray3D << " (difference = "
403  << diff << ")" << endl;
404  BIASABORT;
405  }
406 
407  // compare reprojected 2D point
408 /*
409  point2D = ppb->Project(BIAS::HomgPoint3D(ray3D+C));
410  diff = point2D.Dist(points2D[i]);
411  if (!BIAS::Equal(diff, 0.0, 1e-12)) {
412  cout << names[proj_id] << " reprojection yield inconsistent results!\n";
413  cout << "2D point " << points2D[i] << " -> 3D ray " << ray3D
414  << " -> 2D point " << point2D << " (difference = "
415  << diff << ")" << endl;
416  BIASABORT;
417  }
418 */
419  }
420 
421  if (verbose) cout << " -> ";
422  cout << "OK (" << invisible_num << " not visible)\n";
423  }
424 
425  // Create debug image for each projection parameters
426  cout << "Create debug images...\n";
427 
428  for (unsigned int proj_id = 0; proj_id < projs_num; proj_id++)
429  {
430  cout << "- Save debug image for " << names[proj_id] << "... ";
431 
432  ProjectionParametersBase *ppb = projections[proj_id];
433 
434  // run over image and save color-coded unprojected rays
435  HomgPoint2D point2D(0,0,1);
436  Vector3<double> ray3D;
437  Image<unsigned char> image(width, height, 3);
438  unsigned char *ptr = image.GetImageData();
439  for (unsigned int y = 0; y < height; y++) {
440  point2D[1] = y;
441  for (unsigned int x = 0; x < width; x++) {
442  point2D[0] = x;
443  ray3D = ppb->UnProjectToPointLocal(point2D, 1.0);
444  if (!BIAS::Equal(ray3D.NormL2(), 0.0, 1e-8))
445  ray3D.Normalize();
446  for (unsigned int k = 0; k < 3; k++)
447  *(ptr++) = (unsigned char)rint(255.0*fabs(ray3D[k]));
448  }
449  }
450 
451  // write debug image to file
452  std::string filename = "Test";
453  filename.append(names[proj_id]);
454  filename.append(".png");
455 
456  if (ImageIO::Save(filename, image) != 0)
457  cout << "failed!\n";
458  else
459  cout << "OK\n";
460  }
461 
462  return 0;
463 }
virtual BIAS::Vector3< double > GetC() const
Get projection center.
void addAttribute(const xmlNodePtr Node, const std::string &AttributeName, bool AttributeValue)
Add an attribute to a node.
Definition: XMLIO.cpp:156
This class maps image coords to rays which are buffered for fast lookup.
void Multiply(const T &scalar, Vector4< T > &dest) const
Multiplication with a scalar, storing results in destionation vector.
Definition: Vector4.hh:615
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
Definition: HomgPoint2D.hh:67
int write(const std::string &Filename, bool AutoAddCompressionSuffix=true) const
Write the whole tree that was constructed in memory to disk.
Definition: XMLIO.cpp:379
xmlNodePtr read(const std::string &Filename)
Read and parse an XML file from disk, DtD validation is not yet implemented.
Definition: XMLIO.cpp:416
projection parameters camera parameters which define the mapping between rays in the camera coordinat...
virtual int XMLOut(const xmlNodePtr Node, XMLIO &XMLObject) const
Specialization of XML write function.
camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
virtual HomgPoint3D UnProjectToPoint(const HomgPoint2D &pos, double depth, bool IgnoreDistortion=false) const
calculates a 3D point in the global (not the rig) coordinate system, which belongs to the image posit...
camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
virtual BIAS::Matrix3x4< double > GetExternals() const
Return cached 3x4 representation of external matrix [R|C].
virtual ProjectionParametersBase * Clone() const =0
Covariant virtual copy constructor used in BIAS::Projection.
xmlNodePtr create(const std::string &RootNodeName)
Create the base of a new XML-Tree in memory, already with a one and only root node.
Definition: XMLIO.cpp:88
Vector< T > GetCol(const int &col) const
return a copy of column &quot;col&quot;, zero based counting
Definition: Matrix.cpp:252
int SetFromQuaternion(const Quaternion< ROTATION_MATRIX_TYPE > &q)
Set rotation matrix from a quaternion.
Slim class bundeling pose parametrization and associated covariance matrix.
virtual void UnProjectToRay(const HomgPoint2D &pos, Vector3< double > &origin, Vector3< double > &direction, bool ignoreDistortion=false) const
Calculates the view ray, which belongs to the given position on the image plane, in global coordinate...
virtual int XMLIn(const xmlNodePtr Node, XMLIO &XMLObject)
Specialization of XML read function.
spherical camera that samples along big circles containig the H vector.
virtual HomgPoint2D Project(const HomgPoint3D &X, bool IgnoreDistortion=false) const
calculates the projection of a point in the world coordinate system to a pixel in the image plane of ...
3D rotation matrix
Definition: RMatrix.hh:49
double Dist(const Vector3< T > &vec) const
Return the euclidean distance of 2 vectors.
Definition: Vector3.hh:639
virtual void SetQ(const BIAS::Quaternion< double > &Q)
Set orientation from unit quaternion Q.
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
Definition: XMLIO.hh:72
void Mult(const Vector3< T > &argvec, Vector3< T > &destvec) const
matrix - vector multiplicate this matrix with Vector3, storing the result in destvec calculates: dest...
Definition: Matrix3x3.hh:302
virtual bool PoseValid() const
Check if current pose is valid.
void SetFromRowVectors(const BIAS::Vector3< T > &v0, const BIAS::Vector3< T > &v1, const BIAS::Vector3< T > &v2)
set this matrix from 3 vectors, each representating a row
Definition: Matrix3x3.cpp:226
virtual BIAS::PoseParametrization GetPoseParametrization() const
Return copy of pose parametrization object.
virtual bool QValid() const
Check if current orientation is valid.
virtual BIAS::RMatrix GetR() const
Get orientation as rotation matrix R.
virtual Vector3< double > UnProjectToPointLocal(const HomgPoint2D &pos, const double &depth, bool IgnoreDistortion=false) const
calculates a 3D point in the local camera coordinate system, which belongs to the image position pos ...
double Dist(const Vector4< T > &vec) const
Return the euclidean distance of 2 vectors.
Definition: Vector4.hh:519
virtual bool CValid() const
Check of current projection center is valid.
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
Definition: ImageIO.cpp:725
camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
Definition: HomgPoint3D.hh:61
bool Equal(const T left, const T right, const T eps)
comparison function for floating point values See http://www.boost.org/libs/test/doc/components/test_...
Vector3< PP_TYPE > GetPosition() const
returns the position (first 3 entries) part of the pose parametrization vector
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
void MultIP(const T &scalar)
Definition: Vector3.hh:327
virtual const bool DoExtrinsicsDiffer(const ProjectionParametersBase *p) const
virtual void ValidatePose()
Validate currently set pose.
virtual int XMLGetClassName(std::string &TopLevelTag, double &Version) const
Specialization of XML block name function.
Quaternion< PP_TYPE > GetOrientation() const
returns the quaternion (last 4 entries) part of the pose parametrization vector
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
void Set(const HOMGPOINT2D_TYPE &x, const HOMGPOINT2D_TYPE &y)
set elementwise with given 2 euclidean scalar values.
Definition: HomgPoint2D.hh:174
virtual BIAS::Quaternion< double > GetQ() const
Get orientation as unit quaternion.
virtual void SetC(const BIAS::Vector3< double > &C)
Set projection center.
Vector3< T > & Normalize()
normalize this vector to length 1
Definition: Vector3.hh:663
class for producing random numbers from different distributions
Definition: Random.hh:51
double NormL2() const
the L2 norm sqrt(a^2 + b^2 + c^2)
Definition: Vector3.hh:633
virtual void InvalidatePose()
Invalidate currently set pose.