Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Covariance3Dto2DHomg.hh
1 #ifndef _Covariance3Dto2DHomg_hh_
2 #define _Covariance3Dto2DHomg_hh_
3 
4 #include <MathAlgo/UnscentedTransform.hh>
5 #include <Base/Geometry/KMatrix.hh>
6 #include <Base/Geometry/PMatrixBase.hh>
7 
8 namespace BIAS {
9  class PoseParametrization;
10  class HomgPoint2D;
11  class HomgPoint2DCov;
12  class HomgPoint3D;
13  class HomgPoint3DCov;
14  template <class T> class Matrix;
15  template <class T> class Vector;
16 
17 #define D_C3DT2D_COV 0x00000100
18 
19  /** @class Covariance3Dto2DHomg
20  @brief Projection of 3D points with uncertainties covariances into the
21  2d image plane taking the camera pose uncertainty into account.
22 
23  Given a point in 3D with uncertainty represented/approximated by a
24  multivariate normal distribution (i.e. 3x3 covariance matrix).
25  Given further a camera pose (camer center and orientation).
26 
27  The algorithm computes the projection of the 3D point into the image
28  taking the camera pose uncertainty into account. The probabilty
29  distribution function in the image is represented by a 2D normal
30  distribution (i.e. a 2D covariance matrix).
31 
32  The resulting 2D covariance matrix is approximated using the unscented
33  transform. See UnscentedTransform for details.
34 
35  To use it instantiate this class with the appropriate parametrization
36  of the camera orientation. Currently Euler angles,
37  axis (norm 1) and angle, axis times angle and quaternion are supported.
38 
39  See Example/ExampleCovariance3Dto2DHomg for exemplary usage.
40 
41  TODO: implement for point normalization instead of homogenization
42 
43  @author woelk 02/2006 */
44  class BIASGeometry_EXPORT Covariance3Dto2DHomg
46  {
47  public:
50 
52 
53  /** compute */
54  int Project(const BIAS::PoseParametrization& Pose,
55  const BIAS::HomgPoint3D& X,
56  const BIAS::HomgPoint3DCov& Cov_X,
58  BIAS::HomgPoint2DCov& Cov_x) const;
59 
60  inline void SetK(const BIAS::KMatrix& K)
61  { K_ = K; }
62 
63  inline void UseHomogenizedPoints(bool h) {
64  useHomogenizedPoints_ = h;
65  }
66 
67  protected:
68  /// normalize or homogenize ???
72 
73  /** src is a vector consisting of [ 3d point, camera center, orientation ]
74  The orientation must be represented using one case from
75  E_Parametrization
76  dst is the projection into the image */
77  virtual int Transform_(const BIAS::Vector<double>& src,
78  BIAS::Vector<double>& dst) const;
79 
80 
81  };
82 } // namespace
83 
84 #endif // _Covariance3Dto2DHomg_hh_
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
Definition: HomgPoint2D.hh:67
class representing the covariance matrix of a homogenous point 2D
class BIASGeometryBase_EXPORT HomgPoint2DCov
bool useHomogenizedPoints_
normalize or homogenize ???
Projection of 3D points with uncertainties covariances into the 2d image plane taking the camera pose...
class BIASGeometryBase_EXPORT HomgPoint3DCov
Slim class bundeling pose parametrization and associated covariance matrix.
E_ParametrizationType
description of supported parametrization types
Definition: PMatrixBase.hh:166
class BIASMathBase_EXPORT Matrix
Definition: Operators.hh:37
Represents 3d pose transformations, parametrized as Euclidean translation and unit quaternion orienta...
Definition: Pose.hh:73
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
Definition: HomgPoint3D.hh:61
class representing the covariance matrix of a homogenous point 3D
void SetK(const BIAS::KMatrix &K)
uses the unscented transformation to map a normal distribututed random variable using a nonlinear tra...
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
Definition: KMatrix.hh:48
class BIASMathBase_EXPORT Vector
class BIASGeometryBase_EXPORT HomgPoint2D
class BIASGeometryBase_EXPORT HomgPoint3D