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/QuadDetector.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/Configurable.h> 00035 #include <ICLUtils/Uncopyable.h> 00036 #include <ICLCore/ImgBase.h> 00037 #include <ICLCV/RegionDetector.h> 00038 #include <vector> 00039 00040 #include <ICLMarkers/TiltedQuad.h> 00041 00042 namespace icl{ 00043 namespace markers{ 00044 00046 00062 class ICLMarkers_API QuadDetector : public utils::Configurable, public utils::Uncopyable{ 00063 00065 class Data; 00066 00068 Data *data; 00069 00070 public: 00071 00072 00074 enum QuadColor{ 00075 BlackOnly, 00076 WhiteOnly, 00077 BlackAndWhite 00078 }; 00079 00081 00087 QuadDetector(QuadColor c = BlackOnly, bool dynamic=false, 00088 float minQRating = 0.4); 00089 00091 ~QuadDetector(); 00092 00094 00097 const std::vector<TiltedQuad> &detect(const core::ImgBase *image); 00098 00100 const core::Img8u &getLastBinaryImage() const; 00101 00102 00104 icl::cv::RegionDetector* getRegionDetector(); 00105 00106 00108 typedef std::vector<utils::Point32f> PVec; 00109 00111 typedef std::vector<PVec> PVecVec; 00112 00114 const PVecVec &getAllCorners() const; 00115 00117 PVecVec &getAllCorners(); 00118 00120 const PVecVec &getLongestCorners() const; 00121 00123 PVecVec &getLongestCorners(); 00124 00126 const PVecVec &getSecLongestCorners() const; 00127 00129 PVecVec &getSecLongestCorners(); 00130 00132 const PVecVec &getInterCorners() const; 00133 00135 PVecVec &getInterCorners(); 00136 00138 const PVecVec &getPerpCorners() const; 00139 00141 PVecVec &getPerpCorners(); 00142 00144 const PVecVec &getMirrorCorners() const; 00145 00147 PVecVec &getMirrorCorners(); 00148 00150 std::vector<utils::Point32f> computeCorners(const cv::ImageRegion &r) const; 00151 }; 00152 00153 00155 ICLMarkers_API std::ostream &operator<<(std::ostream &s, const QuadDetector::QuadColor &c); 00156 00158 ICLMarkers_API std::istream &operator>>(std::istream &s, QuadDetector::QuadColor &c); 00159 00160 00161 00162 } // namespace markers 00163 } 00164