Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
FiducialDetectorPlugin.h
Go to the documentation of this file.
00001 /********************************************************************
00002 **                Image Component Library (ICL)                    **
00003 **                                                                 **
00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld          **
00005 **                         Neuroinformatics Group                  **
00006 ** Website: www.iclcv.org and                                      **
00007 **          http://opensource.cit-ec.de/projects/icl               **
00008 **                                                                 **
00009 ** File   : ICLMarkers/src/ICLMarkers/FiducialDetectorPlugin.h     **
00010 ** Module : ICLMarkers                                             **
00011 ** Authors: Christof Elbrechter                                    **
00012 **                                                                 **
00013 **                                                                 **
00014 ** GNU LESSER GENERAL PUBLIC LICENSE                               **
00015 ** This file may be used under the terms of the GNU Lesser General **
00016 ** Public License version 3.0 as published by the                  **
00017 **                                                                 **
00018 ** Free Software Foundation and appearing in the file LICENSE.GPL  **
00019 ** included in the packaging of this file.  Please review the      **
00020 ** following information to ensure the license requirements will   **
00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt                **
00022 **                                                                 **
00023 ** The development of this software was supported by the           **
00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology.    **
00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche       **
00026 ** Forschungsgemeinschaft (DFG) in the context of the German       **
00027 ** Excellence Initiative.                                          **
00028 **                                                                 **
00029 ********************************************************************/
00030 
00031 #pragma once
00032 
00033 #include <ICLUtils/Any.h>
00034 #include <ICLUtils/Configurable.h>
00035 #include <ICLUtils/ParamList.h>
00036 
00037 #include <ICLCore/Img.h>
00038 
00039 #include <ICLGeom/Camera.h>
00040 #include <ICLGeom/CoplanarPointPoseEstimator.h>
00041 
00042 #include <ICLMarkers/FiducialImpl.h>
00043 
00044 namespace icl{
00045   namespace markers{
00046     
00048     struct FiducialDetectorPlugin : public utils::Configurable{
00050 
00052       geom::Camera *camera;
00053   
00055       geom::CoplanarPointPoseEstimator poseEst;
00056           
00057       
00059       FiducialDetectorPlugin();
00060       
00062       virtual ~FiducialDetectorPlugin() {}
00063       
00065 
00072       virtual void getCenter2D(utils::Point32f &dst, FiducialImpl &impl);
00073       
00075       virtual void getRotation2D(float &dst, FiducialImpl &impl);
00076       
00078 
00080       virtual void getCorners2D(std::vector<utils::Point32f> &dst, FiducialImpl &impl);
00081       
00083 
00086       virtual void getKeyPoints2D(std::vector<Fiducial::KeyPoint> &dst, FiducialImpl &impl);
00087   
00089 
00095       virtual void getCenter3D(geom::Vec &dst, FiducialImpl &impl);
00096   
00098 
00104       virtual void getRotation3D(geom::Vec &dst, FiducialImpl &impl);
00105   
00107 
00113       virtual void getPose3D(geom::Mat &dst, FiducialImpl &impl);
00114       
00116       enum SourceImageType{
00117         Binary,  
00118         Gray,    
00119         Color    
00120       };
00121       
00123       virtual SourceImageType getPreProcessing() const { 
00124         return Binary;
00125       }
00126   
00128       virtual void getFeatures(Fiducial::FeatureSet &dst)=0;
00129       
00131       virtual void detect(std::vector<FiducialImpl*> &dst, const core::Img8u &image)=0;
00132       
00134       virtual void addOrRemoveMarkers(bool add, const utils::Any &which, const utils::ParamList &params)=0;
00135   
00137 
00138       virtual std::string getName(const FiducialImpl *impl);
00139       
00141 
00144       virtual std::string getIntermediateImageNames() const{ return ""; }
00145       
00147 
00152       virtual const core::ImgBase *getIntermediateImage(const std::string &name) const throw (utils::ICLException){
00153         throw utils::ICLException("FiducialDetectorPlugin: no intermediate image is associated with givne name '" + name + "'");
00154         return 0;
00155       }
00156       
00158 
00159       static std::vector<int> parse_list_str(const utils::Any &s);
00160       
00162       virtual core::Img8u createMarker(const utils::Any&,const utils::Size &, const utils::ParamList &){
00163         throw utils::ICLException("FiducialDetectorPlugin::createMarker seems to be not implemented for this marker type");
00164         return core::Img8u();
00165       }
00166   
00167     };
00168     
00169   } // namespace markers
00170 }
00171 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines