Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
BIAS::GenSynthMatches Class Reference

class for generating synthetic matches More...

#include <Utils/GenSynthMatches.hh>

+ Inheritance diagram for BIAS::GenSynthMatches:
+ Collaboration diagram for BIAS::GenSynthMatches:

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
int Create3DPoints (bool fixed_errors=false)
 Create static and moving 3D points see _CreateCamMovement for explanation of parameter. More...
 
void CreateCamMovement (const bool fixed_error=false)
 see _CreateCamMovement for docu More...
 
int CreateGTVRML (const std::string &file_name) const
 
int CreateMatches (bool points3D_set_by_user=false, bool fixed_errors=false)
 returns negative value, if error occurs, 0 on success see _CreateCamMovement for explanation of parameter "fixed_errors" More...
 
int CreateMatches (int &index)
 create matches for existing 3D points More...
 
int CreateMoving3DPoint (int index)
 Replace the moving 3D point at index by a newly generated one. More...
 
void CreateMovingTransforms ()
 fills _MovingTransform More...
 
int CreateStatic3DPoint (int index)
 Replace the static 3D point at index by a newly generated one. More...
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
void DrawNoisy (Image< unsigned char > &im, int minindex=0, int maxindex=1) const
 
void DrawTrue (Image< unsigned char > &im, int minindex=0, int maxindex=1) const
 
 GenSynthMatches (Param &para)
 
void Get3DMovingPoints (std::vector< HomgPoint3D > &p, const int frame=0) const
 p = _MovingTransform[frame] * _MovingPoints; More...
 
void Get3DPoints (std::vector< HomgPoint3D > &p) const
 p = _StaticPoints; More...
 
void GetC (int imNo, HomgPoint3D &C) const
 
void GetC (std::vector< HomgPoint3D > &C) const
 
void GetCorrespondences (std::vector< std::vector< HomgPoint2D > > &p) const
 same as GetPOints with inverted indices : p[i][k] is point number i in image k More...
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
void GetGTC (int imNo, HomgPoint3D &C) const
 C = _GT_C[imNo];. More...
 
void GetGTC (std::vector< HomgPoint3D > &C) const
 
void GetGTNormalizedF (std::vector< std::vector< FMatrixBase > > &F) const
 A moving 3D point X_i is generated for image i from 3D Point X using the euclidean transform E_i=[R_i | T_i]: X_i = E_i * X It projects into the image point x_i with the according projection matrix P_i=[r_i'|-r_i'C_i] (where ' denotes transposition): x_i = P_i * X_i. More...
 
void GetGTNormalizedPoints (int imNo, std::vector< HomgPoint2D > &p) const
 p = _GT_NormalizedPoints[imNo]; More...
 
void GetGTNormalizedPoints (std::vector< std::vector< HomgPoint2D > > &p) const
 
void GetGTP (int imNo, PMatrixBase &P) const
 P = _GT_P[imNo];. More...
 
void GetGTP (std::vector< PMatrixBase > &P) const
 
void GetGTPoints (int imNo, std::vector< HomgPoint2D > &p) const
 p = _GT_Points[imNo]; More...
 
void GetGTPoints (std::vector< std::vector< HomgPoint2D > > &p) const
 
void GetGTR (int imNo, RMatrixBase &R) const
 R = _GT_R[imNo];. More...
 
void GetGTR (std::vector< RMatrixBase > &R) const
 
void GetImageSize (int &width, int &height) const
 
void GetInliers (std::vector< bool > &inl) const
 inl[i] indicates if Get(GT)Points()[i] is outlier More...
 
void GetK (KMatrix &K) const
 
int GetMoving3DPoints (std::vector< BIAS::HomgPoint3D > &points)
 read the moving 3D points used for computaion More...
 
int GetMovingTransforms (std::vector< BIAS::EuclideanTransf3D > &res)
 
void GetNormalizedCorrespondences (std::vector< std::vector< HomgPoint2D > > &p) const
 same as GetNormalizedPoints with inverted indices : p[i][k] is point number i in image k More...
 
void GetNormalizedPoints (int imNo, std::vector< HomgPoint2D > &p) const
 
void GetNormalizedPoints (std::vector< std::vector< HomgPoint2D > > &p) const
 p[i][k] is point number k in image i More...
 
int GetNumImages () const
 
int GetNumMovingObjects ()
 
void GetP (int imNo, PMatrixBase &P) const
 
void GetP (std::vector< PMatrixBase > &P) const
 
void GetPoints (int imNo, std::vector< HomgPoint2D > &p) const
 
void GetPoints (std::vector< std::vector< HomgPoint2D > > &p) const
 p[i][k] is point number k in image i More...
 
void GetPointSourceBorders (int &max_inlier, int &max_outlier, int &max_mov_obj) const
 when getting point list for an image, inidices 0 - max_inlier-1 are true matches generated by static object max_inlier - max_outlier-1 are uniform distributed random outliers More...
 
void GetR (int imNo, RMatrixBase &R) const
 
void GetR (std::vector< RMatrixBase > &R) const
 
double GetSigmaImagePoints () const
 
int GetStatic3DPoints (std::vector< BIAS::HomgPoint3D > &points)
 read the static 3D points used for computation 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...
 
GenSynthMatchesoperator= (const MatchDataBase &mdb)
 
bool operator== (MatchDataBase &l)
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
int Read (const std::string &fname)
 binary read More...
 
virtual int Read (std::istream &is)
 binary read More...
 
int ReadData (std::string file)
 read in ascii file format More...
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void Reset ()
 
void SetData (KMatrix &K, std::vector< RMatrixBase > &R, std::vector< HomgPoint3D > &C, std::vector< std::vector< HomgPoint2D > > &m)
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
int SetMoving3DPoints (const std::vector< BIAS::HomgPoint3D > &points)
 set the moving 3D points used for computation More...
 
void SetNormalizedData (KMatrix &K, std::vector< RMatrixBase > &R, std::vector< HomgPoint3D > &C, std::vector< std::vector< HomgPoint2D > > &m)
 
int SetStatic3DPoints (const std::vector< BIAS::HomgPoint3D > &points)
 set the static 3D points used for computation More...
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
int Write (const std::string &fname) const
 binary write More...
 
virtual int Write (std::ostream &os) const
 binary write More...
 
int WriteData (std::string file) const
 write in ascii file format More...
 
virtual ~GenSynthMatches ()
 

Static Public Member Functions

static long int GetGlobalDebugLevel ()
 
static void SetGlobalDebugLevel (long int lev)
 

Protected Member Functions

virtual void _AddParameter (Param &para)
 fills all protected pointer values More...
 
void _AddUniformDistributedOutliers ()
 fills _GT_Points, _Points, _GT_NormalizedPoints, _NormalizedPoints from entries [*_NumStaticPoints] to [*_NumStaticPoints+*_NumOutliers-1] More...
 
int _AreMovingObjectsVisible ()
 returns -1 if no corner of moving object boundary is seen in images More...
 
bool _CheckParams () const
 
void _CreateCamMovement (const bool fixed_error)
 fills _k, _Ki, _GT_R, _R, GT_C, _C, _GT_P and _P More...
 
int _CreateMoving2DPoints (int &index)
 fills _GT_Points, _Points, _GT_NormalizedPoints, _NormalizedPoints from entries [*_NumStaticPoints+_*NumOutliers] to [*_NumStaticPoints+*_NumOutliers+*_NumMovingPoints-1] More...
 
int _CreateMoving3DPoints ()
 fills _MovingPoints returns -1 if no corner of moving object boundary is seen in images or the center of moving objects is not seen in images More...
 
int _CreateMovingGT2DPoints (int &index)
 fills _GT_Points, _GT_NormalizedPoints from entries [*_NumStaticPoints+_*NumOutliers] to [*_NumStaticPoints+*_NumOutliers+*_NumMovingPoints-1] More...
 
void _CreateMovingTransforms ()
 fills _MovinTransforms More...
 
int _CreateStatic2DPoints (int &index)
 fills *_NumStaticPoints first entries of _GT_Points, _Points, _GT_NormalizedPoints, _NormalizedPoints also resizes the above vectors to [*_NumImages][*_NumStaticPoints+*_NumMovingObjects+*_NumOutliers] More...
 
int _CreateStatic3DPoints ()
 fills _StaticPoints returns -1 if no common viewing volume of all cameras is present More...
 
int _CreateStaticGT2DPoints (int &index)
 fills *_NumStaticPoints first entries of _GT_Points and _GT_NormalizedPoints also resizes the above vectors to [*_NumImages][*_NumStaticPoints+*_NumMovingObjects+*_NumOutliers] More...
 
void _Draw (Image< unsigned char > &im, int minindex, int maxindex, const std::vector< std::vector< HomgPoint2D > > *p) const
 helper function used for visualizing the matches More...
 
void _DrawPoints (Image< unsigned char > &im, int index, const std::vector< std::vector< HomgPoint2D > > *p) const
 helper function used for visualizing the matches More...
 
bool _IsSeen (HomgPoint2D &p, double border=0.0)
 
void _SetCamData (KMatrix &K, std::vector< RMatrixBase > &R, std::vector< HomgPoint3D > &C)
 
void _Transpose (const std::vector< std::vector< HomgPoint2D > > &src, std::vector< std::vector< HomgPoint2D > > &dst) const
 
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 
int CreateVRML_ (const std::string &file_name, const std::vector< PMatrix > &P, const std::vector< HomgPoint3D > &p) const
 

Protected Attributes

std::vector< HomgPoint3D_C
 
double * _FocalLength
 
std::vector< BIAS::HomgPoint3D_GT_C
 
std::vector< std::vector
< HomgPoint2D > > 
_GT_NormalizedPoints
 
std::vector< BIAS::PMatrixBase_GT_P
 
std::vector< std::vector
< HomgPoint2D > > 
_GT_Points
 
std::vector< BIAS::RMatrixBase_GT_R
 
int * _ImHeight
 
int * _ImWidth
 
KMatrix _K
 
KMatrix _Ki
 
long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
double * _MaxCamDistance
 
double * _MaxDispOutliers
 
double * _MinCamDistance
 
BIAS::Vector< double > * _MotionVecX
 
BIAS::Vector< double > * _MotionVecY
 
BIAS::Vector< double > * _MotionVecZ
 
BIAS::Vector< double > * _MovingObjMotionVecX
 
BIAS::Vector< double > * _MovingObjMotionVecY
 
BIAS::Vector< double > * _MovingObjMotionVecZ
 
BIAS::Vector< double > * _MovingObjRotVecX
 
BIAS::Vector< double > * _MovingObjRotVecY
 
BIAS::Vector< double > * _MovingObjRotVecZ
 
std::vector< BIAS::HomgPoint3D_MovingPoints
 
std::vector
< BIAS::EuclideanTransf3D
_MovingTransform
 
std::vector< std::vector
< HomgPoint2D > > 
_NormalizedPoints
 
int * _NumImages
 
int * _NumMovingObjects
 
int * _NumMovingPoints
 
int * _NumOutliers
 
int * _NumPoints
 
int * _NumStaticPoints
 
double * _OutlDirChange
 
double * _OutlLengthChange
 
std::vector< PMatrixBase_P
 
BIAS::Param_para
 
std::vector< std::vector
< HomgPoint2D > > 
_Points
 
double * _PrinciplePointX
 
double * _PrinciplePointY
 
std::vector< RMatrixBase_R
 
BIAS::Random _rand
 
BIAS::Vector< double > * _RotVecX
 
BIAS::Vector< double > * _RotVecY
 
BIAS::Vector< double > * _RotVecZ
 
double * _SigmaCamCenterX
 
double * _SigmaCamCenterY
 
double * _SigmaCamCenterZ
 
double * _SigmaCamRotX
 
double * _SigmaCamRotY
 
double * _SigmaCamRotZ
 
double * _SigmaImagePoints
 
BIAS::Vector< double > * _SizeMovingObjX
 
BIAS::Vector< double > * _SizeMovingObjY
 
BIAS::Vector< double > * _SizeMovingObjZ
 
std::vector< BIAS::HomgPoint3D_StaticPoints
 
std::map< std::string, long int > _String2Debuglevel
 
bool * _UserGivenP
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Friends

BIASUtils_EXPORT std::ostream & operator<< (std::ostream &os, const GenSynthMatches &m)
 
BIASUtils_EXPORT std::istream & operator>> (std::istream &os, GenSynthMatches &m)
 

Detailed Description

class for generating synthetic matches

Author
woelk 2004
Examples:
ExampleGenSynthMatches.cpp, ExampleMatchDataBase.cpp, and ExampleTFT.cpp.

Definition at line 75 of file GenSynthMatches.hh.

Constructor & Destructor Documentation

GenSynthMatches::GenSynthMatches ( Param para)
GenSynthMatches::~GenSynthMatches ( )
virtual

Definition at line 199 of file GenSynthMatches.cpp.

Member Function Documentation

void GenSynthMatches::_AddParameter ( Param para)
protectedvirtual
void GenSynthMatches::_AddUniformDistributedOutliers ( )
protected
int GenSynthMatches::_AreMovingObjectsVisible ( )
protected

returns -1 if no corner of moving object boundary is seen in images

or the center of moving objects is not seen in images

Definition at line 1234 of file GenSynthMatches.cpp.

References BIAS::MatchDataBase::_C, _GT_C, _GT_P, _GT_R, _IsSeen(), _MovingTransform, BIAS::MatchDataBase::_NumImages, _NumMovingObjects, _NumMovingPoints, BIAS::MatchDataBase::_P, BIAS::MatchDataBase::_R, and BIAS::HomgPoint3D::Set().

Referenced by _CreateMoving3DPoints().

bool GenSynthMatches::_CheckParams ( ) const
protected
void GenSynthMatches::_CreateCamMovement ( const bool  fixed_error)
protected

fills _k, _Ki, _GT_R, _R, GT_C, _C, _GT_P and _P

When "fixed_errors" is set to true, the noisy camera position is set such that:

  • The rotational error is assumed to be given as axis and angle. The axis is choosen randomly and the angle is exactly as indicated by _SigmaCamRotX (in rad).
  • The translational error is assumed to be given as an angle. It is choosen such the angle between the epipole in the noise free case and the epipole in the noisey case form exactly the angle indicated by _SigmaCamCenterX (in rad). The translational error thus alway lies in the plane perpendicular to the ground truth epipole. Its direction in the plane is choosen randomly and its magnitude is choosen such that the angles between the epipoles is exactly *_SigmaCamCenterX (in rad)

When "fixed_errors" is set to false, the normal distributed noise with diagonal covariance matrix whose elements are indicated by parameters _SigmaCamCenter? are added to each camera positions. The camera orientation is computed using the euler angles from *_RotVec?[frame] with additional normal disributed noise as indiceated by _SigmaCamRot?.

Author
woelk 01/2007

Definition at line 877 of file GenSynthMatches.cpp.

References BIAS::MatchDataBase::_C, _FocalLength, _GT_C, _GT_P, _GT_R, BIAS::MatchDataBase::_K, BIAS::MatchDataBase::_Ki, _MotionVecX, _MotionVecY, _MotionVecZ, BIAS::MatchDataBase::_NumImages, BIAS::MatchDataBase::_P, _PrinciplePointX, _PrinciplePointY, BIAS::MatchDataBase::_R, _rand, _RotVecX, _RotVecY, _RotVecZ, _SigmaCamCenterX, _SigmaCamCenterY, _SigmaCamCenterZ, _SigmaCamRotX, _SigmaCamRotY, _SigmaCamRotZ, _UserGivenP, BIAS::Vector3< T >::CoordSphereToEuclidean(), BIAS::Vector3< T >::CrossProduct(), BIAS::Debug::DebugLevelIsSet(), BIAS::Random::GetNormalDistributed(), BIAS::Random::GetUniformDistributed(), BIAS::KMatrix::Invert(), BIAS::Vector3< T >::NormL2(), BIAS::HomgPoint3D::Set(), BIAS::RMatrixBase::SetXYZ(), and BIAS::Vector< T >::Size().

Referenced by Create3DPoints().

int GenSynthMatches::_CreateMoving2DPoints ( int &  index)
protected

fills _GT_Points, _Points, _GT_NormalizedPoints, _NormalizedPoints from entries [*_NumStaticPoints+_*NumOutliers] to [*_NumStaticPoints+*_NumOutliers+*_NumMovingPoints-1]

Definition at line 1573 of file GenSynthMatches.cpp.

References _CreateMovingGT2DPoints(), _GT_Points, _IsSeen(), BIAS::MatchDataBase::_Ki, _MovingPoints, _MovingTransform, BIAS::MatchDataBase::_NormalizedPoints, BIAS::MatchDataBase::_NumImages, _NumMovingObjects, _NumMovingPoints, _NumOutliers, _NumStaticPoints, BIAS::MatchDataBase::_P, BIAS::MatchDataBase::_Points, _rand, _SigmaImagePoints, BIAS::Random::GetNormalDistributed(), and BIAS::HomgPoint2D::Set().

Referenced by CreateMatches().

int GenSynthMatches::_CreateMoving3DPoints ( )
protected

fills _MovingPoints returns -1 if no corner of moving object boundary is seen in images or the center of moving objects is not seen in images

Definition at line 1375 of file GenSynthMatches.cpp.

References _AreMovingObjectsVisible(), _GT_P, _IsSeen(), _MovingPoints, _MovingTransform, BIAS::MatchDataBase::_NumImages, _NumMovingObjects, _NumMovingPoints, BIAS::MatchDataBase::_P, _rand, and BIAS::Random::GetUniformDistributed().

Referenced by Create3DPoints().

int GenSynthMatches::_CreateMovingGT2DPoints ( int &  index)
protected

fills _GT_Points, _GT_NormalizedPoints from entries [*_NumStaticPoints+_*NumOutliers] to [*_NumStaticPoints+*_NumOutliers+*_NumMovingPoints-1]

Definition at line 1626 of file GenSynthMatches.cpp.

References _GT_NormalizedPoints, _GT_P, _GT_Points, _IsSeen(), BIAS::MatchDataBase::_Ki, _MovingPoints, _MovingTransform, BIAS::MatchDataBase::_NumImages, _NumMovingObjects, _NumMovingPoints, _NumOutliers, and _NumStaticPoints.

Referenced by _CreateMoving2DPoints(), and Read().

void GenSynthMatches::_CreateMovingTransforms ( )
protected

fills _MovinTransforms

Definition at line 981 of file GenSynthMatches.cpp.

References _MovingTransform, BIAS::MatchDataBase::_NumImages, _NumMovingObjects, and _NumMovingPoints.

Referenced by Create3DPoints().

int GenSynthMatches::_CreateStatic2DPoints ( int &  index)
protected

fills *_NumStaticPoints first entries of _GT_Points, _Points, _GT_NormalizedPoints, _NormalizedPoints also resizes the above vectors to [*_NumImages][*_NumStaticPoints+*_NumMovingObjects+*_NumOutliers]

Definition at line 1431 of file GenSynthMatches.cpp.

References _CreateStaticGT2DPoints(), _GT_NormalizedPoints, _GT_Points, _IsSeen(), BIAS::MatchDataBase::_Ki, BIAS::MatchDataBase::_NormalizedPoints, BIAS::MatchDataBase::_NumImages, _NumMovingObjects, _NumMovingPoints, _NumOutliers, _NumStaticPoints, BIAS::MatchDataBase::_P, BIAS::MatchDataBase::_Points, _rand, _SigmaImagePoints, _StaticPoints, BIAS::Debug::DebugLevelIsSet(), BIAS::Random::GetNormalDistributed(), and BIAS::HomgPoint2D::Set().

Referenced by CreateMatches().

int GenSynthMatches::_CreateStatic3DPoints ( )
protected
int GenSynthMatches::_CreateStaticGT2DPoints ( int &  index)
protected

fills *_NumStaticPoints first entries of _GT_Points and _GT_NormalizedPoints also resizes the above vectors to [*_NumImages][*_NumStaticPoints+*_NumMovingObjects+*_NumOutliers]

Definition at line 1481 of file GenSynthMatches.cpp.

References _GT_NormalizedPoints, _GT_P, _GT_Points, _IsSeen(), BIAS::MatchDataBase::_Ki, BIAS::MatchDataBase::_NumImages, _NumMovingObjects, _NumMovingPoints, _NumOutliers, _NumStaticPoints, and _StaticPoints.

Referenced by _CreateStatic2DPoints(), and Read().

void GenSynthMatches::_Draw ( Image< unsigned char > &  im,
int  minindex,
int  maxindex,
const std::vector< std::vector< HomgPoint2D > > *  p 
) const
protected
void GenSynthMatches::_DrawPoints ( Image< unsigned char > &  im,
int  index,
const std::vector< std::vector< HomgPoint2D > > *  p 
) const
protected

helper function used for visualizing the matches

Definition at line 391 of file GenSynthMatches.cpp.

References _ImHeight, _ImWidth, BIAS::MatchDataBase::_NumImages, _NumMovingObjects, _NumMovingPoints, _NumOutliers, _NumStaticPoints, and BIAS::ImageDraw< StorageType >::CircleCenterFilled().

Referenced by _Draw().

bool BIAS::GenSynthMatches::_IsSeen ( HomgPoint2D p,
double  border = 0.0 
)
inlineprotected
void MatchDataBase::_SetCamData ( KMatrix K,
std::vector< RMatrixBase > &  R,
std::vector< HomgPoint3D > &  C 
)
protectedinherited
void BIAS::MatchDataBase::_Transpose ( const std::vector< std::vector< HomgPoint2D > > &  src,
std::vector< std::vector< HomgPoint2D > > &  dst 
) const
inlineprotectedinherited
void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

int GenSynthMatches::Create3DPoints ( bool  fixed_errors = false)

Create static and moving 3D points see _CreateCamMovement for explanation of parameter.

Definition at line 261 of file GenSynthMatches.cpp.

References _CreateCamMovement(), _CreateMoving3DPoints(), _CreateMovingTransforms(), _CreateStatic3DPoints(), _NumMovingObjects, _NumMovingPoints, and _NumStaticPoints.

Referenced by BIAS::GenSynthMatchesRig::CreateMatches(), and CreateMatches().

void BIAS::GenSynthMatches::CreateCamMovement ( const bool  fixed_error = false)
inline

see _CreateCamMovement for docu

Definition at line 100 of file GenSynthMatches.hh.

Referenced by BIAS::GenSynthMatchesRig::CreateMatches().

int GenSynthMatches::CreateGTVRML ( const std::string &  file_name) const
int GenSynthMatches::CreateMatches ( bool  points3D_set_by_user = false,
bool  fixed_errors = false 
)

returns negative value, if error occurs, 0 on success see _CreateCamMovement for explanation of parameter "fixed_errors"

Examples:
ExampleMatchDataBase.cpp, and ExampleTFT.cpp.

Definition at line 203 of file GenSynthMatches.cpp.

References _CheckParams(), Create3DPoints(), and Reset().

Referenced by BIAS::GenSynthMatchesRig::CreateMatches().

int GenSynthMatches::CreateMatches ( int &  index)
int GenSynthMatches::CreateMoving3DPoint ( int  index)
void BIAS::GenSynthMatches::CreateMovingTransforms ( )
inline

fills _MovingTransform

Definition at line 104 of file GenSynthMatches.hh.

Referenced by BIAS::GenSynthMatchesRig::CreateMatches().

int GenSynthMatches::CreateStatic3DPoint ( int  index)
int GenSynthMatches::CreateVRML_ ( const std::string &  file_name,
const std::vector< PMatrix > &  P,
const std::vector< HomgPoint3D > &  p 
) const
protected
bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

void GenSynthMatches::DrawNoisy ( Image< unsigned char > &  im,
int  minindex = 0,
int  maxindex = 1 
) const
Examples:
ExampleTFT.cpp.

Definition at line 289 of file GenSynthMatches.cpp.

References _Draw(), and BIAS::MatchDataBase::_Points.

void GenSynthMatches::DrawTrue ( Image< unsigned char > &  im,
int  minindex = 0,
int  maxindex = 1 
) const
Examples:
ExampleTFT.cpp.

Definition at line 285 of file GenSynthMatches.cpp.

References _Draw(), and _GT_Points.

void GenSynthMatches::Get3DMovingPoints ( std::vector< HomgPoint3D > &  p,
const int  frame = 0 
) const

p = _MovingTransform[frame] * _MovingPoints;

Definition at line 553 of file GenSynthMatches.cpp.

References _MovingPoints, and _MovingTransform.

Referenced by CreateGTVRML().

void GenSynthMatches::Get3DPoints ( std::vector< HomgPoint3D > &  p) const

p = _StaticPoints;

Definition at line 549 of file GenSynthMatches.cpp.

References _StaticPoints.

Referenced by CreateGTVRML().

void MatchDataBase::GetC ( int  imNo,
HomgPoint3D C 
) const
inherited
Examples:
ExampleMatchDataBase.cpp, and ExampleTFT.cpp.

Definition at line 69 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_C.

void MatchDataBase::GetC ( std::vector< HomgPoint3D > &  C) const
inherited

Definition at line 71 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_C.

void MatchDataBase::GetCorrespondences ( std::vector< std::vector< HomgPoint2D > > &  p) const
inherited

same as GetPOints with inverted indices : p[i][k] is point number i in image k

Definition at line 83 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_Points, and BIAS::MatchDataBase::_Transpose().

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

void GenSynthMatches::GetGTC ( int  imNo,
HomgPoint3D C 
) const

C = _GT_C[imNo];.

Definition at line 521 of file GenSynthMatches.cpp.

References _GT_C.

Referenced by CreateGTVRML().

void GenSynthMatches::GetGTC ( std::vector< HomgPoint3D > &  C) const

Definition at line 524 of file GenSynthMatches.cpp.

References _GT_C.

void GenSynthMatches::GetGTNormalizedF ( std::vector< std::vector< FMatrixBase > > &  F) const

A moving 3D point X_i is generated for image i from 3D Point X using the euclidean transform E_i=[R_i | T_i]: X_i = E_i * X It projects into the image point x_i with the according projection matrix P_i=[r_i'|-r_i'C_i] (where ' denotes transposition): x_i = P_i * X_i.

Finding a projection matrix P_x where each 3D point from image i-1 projects onto the same 2D points goes as follows: x_i = P_x X_{i-1}

First take the 3D point and move it to ist new poition in image i. This is done by first applying the inverse E_{i-1} and then E_i: X_i = E_i * E_{i-1}^{-1} * X_{i-1} Now use the old projection matrix P_i. x_i = P_i * E_i * E_{i-1}^{-1} * X_{i-1}

The new projection matrix P_x is composed as follows: P_x = P_i * E_i * E_{i-1}^{-1} = [r_i'|-r_i'C_i] * [R_i | T_i] * [R_{i-1} | T_{i-1}]^{-1} = [r_i'|-r_i'C_i] * [R_i | T_i] * [R_{i-1}' | -R_{i-1}'T_{i-1}] = [r_i'|-r_i'C_i] * [R_i R_{i-1}' | T_i - R_i R_{i-1}'T_{i-1}] = [r_i' R_i R_{i-1}' | -r_i'C_i + r_i'(T_i - R_i R_{i-1}'T_{i-1})] = [r_i' R_i R_{i-1}' | -r_i'C_i + r_i'T_i - r_i'R_i R_{i-1}'T_{i-1}] = [r_i'R_iR_{i-1}' | -r_i'R_iR_{i-1}'R_{i-1}R_i'C_i + r_i'R_iR_{i-1}'R_{i-1}R_i'T_i - r_i'R_i R_{i-1}'T_{i-1}] = [r_i'R_iR_{i-1}' | -r_i'R_iR_{i-1}'(T_{i-1}+R_{i-1}R_i'(C_i-T_i))] setting R_x' = r_i'R_iR_{i-1}' is aequivalent to R_x = R_{i-1} R_i' r_i setting C_x = T_{i-1} + R_{i-1} R_i' (C_i - T_i) and leads to = [ R_x' | -R_x' C_x ]

Author
woelk 08/2004

Definition at line 607 of file GenSynthMatches.cpp.

References _GT_C, _GT_NormalizedPoints, _GT_R, _MovingObjMotionVecX, _MovingObjMotionVecY, _MovingObjMotionVecZ, _MovingObjRotVecX, _MovingObjRotVecY, _MovingObjRotVecZ, BIAS::MatchDataBase::_NumImages, _NumMovingObjects, _NumMovingPoints, _NumOutliers, _NumStaticPoints, BIAS::Debug::DebugLevelIsSet(), BIAS::Matrix3x3< T >::Mult(), BIAS::Vector3< T >::Set(), BIAS::RMatrixBase::SetXYZ(), and BIAS::Matrix3x3< T >::Transpose().

void GenSynthMatches::GetGTNormalizedPoints ( int  imNo,
std::vector< HomgPoint2D > &  p 
) const

p = _GT_NormalizedPoints[imNo];

Definition at line 542 of file GenSynthMatches.cpp.

References _GT_NormalizedPoints.

void GenSynthMatches::GetGTNormalizedPoints ( std::vector< std::vector< HomgPoint2D > > &  p) const

Definition at line 545 of file GenSynthMatches.cpp.

References _GT_NormalizedPoints.

void GenSynthMatches::GetGTP ( int  imNo,
PMatrixBase P 
) const

P = _GT_P[imNo];.

Definition at line 528 of file GenSynthMatches.cpp.

References _GT_P.

void GenSynthMatches::GetGTP ( std::vector< PMatrixBase > &  P) const

Definition at line 531 of file GenSynthMatches.cpp.

References _GT_P.

void GenSynthMatches::GetGTPoints ( int  imNo,
std::vector< HomgPoint2D > &  p 
) const

p = _GT_Points[imNo];

Definition at line 535 of file GenSynthMatches.cpp.

References _GT_Points.

void GenSynthMatches::GetGTPoints ( std::vector< std::vector< HomgPoint2D > > &  p) const

Definition at line 538 of file GenSynthMatches.cpp.

References _GT_Points.

void GenSynthMatches::GetGTR ( int  imNo,
RMatrixBase R 
) const

R = _GT_R[imNo];.

Definition at line 514 of file GenSynthMatches.cpp.

References _GT_R.

Referenced by CreateGTVRML().

void GenSynthMatches::GetGTR ( std::vector< RMatrixBase > &  R) const

Definition at line 517 of file GenSynthMatches.cpp.

References _GT_R.

void BIAS::GenSynthMatches::GetImageSize ( int &  width,
int &  height 
) const
inline

Definition at line 195 of file GenSynthMatches.hh.

void GenSynthMatches::GetInliers ( std::vector< bool > &  inl) const

inl[i] indicates if Get(GT)Points()[i] is outlier

Definition at line 568 of file GenSynthMatches.cpp.

References BIAS::MatchDataBase::_NumPoints, and _NumStaticPoints.

void MatchDataBase::GetK ( KMatrix K) const
inherited
Examples:
ExampleMatchDataBase.cpp.

Definition at line 60 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_K.

Referenced by CreateGTVRML().

int BIAS::GenSynthMatches::GetMoving3DPoints ( std::vector< BIAS::HomgPoint3D > &  points)
inline

read the moving 3D points used for computaion

Definition at line 122 of file GenSynthMatches.hh.

Referenced by BIAS::GenSynthMatchesRig::CreateMatches().

int BIAS::GenSynthMatches::GetMovingTransforms ( std::vector< BIAS::EuclideanTransf3D > &  res)
inline

Definition at line 127 of file GenSynthMatches.hh.

void MatchDataBase::GetNormalizedCorrespondences ( std::vector< std::vector< HomgPoint2D > > &  p) const
inherited

same as GetNormalizedPoints with inverted indices : p[i][k] is point number i in image k

Definition at line 90 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_NormalizedPoints, and BIAS::MatchDataBase::_Transpose().

void MatchDataBase::GetNormalizedPoints ( int  imNo,
std::vector< HomgPoint2D > &  p 
) const
inherited
void MatchDataBase::GetNormalizedPoints ( std::vector< std::vector< HomgPoint2D > > &  p) const
inherited

p[i][k] is point number k in image i

Definition at line 88 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_NormalizedPoints.

int BIAS::MatchDataBase::GetNumImages ( ) const
inlineinherited

Definition at line 88 of file MatchDataBase.hh.

int BIAS::GenSynthMatches::GetNumMovingObjects ( )
inline

Definition at line 131 of file GenSynthMatches.hh.

void MatchDataBase::GetP ( int  imNo,
PMatrixBase P 
) const
inherited

Definition at line 74 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_P.

void MatchDataBase::GetP ( std::vector< PMatrixBase > &  P) const
inherited

Definition at line 76 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_P.

void MatchDataBase::GetPoints ( int  imNo,
std::vector< HomgPoint2D > &  p 
) const
inherited
Examples:
ExampleMatchDataBase.cpp.

Definition at line 79 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_Points.

void MatchDataBase::GetPoints ( std::vector< std::vector< HomgPoint2D > > &  p) const
inherited

p[i][k] is point number k in image i

Definition at line 81 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_Points.

void BIAS::GenSynthMatches::GetPointSourceBorders ( int &  max_inlier,
int &  max_outlier,
int &  max_mov_obj 
) const
inline

when getting point list for an image, inidices 0 - max_inlier-1 are true matches generated by static object max_inlier - max_outlier-1 are uniform distributed random outliers

max_outlier - max_mov_obj-1 are the points generated by the moving objects

Definition at line 209 of file GenSynthMatches.hh.

Referenced by CreateVRML_().

void MatchDataBase::GetR ( int  imNo,
RMatrixBase R 
) const
inherited
Examples:
ExampleMatchDataBase.cpp, and ExampleTFT.cpp.

Definition at line 63 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_R.

void MatchDataBase::GetR ( std::vector< RMatrixBase > &  R) const
inherited

Definition at line 65 of file MatchDataBase.cpp.

References BIAS::MatchDataBase::_R.

double BIAS::GenSynthMatches::GetSigmaImagePoints ( ) const
inline

Definition at line 198 of file GenSynthMatches.hh.

int BIAS::GenSynthMatches::GetStatic3DPoints ( std::vector< BIAS::HomgPoint3D > &  points)
inline

read the static 3D points used for computation

Definition at line 112 of file GenSynthMatches.hh.

Referenced by BIAS::GenSynthMatchesRig::CreateMatches().

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
GenSynthMatches & GenSynthMatches::operator= ( const MatchDataBase mdb)
bool MatchDataBase::operator== ( MatchDataBase l)
inherited
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

int GenSynthMatches::Read ( const std::string &  fname)

binary read

Definition at line 767 of file GenSynthMatches.cpp.

References BIAS::MatchDataBase::Read().

Referenced by BIAS::GenSynthMatchesRig::Read().

int GenSynthMatches::Read ( std::istream &  is)
virtual
int GenSynthMatches::ReadData ( std::string  file)

read in ascii file format

Definition at line 458 of file GenSynthMatches.cpp.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

void GenSynthMatches::Reset ( )
void MatchDataBase::SetData ( KMatrix K,
std::vector< RMatrixBase > &  R,
std::vector< HomgPoint3D > &  C,
std::vector< std::vector< HomgPoint2D > > &  m 
)
inherited
void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

int BIAS::GenSynthMatches::SetMoving3DPoints ( const std::vector< BIAS::HomgPoint3D > &  points)
inline

set the moving 3D points used for computation

Definition at line 117 of file GenSynthMatches.hh.

Referenced by BIAS::GenSynthMatchesRig::CreateMatches().

void MatchDataBase::SetNormalizedData ( KMatrix K,
std::vector< RMatrixBase > &  R,
std::vector< HomgPoint3D > &  C,
std::vector< std::vector< HomgPoint2D > > &  m 
)
inherited
int BIAS::GenSynthMatches::SetStatic3DPoints ( const std::vector< BIAS::HomgPoint3D > &  points)
inline

set the static 3D points used for computation

Definition at line 107 of file GenSynthMatches.hh.

Referenced by BIAS::GenSynthMatchesRig::CreateMatches().

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

int GenSynthMatches::Write ( const std::string &  fname) const

binary write

Examples:
ExampleMatchDataBase.cpp.

Definition at line 685 of file GenSynthMatches.cpp.

References BIAS::MatchDataBase::Write().

int GenSynthMatches::Write ( std::ostream &  os) const
virtual
int GenSynthMatches::WriteData ( std::string  file) const

write in ascii file format

Examples:
ExampleTFT.cpp.

Definition at line 437 of file GenSynthMatches.cpp.

Friends And Related Function Documentation

BIASUtils_EXPORT std::ostream& operator<< ( std::ostream &  os,
const GenSynthMatches m 
)
friend
BIASUtils_EXPORT std::istream& operator>> ( std::istream &  os,
GenSynthMatches m 
)
friend

Member Data Documentation

std::vector<HomgPoint3D> BIAS::MatchDataBase::_C
protectedinherited
double* BIAS::GenSynthMatches::_FocalLength
protected
std::vector<BIAS::HomgPoint3D> BIAS::GenSynthMatches::_GT_C
protected
std::vector<std::vector<HomgPoint2D> > BIAS::GenSynthMatches::_GT_NormalizedPoints
protected
std::vector<BIAS::PMatrixBase> BIAS::GenSynthMatches::_GT_P
protected
std::vector<std::vector<HomgPoint2D> > BIAS::GenSynthMatches::_GT_Points
protected
std::vector<BIAS::RMatrixBase> BIAS::GenSynthMatches::_GT_R
protected
int * BIAS::GenSynthMatches::_ImHeight
protected
int* BIAS::GenSynthMatches::_ImWidth
protected
KMatrix BIAS::MatchDataBase::_K
protectedinherited
KMatrix BIAS::MatchDataBase::_Ki
protectedinherited
long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

double * BIAS::GenSynthMatches::_MaxCamDistance
protected
double * BIAS::GenSynthMatches::_MaxDispOutliers
protected
double* BIAS::GenSynthMatches::_MinCamDistance
protected
BIAS::Vector<double>* BIAS::GenSynthMatches::_MotionVecX
protected
BIAS::Vector<double> * BIAS::GenSynthMatches::_MotionVecY
protected
BIAS::Vector<double> * BIAS::GenSynthMatches::_MotionVecZ
protected
BIAS::Vector<double>* BIAS::GenSynthMatches::_MovingObjMotionVecX
protected
BIAS::Vector<double> * BIAS::GenSynthMatches::_MovingObjMotionVecY
protected
BIAS::Vector<double> * BIAS::GenSynthMatches::_MovingObjMotionVecZ
protected
BIAS::Vector<double> * BIAS::GenSynthMatches::_MovingObjRotVecX
protected
BIAS::Vector<double> * BIAS::GenSynthMatches::_MovingObjRotVecY
protected
BIAS::Vector<double> * BIAS::GenSynthMatches::_MovingObjRotVecZ
protected
std::vector<BIAS::HomgPoint3D> BIAS::GenSynthMatches::_MovingPoints
protected
std::vector<BIAS::EuclideanTransf3D> BIAS::GenSynthMatches::_MovingTransform
protected
std::vector<std::vector<HomgPoint2D> > BIAS::MatchDataBase::_NormalizedPoints
protectedinherited
int* BIAS::MatchDataBase::_NumImages
protectedinherited
int * BIAS::GenSynthMatches::_NumMovingObjects
protected
int* BIAS::GenSynthMatches::_NumMovingPoints
protected
int * BIAS::GenSynthMatches::_NumOutliers
protected
int * BIAS::MatchDataBase::_NumPoints
protectedinherited
int* BIAS::GenSynthMatches::_NumStaticPoints
protected
double * BIAS::GenSynthMatches::_OutlDirChange
protected
double* BIAS::GenSynthMatches::_OutlLengthChange
protected
std::vector<PMatrixBase> BIAS::MatchDataBase::_P
protectedinherited
BIAS::Param* BIAS::GenSynthMatches::_para
protected

Definition at line 220 of file GenSynthMatches.hh.

Referenced by GenSynthMatches().

std::vector<std::vector<HomgPoint2D> > BIAS::MatchDataBase::_Points
protectedinherited
double * BIAS::GenSynthMatches::_PrinciplePointX
protected
double * BIAS::GenSynthMatches::_PrinciplePointY
protected
std::vector<RMatrixBase> BIAS::MatchDataBase::_R
protectedinherited
BIAS::Random BIAS::GenSynthMatches::_rand
protected
BIAS::Vector<double> * BIAS::GenSynthMatches::_RotVecX
protected
BIAS::Vector<double> * BIAS::GenSynthMatches::_RotVecY
protected
BIAS::Vector<double> * BIAS::GenSynthMatches::_RotVecZ
protected
double* BIAS::GenSynthMatches::_SigmaCamCenterX
protected
double * BIAS::GenSynthMatches::_SigmaCamCenterY
protected
double * BIAS::GenSynthMatches::_SigmaCamCenterZ
protected
double* BIAS::GenSynthMatches::_SigmaCamRotX
protected
double * BIAS::GenSynthMatches::_SigmaCamRotY
protected
double * BIAS::GenSynthMatches::_SigmaCamRotZ
protected
double* BIAS::GenSynthMatches::_SigmaImagePoints
protected
BIAS::Vector<double>* BIAS::GenSynthMatches::_SizeMovingObjX
protected

Definition at line 262 of file GenSynthMatches.hh.

Referenced by _AddParameter(), _CheckParams(), GenSynthMatches(), operator=(), Read(), and Write().

BIAS::Vector<double> * BIAS::GenSynthMatches::_SizeMovingObjY
protected

Definition at line 262 of file GenSynthMatches.hh.

Referenced by _AddParameter(), _CheckParams(), GenSynthMatches(), operator=(), Read(), and Write().

BIAS::Vector<double> * BIAS::GenSynthMatches::_SizeMovingObjZ
protected

Definition at line 262 of file GenSynthMatches.hh.

Referenced by _AddParameter(), _CheckParams(), GenSynthMatches(), operator=(), Read(), and Write().

std::vector<BIAS::HomgPoint3D> BIAS::GenSynthMatches::_StaticPoints
protected
std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

bool* BIAS::GenSynthMatches::_UserGivenP
protected
std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.


The documentation for this class was generated from the following files: