Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Projection.hh
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 #ifndef __BIAS_Projection_hh__
27 #define __BIAS_Projection_hh__
28 
29 #include <bias_config.h>
30 
31 #include <math.h>
32 
33 #include <Base/Debug/Debug.hh>
34 #include <Base/Math/Matrix4x4.hh>
35 #include <Base/Math/Vector4.hh>
36 #include <Base/Geometry/HomgPoint3D.hh>
37 #include <Base/Geometry/Quaternion.hh>
38 #include <Geometry/Pose.hh>
39 #include <Geometry/PMatrix.hh>
40 #include <Geometry/ProjectionParametersBase.hh>
41 #include <Geometry/ProjectionParametersPerspective.hh>
42 #include <Geometry/ProjectionParametersPerspectiveDepth.hh>
43 #include <Geometry/ProjectionParametersSpherical.hh>
44 #include <Geometry/ProjectionParametersSphericalFast.hh>
45 #include <Geometry/ProjectionParametersSphericalSimple.hh>
46 #include <Geometry/ProjectionParametersCylindric.hh>
47 #include <Geometry/ProjectionParametersProjective.hh>
48 #include <Geometry/ProjectionParametersIO.hh>
49 #ifndef WIN32
50 #ifdef BUILD_DYNAMIC_LOAD_PROJECTION
51 #include <Geometry/ProjectionParametersDynamicLoad.hh>
52 #endif
53 #endif
54 #include <Geometry/ProjectionParametersFactory.hh>
55 
56 #ifdef BIAS_HAVE_XML2
57 # include <Base/Common/XMLBase.hh>
58 #endif // BIAS_HAVE_XML2
59 
60 
61 namespace BIAS {
62 
63  /**
64  * @class Projection
65  * @ingroup g_geometry
66  * @brief This class hides the underlying projection model, like projection matrix,
67  * spherical camera, lens distortion. Read and write projections with XMLRead(filename) and XMLWrite(filename)
68  * @author MIP
69  */
70  class BIASGeometry_EXPORT Projection
71 #ifdef BIAS_HAVE_XML2
72  : public XMLBase
73 #endif // BIAS_HAVE_XML2
74  {
75  public:
76  /** \brief constructor */
77  Projection();
78  /** \brief copy constructor */
79  Projection(const Projection& p);
80  /** \brief constructor for initialization with a ProjectionParametersBase object*/
81  explicit Projection(const ProjectionParametersBase& p) ;
82  /** \brief destructor for initialization with a ProjectionParametersBase object*/
83  virtual ~Projection();
84  /** \brief operator=*/
85  const Projection& operator=(const Projection& p) {
86  // delete old parameters if any
87  for (unsigned int i=0; i<vecParameters_.size(); i++) {
88  delete vecParameters_[i];
89  }
90  vecParameters_.clear();
91 
92  // copy new parameters
93  vecParameters_.resize(p.vecParameters_.size());
94  for (unsigned int i=0; i<p.vecParameters_.size(); i++)
95  vecParameters_[i] = p.vecParameters_[i]->Clone();
96  return *this;
97  }
98 
99  /**
100  @brief Create a perspective camera and add to projection
101  @param pose the pose to use
102  @param K the KMatrix of the new camera
103  @param width width of the new camera
104  @param height height of the new camera
105  @param radDistType the radial distortion type (DISTYPE_DEF or DISTYPE_BROWN)
106  @param UndistortionCoefficients std::vector containing the distortion parameters
107  @author ischiller
108  @date 09/08
109  */
110  void CreatePerspective(const BIAS::Pose& pose,
111  const BIAS::KMatrix& K,
112  int width, int height,
114  const std::vector<double>&
115  UndistortionCoefficients =
116  std::vector<double>(4, 0.0));
117 
118  /** @brief push_back a new sperical cam to this
119  @author Jan Woetzel */
120  void CreateSpherical( const Pose& pose,
121  const unsigned int width, const int height,
122  const double principalX, const double principalY,
123  const double radius,
124  const double aspect=1.0 );
125 
126  /**
127  @brief Add a camera to the projection,the coordinates of the pose
128  are given in absolute Coordinates, they are transformed to
129  relative coordinates to the first camera internally
130  @param ppB Pointer to ProjectionParametersBase,
131  the Object is copied and stored in vecParameters_
132  @author ischiller
133  @date 07/07
134  */
135  void AddAbsoluteCamera(ProjectionParametersBase *ppb);
136 
137  /**
138  @brief Add a camera to the projection,the coordinates of the pose
139  are given in relative Coordinates, first cam is origin
140  @param ppB Pointer to ProjectionParametersBase,
141  the Object is copied and stored in vecParameters_
142  @author ischiller
143  @date 07/07
144  */
145  void AddRelativeCamera(ProjectionParametersBase *ppb);
146 
147 
148 #ifdef BIAS_HAVE_XML2
149  /**
150  * @brief Reads a camera data XML file and constructs the
151  * ProjectionParametersBase-pointer, using the ProjectionParametersIO
152  * and the CameraParameter file format.
153  * @param filename Name of the XML parameter file */
154  int ReadFromCamParamFile(const std::string& filename, const bool silent = false);
155 
156 #endif // BIAS_HAVE_XML2
157 
158  /** @brief read BBC's FreeD data from file and constructs a perspective
159  projection (may have radial distortion)
160  @author koeser
161  @date 11/2006 */
162  int ReadFromBBC(const std::string& filename, const bool silent = false);
163 
164  /** @brief initializes projection from cameradata object
165  @author streckel (separated by koeser 11/06) */
166  int InitFromCameraData(const std::vector<CameraData>& vcd);
167 
168  /** @brief convenience wrapper which tries to read different formats
169  @author bartczak, koeser */
170  virtual int Load(const std::string& filename);
171 
172  /** \brief Determine whether the Projection is Empty
173  * \return true if Projection is empty, false otherwise */
174  bool IsEmpty() const { return (vecParameters_.size()==0);}
175 
176  /** \brief Determine number of ProjectionParameterBase pointers in Projection
177  * \return The number of ProjectionParameterBase and derived objects in Projection */
178  inline unsigned int Size() const
179  {
180  return (unsigned int)vecParameters_.size();
181  }
182 
183  /** \brief Delete all ProjectionParameterBase objects contained in Projection */
184  inline void Clear()
185  {
186  for (unsigned int i=0; i<vecParameters_.size(); i++) {
187  delete vecParameters_[i];
188  }
189  vecParameters_.clear();
190  }
191 
192  /** @brief const parameter access function
193  * @return NULL on error, pointer to parameters otherwise */
194  const ProjectionParametersBase* GetParameters(unsigned int cam = 0) const {
195  if(cam >= vecParameters_.size()){
196  BIASWARN("No parameters for camera with index:"<<cam);
197  return NULL;
198  }
199  return vecParameters_[cam];
200  }
201 
202  /** @brief Non-const access function to parameters
203  * @return NULL on error, pointer to parameters otherwise */
204  ProjectionParametersBase* GetParameters(unsigned int cam = 0) {
205  if(cam >= vecParameters_.size()){
206  BIASWARN("No parameters for camera with index:"<<cam);
207  return NULL;
208  }
209  return vecParameters_[cam];
210  }
211 
212  /**
213  * @brief Allocates memory for parameters base type and returns pointer to it!
214  * @attention The responsiblity to free associated memory is passed to
215  * recipient!
216  * @return NULL on error, pointer to parameters otherwise
217  */
219  if(cam >= vecParameters_.size()){
220  BIASWARN("No parameters for camera with index:"<<cam);
221  return NULL;
222  }
223  ProjectionParametersBase* clone = vecParameters_[cam]->Clone();
224  if(cam!=0) {
225  Pose rigPose = vecParameters_[0]->GetPose();
226  Pose absolutePose;
227  rigPose.ConcatenateLocalTransform(clone->GetPose(), absolutePose);
228  clone->SetPose(absolutePose);
229  }
230  return clone;
231 
232  }
233 
234  /** @brief return Center of camera with index cam.
235  If cam>0 this is a relative pose in the coordinate system of cam 0 */
236  inline Vector3<double> GetC(unsigned int cam = 0) const {
237  BIASASSERT(cam<vecParameters_.size() && vecParameters_[cam]);
238  return vecParameters_[cam]->GetC();
239  }
240 
241  /** @brief return RMatrix of camera with index cam.
242  If cam>0 this is a relative pose in the coordinate system of cam 0 */
243  inline RMatrix GetR(unsigned int cam = 0) const {
244  BIASASSERT(cam<vecParameters_.size() && vecParameters_[cam]);
245  return vecParameters_[cam]->GetR();
246  }
247 
248  /** @brief return RMatrix of camera with index cam.
249  If cam>0 this is an absolute rotation in the global coordinate system */
250  inline RMatrix GetAbsoluteR(unsigned int cam = 0) const {
251  BIASASSERT(cam<vecParameters_.size());
252  BIASASSERT(vecParameters_.size()>cam && vecParameters_[0] && vecParameters_[cam]);
253  if(cam>0)
254  return vecParameters_[0]->GetR() * vecParameters_[cam]->GetR();
255  else
256  return vecParameters_[cam]->GetR();
257  }
258 
259  /** @brief Return center of camera with index cam.
260  * If cam>0 this is an absolute position in the global coordinate system */
261  inline Vector3<double> GetAbsoluteC(unsigned int cam = 0) const {
262  BIASASSERT(cam<vecParameters_.size());
263  BIASASSERT(vecParameters_.size()>cam && vecParameters_[0] && vecParameters_[cam]);
264  if(cam>0)
265  return vecParameters_[0]->GetC() +
266  vecParameters_[0]->GetR() *vecParameters_[cam]->GetC();
267  else
268  return vecParameters_[0]->GetC();
269  }
270 
271  /** @brief return rotation quaternion of camera with index cam.
272  If cam>0 this is an absolute rotation in the global coordinate system */
273  inline Quaternion<double> GetAbsoluteQ(unsigned int cam = 0) const {
274  BIASASSERT(cam<vecParameters_.size());
275  BIASASSERT(vecParameters_.size()>cam && vecParameters_[0] && vecParameters_[cam]);
276  if(cam>0) {
277  return vecParameters_[0]->GetQ() * vecParameters_[cam]->GetQ();
278  }
279  else
280  return vecParameters_[0]->GetQ();
281  }
282 
283  /** @brief return rotation quaternion of camera with index cam
284  if cam>0 this is a relative pose in the coordinate system of cam 0 */
285  BIAS::Quaternion<double> GetQ(unsigned int cam = 0) const;
286 
287  /** @brief Obtain the external camera parameters
288  * @return Const reference to external pose parameters as Matrix3x4<double>
289  * @attention The Externals of cameras with cam >0 may be incorrect
290  * @author koeser
291  * @date 02/2006 */
292  inline Matrix3x4<double> GetExternals(unsigned int cam = 0) const {
293  BIASASSERT(vecParameters_.size()>cam && vecParameters_[cam]);
294  BIASASSERT(cam<vecParameters_.size());
295  if (cam==0) {
296  return vecParameters_[cam]->GetExternals();
297  } else {
298  BIASWARN("Externals of relative camera may be incorrect!");
299  return vecParameters_[cam]->GetExternals();
300  }
301  }
302 
303  /** @brief Get the Pose covariance
304  * @attention The covariance of cameras with cam >0 may be incorrect
305  * @return The covariance Matrix */
306  virtual Matrix<double> GetCov(unsigned int cam = 0) const {
307  BIASASSERT(cam<vecParameters_.size() && vecParameters_[cam]);
308  if (cam==0) return vecParameters_[cam]->GetCov();
309  else {
310  BIASWARN("Not yet defined behaviour!");
311  return vecParameters_[cam]->GetCov();
312  }
313  }
314 
315  /** @brief return complete pose object.
316  If cam>0 this is a relative pose in the coordinate system of cam 0 */
317  virtual const Pose&
318  GetPose(unsigned int cam = 0) const {
319  BIASASSERT(cam<vecParameters_.size() && vecParameters_[cam]);
320  return vecParameters_[cam]->GetPose();
321  }
322 
323  /** @brief Set the Pose covariance */
324  virtual void SetCov(const Matrix<double>& Cov, unsigned int cam = 0) {
325  BIASASSERT(cam<vecParameters_.size() && vecParameters_[cam]);
326  vecParameters_[cam]->SetCov(Cov);
327  }
328 
329  /** @brief Set center of camera with index cam.
330  If cam>0 this is a relative pose in the coordinate system of cam 0 */
331  virtual void SetC(const Vector3<double>& C, unsigned int cam = 0) {
332  BIASASSERT(vecParameters_.size()>cam && vecParameters_[cam]);
333  vecParameters_[cam]->SetC(C);
334  }
335 
336  /** @brief Set rotation quaternion of camera with index cam.
337  If cam>0 this is a relative pose in the coordinate system of cam 0 */
338  virtual void SetQ(const Quaternion<double>& Q, unsigned int cam = 0) {
339  BIASASSERT(vecParameters_.size()>cam && vecParameters_[cam]);
340  vecParameters_[cam]->SetQ(Q);
341  }
342 
343  /** @brief Set rotation matrix of camera with index cam.
344  If cam>0 this is a relative pose in the coordinate system of cam 0 */
345  virtual void SetR(const RMatrix& R, unsigned int cam = 0) {
346  BIASASSERT(vecParameters_.size()>cam && vecParameters_[cam]);
347  vecParameters_[cam]->SetR(R);
348  }
349 
350  /** @brief Set the Pose of the camera with index cam.
351  * If cam>0 this is a relative pose in the coordinate system of cam 0 */
352  virtual void SetPose(const BIAS::Pose pose, unsigned int cam = 0) {
353  BIASASSERT(vecParameters_.size()>cam && vecParameters_[cam]);
354  vecParameters_[cam]->SetPose(pose);
355  }
356 
357  /** @brief Determine whether the pose is valid or not.
358  * @return true if pose valid, false otherwise. */
359  inline bool PoseValid(unsigned int cam = 0) const {
360  if (vecParameters_.size()<=cam || !vecParameters_[cam]) return false;
361  return vecParameters_[cam]->PoseValid();
362  }
363 
364  /** @brief returns the 2d projection of X in camera cam,
365  * where X is given in the global coordinate frame (not the rig)
366  * (needs HomgPoint3D to map points at infinity)
367  * @return A HomgPoint2D with the 2D positio nof the 3D point in the
368  * image of the camera. */
369  virtual HomgPoint2D Project(const HomgPoint3D &X, unsigned int cam = 0,
370  bool IgnoreDistortion = false) const;
371 
372  /** @brief Checks if 3D point projects into specified image and returns
373  * belonging 2D image point.
374  * @param X assumes homogenized point!
375  * @author bartczak
376  * @return true if the point projects in the image of the camera,
377  * false if point does not project into camera image. */
378  virtual bool DoesPointProjectIntoImage(const BIAS::HomgPoint3D& X,
379  BIAS::HomgPoint2D& x,
380  unsigned int cam = 0,
381  bool IgnoreDistortion = false) const;
382 
383  /**
384  * \brief Checks whether extrinsic parameters are different
385  * \return false if all params in argument and all params (*this)
386  * have same extrinsics. */
387  virtual const bool DoExtrinsicsDiffer(const BIAS::Projection &p) const;
388 
389  /**
390  * \brief Checks whether intrinsic parameters are different
391  * \return false if all params in argument and all params in (*this)
392  * have same intrinsics */
393  virtual const bool DoIntrinsicsDiffer(const BIAS::Projection &p) const;
394 
395 
396  /** @brief calculates the viewing ray in the global coordinate frame
397  (not the rig) from the camera center which belongs to the given image
398  position. The resulting vector3 may have any length.
399  @return Vector3<double> with ray parameters. */
400  void UnProjectToRay(const HomgPoint2D& pos, Vector3<double>& origin,
401  Vector3<double>& rayDir,
402  unsigned int cam = 0,
403  bool IgnoreDistortion = false) const;
404 
405  /** @brief calculates the viewing ray in the global coordinate frame
406  (not the rig) from the camera center which belongs to the given image
407  position. The resulting vector3 may have any length.
408  @return Vector3<double> with ray parameters. */
409  void UnProjectToRay(const HomgPoint2D& pos,
410  Vector3<double>& rayDir,
411  unsigned int cam = 0,
412  bool IgnoreDistortion = false) const;
413 
414  /** @brief calculates a 3D point in
415  the global (not the rig) coordinate system, which
416  belongs to the image position pos with distance depth to the
417  camera center of cam. */
418  Vector3<double> UnProjectToPoint(const HomgPoint2D& pos,
419  double depth,
420  unsigned int cam = 0,
421  bool IgnoreDistortion = false) const;
422 
423  /** @brief calculates a 3D point in
424  a local camera coordinate system specified by camSystem, which
425  belongs to the image position pos in cam with distance depth to the
426  camera center cam.
427  @author koeser */
428  Vector3<double> UnProjectToPointLocal(const HomgPoint2D& pos,
429  const double& depth,
430  unsigned int camSystem = 0,
431  unsigned int cam = 0,
432  bool IgnoreDistortion = false) const;
433 
434 
435  /** @brief calculate 3D point and associated covariance by unprojection
436  @author woelk 03/2006 */
437  Matrix3x3<double> UnProjectToCovLocal(const HomgPoint2D& pos,
438  const Matrix3x3<double>& cov2D,
439  const double& depth,
440  unsigned int camSystem = 0,
441  unsigned int cam = 0,
442  bool IgnoreDistortion = false,
443  bool Normalize = false) const;
444 
445  /** @brief calculates a 3D ray in
446  a local camera coordinate system specified by camSystem, which
447  belongs to the image position pos in cam. */
448  void UnProjectToRayLocal(const HomgPoint2D& pos, Vector3<double>& origin,
449  Vector3<double>& rayDir,
450  unsigned int camSystem = 0,
451  unsigned int cam = 0,
452  bool IgnoreDistortion = false) const;
453 
454 #ifdef BIAS_HAVE_XML2
455  /**@brief specialization of XML block name function for BIAS::Projection.
456  * returns the xml class name Projection */
457  virtual int XMLGetClassName(std::string& TopLevelTag,
458  double& Version) const;
459 
460  /** @brief specialization of XML write function for BIAS::Projection.
461  * Called if the function XMLWrite is called.*/
462  virtual int XMLOut(const xmlNodePtr Node, XMLIO& XMLObject) const;
463 
464  /** @brief specialization of XML read function for BIAS::Projection.
465  * Called if the function XMLRead is called.*/
466  virtual int XMLIn(const xmlNodePtr Node, XMLIO& XMLObject);
467 #endif // BIAS_HAVE_XML2
468 
469  /** @brief adapt internal params to resampled image
470  @param ratio 2.0 = downsample, 0.5 = upsample */
471  inline void Rescale(float ratio, unsigned int cam = 0) {
472  BIASASSERT(cam < vecParameters_.size());
473  BIASASSERT(vecParameters_[cam]!=NULL);
474  vecParameters_[cam]->Rescale(ratio);
475  }
476 
477  /** \brief Set the identifier of the Projection such as a name */
478  inline void SetIdentifier(const std::string& identString) {
479  identifier_ = identString;
480  }
481 
482  /** \brief Return the identifier of the Projection such as a name. */
483  inline std::string GetIdentifier() const {
484  return identifier_;
485  }
486 
487  /** \brief The outstream operator, used in XMLOut, etc */
488  friend std::ostream& operator<<(std::ostream &os, const Projection& p);
489 
490  protected:
491 
492  /// the intrinsics (like K, ...) of the camera usually only one
493  /// only in rig mode there may be many, in that case vecIntrinsics[0]
494  /// holds the external pose while the others hold the internal pose
495  /// (pose in the coordinate system of the first camera)
496  std::vector<ProjectionParametersBase* > vecParameters_;
497 
498  /** Multifunctional identifier. */
499  std::string identifier_;
500 
501  };
502 
503  inline std::ostream& operator<<(std::ostream &os, const Projection& p) {
504  os <<"Identifier: """<<p.GetIdentifier()<<"\n";
505  os <<"vecParameters_.size(): "<<p.Size()<<"\n";
506  std::vector<ProjectionParametersBase* >::const_iterator it;
507  for (it = p.vecParameters_.begin(); it!=p.vecParameters_.end(); it++){
508 #ifndef WIN32
509 #ifdef BUILD_DYNAMIC_LOAD_PROJECTION
510  // check for dynamic projection first because writing base parameters to the strem
511  // does not make any sense
512  if ((dynamic_cast<ProjectionParametersDynamicLoad*>(*it))!=NULL){
513  os << *(dynamic_cast<ProjectionParametersDynamicLoad*>(*it));
514  continue;
515  }
516 #endif
517 #endif
518  //ostream of ProjectionParametersBase
519  os<< **it;
520  //check which type the current parameters are by dynamic cast and call ostream operator of it.
521  //ProjectionParametersPerspectiveDepth has to be checked first, because it is derived from ProjectionParametersPerspective
522  if ((dynamic_cast<ProjectionParametersPerspectiveDepth *>(*it))!=NULL)
523  os <<*(dynamic_cast<ProjectionParametersPerspectiveDepth *>(*it));
524  else if ((dynamic_cast<ProjectionParametersPerspective *>(*it))!=NULL)
525  os <<*(dynamic_cast<ProjectionParametersPerspective *>(*it));
526  else if ((dynamic_cast<ProjectionParametersSpherical*>(*it))!=NULL)
527  os << *(dynamic_cast<ProjectionParametersSpherical *>(*it));
528  else if ((dynamic_cast<ProjectionParametersSphericalFast*>(*it))!=NULL)
529  os << *(dynamic_cast<ProjectionParametersSphericalFast *>(*it));
530  else if ((dynamic_cast<ProjectionParametersSphericalSimple*>(*it))!=NULL)
531  os << *(dynamic_cast<ProjectionParametersSphericalSimple*>(*it));
532  else if ((dynamic_cast<ProjectionParametersProjective*>(*it))!=NULL)
533  os << *(dynamic_cast<ProjectionParametersProjective*>(*it));
534  }
535  return os;
536  }
537 
538 
539 } // end namespace
540 
541 
542 #endif //__BIAS_Projection_hh__
543 
Quaternion< double > GetAbsoluteQ(unsigned int cam=0) const
return rotation quaternion of camera with index cam.
Definition: Projection.hh:273
bool PoseValid(unsigned int cam=0) const
Determine whether the pose is valid or not.
Definition: Projection.hh:359
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
Definition: HomgPoint2D.hh:67
std::string identifier_
Multifunctional identifier.
Definition: Projection.hh:499
virtual const Pose & GetPose(unsigned int cam=0) const
return complete pose object.
Definition: Projection.hh:318
ProjectionParametersBase * GetParameters(unsigned int cam=0)
Non-const access function to parameters.
Definition: Projection.hh:204
virtual ProjectionParametersBase * Clone() const =0
Covariant virtual copy constructor used in BIAS::Projection.
Matrix3x4< double > GetExternals(unsigned int cam=0) const
Obtain the external camera parameters.
Definition: Projection.hh:292
std::string GetIdentifier() const
Return the identifier of the Projection such as a name.
Definition: Projection.hh:483
std::vector< ProjectionParametersBase * > vecParameters_
the intrinsics (like K, ...) of the camera usually only one only in rig mode there may be many...
Definition: Projection.hh:496
void Rescale(float ratio, unsigned int cam=0)
adapt internal params to resampled image
Definition: Projection.hh:471
void Clear()
Delete all ProjectionParameterBase objects contained in Projection.
Definition: Projection.hh:184
virtual void SetC(const Vector3< double > &C, unsigned int cam=0)
Set center of camera with index cam.
Definition: Projection.hh:331
virtual void SetPose(const BIAS::Pose pose)
Set pose from pose object.
3D rotation matrix
Definition: RMatrix.hh:49
Represents 3d pose transformations, parametrized as Euclidean translation and unit quaternion orienta...
Definition: Pose.hh:73
virtual void SetR(const RMatrix &R, unsigned int cam=0)
Set rotation matrix of camera with index cam.
Definition: Projection.hh:345
virtual void SetPose(const BIAS::Pose pose, unsigned int cam=0)
Set the Pose of the camera with index cam.
Definition: Projection.hh:352
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
Definition: XMLIO.hh:72
const ProjectionParametersBase * GetParameters(unsigned int cam=0) const
const parameter access function
Definition: Projection.hh:194
This class hides the underlying projection model, like projection matrix, spherical camera...
Definition: Projection.hh:70
const Projection & operator=(const Projection &p)
operator=
Definition: Projection.hh:85
Base class with interface for xml output.
Definition: XMLBase.hh:56
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
Definition: HomgPoint3D.hh:61
std::ostream & operator<<(std::ostream &os, const Array2D< T > &arg)
Definition: Array2D.hh:260
bool IsEmpty() const
Determine whether the Projection is Empty.
Definition: Projection.hh:174
virtual void SetCov(const Matrix< double > &Cov, unsigned int cam=0)
Set the Pose covariance.
Definition: Projection.hh:324
virtual Matrix< double > GetCov(unsigned int cam=0) const
Get the Pose covariance.
Definition: Projection.hh:306
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
Definition: KMatrix.hh:48
virtual void SetQ(const Quaternion< double > &Q, unsigned int cam=0)
Set rotation quaternion of camera with index cam.
Definition: Projection.hh:338
unsigned int Size() const
Determine number of ProjectionParameterBase pointers in Projection.
Definition: Projection.hh:178
void ConcatenateLocalTransform(const CoordinateTransform3D &localT, CoordinateTransform3D &res) const
Calculates transformation from global system of this instance to the local coordinate system of the g...
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
virtual const BIAS::Pose & GetPose() const
Return complete pose object.
Vector3< double > GetC(unsigned int cam=0) const
return Center of camera with index cam.
Definition: Projection.hh:236
void SetIdentifier(const std::string &identString)
Set the identifier of the Projection such as a name.
Definition: Projection.hh:478
ProjectionParametersBase * GetParameterCloneWithAbsolutePose(unsigned int cam=0) const
Allocates memory for parameters base type and returns pointer to it!
Definition: Projection.hh:218
RMatrix GetR(unsigned int cam=0) const
return RMatrix of camera with index cam.
Definition: Projection.hh:243
Vector3< double > GetAbsoluteC(unsigned int cam=0) const
Return center of camera with index cam.
Definition: Projection.hh:261
RMatrix GetAbsoluteR(unsigned int cam=0) const
return RMatrix of camera with index cam.
Definition: Projection.hh:250