Basic Image AlgorithmS Library
2.8.0
|
Implements a 3D similarity transformation (rotation, translation, and isometric scaling). More...
#include <Geometry/SimilarityTransform.hh>
Public Member Functions | |
void | AddDebugLevel (const long int lv) |
void | AddDebugLevel (const std::string &name) |
bool | DebugLevelIsSet (const long int lv) const |
bool | DebugLevelIsSet (const std::string &name) const |
void | Dump () |
Print transformation together with more intuitive rotation representations for debugging purposed. More... | |
const Vector3< double > & | GetC () const |
Return vector representing translation. More... | |
int | GetDebugLevel () const |
std::ostream & | GetDebugStream () const |
void | GetDebugStream (std::ostream &os) const |
const Quaternion< double > & | GetQ () const |
Return unit quaternion representing rotation. More... | |
BIAS::RMatrixBase | GetR () const |
Compute rotation matrix from the unit quaternion representing the rotational part of this. More... | |
double | GetScale () |
Return isometric scaling of this transformation. More... | |
Matrix4x4< double > | GetTransformMatrix () const |
Returns 4x4 transformation matrix corresponding to this. More... | |
void | InvertIP () |
Invert the similarity transform (in place) More... | |
bool | Load (const std::string &inputFile) |
Load similarity transform from text file inputFile. More... | |
void | Mult (const SimilarityTransform &arg, SimilarityTransform &result) |
Concatenate this similarity transform and the given one so that result = this * arg holds for the corresponding 4x4 matrices. More... | |
void | Mult (const HomgPoint3D &vec, HomgPoint3D &result) const |
Transform the given homogeneous 3D point with this similarity transform so that result = this * vec holds for the corresponding 4x4 matrix. More... | |
void | MultVec (const Vector3< double > &vec, Vector3< double > &result) const |
Transform the given vector with this similarity transform so that result = this * vec holds for the corresponding 4x4 matrix. More... | |
long int | Name2DebugLevel (const std::string &name) const |
looks up a debuglevel in the internal map, returns 0 if not found More... | |
long int | NewDebugLevel (const std::string &name) |
creates a new debuglevel More... | |
const SimilarityTransform & | operator= (const SimilarityTransform &c) |
Copy all elements of another SimilarityTransform instance. More... | |
void | PrintDebugLevel (std::ostream &os=std::cout) const |
void | RemoveDebugLevel (const long int lv) |
void | RemoveDebugLevel (const std::string &name) |
bool | Save (const std::string &outputFile) |
Save similarity transform to text file outputFile. More... | |
void | Set (const Quaternion< double > &Q, const Vector3< double > &C, const double &scale=1.0) |
Set rotation, translation, and optional scaling. More... | |
void | SetC (const Vector3< double > &C) |
Set translational part from vector C. More... | |
void | SetDebugLevel (const long int lv) |
void | SetDebugLevel (const std::string &name) |
void | SetDebugStream (const std::ostream &os) |
void | SetQ (const Quaternion< double > &Q) |
Set rotational part from unit quaternion Q. More... | |
void | SetR (const BIAS::RMatrixBase &R) |
Set rotational part from rotation matrix R. More... | |
void | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
SimilarityTransform () | |
Creates the identity transformation with zero covariance. More... | |
SimilarityTransform (const SimilarityTransform &c) | |
Copy constructor, calls operator=. More... | |
Static Public Member Functions | |
static long int | GetGlobalDebugLevel () |
static void | SetGlobalDebugLevel (long int lev) |
Protected Member Functions | |
long | ConsumeNextFreeDebuglevel_ () |
returns the next available debuglevel More... | |
Protected Attributes | |
long int | _liDebugLevel |
long int | _liNextDebugLevel |
new concept, debuglevel are managed here in the debug class More... | |
std::map< std::string, long int > | _String2Debuglevel |
Vector3< double > | C_ |
the translation More... | |
Quaternion< double > | Q_ |
this is the rotation More... | |
double | scale_ |
Static Protected Attributes | |
static std::ostream | _zDebugStream |
static long int | GlobalDebugLevel = 0 |
Friends | |
std::ostream & | operator<< (std::ostream &os, const SimilarityTransform &p) |
std::istream & | operator>> (std::istream &is, SimilarityTransform &p) |
Implements a 3D similarity transformation (rotation, translation, and isometric scaling).
Similarity transformations can be interpreted either as a coordinate transformation or motion and scaling of points. Euclidean transformations are special similiarty transformations with scale = 1.
This transformation is identical to the following matrix:
[ C_[0] ] [ scale_*R C_[1] ] T = [ C_[2] ] [ 0 0 0 1 ]
The internal representation of the rotation is a unit quaternion Q_. This quaternion, a translation vector and a scale are used to parametrize the similarity with 8 parameters (and one constraint Q_.NormL2() == 1). Additional, a covariance matrix for all parameters can be stored.
Can be used to represent poses, rigid motions or coordinate transforms.
Definition at line 65 of file SimilarityTransform.hh.
|
inline |
Creates the identity transformation with zero covariance.
Definition at line 70 of file SimilarityTransform.hh.
|
inline |
Copy constructor, calls operator=.
Definition at line 75 of file SimilarityTransform.hh.
|
inlineinherited |
Definition at line 355 of file Debug.hh.
Referenced by BIAS::GLProjectionParametersBase::AddDebugLevel(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase(), BIAS::ShowCamWxVideoSourceFactory::OpenDevice(), and BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph().
|
inlineinherited |
|
inlineprotectedinherited |
|
inlineinherited |
Definition at line 341 of file Debug.hh.
Referenced by BIAS::GenSynthMatches::_AddUniformDistributedOutliers(), BIAS::GenSynthMatches::_CreateCamMovement(), BIAS::GenSynthMatches::_CreateStatic2DPoints(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::GenSynthMatches::GetGTNormalizedF(), BIAS::MonteCarloTransform::GetSamples_(), and BIAS::MonteCarloTransform::Transform().
|
inlineinherited |
void SimilarityTransform::Dump | ( | ) |
Print transformation together with more intuitive rotation representations for debugging purposed.
Definition at line 67 of file SimilarityTransform.cpp.
References BIAS::RMatrixBase::GetRotationAxisAngle(), and BIAS::RMatrixBase::SetFromQuaternion().
|
inline |
Return vector representing translation.
Definition at line 107 of file SimilarityTransform.hh.
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inline |
Return unit quaternion representing rotation.
Definition at line 104 of file SimilarityTransform.hh.
|
inline |
Compute rotation matrix from the unit quaternion representing the rotational part of this.
Definition at line 114 of file SimilarityTransform.hh.
References BIAS::RMatrixBase::SetFromQuaternion().
|
inline |
Return isometric scaling of this transformation.
Definition at line 121 of file SimilarityTransform.hh.
Matrix4x4< double > SimilarityTransform::GetTransformMatrix | ( | ) | const |
Returns 4x4 transformation matrix corresponding to this.
Definition at line 84 of file SimilarityTransform.cpp.
References BIAS::RMatrixBase::SetFromQuaternion().
|
inline |
Invert the similarity transform (in place)
Definition at line 137 of file SimilarityTransform.hh.
Referenced by BIAS::CamPoseCalib::GuessInitialCam_().
bool SimilarityTransform::Load | ( | const std::string & | inputFile | ) |
Load similarity transform from text file inputFile.
Definition at line 37 of file SimilarityTransform.cpp.
|
inline |
Concatenate this similarity transform and the given one so that result = this * arg holds for the corresponding 4x4 matrices.
Definition at line 145 of file SimilarityTransform.hh.
References C_, Q_, and scale_.
Referenced by BIAS::operator*().
|
inline |
Transform the given homogeneous 3D point with this similarity transform so that result = this * vec holds for the corresponding 4x4 matrix.
Computes the 4x4 transformation matrix internally.
Definition at line 165 of file SimilarityTransform.hh.
|
inline |
Transform the given vector with this similarity transform so that result = this * vec holds for the corresponding 4x4 matrix.
Definition at line 157 of file SimilarityTransform.hh.
Referenced by BIAS::operator*().
|
inlineinherited |
|
inlineinherited |
creates a new debuglevel
Definition at line 474 of file Debug.hh.
Referenced by BIAS::COSAC< SolutionType >::COSAC(), BIAS::ProjectionParametersPerspectiveDepth::Init(), BIAS::MonteCarloTransform::MonteCarloTransform(), BIAS::PMatrixEstimation::PMatrixEstimation(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), BIAS::RotationAveraging::RotationAveraging(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
|
inline |
Copy all elements of another SimilarityTransform instance.
Definition at line 81 of file SimilarityTransform.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
bool SimilarityTransform::Save | ( | const std::string & | outputFile | ) |
Save similarity transform to text file outputFile.
Definition at line 52 of file SimilarityTransform.cpp.
|
inline |
Set rotation, translation, and optional scaling.
Definition at line 99 of file SimilarityTransform.hh.
|
inline |
Set translational part from vector C.
Definition at line 96 of file SimilarityTransform.hh.
Referenced by BIAS::CamPoseCalib::GuessInitialCam_().
|
inlineinherited |
Definition at line 318 of file Debug.hh.
Referenced by BIAS::ShowCamWxVideoSourceFactory::CreateBumbleBee(), BIAS::ShowCamWxVideoSourceFactory::CreateDCAM(), BIAS::VideoSource_MDcam::ScanBus(), BIAS::GLProjectionParametersBase::SetDebugLevel(), BIAS::VideoSource_Disk::VideoSource_Disk(), BIAS::VideoSource_DV2::VideoSource_DV2(), BIAS::VideoSource_DV::VideoSource_DV_Internal_Init_(), and BIAS::VideoSource_V4L::VideoSource_V4L().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inline |
Set rotational part from unit quaternion Q.
Definition at line 89 of file SimilarityTransform.hh.
|
inline |
Set rotational part from rotation matrix R.
Definition at line 92 of file SimilarityTransform.hh.
References BIAS::RMatrixBase::GetQuaternion().
Referenced by BIAS::CamPoseCalib::GuessInitialCam_().
|
inlineinherited |
|
friend |
Definition at line 184 of file SimilarityTransform.hh.
|
friend |
Definition at line 190 of file SimilarityTransform.hh.
|
protectedinherited |
Definition at line 510 of file Debug.hh.
Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().
|
protectedinherited |
new concept, debuglevel are managed here in the debug class
Definition at line 516 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protectedinherited |
Definition at line 517 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protected |
the translation
Definition at line 179 of file SimilarityTransform.hh.
Referenced by Mult(), BIAS::operator<<(), operator=(), and BIAS::operator>>().
|
staticprotectedinherited |
|
protected |
this is the rotation
Definition at line 176 of file SimilarityTransform.hh.
Referenced by Mult(), BIAS::operator<<(), operator=(), and BIAS::operator>>().
|
protected |
Definition at line 181 of file SimilarityTransform.hh.
Referenced by Mult(), BIAS::operator<<(), operator=(), and BIAS::operator>>().