Image Component Library (ICL)
|
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.LGPL ** 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/CompatMacros.h> 00034 #include <ICLUtils/Any.h> 00035 #include <ICLUtils/Configurable.h> 00036 #include <ICLUtils/ParamList.h> 00037 00038 #include <ICLCore/Img.h> 00039 00040 #include <ICLGeom/Camera.h> 00041 #include <ICLGeom/CoplanarPointPoseEstimator.h> 00042 00043 #include <ICLMarkers/FiducialImpl.h> 00044 00045 namespace icl{ 00046 namespace markers{ 00047 00049 struct ICLMarkers_API FiducialDetectorPlugin : public utils::Configurable{ 00051 00053 geom::Camera *camera; 00054 00056 geom::CoplanarPointPoseEstimator poseEst; 00057 00058 00060 FiducialDetectorPlugin(); 00061 00063 virtual ~FiducialDetectorPlugin() {} 00064 00066 00073 virtual void getCenter2D(utils::Point32f &dst, FiducialImpl &impl); 00074 00076 virtual void getRotation2D(float &dst, FiducialImpl &impl); 00077 00079 00081 virtual void getCorners2D(std::vector<utils::Point32f> &dst, FiducialImpl &impl); 00082 00084 00087 virtual void getKeyPoints2D(std::vector<Fiducial::KeyPoint> &dst, FiducialImpl &impl); 00088 00090 00096 virtual void getCenter3D(geom::Vec &dst, FiducialImpl &impl); 00097 00099 00105 virtual void getRotation3D(geom::Vec &dst, FiducialImpl &impl); 00106 00108 00114 virtual void getPose3D(geom::Mat &dst, FiducialImpl &impl); 00115 00117 enum SourceImageType{ 00118 Binary, 00119 Gray, 00120 Color 00121 }; 00122 00124 virtual SourceImageType getPreProcessing() const { 00125 return Binary; 00126 } 00127 00129 virtual void getFeatures(Fiducial::FeatureSet &dst)=0; 00130 00132 virtual void detect(std::vector<FiducialImpl*> &dst, const core::Img8u &image)=0; 00133 00135 virtual void addOrRemoveMarkers(bool add, const utils::Any &which, const utils::ParamList ¶ms)=0; 00136 00138 00139 virtual std::string getName(const FiducialImpl *impl); 00140 00142 00145 virtual std::string getIntermediateImageNames() const{ return ""; } 00146 00148 00153 virtual const core::ImgBase *getIntermediateImage(const std::string &name) const throw (utils::ICLException){ 00154 throw utils::ICLException("FiducialDetectorPlugin: no intermediate image is associated with givne name '" + name + "'"); 00155 return 0; 00156 } 00157 00159 00160 static std::vector<int> parse_list_str(const utils::Any &s); 00161 00163 virtual core::Img8u createMarker(const utils::Any&,const utils::Size &, const utils::ParamList &){ 00164 throw utils::ICLException("FiducialDetectorPlugin::createMarker seems to be not implemented for this marker type"); 00165 return core::Img8u(); 00166 } 00167 }; 00168 00169 } // namespace markers 00170 } 00171