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 More... | |
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) | |
creates an initialized instance with given parameters More... | |
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) |
(re-)initializes the detector with given parameters More... | |
const std::vector< MultiCamFiducial > & | detect (const std::vector< const core::ImgBase * > &images, int minCamsFound=1) |
detects fiducials in all images and returns the combined results More... | |
int | getNumCameras () const |
returns the internal number of cameras More... | |
const FiducialDetector & | getFiducialDetector (int idx) const |
returns the internal 2D FiducialDetector at given camera index More... | |
FiducialDetector & | getFiducialDetector (int idx) |
returns the internal 2D FiducialDetector at given camera index (const) More... | |
void | loadMarkers (const utils::Any &which, const utils::ParamList ¶ms) |
loads additional markers (passed to all 2D detectors) More... | |
void | unloadMarkers (const utils::Any &which) |
unloads markers (passed to all 2D detectors) More... | |
std::string | getIntermediateImageNames () const |
provides a comma separated list of intermediate images More... | |
const core::ImgBase * | getIntermediateImage (const std::string &name) const |
returns a named intermeted image More... | |
Public Member Functions inherited from icl::utils::Configurable | |
virtual | ~Configurable () |
virtual destructor More... | |
Configurable (const Configurable &other) | |
Copy constructor. More... | |
Configurable & | operator= (const Configurable &other) |
Assignment operator. More... | |
void | setConfigurableID (const std::string &ID) |
sets the ID of this configurable More... | |
const std::string & | getConfigurableID () const |
returns the configurables static ID More... | |
bool | isOrderedFlagSet () const |
returns whether the ordered flag is set More... | |
void | deactivateProperty (const std::string &pattern) |
adds an additional deativation pattern More... | |
void | deleteDeactivationPattern (const std::string &pattern) |
removed a formerly added deactivation pattern More... | |
std::vector< std::string > | getPropertyListWithoutDeactivated () const |
this returns a filtered list of properties (using all filters added by deactivateProperty) More... | |
virtual void | adaptProperty (const std::string &name, const std::string &newType, const std::string &newInfo, const std::string &newToolTip) |
this function can be used to adapt a specific property afterwards More... | |
void | registerCallback (const Callback &cb) |
add a callback for changed properties More... | |
void | removedCallback (const Callback &cb) |
removes a callback that was registered before More... | |
void | syncChangesTo (Configurable *others, int num=1) |
this can be used to let this instance also apply property changes to others More... | |
virtual void | setPropertyValue (const std::string &propertyName, const Any &value) |
sets a property value More... | |
virtual std::vector< std::string > | getPropertyList () const |
returns a list of All properties, that can be set using setProperty More... | |
virtual bool | supportsProperty (const std::string &propertyName) const |
base implementation for property check (seaches in the property list) More... | |
virtual void | saveProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC) const |
writes all available properties into a file More... | |
virtual void | loadProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC) |
reads a camera config file from disc More... | |
virtual std::string | getPropertyType (const std::string &propertyName) const |
get type of property More... | |
virtual std::string | getPropertyInfo (const std::string &propertyName) const |
get information of a properties valid values More... | |
virtual Any | getPropertyValue (const std::string &propertyName) const |
returns the current value of a property or a parameter More... | |
virtual std::string | getPropertyToolTip (const std::string &propertyName) const |
returns the tooltip description for a given property More... | |
virtual int | getPropertyVolatileness (const std::string &propertyName) const |
Returns whether this property may be changed internally. More... | |
Static Public Member Functions | |
static int | getCameraIDFromIntermediteImageName (const std::string &name) |
extract the current camera from the given intermediate image name More... | |
Static Public Member Functions inherited from icl::utils::Configurable | |
static std::string | create_default_ID (const std::string &prefix) |
this function can be used in subclasses to create a default ID More... | |
static Configurable * | get (const std::string &id) |
returns configurable by given ID More... | |
static void | register_configurable_type (const std::string &classname, Function< Configurable * > creator) |
registers a configurable type More... | |
static std::vector< std::string > | get_registered_configurables () |
returns a list of all registered configurable classnames More... | |
static Configurable * | create_configurable (const std::string &classname) |
creates a configurable by given name More... | |
Private Member Functions | |
void | property_callback (const Property &p) |
internally used property callback More... | |
Private Attributes | |
Data * | m_data |
internal data structure More... | |
Additional Inherited Members | |
Public Types inherited from icl::utils::Configurable | |
typedef Function< void, const Property & > | Callback |
Function type for changed properties. More... | |
Static Public Attributes inherited from icl::utils::Configurable | |
static const std::vector< std::string > | EMPTY_VEC |
used as shortcut – just an empty vector of std::strings More... | |
Protected Member Functions inherited from icl::utils::Configurable | |
void | addProperty (const std::string &name, const std::string &type, const std::string &info, const Any &value=Any(), const int volatileness=0, const std::string &tooltip=std::string()) |
This can be used by derived classes to store supported properties in the internal list. More... | |
void | addChildConfigurable (Configurable *configurable, const std::string &childPrefix="") |
This adds another configurable as child. More... | |
void | removeChildConfigurable (Configurable *configurable) |
removes the given child configurable More... | |
Property & | prop (const std::string &propertyName) |
this CAN be used e.g. to store a property value in internal property-list More... | |
const Property & | prop (const std::string &propertyName) const |
this CAN be used e.g. to store a property value in internal property-list More... | |
Configurable (const std::string &ID="", bool ordered=true) | |
create this configurable with given ID More... | |
void | call_callbacks (const std::string &propertyName, const Configurable *caller) const |
calls all registered callbacks More... | |
Protected Attributes inherited from icl::utils::Configurable | |
std::vector< Callback > | callbacks |
internally managed list of callbacks More... | |
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.
icl::markers::MultiCamFiducialDetector::MultiCamFiducialDetector | ( | ) |
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 |
||
) |
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 |
||
) |
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 |
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
FiducialDetector& icl::markers::MultiCamFiducialDetector::getFiducialDetector | ( | int | idx | ) |
returns the internal 2D FiducialDetector at given camera index (const)
const core::ImgBase* icl::markers::MultiCamFiducialDetector::getIntermediateImage | ( | const std::string & | name | ) | const |
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 |
||
) |
(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 | ||
) |
loads additional markers (passed to all 2D detectors)
|
private |
internally used property callback
void icl::markers::MultiCamFiducialDetector::unloadMarkers | ( | const utils::Any & | which | ) |
unloads markers (passed to all 2D detectors)
|
private |
internal data structure
internal data pointer