26 #include "CovMatrix3x3.hh"
53 (
void*)
GetData(), 9*
sizeof(COVMATRIX3X3_TYPE))) {
54 BIASERR(
"Corrupted Data in CovMatrix. Maybe you forgot to invalidate."
75 (
void*)
GetData(), 9*
sizeof(COVMATRIX3X3_TYPE))) {
76 BIASERR(
"Corrupted Data in CovMatrix. Maybe you forgot to invalidate.");
137 x.
Set(DBL_MAX,-DBL_MAX); y.
Set(DBL_MAX,-DBL_MAX);
138 for (
int i=0;i<3; i++)
139 for (
double sig=-1; sig <= 1.1; sig+=2){
143 TT *= (sig*scale*S[i]);
148 M.
Set(TT[0], TT[1], TT[2]);
153 if (m[0]<x[0]) x[0]=m[0];
154 if (m[0]>x[1]) x[1]=m[0];
155 if (m[1]<y[0]) y[0]=m[1];
156 if (m[1]>y[1]) y[1]=m[1];
163 if (x[1]<point2d[0]) {
164 x[0]=x[1]; x[1]=DBL_MAX;
166 if (x[0]>point2d[0]) {
167 x[1]=x[0]; x[0]=-DBL_MAX;
170 if (y[1]<point2d[1]) {
171 y[0]=y[1]; y[1]=DBL_MAX;
173 if (y[0]>point2d[1]) {
174 y[1]=y[0]; y[0]=-DBL_MAX;
188 double scale,
double minSearchArea)
200 x.
Set(DBL_MAX,-DBL_MAX); y.
Set(DBL_MAX,-DBL_MAX);
201 for (
int i=0;i<3; i++)
202 for (
double sig=-1; sig <= 1.1; sig+=2){
208 TT *= sig*minSearchArea;
212 M.
Set(TT[0], TT[1], TT[2]);
217 if (m[0]<x[0]) x[0]=m[0];
218 if (m[0]>x[1]) x[1]=m[0];
219 if (m[1]<y[0]) y[0]=m[1];
220 if (m[1]>y[1]) y[1]=m[1];
224 TT *= (sig*scale*S[i]);
228 M.
Set(TT[0], TT[1], TT[2]);
233 if (m[0]<x[0]) x[0]=m[0];
234 if (m[0]>x[1]) x[1]=m[0];
235 if (m[1]<y[0]) y[0]=m[1];
236 if (m[1]>y[1]) y[1]=m[1];
243 if (x[1]<point2d[0]) {
244 x[0]=x[1]; x[1]=DBL_MAX;
246 if (x[0]>point2d[0]) {
247 x[1]=x[0]; x[0]=-DBL_MAX;
250 if (y[1]<point2d[1]) {
251 y[0]=y[1]; y[1]=DBL_MAX;
253 if (y[0]>point2d[1]) {
254 y[1]=y[0]; y[0]=-DBL_MAX;
void GetRow(const unsigned int row, Vector3< T > &r) const
extract one row ('Zeile') from ths matrix (for convenience)
void Set(const T *pv)
copy the array of vectorsize beginning at *T to this->data_
CovMatrix3x3 & operator=(const CovMatrix3x3 &mat)
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
int GetPCA(Vector3< COVMATRIX3X3_TYPE > &S, Matrix3x3< COVMATRIX3X3_TYPE > &VT)
void Set(const HOMGPOINT3D_TYPE &x, const HOMGPOINT3D_TYPE &y, const HOMGPOINT3D_TYPE &z)
set elementwise with given 3 euclidean scalar values.
HomgPoint2D & Homogenize()
homogenize class data member elements to W==1 by divison by W
void SetZero()
set all values to 0
void Homogenize()
homogenize class data member elements to W==1 by divison by W
int Compute(const Matrix< double > &M, double ZeroThreshold=DEFAULT_DOUBLE_ZERO_THRESHOLD)
set a new matrix and compute its decomposition.
int GetS(Vector3< COVMATRIX3X3_TYPE > &S)
void Set(const T &scalar)
set all elements to a scalar value
const Matrix< double > & GetVT() const
return VT (=transposed(V))
int GetSearchArea(PMatrixBase &P, HomgPoint3D &point3D, Vector2< double > &x, Vector2< double > &y, double scale)
Computes the bounding box x=[xmin,xmax] , y=[ymin,ymax] in image as determined from the projected cov...
class for 3x3 covariance matrices
const Vector< double > & GetS() const
return S which is a vector of the singular values of A in descending order.
Matrix3x3< COVMATRIX3X3_TYPE > _VT
is a 'fixed size' quadratic matrix of dim.
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
describes a projective 3D -> 2D mapping in homogenous coordinates
Matrix3x3< COVMATRIX3X3_TYPE > ConsistencyBackup_
saves matrix fields to make consistency checks possible later
Vector3< COVMATRIX3X3_TYPE > _S
matrix class with arbitrary size, indexing is row major.
const Matrix< double > & GetU() const
return U U is a m x m orthogonal matrix
Matrix3x3< T > & operator=(const Matrix3x3< T > &mat)
assignment operator
bool _IsDecomposed
flag indicating whether the stored PCA is still valid
Matrix3x3< COVMATRIX3X3_TYPE > _U