34 #include "../../Base/Math/Random.hh"
35 #include "../PMatrix.hh"
36 #include "../RMatrix.hh"
49 unsigned int numTests = 30;
50 for (
unsigned int i=0; i<numTests; i++) {
72 cout <<
"skew " << K.
GetSkew() << endl;
76 if (C[0] * R[0][2] >0.0)
78 if (C[1] * R[1][2] >0.0)
84 for(
int x=0; x < 3; x++){
85 for(
int y = 0; y < 4; y++){
101 PEst.
Compose(KEst, REst, CEst);
102 cout <<
"Test no " << i <<
" : " << ((
PMatrix)(P - PEst)).IsZero(1e-12) << endl;
109 cout <<
"K " << (
KMatrix)(K - KEst) << endl;
110 cout <<
"R " << (
RMatrix)(R - REst) << endl;
111 cout <<
"C " << C - CEst << endl;
void SetSkew(const KMATRIX_TYPE &val)
int GetR(Matrix3x3< double > &R)
double GetUniformDistributed(const double min, const double max)
on succesive calls return uniform distributed random variable between min and max ...
KMATRIX_TYPE GetSkew() const
void InvalidateDecomposition()
to re-Decompose_() after filling with data use this.
class BIASGeometry_EXPORT PMatrix
int GetC(Vector3< double > &C)
computes translation vector origin world coo -> origin camera coo (center), uses decomposition, which is cached
void SetHy(const KMATRIX_TYPE &val)
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
double GetNormalDistributed(const double mean, const double sigma)
on succesive calls return normal distributed random variable with mean and standard deviation sigma ...
describes a projective 3D -> 2D mapping in homogenous coordinates
void SetHx(const KMATRIX_TYPE &val)
Vector3< T > & Normalize()
normalize this vector to length 1
class for producing random numbers from different distributions
void Compose(const Matrix3x3< double > &K, const Matrix3x3< double > &R, const Vector3< double > &C)
composes this from K, R and C using P = [ K R' | -K R' C ] with R' = transpose(R) ...
void SetIdentity()
set the elements of this matrix to the identity matrix (possibly overriding the inherited method) ...
int GetK(KMatrix &K)
calibration matrix