Basic Image AlgorithmS Library
2.8.0
|
affine transformation of 2D image plane which relates image coordinate system and local affine feature coordinate system More...
#include <Geometry/LocalAffineFrame.hh>
Public Member Functions | |
void | Draw (BIAS::Image< unsigned char > &targetImage, const double &positionCovScale=1.0, const unsigned int linethickness=1) const |
draw a square at the feature's ori position More... | |
double | FractionInImage (unsigned int width, unsigned int height, unsigned int x0=0, unsigned int y0=0) const |
returns fraction of square area [-1;1][-1;1], which is in the image (slow numeric sampling) More... | |
const BIAS::Matrix2x2< double > & | GetA () const |
return affine matrix More... | |
BIAS::Matrix< double > | GetAsInverseMatrix () const |
returns matrix which transforms a point in image coordinates into a point in feature coordinates (GlobalToLocal) More... | |
BIAS::Matrix< double > | GetAsMatrix () const |
returns matrix which transforms a point in feature coordinates into a point in image coordinates (LocalToGlobal) More... | |
BIAS::Vector< double > | GetAsVector () const |
return a 6-vector (a11,a12,a21,a22,tx,ty) More... | |
const BIAS::Matrix< double > & | GetCov () const |
return 6x6 covariance More... | |
LocalAffineFrame | GetHomographyTransformed (const BIAS::HMatrix &H) const |
use linear propagation to transform the local affine frame e.g. More... | |
BIAS::LocalAffineFrame | GetLocalSimilarityFrame () const |
find closest scaled rotation matrix to linear A (under Frobenius norm) and return More... | |
LocalAffineFrame | GetRelativeTransform (const LocalAffineFrame &F2, bool setDefaultCov=false) const |
get global transform to transfer an image point of 1 into the image system of 2, e.g. More... | |
const BIAS::Vector2< double > & | GetT () const |
return offset More... | |
BIAS::HomgPoint2D | GlobalToLocal (const BIAS::HomgPoint2D &x) const |
tranform a point in the image coordinate system into the feature coordinate system More... | |
LocalAffineFrame () | |
LocalAffineFrame (const LocalAffineFrame &FP) | |
BIAS::HomgPoint2D | LocalToGlobal (const BIAS::HomgPoint2D &x) const |
tranform a point in the feature coordinate system into the iamge coordinate system More... | |
const LocalAffineFrame & | operator= (const LocalAffineFrame &FP) |
void | SetA (const BIAS::Matrix2x2< double > &A, const BIAS::Matrix< double > &cov=BIAS::Matrix< double >(4, 4, BIAS::MatrixZero)) |
return affine matrix More... | |
void | SetDefaultCov () |
sets default nonzero cov More... | |
void | SetFromMatrix (const BIAS::Matrix< double > &affineTransform) |
construct from homography-style affine matrix (last row 0,0,1) More... | |
void | SetFromVector (const BIAS::Vector< double > &affineparams) |
set from a 6-vector (a11,a12,a21,a22,tx,ty), default cov More... | |
void | SetFromVector (const BIAS::Vector< double > &affineparams, const BIAS::Matrix< double > &cov) |
set from 6-vector (a11,a12,a21,a22,tx,ty) with cov More... | |
void | SetT (const BIAS::Vector2< double > &T, const BIAS::Matrix< double > &cov=BIAS::Matrix< double >(2, 2, BIAS::MatrixZero)) |
return offset More... | |
xmlNodePtr | XMLAdd (const xmlNodePtr Node, XMLIO &XMLObject) const |
call this to add the class to a node of a given xml tree More... | |
virtual int | XMLGetClassName (std::string &TopLevelTag, double &Version) const |
specialization of XML block name function More... | |
virtual int | XMLIn (const xmlNodePtr Node, BIAS::XMLIO &XMLObject) |
specialization of XML read function More... | |
virtual int | XMLOut (const xmlNodePtr Node, BIAS::XMLIO &XMLObject) const |
specialization of XML write function More... | |
int | XMLRead (const std::string &Filename) |
derived classes must implement the function XMLIn which is called by this function XMLRead to read everything with name Filename into (*this). More... | |
int | XMLReadFromString (const std::string &str) |
reconstruct xml tree from string More... | |
int | XMLWrite (const std::string &Filename, int CompressionLevel=0, bool AutoAddCompressionSuffix=true, std::string encoding="UTF-8") const |
call this to add the class to a new xml tree and write it to the file Filename. More... | |
int | XMLWriteToString (std::string &str, std::string encoding="UTF-8") const |
serialize xml tree to string More... | |
Protected Attributes | |
BIAS::Matrix2x2< double > | A_ |
"orientation + area(detA) of feature" affine matrix which transforms all pixels of the unit feature (or imagine the local feature coordinate system) of one-pixel square into the shape of the current feature(into the image coordinate system) e.g. More... | |
BIAS::Matrix< double > | Cov_ |
6x6 covariance matrix of the 6 region parameters(a11,a12,a21,a22,tx,ty) More... | |
BIAS::Vector2< double > | t_ |
original image position More... | |
Friends | |
BIASGeometry_EXPORT std::ostream & | operator<< (std::ostream &os, const LocalAffineFrame &fp) |
BIASGeometry_EXPORT std::istream & | operator>> (std::istream &is, LocalAffineFrame &fp) |
Related Functions | |
(Note that these are not member functions.) | |
BIASGeometry_EXPORT std::ostream & | operator<< (std::ostream &os, const LocalAffineFrame &fp) |
BIASGeometry_EXPORT std::istream & | operator>> (std::istream &is, LocalAffineFrame &fp) |
affine transformation of 2D image plane which relates image coordinate system and local affine feature coordinate system
Definition at line 33 of file LocalAffineFrame.hh.
|
inline |
Definition at line 40 of file LocalAffineFrame.hh.
|
inline |
Definition at line 45 of file LocalAffineFrame.hh.
void LocalAffineFrame::Draw | ( | BIAS::Image< unsigned char > & | targetImage, |
const double & | positionCovScale = 1.0 , |
||
const unsigned int | linethickness = 1 |
||
) | const |
draw a square at the feature's ori position
Definition at line 47 of file LocalAffineFrame.cpp.
References BIAS::Matrix2x2< T >::EigenvalueDecomposition(), BIAS::ImageDraw< StorageType >::Ellipse(), BIAS::HMatrix::FactorizeAffineMatrixRRight(), BIAS::ImageBase::IsPositionInImage(), and BIAS::ImageDraw< StorageType >::Line().
|
inline |
returns fraction of square area [-1;1][-1;1], which is in the image (slow numeric sampling)
Definition at line 231 of file LocalAffineFrame.hh.
References BIAS::HomgPoint2D::Homogenize().
|
inline |
return affine matrix
Definition at line 165 of file LocalAffineFrame.hh.
Referenced by BIAS::ImageAlignment::SetAlignmentPixelsRectangular().
|
inline |
returns matrix which transforms a point in image coordinates into a point in feature coordinates (GlobalToLocal)
Definition at line 128 of file LocalAffineFrame.hh.
References BIAS::Matrix2x2< T >::Invert(), and BIAS::MatrixZero.
Referenced by GetRelativeTransform().
|
inline |
returns matrix which transforms a point in feature coordinates into a point in image coordinates (LocalToGlobal)
Definition at line 114 of file LocalAffineFrame.hh.
References BIAS::MatrixZero.
|
inline |
return a 6-vector (a11,a12,a21,a22,tx,ty)
Definition at line 75 of file LocalAffineFrame.hh.
|
inline |
return 6x6 covariance
Definition at line 108 of file LocalAffineFrame.hh.
LocalAffineFrame LocalAffineFrame::GetHomographyTransformed | ( | const BIAS::HMatrix & | H | ) | const |
use linear propagation to transform the local affine frame e.g.
into another image
Definition of homography direction: (*this) has "position" t_. The result will have position H*t_
Definition at line 220 of file LocalAffineFrame.cpp.
References BIAS::HMatrix::GetJacobian(), BIAS::HomgPoint2D::Homogenize(), BIAS::MatrixZero, SetFromVector(), and BIAS::Matrix< T >::Transpose().
BIAS::LocalAffineFrame LocalAffineFrame::GetLocalSimilarityFrame | ( | ) | const |
find closest scaled rotation matrix to linear A (under Frobenius norm) and return
Definition at line 252 of file LocalAffineFrame.cpp.
References BIAS::Matrix< T >::GetSystemMatrix(), BIAS::Matrix2x2< T >::Invert(), BIAS::MatrixZero, SetA(), SetT(), and BIAS::Matrix< T >::Transpose().
LocalAffineFrame LocalAffineFrame::GetRelativeTransform | ( | const LocalAffineFrame & | F2, |
bool | setDefaultCov = false |
||
) | const |
get global transform to transfer an image point of 1 into the image system of 2, e.g.
given two affine features, get affine transform between images for KLT tracker setDefaultCov set digonal small cov or use error propagation from uncertainties of base transformations
Definition at line 116 of file LocalAffineFrame.cpp.
References A_, Cov_, GetAsInverseMatrix(), BIAS::MatrixZero, SetDefaultCov(), SetFromMatrix(), t_, and BIAS::Matrix< T >::Transpose().
|
inline |
return offset
Definition at line 168 of file LocalAffineFrame.hh.
|
inline |
tranform a point in the image coordinate system into the feature coordinate system
Definition at line 58 of file LocalAffineFrame.hh.
References BIAS::HomgPoint2D.
|
inline |
tranform a point in the feature coordinate system into the iamge coordinate system
Definition at line 65 of file LocalAffineFrame.hh.
References BIAS::HomgPoint2D.
Referenced by BIAS::ImageAlignment::SetAlignmentPixelsRectangular().
|
inline |
Definition at line 49 of file LocalAffineFrame.hh.
|
inline |
return affine matrix
Definition at line 171 of file LocalAffineFrame.hh.
Referenced by GetLocalSimilarityFrame().
|
inline |
sets default nonzero cov
Definition at line 159 of file LocalAffineFrame.hh.
Referenced by GetRelativeTransform().
|
inline |
construct from homography-style affine matrix (last row 0,0,1)
Definition at line 143 of file LocalAffineFrame.hh.
References BIAS::Equal(), TNT::Matrix< T >::num_cols(), and TNT::Matrix< T >::num_rows().
Referenced by GetRelativeTransform().
|
inline |
set from a 6-vector (a11,a12,a21,a22,tx,ty), default cov
Definition at line 88 of file LocalAffineFrame.hh.
References BIAS::MatrixZero.
Referenced by GetHomographyTransformed().
|
inline |
set from 6-vector (a11,a12,a21,a22,tx,ty) with cov
Definition at line 95 of file LocalAffineFrame.hh.
References BIAS::Matrix< T >::GetData().
|
inline |
return offset
Definition at line 189 of file LocalAffineFrame.hh.
Referenced by GetLocalSimilarityFrame().
|
inherited |
call this to add the class to a node of a given xml tree
Definition at line 26 of file XMLBase.cpp.
References BIAS::XMLIO::addAttribute(), and BIAS::XMLIO::addChildNode().
|
virtual |
specialization of XML block name function
Implements BIAS::XMLBase.
Definition at line 24 of file LocalAffineFrame.cpp.
|
virtual |
specialization of XML read function
Implements BIAS::XMLBase.
Definition at line 39 of file LocalAffineFrame.cpp.
|
virtual |
specialization of XML write function
Implements BIAS::XMLBase.
Definition at line 31 of file LocalAffineFrame.cpp.
|
inherited |
derived classes must implement the function XMLIn which is called by this function XMLRead to read everything with name Filename into (*this).
Definition at line 78 of file XMLBase.cpp.
References BIAS::XMLIO::clear(), BIAS::XMLIO::getAttributeValueDouble(), BIAS::XMLIO::getNodeName(), and BIAS::XMLIO::read().
Referenced by BIAS::biasGLviewerGLUT::Init(), BIAS::SceneOpenSceneGraph::Load(), and BIAS::GLProjectionParametersPerspective::XMLRead().
|
inherited |
reconstruct xml tree from string
Definition at line 111 of file XMLBase.cpp.
References BIAS::XMLIO::clear(), BIAS::XMLIO::getAttributeValueDouble(), BIAS::XMLIO::getNodeName(), and BIAS::XMLIO::ReadFromString().
Referenced by BIAS::IOUtils::GetProjection().
|
inherited |
call this to add the class to a new xml tree and write it to the file Filename.
Calls function XMLOut of derived class
CompressionLevel | 0..9 (0=off, 9=highest compression) |
Definition at line 40 of file XMLBase.cpp.
References BIAS::XMLIO::addAttribute(), BIAS::XMLIO::clear(), BIAS::XMLIO::create(), BIAS::XMLIO::SetCompression(), BIAS::XMLIO::SetEncoding(), and BIAS::XMLIO::write().
Referenced by BIAS::SphericalDepthPanorama::GetTriangleMesh(), BIAS::SceneOpenSceneGraph::Save(), BIAS::ScreenShotListener::StoreNextScreenShot_(), and BIAS::GLProjectionParametersPerspective::XMLWrite().
|
inherited |
serialize xml tree to string
Definition at line 61 of file XMLBase.cpp.
References BIAS::XMLIO::addAttribute(), BIAS::XMLIO::clear(), BIAS::XMLIO::create(), BIAS::XMLIO::SetEncoding(), and BIAS::XMLIO::WriteToString().
|
friend |
|
related |
|
friend |
|
related |
|
protected |
"orientation + area(detA) of feature" affine matrix which transforms all pixels of the unit feature (or imagine the local feature coordinate system) of one-pixel square into the shape of the current feature(into the image coordinate system) e.g.
y = (1;0) is the 3 o'clock ray to the feature border x_i = A_ * x_f + t_;
Definition at line 269 of file LocalAffineFrame.hh.
Referenced by GetRelativeTransform(), and operator=().
|
protected |
6x6 covariance matrix of the 6 region parameters(a11,a12,a21,a22,tx,ty)
Definition at line 272 of file LocalAffineFrame.hh.
Referenced by GetRelativeTransform(), and operator=().
|
protected |
original image position
Definition at line 261 of file LocalAffineFrame.hh.
Referenced by GetRelativeTransform(), and operator=().