Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Cov3Dto2DPoseCertain.hh
1 #ifndef __Cov3Dto2DPoseCertain_hh__
2 #define __Cov3Dto2DPoseCertain_hh__
3 
4 #include <MathAlgo/UnscentedTransform.hh>
5 #include <Base/Geometry/HomgPoint2D.hh>
6 #include <Base/Geometry/HomgPoint3D.hh>
7 #include <Base/Geometry/PMatrixBase.hh>
8 #include <Base/Math/Vector.hh>
9 #include <Base/Math/Matrix.hh>
10 #include <Base/Math/Vector3.hh>
11 #include <Base/Math/Matrix3x3.hh>
12 #include <Base/Math/Vector2.hh>
13 #include <Base/Math/Matrix2x2.hh>
14 
15 namespace BIAS {
16 
17  /** @class Cov3Dto2DPoseCertain
18  @brief project a 3D covariance matrix into the image plane using the
19  unscented transform assuming that the pose is certain
20  @author woelk 06/2006 */
22  {
23  public:
25  : UnscentedTransform(), P_(P) {};
26 
27  inline void Transform(const BIAS::Vector3<double>& src_mean,
28  const BIAS::Matrix3x3<double>& src_cov,
29  BIAS::Vector2<double>& dst_mean,
30  BIAS::Matrix2x2<double>& dst_cov) const
31  {
32  BIAS::Vector<double> src_mean2(src_mean), dst_mean2;
33  BIAS::Matrix<double> src_cov2(src_cov), dst_cov2;
34  UnscentedTransform::Transform(src_mean2, src_cov2, dst_mean2, dst_cov2);
35  dst_mean = dst_mean2;
36  dst_cov = dst_cov2;
37  }
38 
39  protected:
42  BIAS::Vector<double>& dst) const
43  {
46 
47  X.Set(src[0], src[1], src[2], 1.0);
48  x = P_ * X;
49  x.Homogenize();
50 
51  dst.newsize(2);
52  dst[0] = x[0];
53  dst[1] = x[1];
54  return 0;
55  }
56  };
57 
58 
59 } // namespace
60 
61 #endif // __Cov3Dto2DPoseCertain_hh__
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
Definition: HomgPoint2D.hh:67
void Set(const HOMGPOINT3D_TYPE &x, const HOMGPOINT3D_TYPE &y, const HOMGPOINT3D_TYPE &z)
set elementwise with given 3 euclidean scalar values.
Definition: HomgPoint3D.hh:321
HomgPoint2D & Homogenize()
homogenize class data member elements to W==1 by divison by W
Definition: HomgPoint2D.hh:215
project a 3D covariance matrix into the image plane using the unscented transform assuming that the p...
Cov3Dto2DPoseCertain(const BIAS::PMatrixBase &P)
int Transform_(const BIAS::Vector< double > &src, BIAS::Vector< double > &dst) const
implements a point transformation
Vector< T > & newsize(Subscript N)
Definition: vec.h:220
int Transform(const Vector< double > &src_mean, const Matrix< double > &src_cov, Vector< double > &dst_mean, Matrix< double > &dst_cov) const
computes the second order approximation of the transformations of the mean and the associated covaria...
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
uses the unscented transformation to map a normal distribututed random variable using a nonlinear tra...
void Transform(const BIAS::Vector3< double > &src_mean, const BIAS::Matrix3x3< double > &src_cov, BIAS::Vector2< double > &dst_mean, BIAS::Matrix2x2< double > &dst_cov) const