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/FiducialImpl.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/Size32f.h> 00035 #include <ICLMarkers/Fiducial.h> 00036 00037 #include <bitset> 00038 00039 namespace icl{ 00040 namespace markers{ 00041 00043 00076 struct ICLMarkers_API FiducialImpl{ 00078 FiducialDetectorPlugin *parent; 00079 00081 Fiducial::FeatureSet supported; 00082 00084 Fiducial::FeatureSet computed; 00085 00087 /* The Fiduical ID can be used externally to distinguish between differnent 00088 Fiducial instances */ 00089 int id; 00090 00092 00094 int index; 00095 00097 00099 utils::Size32f realSizeMM; 00100 00102 cv::ImageRegion imageRegion; 00103 00105 /* this pointer and its members <b>can</b> be instantiated by 00106 parent FiduicalDetectorImpl instance */ 00107 struct Info2D{ 00108 utils::Point32f infoCenter; 00109 float infoRotation; 00110 std::vector<utils::Point32f> infoCorners; 00111 std::vector<Fiducial::KeyPoint> infoKeyPoints; 00112 } *info2D; 00113 00115 /* this pointer and its members <b>can</b> be instantiated by 00116 parent FiduicalDetectorImpl instance */ 00117 struct Info3D{ 00118 geom::Vec infoCenter; 00119 geom::Vec infoRotation; 00120 geom::Mat infoPose; 00121 } *info3D; 00122 00124 inline FiducialImpl():supported(0),computed(0),id(-1),index(-1),info2D(0),info3D(0){} 00125 00127 inline FiducialImpl(FiducialDetectorPlugin *parent, 00128 Fiducial::FeatureSet supported, 00129 Fiducial::FeatureSet computed, 00130 int id, int index, 00131 const utils::Size32f &realSizeMM): 00132 parent(parent),supported(supported), 00133 computed(computed),id(id),index(index), 00134 realSizeMM(realSizeMM),info2D(0),info3D(0){} 00135 00137 FiducialImpl(const FiducialImpl &o); 00138 00140 FiducialImpl &operator=(const FiducialImpl &o); 00141 00143 inline ~FiducialImpl(){ 00144 if(info2D) delete info2D; 00145 if(info3D) delete info3D; 00146 } 00147 00149 inline Info2D *ensure2D(){ 00150 if(!info2D) info2D = new Info2D; 00151 return info2D; 00152 } 00153 00155 inline Info3D *ensure3D(){ 00156 if(!info3D) info3D = new Info3D; 00157 return info3D; 00158 } 00159 00160 }; 00161 00162 00163 } // namespace markers 00164 } 00165 00166