Basic Image AlgorithmS Library
2.8.0
|
a 3x3 Matrix describing projective transformations between planes More...
#include <Geometry/HMatrix.hh>
Public Member Functions | |
double | ComputeLinearizationError (const HomgPoint2D &x0, const HomgPoint2D &y) const |
compute distance between y mapped with homography or first order taylor approximation at development point x0 in pixel More... | |
void | GetAbsMaxMin (HMATRIX_TYPE &max, HMATRIX_TYPE &min) const |
void | GetColumn (const unsigned int col, Vector3< HMATRIX_TYPE > &r) const |
extract one column ('Spalte') from this matrix (for convenience) More... | |
BIAS::Vector3< HMATRIX_TYPE > | GetColumn (const unsigned int col) const |
HMATRIX_TYPE * | GetData () |
const HMATRIX_TYPE * | GetData () const |
HMATRIX_TYPE | GetDeterminant () const |
returns the Determinant |A| of this More... | |
int | GetInverse (Matrix3x3< HMATRIX_TYPE > &inv) const |
Matrix inversion: inverts this and stores resulty in argument inv. More... | |
void | GetJacobian (const HomgPoint2D &x, Matrix< double > &Jac) const |
returns jacobian of H: R^2 –> R^2 More... | |
HMatrix | GetLinearized (const HomgPoint2D &x) const |
returns 1st order Taylor expansion of homography at x More... | |
double | GetMappedError (const BIAS::HomgPoint2D &PointPicOne, const BIAS::HomgPoint2D &PointPicTwo) const |
void | GetMappedRange (const unsigned int OrigWidth, const unsigned int OrigHeight, BIAS::Vector2< double > &corner, double &sizeWidth, double &sizeHeight) const |
maps the rectangle (0,0),(OrigWidth,OrigHeight) with this H and computes mapped range as corner + size. More... | |
HMATRIX_TYPE | GetMax () const |
void | GetMaxMin (HMATRIX_TYPE &max, HMATRIX_TYPE &min) const |
return biggest and smallest entry More... | |
HMATRIX_TYPE | GetMin () const |
unsigned | GetNumElements () const |
double | GetReprojectionError (std::vector< BIAS::HomgPoint2D > &p1, std::vector< BIAS::HomgPoint2D > &p2) |
compute reprojection error for both vectors of HomgPoint2D More... | |
void | GetRow (const unsigned int row, Vector3< HMATRIX_TYPE > &r) const |
extract one row ('Zeile') from ths matrix (for convenience) More... | |
Vector3< HMATRIX_TYPE > | GetRow (const unsigned int row) const |
HMatrix () | |
HMatrix (const MatrixInitType &i) | |
HMatrix (Matrix3x3< double > Mat) | |
HMatrix (const PMatrix &P1, const PMatrix &P2, const HomgPlane3D &scenePlane=HomgPlane3D(0, 0, 0, 1)) | |
homography induced by a plane (e.g. More... | |
int | InvertIP () |
In place matrix conversion. More... | |
bool | IsIdentity (const HMATRIX_TYPEeps=std::numeric_limits< HMATRIX_TYPE >::epsilon()) const |
bool | IsZero (const HMATRIX_TYPEeps=std::numeric_limits< HMATRIX_TYPE >::epsilon()) const |
bool | Load (const std::string &fname) |
void | MakeSymmetric () |
void | MapAcrossPlane (const PMatrix &P1, const PMatrix &P2, const HomgPlane3D &scenePlane=HomgPlane3D(0, 0, 0, 1)) |
Set (*this) to map coordinates from camera p1 to p2 using the given scene plane. More... | |
void | Mult (const Vector3< HMATRIX_TYPE > &argvec, Vector3< HMATRIX_TYPE > &destvec) const |
matrix - vector multiplicate this matrix with Vector3, storing the result in destvec calculates: destvec = (this Matrix) * argvec More... | |
void | Mult (const Matrix3x3< HMATRIX_TYPE > &argmat, Matrix3x3< HMATRIX_TYPE > &destmat) const |
matrix-matrix multiplication with other Matrix3x3, storing the result in destmat calculates: destmat = (this mat) * argmat More... | |
void | Mult (const Matrix3x4< HMATRIX_TYPE > &argmat, Matrix3x4< HMATRIX_TYPE > &destmat) const |
HMATRIX_TYPE | Normalize () |
divide this by biggest absolute entry, returns biggest entry More... | |
double | NormFrobenius () const |
HMATRIX_TYPE | NormL1 () const |
double | NormL2 () const |
bool | operator!= (const Matrix3x3< HMATRIX_TYPE > &arg) const |
Matrix3x3< HMATRIX_TYPE > & | operator*= (const Matrix3x3< HMATRIX_TYPE > &arg) |
woelk 11/2007 (c) www.vision-n.de More... | |
Matrix3x3< HMATRIX_TYPE > & | operator*= (const HMATRIX_TYPE &arg) |
woelk 11/2007 (c) www.vision-n.de More... | |
Matrix3x3< HMATRIX_TYPE > & | operator+= (const Matrix3x3< HMATRIX_TYPE > &arg) |
Matrix3x3< HMATRIX_TYPE > & | operator-= (const Matrix3x3< HMATRIX_TYPE > &arg) |
Matrix3x3< HMATRIX_TYPE > & | operator/= (const HMATRIX_TYPE &arg) |
HMatrix & | operator= (const HMatrix &mat) |
bool | operator== (const Matrix3x3< HMATRIX_TYPE > &arg) const |
HMATRIX_TYPE * | operator[] (const unsigned row) |
const HMATRIX_TYPE * | operator[] (const unsigned row) const |
bool | Save (const std::string &fname) const |
void | Scale (const HMATRIX_TYPE &scalar, Matrix3x3< HMATRIX_TYPE > &destmat) const |
scalar-matrix multiplication More... | |
void | SetAsCrossProductMatrix (const Vector3< HMATRIX_TYPE > &vec) |
Sets matrix from vector as cross product matrix of this vector. More... | |
void | SetAsCrossProductMatrix (const HMATRIX_TYPE &x, const HMATRIX_TYPE &y, const HMATRIX_TYPE &z) |
Sets matrix from vector as cross product matrix of a vector. More... | |
void | SetColumn (const unsigned int col, const Vector3< HMATRIX_TYPE > &c) |
void | SetFromColumnVectors (const BIAS::Vector3< HMATRIX_TYPE > &v0, const BIAS::Vector3< HMATRIX_TYPE > &v1, const BIAS::Vector3< HMATRIX_TYPE > &v2) |
set this matrix from 3 vectors each representating a column More... | |
void | SetFromRowVectors (const BIAS::Vector3< HMATRIX_TYPE > &v0, const BIAS::Vector3< HMATRIX_TYPE > &v1, const BIAS::Vector3< HMATRIX_TYPE > &v2) |
set this matrix from 3 vectors, each representating a row More... | |
void | SetFromVector (const TNT::Vector< HMATRIX_TYPE > &vec) |
sets the diagonalelements of this 3x3 Matrix rowwise with the values of the 9 (x1) vector More... | |
void | SetIdentity () |
set the elements of this matrix to the identity matrix (possibly overriding the inherited method) More... | |
void | SetRow (const unsigned int row, const Vector3< HMATRIX_TYPE > &r) |
void | SetZero () |
HMATRIX_TYPE | Trace () const |
return the trace of the matrix More... | |
Matrix3x3< HMATRIX_TYPE > | Transpose () const |
returns transposed matrix tested 12.06.2002 More... | |
void | Transpose (const Matrix3x3< HMATRIX_TYPE > &arg) |
sets this as transposed arg, fw More... | |
void | TransposedMult (const Vector3< HMATRIX_TYPE > &argvec, Vector3< HMATRIX_TYPE > &destvec) const |
multiplies matrix from left with transposed argvec, resulting in transposed destvec More... | |
void | TransposeIP () |
tranpose this matrix "in place" example: 0 1 2 –> 0 3 6 3 4 5 –> 1 4 7 6 7 8 –> 2 5 8 More... | |
~HMatrix () | |
Static Public Member Functions | |
static int | ComposeAffineMatrixRLeft (Matrix2x2< double > &A, const Matrix2x2< double > &phi, const Matrix2x2< double > &theta, const double &d1, const double &d2) |
compose affine matrix from rotations and nonisotropic scalings More... | |
static int | ComposeAffineMatrixRRight (Matrix2x2< double > &A, const Matrix2x2< double > &phi, const Matrix2x2< double > &theta, const double &d1, const double &d2) |
compose affine matrix from rotations and nonisotropic scalings More... | |
static int | FactorizeAffineMatrixRLeft (const Matrix2x2< double > &A, Matrix2x2< double > &phi, Matrix2x2< double > &theta, double &d1, double &d2) |
decompose affine matrix into rotations and nonisotropic scalings More... | |
static int | FactorizeAffineMatrixRRight (const Matrix2x2< double > &A, Matrix2x2< double > &phi, Matrix2x2< double > &theta, double &d1, double &d2) |
decompose affine matrix into rotations and nonisotropic scalings More... | |
Protected Attributes | |
HMATRIX_TYPE | Data_ [9] |
a 3x3 Matrix describing projective transformations between planes
Definition at line 39 of file HMatrix.hh.
HMatrix::HMatrix | ( | ) |
Definition at line 36 of file HMatrix.cpp.
|
inlineexplicit |
Definition at line 44 of file HMatrix.hh.
HMatrix::HMatrix | ( | Matrix3x3< double > | Mat | ) |
Definition at line 40 of file HMatrix.cpp.
|
inline |
HMatrix::~HMatrix | ( | ) |
Definition at line 51 of file HMatrix.cpp.
|
static |
compose affine matrix from rotations and nonisotropic scalings
if result=0 then A = theta * phi^-1 * d * phi where theta and phi must be rotation matrices
Definition at line 280 of file HMatrix.cpp.
References BIAS::Matrix2x2< T >::Invert(), and BIAS::MatrixZero.
|
static |
compose affine matrix from rotations and nonisotropic scalings
if result=0 then A = phi^-1 * d * phi * theta where theta and phi must be rotation matrices
Definition at line 292 of file HMatrix.cpp.
References BIAS::Matrix2x2< T >::Invert(), and BIAS::MatrixZero.
double HMatrix::ComputeLinearizationError | ( | const HomgPoint2D & | x0, |
const HomgPoint2D & | y | ||
) | const |
compute distance between y mapped with homography or first order taylor approximation at development point x0 in pixel
Definition at line 332 of file HMatrix.cpp.
References GetLinearized(), BIAS::HomgPoint2D::Homogenize(), and BIAS::Vector3< T >::NormL2().
|
static |
decompose affine matrix into rotations and nonisotropic scalings
if result=0 then A = theta * phi^-1 * d * phi where theta and phi are rotation matrices
Definition at line 248 of file HMatrix.cpp.
References BIAS::SVD::Compute(), BIAS::SVD::GetS(), BIAS::SVD::GetU(), and BIAS::SVD::GetVT().
|
static |
decompose affine matrix into rotations and nonisotropic scalings
if result=0 then A = phi^-1 * d * phi * theta where theta and phi are rotation matrices
Definition at line 262 of file HMatrix.cpp.
References BIAS::SVD::Compute(), BIAS::SVD::GetS(), BIAS::SVD::GetU(), BIAS::SVD::GetVT(), and BIAS::Matrix< T >::Transpose().
Referenced by BIAS::LocalAffineFrame::Draw().
|
inherited |
|
inherited |
extract one column ('Spalte') from this matrix (for convenience)
|
inlineinherited |
Definition at line 202 of file Matrix3x3.hh.
|
inlineinherited |
Definition at line 99 of file Matrix3x3.hh.
|
inlineinherited |
Definition at line 103 of file Matrix3x3.hh.
|
inherited |
returns the Determinant |A| of this
|
inherited |
Matrix inversion: inverts this and stores resulty in argument inv.
Returns -1 if determinant is zero, 0 on success.
void HMatrix::GetJacobian | ( | const HomgPoint2D & | x, |
Matrix< double > & | Jac | ||
) | const |
returns jacobian of H: R^2 –> R^2
H as a mapping of 2D to 2D is not a linear mapping, because of the nonlinear homogenization. This function returns the 2x2 Jacobian matrix at the point x. You have to pass homogenized points and a correctly sized jacobian
x | homogenized point (real point in R^2) for the jacobian |
Jac | (output) 2x2 jacobian at x |
Definition at line 190 of file HMatrix.cpp.
References BIAS::Matrix< T >::GetCols(), BIAS::Matrix< T >::GetRows(), BIAS::HomgPoint2D::IsHomogenized(), and BIAS::Matrix< T >::SetZero().
Referenced by BIAS::LocalAffineFrame::GetHomographyTransformed(), GetLinearized(), and BIAS::TrackerBaseAffine< StorageType >::TrackAffine_().
HMatrix HMatrix::GetLinearized | ( | const HomgPoint2D & | x | ) | const |
returns 1st order Taylor expansion of homography at x
Definition at line 55 of file HMatrix.cpp.
References GetJacobian(), BIAS::HomgPoint2D::Homogenize(), and BIAS::MatrixZero.
Referenced by ComputeLinearizationError().
double HMatrix::GetMappedError | ( | const BIAS::HomgPoint2D & | PointPicOne, |
const BIAS::HomgPoint2D & | PointPicTwo | ||
) | const |
Definition at line 179 of file HMatrix.cpp.
References BIAS::HomgPoint2D::Homogenize().
void HMatrix::GetMappedRange | ( | const unsigned int | OrigWidth, |
const unsigned int | OrigHeight, | ||
BIAS::Vector2< double > & | corner, | ||
double & | sizeWidth, | ||
double & | sizeHeight | ||
) | const |
maps the rectangle (0,0),(OrigWidth,OrigHeight) with this H and computes mapped range as corner + size.
JW 07/2003
Definition at line 135 of file HMatrix.cpp.
References BIAS::HomgPoint2D, and BIAS::HomgPoint2D::Homogenize().
|
inherited |
|
inherited |
return biggest and smallest entry
|
inherited |
|
inlineinherited |
Definition at line 107 of file Matrix3x3.hh.
double HMatrix::GetReprojectionError | ( | std::vector< BIAS::HomgPoint2D > & | p1, |
std::vector< BIAS::HomgPoint2D > & | p2 | ||
) |
compute reprojection error for both vectors of HomgPoint2D
Computes sum of squared distances of projected points to real ones in both directions
Definition at line 303 of file HMatrix.cpp.
References BIAS::HomgPoint2D::DistanceSquared(), BIAS::HomgPoint2D::Homogenize(), and BIAS::Matrix3x3< T >::InvertIP().
|
inherited |
extract one row ('Zeile') from ths matrix (for convenience)
|
inlineinherited |
Definition at line 196 of file Matrix3x3.hh.
|
inherited |
In place matrix conversion.
Returns -1 if determinant is zero, 0 on success.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
void HMatrix::MapAcrossPlane | ( | const PMatrix & | P1, |
const PMatrix & | P2, | ||
const HomgPlane3D & | scenePlane = HomgPlane3D(0,0,0,1) |
||
) |
Set (*this) to map coordinates from camera p1 to p2 using the given scene plane.
Infinite homography by default.
Definition at line 81 of file HMatrix.cpp.
References BIAS::PMatrix::GetC(), BIAS::PMatrix::GetK(), BIAS::PMatrix::GetR(), BIAS::HomgPoint3D, BIAS::KMatrix::Invert(), BIAS::Vector3< T >::NormL2(), BIAS::Vector4< T >::NormL2(), BIAS::Vector3< T >::OuterProduct(), BIAS::Vector3< T >::ScalarProduct(), and BIAS::Matrix3x3< T >::Transpose().
|
inlineinherited |
matrix - vector multiplicate this matrix with Vector3, storing the result in destvec calculates: destvec = (this Matrix) * argvec
|
inlineinherited |
matrix-matrix multiplication with other Matrix3x3, storing the result in destmat calculates: destmat = (this mat) * argmat
|
inherited |
|
inherited |
divide this by biggest absolute entry, returns biggest entry
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 255 of file Matrix3x3.hh.
|
inlineinherited |
Definition at line 274 of file Matrix3x3.hh.
|
inlineinherited |
woelk 11/2007 (c) www.vision-n.de
Definition at line 143 of file Matrix3x3.hh.
|
inherited |
woelk 11/2007 (c) www.vision-n.de
|
inherited |
|
inherited |
|
inherited |
Definition at line 44 of file HMatrix.cpp.
References BIAS::HMatrixBase::operator=().
|
inherited |
|
inlineinherited |
Definition at line 91 of file Matrix3x3.hh.
|
inlineinherited |
Definition at line 95 of file Matrix3x3.hh.
|
inherited |
|
inlineinherited |
scalar-matrix multiplication
|
inherited |
Sets matrix from vector as cross product matrix of this vector.
|
inherited |
Sets matrix from vector as cross product matrix of a vector.
with components (x, y, z)
|
inherited |
|
inherited |
set this matrix from 3 vectors each representating a column
|
inherited |
set this matrix from 3 vectors, each representating a row
|
inherited |
sets the diagonalelements of this 3x3 Matrix rowwise with the values of the 9 (x1) vector
|
inlineinherited |
set the elements of this matrix to the identity matrix (possibly overriding the inherited method)
|
inherited |
|
inlineinherited |
|
inlineinherited |
return the trace of the matrix
Definition at line 230 of file Matrix3x3.hh.
|
inherited |
returns transposed matrix tested 12.06.2002
|
inlineinherited |
sets this as transposed arg, fw
|
inlineinherited |
multiplies matrix from left with transposed argvec, resulting in transposed destvec
|
inlineinherited |
tranpose this matrix "in place" example: 0 1 2 –> 0 3 6 3 4 5 –> 1 4 7 6 7 8 –> 2 5 8
|
protectedinherited |
Definition at line 282 of file Matrix3x3.hh.