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 : ICLGeom/src/ICLGeom/ObjectEdgeDetector.h ** 00010 ** Module : ICLGeom ** 00011 ** Authors: Andre Ueckermann ** 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 <ICLGeom/GeomDefs.h> 00035 #include <ICLCore/Img.h> 00036 #include <ICLGeom/Camera.h> 00037 #include <ICLUtils/Uncopyable.h> 00038 #include <ICLCore/DataSegment.h> 00039 00040 #include <ICLGeom/ObjectEdgeDetectorPlugin.h> 00041 00042 namespace icl{ 00043 namespace geom{ 00044 00052 class ICLGeom_API ObjectEdgeDetector{ 00053 00054 struct Data; 00055 Data *m_data; 00056 00057 public: 00058 00059 enum Mode {BEST, GPU, CPU}; 00060 00062 00065 ObjectEdgeDetector(Mode mode=BEST); 00066 00068 virtual ~ObjectEdgeDetector(); 00069 00071 00077 const core::Img8u &calculate(const core::Img32f &depthImage, bool filter, bool average, bool gauss); 00078 00080 00081 void setDepthImage(const core::Img32f &depthImg); 00082 00084 00085 void applyMedianFilter(); 00086 00088 00089 const core::Img32f &getFilteredDepthImage(); 00090 00092 00094 void setFilteredDepthImage(const core::Img32f &filteredImg); 00095 00097 00099 void applyNormalCalculation(); 00100 00102 00106 void applyLinearNormalAveraging(); 00107 00109 00115 void applyGaussianNormalSmoothing(); 00116 00118 00119 const core::DataSegment<float,4> getNormals(); 00120 00122 00123 void applyWorldNormalCalculation(const Camera &cam); 00124 00126 00127 const core::DataSegment<float,4> getWorldNormals(); 00128 00130 00131 const core::Img8u &getRGBNormalImage(); 00132 00134 00136 void setNormals(core::DataSegment<float,4> pNormals); 00137 00139 00141 void applyAngleImageCalculation(); 00142 00144 00145 const core::Img32f &getAngleImage(); 00146 00148 00150 void setAngleImage(const core::Img32f &angleImg); 00151 00153 00154 void applyImageBinarization(); 00155 00157 00158 const core::Img8u &getBinarizedAngleImage(); 00159 00161 00163 void setMedianFilterSize(int size); 00164 00166 00168 void setNormalCalculationRange(int range); 00169 00171 00172 void setNormalAveragingRange(int range); 00173 00175 00177 void setAngleNeighborhoodMode(int mode); 00178 00180 00182 void setAngleNeighborhoodRange(int range); 00183 00185 00188 void setBinarizationThreshold(float threshold); 00189 00191 00193 void setUseNormalAveraging(bool use); 00194 00196 00198 void setUseGaussSmoothing(bool use); 00199 00200 private: 00201 ObjectEdgeDetectorPlugin* objectEdgeDetector; 00202 00203 void initialize(utils::Size size); 00204 00205 }; 00206 } 00207 }