Image Component Library (ICL)
|
Fiducial detector class that allows for using multiple cameras at once for fiducial detection. More...
#include <MultiCamFiducialDetector.h>
Public Member Functions | |
MultiCamFiducialDetector () | |
creates an uninitialized instance | |
MultiCamFiducialDetector (const std::string &pluginType, const utils::Any &markersToLoad, const utils::ParamList ¶ms, const std::vector< geom::Camera * > &cams, bool syncProperties=true, bool deepCopyCams=false) throw (utils::ICLException) | |
creates an initialized instance with given parameters | |
void | init (const std::string &pluginType, const utils::Any &markersToLoad, const utils::ParamList ¶ms, const std::vector< geom::Camera * > &cams, bool syncProperties=true, bool deepCopyCams=false) throw (utils::ICLException) |
(re-)initializes the detector with given parameters | |
const std::vector < MultiCamFiducial > & | detect (const std::vector< const core::ImgBase * > &images, int minCamsFound=1) throw (utils::ICLException) |
detects fiducials in all images and returns the combined results | |
int | getNumCameras () const |
returns the internal number of cameras | |
const FiducialDetector & | getFiducialDetector (int idx) const |
returns the internal 2D FiducialDetector at given camera index | |
FiducialDetector & | getFiducialDetector (int idx) |
returns the internal 2D FiducialDetector at given camera index (const) | |
void | loadMarkers (const utils::Any &which, const utils::ParamList ¶ms) throw (utils::ICLException) |
loads additional markers (passed to all 2D detectors) | |
void | unloadMarkers (const utils::Any &which) |
unloads markers (passed to all 2D detectors) | |
std::string | getIntermediateImageNames () const |
provides a comma separated list of intermediate images | |
const core::ImgBase * | getIntermediateImage (const std::string &name) const throw (utils::ICLException) |
returns a named intermeted image | |
Static Public Member Functions | |
static int | getCameraIDFromIntermediteImageName (const std::string &name) |
extract the current camera from the given intermediate image name | |
Private Member Functions | |
void | property_callback (const Property &p) |
internally used property callback | |
Private Attributes | |
Data * | m_data |
internal data structure |
Fiducial detector class that allows for using multiple cameras at once for fiducial detection.
By using more than one camera at once, the 3D Pose estimation accurrace can be increased significantly. The MultiCamFiducialDetector detects Fiducials in several input images and uses corresponding camera calibration files to provide highly accurate 3D marker poses. If a fiducial is only detectable in a single camera image, single-camera pose-estimation is used automatically.
Internall, for each camera view, a dedicated FiducialDetector is instantiated. If a new set of input images is given, all of these FiducialDetectors are applied to the corresponding image. Then, the 2D fiducial detection results are sorted by marker ID and combined. A MultiCamFiducial with ID x combines all fiducials with ID x that were detection in all views
Due to the fact, that the markers are combined by ID, It is not allowed to have several markers with Identical IDs in a scene. If you have, they will be mixed up and the resulting 3D pose estimation becomes completly wrong.
creates an uninitialized instance
icl::markers::MultiCamFiducialDetector::MultiCamFiducialDetector | ( | const std::string & | pluginType, |
const utils::Any & | markersToLoad, | ||
const utils::ParamList & | params, | ||
const std::vector< geom::Camera * > & | cams, | ||
bool | syncProperties = true , |
||
bool | deepCopyCams = false |
||
) | throw (utils::ICLException) |
creates an initialized instance with given parameters
const std::vector<MultiCamFiducial>& icl::markers::MultiCamFiducialDetector::detect | ( | const std::vector< const core::ImgBase * > & | images, |
int | minCamsFound = 1 |
||
) | throw (utils::ICLException) |
detects fiducials in all images and returns the combined results
Please note, that images[i] must correspond to cams[i] in the constructor/init method
static int icl::markers::MultiCamFiducialDetector::getCameraIDFromIntermediteImageName | ( | const std::string & | name | ) | [static] |
extract the current camera from the given intermediate image name
const FiducialDetector& icl::markers::MultiCamFiducialDetector::getFiducialDetector | ( | int | idx | ) | const |
returns the internal 2D FiducialDetector at given camera index
returns the internal 2D FiducialDetector at given camera index (const)
const core::ImgBase* icl::markers::MultiCamFiducialDetector::getIntermediateImage | ( | const std::string & | name | ) | const throw (utils::ICLException) |
returns a named intermeted image
std::string icl::markers::MultiCamFiducialDetector::getIntermediateImageNames | ( | ) | const |
provides a comma separated list of intermediate images
The returned list can simply be added to a view-selection combo box. e.g.
icl::markers::MultiCamFiducialDetector fd; fd.init(...); gui << Combo(fd.getIntermediateImageNames()).label("current image").handle("vis") << Draw3D().handle("image") << Show();
...
gui["image"] = fd.getIntermediateImage( gui["vis"] ); gui["image"].render();
int icl::markers::MultiCamFiducialDetector::getNumCameras | ( | ) | const |
returns the internal number of cameras
void icl::markers::MultiCamFiducialDetector::init | ( | const std::string & | pluginType, |
const utils::Any & | markersToLoad, | ||
const utils::ParamList & | params, | ||
const std::vector< geom::Camera * > & | cams, | ||
bool | syncProperties = true , |
||
bool | deepCopyCams = false |
||
) | throw (utils::ICLException) |
(re-)initializes the detector with given parameters
pluginType | this option directly passed to all internal 2D FiducialDetector instances |
markersToLoad | this option directly passed to all internal 2D FiducialDetector instances |
params | this option directly passed to all internal 2D FiducialDetector instances |
cams | Contains the list of calibrated cameras. Please note that cams[i] must belong to images[i] in the MultiCamFiducialDetector::detect method |
syncProperties | if this is set to false, each internal 2D FiducialDetector get's its own property list. If syncProperties is true (default), the 2D FiducialDetector properties are synchronized internally |
deepCopyCams | by default, the given cameras are just copied shallowly (by pointer) if the cameras are moved at runtime, and the MultiCamFiducialDetector shall use the adapted camera parameters then, deepCopyCams must be left false (default) Please Note: you can obtain all cameras of a scene using Scene::getAllCameras() |
void icl::markers::MultiCamFiducialDetector::loadMarkers | ( | const utils::Any & | which, |
const utils::ParamList & | params | ||
) | throw (utils::ICLException) |
loads additional markers (passed to all 2D detectors)
void icl::markers::MultiCamFiducialDetector::property_callback | ( | const Property & | p | ) | [private] |
internally used property callback
void icl::markers::MultiCamFiducialDetector::unloadMarkers | ( | const utils::Any & | which | ) |
unloads markers (passed to all 2D detectors)
Data* icl::markers::MultiCamFiducialDetector::m_data [private] |
internal data structure
internal data pointer