Basic Image AlgorithmS Library
2.8.0
|
Generates synthetic matches for cameras in a rig. More...
#include <Utils/GenSynthMatchesRig.hh>
Public Member Functions | |
int | CreateMatches () |
Creates 3D points and generates 2D matches for them. More... | |
void | DrawNoisy (std::vector< Image< unsigned char > > &im, int minindex=0, int maxindex=1) const |
Creates images showing the 2D matches for all cameras. More... | |
void | DrawNoisy (Image< unsigned char > &img, int minindex, int maxindex, int camIndex) const |
Creates an image showing the 2D matches for a camera. More... | |
void | DrawTrue (std::vector< Image< unsigned char > > &im, int minindex=0, int maxindex=1) const |
Create images for all cameras showing the matches. More... | |
void | DrawTrue (Image< unsigned char > &img, int minindex, int maxindex, int camIndex) const |
Creates an image showing the 2D matches for a camera. More... | |
GenSynthMatchesRig (Param ¶) | |
Constructor - register parameters. More... | |
std::vector < BIAS::GenSynthMatches > | GetCams () const |
returns the vector of the used GenSynthMatches object More... | |
int | Read (std::string file) |
read in xml/ascii file format More... | |
void | Reset () |
int | Write (std::string file) const |
write in xml/ascii file format More... | |
virtual | ~GenSynthMatchesRig () |
Default destructor... More... | |
Protected Member Functions | |
void | AddParameters_ (Param ¶) |
Add parameters to the param object. More... | |
void | GetParameters_ () |
read the parameters from the param object. More... | |
void | PrintCamPoses_ () |
Print the poses of the cameras. For debugging only. More... | |
void | Setup_ () |
Setup the global poses of the cameras and read the parameters. More... | |
void | UpdateParams_ (int camID) |
Update the param object for the given slave camera. More... | |
Protected Attributes | |
Param * | allParams_ |
Pointer to the parameter object. More... | |
std::vector< GenSynthMatches > | CamMatches_ |
Vector containing the cameras. More... | |
GenSynthMatches | GenMatches_ |
dummy to initialize the param object More... | |
BIAS::Vector< double > | MasterAnglesX_ |
BIAS::Vector< double > | MasterAnglesY_ |
BIAS::Vector< double > | MasterAnglesZ_ |
BIAS::Vector< double > | MasterCenterX_ |
motion vectors read from the param file More... | |
BIAS::Vector< double > | MasterCenterY_ |
BIAS::Vector< double > | MasterCenterZ_ |
int * | NumCameras_ |
The number of cameras used. Read from the param object. More... | |
std::vector< VecOMapOStrDbl > | SlaveCamsGlobal_ |
std::vector< std::map < std::string, double > > | SlaveCamsRelative_ |
Friends | |
BIASUtils_EXPORT std::ostream & | operator<< (std::ostream &os, const GenSynthMatchesRig &m) |
BIASUtils_EXPORT std::istream & | operator>> (std::istream &os, GenSynthMatchesRig &m) |
Generates synthetic matches for cameras in a rig.
Definition at line 70 of file GenSynthMatchesRig.hh.
GenSynthMatchesRig::GenSynthMatchesRig | ( | Param & | para | ) |
Constructor - register parameters.
Constructor.
Registers the needed parameters in the param object. The values can then be filled externally, e.g. by a param file. The object GenMatches_ of type BIAS::GenSynthMatches is initialized with the param object - this way GenMatches will register all parameters needed for a GenSynthMatches object in the argument of the constructor. In AddParameters_() the special parameters of this class will become registered.
para | A parameter object. |
Definition at line 69 of file GenSynthMatchesRig.cpp.
References AddParameters_(), allParams_, and BIAS::Param::GetParamInt().
|
virtual |
Default destructor...
Definition at line 85 of file GenSynthMatchesRig.cpp.
|
protected |
Add parameters to the param object.
Register needed parameters.
The parameters needed by the BIAS::GenSynthMatches objects are registered by a dummy object in the constructor.
[out] | para | The parameter object to be updated. |
Definition at line 692 of file GenSynthMatchesRig.cpp.
References BIAS::Param::AddParamDouble(), BIAS::Param::AddParamInt(), BIAS::Param::CheckParam(), BIAS::Param::GetFreeGroupID(), BIAS::Param::GetGroupID(), BIAS::Param::GetParamDouble(), BIAS::Param::GetParamInt(), BIAS::Param::IsUsedGroupID(), NumCameras_, BIAS::Param::SetGroupName(), and SlaveCamsRelative_.
Referenced by GenSynthMatchesRig().
int GenSynthMatchesRig::CreateMatches | ( | ) |
Creates 3D points and generates 2D matches for them.
Generates 3D Points an creates the 2D matches for each camera at each time step.
At first Setup_() is beenig called to compute the poses of the slave cameras in the global coord system (which hast its origin at the center of the master camera). For each camera an BIAS::GenSynthMatches object will be created. The object assigned to the master cam creates random 3D Points which will be passed to the slave cameras. So all cameras work with the same 3D points and try to generate 2D matches for them. If a 3D point has no match with an image plane of a camera, the 3D point will be replaced. After 1000 reties the computation will abort.
Definition at line 339 of file GenSynthMatchesRig.cpp.
References allParams_, CamMatches_, BIAS::GenSynthMatches::Create3DPoints(), BIAS::GenSynthMatches::CreateCamMovement(), BIAS::GenSynthMatches::CreateMatches(), BIAS::GenSynthMatches::CreateMoving3DPoint(), BIAS::GenSynthMatches::CreateMovingTransforms(), BIAS::GenSynthMatches::CreateStatic3DPoint(), BIAS::GenSynthMatches::GetMoving3DPoints(), BIAS::GenSynthMatches::GetStatic3DPoints(), NumCameras_, BIAS::GenSynthMatches::SetMoving3DPoints(), BIAS::GenSynthMatches::SetStatic3DPoints(), Setup_(), and UpdateParams_().
|
inline |
returns the vector of the used GenSynthMatches object
Definition at line 108 of file GenSynthMatchesRig.hh.
Referenced by BIAS::operator<<().
|
protected |
read the parameters from the param object.
Read the parameters from the param object.
The relative transformations of the slave cameras to the master camera are stored in SlaveCamsRelative_.
Definition at line 269 of file GenSynthMatchesRig.cpp.
References allParams_, BIAS::Param::GetParamDouble(), BIAS::Param::GetParamInt(), BIAS::Param::GetParamVecDbl(), MasterAnglesX_, MasterAnglesY_, MasterAnglesZ_, MasterCenterX_, MasterCenterY_, MasterCenterZ_, NumCameras_, TNT::Vector< T >::size(), and SlaveCamsRelative_.
Referenced by Setup_().
|
protected |
Print the poses of the cameras. For debugging only.
Print out the camera poses of each camera and each time step.
Definition at line 669 of file GenSynthMatchesRig.cpp.
References MasterAnglesX_, MasterAnglesY_, MasterAnglesZ_, MasterCenterX_, MasterCenterY_, MasterCenterZ_, and SlaveCamsRelative_.
int GenSynthMatchesRig::Read | ( | std::string | file | ) |
read in xml/ascii file format
Fill the necessary parts of this object from a file.
These are:
[in] | The | file name to read from. |
Here is an example for an xml file:
Definition at line 612 of file GenSynthMatchesRig.cpp.
References allParams_, CamMatches_, BIAS::XMLIO::getAttributeValueString(), BIAS::XMLIO::GetChildren(), BIAS::XMLIO::getFirstAttribute(), NumCameras_, BIAS::GenSynthMatches::Read(), and BIAS::XMLIO::read().
void BIAS::GenSynthMatchesRig::Reset | ( | ) |
|
protected |
Setup the global poses of the cameras and read the parameters.
Here the values of the param (object/file) are assigned to the member variables with the GetParameters_() method.
In the next step, the vector SlaveCamsGlobal_ containing the global poses of the slave cameras is being filled. The global poses are computed by applying the movement of the master camera (first camera) to the slave cameras (which have known relative transforms to the master camera).
Definition at line 100 of file GenSynthMatchesRig.cpp.
References allParams_, GetParameters_(), BIAS::Param::GetParamInt(), BIAS::RMatrixBase::GetRotationAnglesXYZ(), MasterAnglesX_, MasterAnglesY_, MasterAnglesZ_, MasterCenterX_, MasterCenterY_, MasterCenterZ_, BIAS::MatrixIdentity, NumCameras_, BIAS::RMatrixBase::SetXYZ(), SlaveCamsGlobal_, SlaveCamsRelative_, BIAS::Matrix3x3< T >::Transpose(), and BIAS::Matrix3x3< T >::TransposeIP().
Referenced by CreateMatches().
|
protected |
Update the param object for the given slave camera.
Updates the parameters for a given slave camera.
The parameters are updated before the 2D matches are computed for a BIAS::GenSynthMatches object of a slave camera. The values of the poses (motion/rotation vectors) of the camera of the BIAS::GenSynthMatches object will be filled with the global poses of the given slave cam.
[in] | camID | The ID of the camera to be updated. |
Definition at line 434 of file GenSynthMatchesRig.cpp.
References allParams_, BIAS::Param::GetParamInt(), BIAS::Param::GetParamVecDbl(), and SlaveCamsGlobal_.
Referenced by CreateMatches().
int GenSynthMatchesRig::Write | ( | std::string | file | ) | const |
write in xml/ascii file format
Write the necessary components of this object to an xml file.
These are:
[in] | file | The file name to store the file. The extension (.xml) should be contained in the file name. |
Definition at line 566 of file GenSynthMatchesRig.cpp.
References BIAS::XMLIO::addAttribute(), BIAS::XMLIO::addChildNode(), CamMatches_, BIAS::XMLIO::create(), and BIAS::XMLIO::write().
|
friend |
|
friend |
|
protected |
Pointer to the parameter object.
Definition at line 120 of file GenSynthMatchesRig.hh.
Referenced by CreateMatches(), GenSynthMatchesRig(), GetParameters_(), Read(), Setup_(), and UpdateParams_().
|
protected |
Vector containing the cameras.
Definition at line 135 of file GenSynthMatchesRig.hh.
Referenced by CreateMatches(), DrawNoisy(), DrawTrue(), Read(), and Write().
|
protected |
dummy to initialize the param object
Definition at line 138 of file GenSynthMatchesRig.hh.
|
protected |
Definition at line 126 of file GenSynthMatchesRig.hh.
Referenced by GetParameters_(), PrintCamPoses_(), and Setup_().
|
protected |
Definition at line 127 of file GenSynthMatchesRig.hh.
Referenced by GetParameters_(), PrintCamPoses_(), and Setup_().
|
protected |
Definition at line 128 of file GenSynthMatchesRig.hh.
Referenced by GetParameters_(), PrintCamPoses_(), and Setup_().
|
protected |
motion vectors read from the param file
Definition at line 123 of file GenSynthMatchesRig.hh.
Referenced by GetParameters_(), PrintCamPoses_(), and Setup_().
|
protected |
Definition at line 124 of file GenSynthMatchesRig.hh.
Referenced by GetParameters_(), PrintCamPoses_(), and Setup_().
|
protected |
Definition at line 125 of file GenSynthMatchesRig.hh.
Referenced by GetParameters_(), PrintCamPoses_(), and Setup_().
|
protected |
The number of cameras used. Read from the param object.
Definition at line 140 of file GenSynthMatchesRig.hh.
Referenced by AddParameters_(), CreateMatches(), DrawNoisy(), DrawTrue(), GetParameters_(), Read(), and Setup_().
|
protected |
Definition at line 133 of file GenSynthMatchesRig.hh.
Referenced by Setup_(), and UpdateParams_().
|
protected |
Definition at line 131 of file GenSynthMatchesRig.hh.
Referenced by AddParameters_(), GetParameters_(), PrintCamPoses_(), and Setup_().