26 #ifndef _BIAS_FMatrixBase_hh_
27 #define _BIAS_FMatrixBase_hh_
29 #include <bias_config.h>
33 #include <Base/Debug/Error.hh>
34 #include <Base/Debug/Debug.hh>
36 #include <Base/Math/Matrix3x3.hh>
37 #include <Base/Math/Vector3.hh>
39 #include "RMatrixBase.hh"
41 #include "HomgPoint2D.hh"
42 #include "HomgLine2D.hh"
45 #define FMATRIX_TYPE double
82 Matrix3x3<FMATRIX_TYPE>(i) {_isDecomposed=
false; };
91 { _isDecomposed=
false; };
98 for (
int i=0; i<9;i++) {
99 (this->GetData())[i] = d[i];
115 { Set(epipole, EulerAngXYZ); };
170 return GetEpipolarErrorHomogenized(P1,P2);}
181 void GetEpipolarLineImage1(
const HomgPoint2D& point,
188 void GetEpipolarLineImage2(
const HomgPoint2D& point,
231 R.
SetXYZ(EulerAngXYZ[0], EulerAngXYZ[1], EulerAngXYZ[2]);
244 (*this).SetAsCrossProductMatrix(R.
Transpose()*C);
273 const register double *matP =
GetData();
274 EL[0] = P2[0] * matP[0]
277 EL[1] = P2[0] * matP[1]
280 EL[2] = P2[0] * matP[2]
284 double dist = EL[0] * P1[0] + EL[1] * P1[1] + EL[2];
287 double dError = dist = dist * dist;
288 dError /= (EL[0]*EL[0]+EL[1]*EL[1]);
293 EL[0] = matP[0]*P1[0]+ matP[1]*P1[1] + matP[2];
294 EL[1] = matP[3]*P1[0]+ matP[4]*P1[1] + matP[5];
297 return (dError + (dist / (EL[0]*EL[0]+EL[1]*EL[1])));
318 result=l1[0]*l2[0]+l1[1]*l2[1];
320 if (result>=1.0) { result=1.0; }
321 if (result<=-1.0) { result=-1.0; }
322 BIASASSERT(result>=-1.0 && result <=1.0);
327 #endif // FMatrixBase
MatrixInitType
can be passed to matrix constructors to init the matrix with the most often used values ...
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
void SetXYZ(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY, ROTATION_MATRIX_TYPE PhiZ)
Set Euler angles (in rad) in order XYZ.
FMatrixBase(const Vector3< FMATRIX_TYPE > &epipole, const RMatrixBase &R)
see Set(Vector3<FMATRIX_TYPE>& epipole, RMatixBase& R);
double GetCosAngleErrorHomogenized(const BIAS::HomgPoint2D &p1, const BIAS::HomgPoint2D &p2)
returns the cosine of the angle bewteen epipolar line and match line
FMatrixBase(const Vector3< FMATRIX_TYPE > &epipole, const Vector3< FMATRIX_TYPE > &EulerAngXYZ)
see Set(Vector3<FMATRIX_TYPE>& epipole, Vector3<FMATRIX_TYPE>& EulerAngXYZ);
double GetEpipolarError(BIAS::HomgPoint2D &P1, BIAS::HomgPoint2D &P2)
computes error in epipolar geometry for the given correspondence P1,P2 using above function after hom...
FMatrixBase(const MatrixInitType &i)
constructor setting identity or zero
HomgPoint2D & Homogenize()
homogenize class data member elements to W==1 by divison by W
void Set(const Vector3< FMATRIX_TYPE > &epipole, const RMatrixBase &R)
set it from epipole and rotation matrix in order to generate essential matrix from image 1 to image 2...
FMatrixBase(const Matrix3x3< FMATRIX_TYPE > &A)
describes the epipolar relationship between a point and his mapping on a corresponding epipolar line...
void Set(const HomgPoint2D &p1, const HomgPoint2D &p2)
constructing a line through two points
double GetEpipolarErrorHomogenized(const BIAS::HomgPoint2D &P1, const BIAS::HomgPoint2D &P2) const
computes error in epipolar geometry for the given correspondence P1;P2
void Mult(const Vector3< T > &argvec, Vector3< T > &destvec) const
matrix - vector multiplicate this matrix with Vector3, storing the result in destvec calculates: dest...
a line l = (a b c)^T is a form of the implicit straight line equation 0 = a*x + b*y + c if homogenize...
void Homogenize()
aequivalent to homogenize for points the gradient triangle is normed to hypothenuse length of 1 ...
is a 'fixed size' quadratic matrix of dim.
class Vector3 contains a Vector of fixed dim.
Matrix3x3< T > Transpose() const
returns transposed matrix tested 12.06.2002
Matrix3x3< T > & operator=(const Matrix3x3< T > &mat)
assignment operator
FMatrixBase(const FMATRIX_TYPE *d)
constructor for convenience to build form a c-style aaray amtrix
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
FMatrixBase & operator=(const Matrix3x3< FMATRIX_TYPE > &mat)
assignment operators calling corresponding operator from base class "TNT::Matrix" if appropriate ...
Implements a 3D rotation matrix.
FMatrixBase()
default constructor untested (04/18/2002)
void SetAsCrossProductMatrix(const Vector3< T > &vec)
Sets matrix from vector as cross product matrix of this vector.