Image Component Library (ICL)
|
Main Fiducial Detector class. More...
#include <FiducialDetector.h>
Public Member Functions | |
FiducialDetector (const std::string &plugin="bch", const utils::Any &markersToLoad=utils::Any(), const utils::ParamList ¶ms=utils::ParamList(), const geom::Camera *camera=0) | |
create a FiducialDetector instance with speical plugin type More... | |
virtual | ~FiducialDetector () |
Destructor. More... | |
const std::string & | getPluginType () const |
returns the current plugin type More... | |
void | setCamera (const geom::Camera &camera) |
sets the current camera More... | |
const geom::Camera & | getCamera () const |
returns the current camera (or throws an exception if no camera is available) More... | |
void | loadMarkers (const utils::Any &which, const utils::ParamList ¶ms=utils::ParamList()) |
loads markers according to the current plugin type More... | |
void | unloadMarkers (const utils::Any &which) |
unloads all already defined markers More... | |
const std::vector< Fiducial > & | detect (const core::ImgBase *image) |
detects markers in the given and returns all found markers More... | |
Fiducial::FeatureSet | getFeatures () const |
returns the list of supported features More... | |
std::string | getIntermediateImageNames () const |
returns a list (comma separated) of all available intermediate image results More... | |
const core::ImgBase * | getIntermediateImage (const std::string &name) const |
returns the intermediate result image associated with given name More... | |
core::Img8u | createMarker (const utils::Any &whichOne, const utils::Size &size, const utils::ParamList ¶ms) |
creates an image of a given markers More... | |
FiducialDetectorPlugin * | getPlugin () |
returns the internal plugin 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... | |
Private Attributes | |
Data * | data |
hidden data pointer 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 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... | |
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::Uncopyable | |
Uncopyable () | |
Empty base constructor. 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... | |
Main Fiducial Detector class.
icl::markers::FiducialDetector::FiducialDetector | ( | const std::string & | plugin = "bch" , |
const utils::Any & | markersToLoad = utils::Any() , |
||
const utils::ParamList & | params = utils::ParamList() , |
||
const geom::Camera * | camera = 0 |
||
) |
create a FiducialDetector instance with speical plugin type
The given plugin type can be:
other parameters
For extraction of 3D marker information, usually a camera is needed. The camera can also set later using setCamera Even though the camera is passed per pointer, it is compied deeply into the FiducialDetector instance. The camera can be updated using setCamera() lateron
The also optionally given markersToLoad and params are directly passed to the loadMarkers method
benchmarks TODO
|
virtual |
Destructor.
core::Img8u icl::markers::FiducialDetector::createMarker | ( | const utils::Any & | whichOne, |
const utils::Size & | size, | ||
const utils::ParamList & | params | ||
) |
creates an image of a given markers
sice this function call is directly passed to the underlying FiducialDetectorPlugin instance, its implemention depends on this implementation.
whichOne | specifies the marker to create in case of plugin type 'icl1' or 'bch', this is simply the marker ID. If the plugin type is art, whichOne needs to be an image filename. Amoeba markers cannot be created automatically because the marker layout is not free. |
size | resulting image size (please note, that the recommended image size aspect ratio for icl1-typed markers is 13:17 (e.g. 230:300) |
params | this list contains additional parameters that are neccessary for marker creation. |
bch needs an integer valued "border-width" parameter, which is used as border width. Please note that the bch-code center always consists of 6x6 pixels. The resulting image of size 2*border-width + 6 is finally scaled up to 'size' before it is returned. art needs a float valued 'border ratio' parameter. This is used to compute the border size for a given marker image. If the marker image (without border) has size A^2, then whole marker image (whith borders) has size (1+'border ratio')*A. Only finally, the image is scaled to it's destination size. icl1 does not need extra parameters amoeba is not supported
const std::vector<Fiducial>& icl::markers::FiducialDetector::detect | ( | const core::ImgBase * | image | ) |
detects markers in the given and returns all found markers
Please note, the preferred input core::format is core::Img8u. Other formats are converted to depth8u internally. Usually, your plugin will use gray images as input. You can query this information by calling getPropertyValue("preferred image type")
const geom::Camera& icl::markers::FiducialDetector::getCamera | ( | ) | const |
returns the current camera (or throws an exception if no camera is available)
Fiducial::FeatureSet icl::markers::FiducialDetector::getFeatures | ( | ) | const |
returns the list of supported features
const core::ImgBase* icl::markers::FiducialDetector::getIntermediateImage | ( | const std::string & | name | ) | const |
returns the intermediate result image associated with given name
If no image is associated with this name, an exception is thrown. Note, the image might be associated, but still be null, in particular if detect was not called one before
std::string icl::markers::FiducialDetector::getIntermediateImageNames | ( | ) | const |
returns a list (comma separated) of all available intermediate image results
The returned images can be used for debugging or for further processing. the Fiducial Detector does always add the two tokes "input" and "pp", which refers to the last input image and the last preprocessing result image
FiducialDetectorPlugin* icl::markers::FiducialDetector::getPlugin | ( | ) |
returns the internal plugin
const std::string& icl::markers::FiducialDetector::getPluginType | ( | ) | const |
returns the current plugin type
void icl::markers::FiducialDetector::loadMarkers | ( | const utils::Any & | which, |
const utils::ParamList & | params = utils::ParamList() |
||
) |
loads markers according to the current plugin type
ParamList("size",utils::Size(50,50));
void icl::markers::FiducialDetector::setCamera | ( | const geom::Camera & | camera | ) |
sets the current camera
The camera is usually needed for extraction of 3D marker information. After setting a camera, some already existent Fiducials might become out of date. Therefore, detect must be called again when the camera was changed.
void icl::markers::FiducialDetector::unloadMarkers | ( | const utils::Any & | which | ) |
unloads all already defined markers
usually, markers are unloaded with the same pattern that was also used for loading the markers before
|
private |
hidden data pointer