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) throw (utils::ICLException) | |
create a FiducialDetector instance with speical plugin type | |
virtual | ~FiducialDetector () |
Destructor. | |
const std::string & | getPluginType () const |
returns the current plugin type | |
void | setCamera (const geom::Camera &camera) |
sets the current camera | |
const geom::Camera & | getCamera () const throw (utils::ICLException) |
returns the current camera (or throws an exception if no camera is available) | |
void | loadMarkers (const utils::Any &which, const utils::ParamList ¶ms=utils::ParamList()) throw (utils::ICLException) |
loads markers according to the current plugin type | |
void | unloadMarkers (const utils::Any &which) |
unloads all already defined markers | |
const std::vector< Fiducial > & | detect (const core::ImgBase *image) throw (utils::ICLException) |
detects markers in the given and returns all found markers | |
Fiducial::FeatureSet | getFeatures () const |
returns the list of supported features | |
std::string | getIntermediateImageNames () const |
returns a list (comma separated) of all available intermediate image results | |
const core::ImgBase * | getIntermediateImage (const std::string &name) const throw (utils::ICLException) |
returns the intermediate result image associated with given name | |
core::Img8u | createMarker (const utils::Any &whichOne, const utils::Size &size, const utils::ParamList ¶ms) |
creates an image of a given markers | |
FiducialDetectorPlugin * | getPlugin () |
returns the internal plugin | |
Private Attributes | |
Data * | data |
hidden data pointer |
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 |
||
) | throw (utils::ICLException) |
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 icl::markers::FiducialDetector::~FiducialDetector | ( | ) | [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 | ) | throw (utils::ICLException) |
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 throw (utils::ICLException) |
returns the current camera (or throws an exception if no camera is available)
returns the list of supported features
const core::ImgBase* icl::markers::FiducialDetector::getIntermediateImage | ( | const std::string & | name | ) | const throw (utils::ICLException) |
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
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() |
||
) | throw (utils::ICLException) |
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
Data* icl::markers::FiducialDetector::data [private] |
hidden data pointer