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.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 <bitset> 00034 #include <ICLUtils/Size32f.h> 00035 #include <ICLMarkers/Fiducial.h> 00036 00037 00038 namespace icl{ 00039 namespace markers{ 00040 00042 00075 struct FiducialImpl{ 00077 FiducialDetectorPlugin *parent; 00078 00080 Fiducial::FeatureSet supported; 00081 00083 Fiducial::FeatureSet computed; 00084 00086 /* The Fiduical ID can be used externally to distinguish between differnent 00087 Fiducial instances */ 00088 int id; 00089 00091 00093 int index; 00094 00096 00098 utils::Size32f realSizeMM; 00099 00101 cv::ImageRegion imageRegion; 00102 00104 /* this pointer and its members <b>can</b> be instantiated by 00105 parent FiduicalDetectorImpl instance */ 00106 struct Info2D{ 00107 utils::Point32f infoCenter; 00108 float infoRotation; 00109 std::vector<utils::Point32f> infoCorners; 00110 std::vector<Fiducial::KeyPoint> infoKeyPoints; 00111 } *info2D; 00112 00114 /* this pointer and its members <b>can</b> be instantiated by 00115 parent FiduicalDetectorImpl instance */ 00116 struct Info3D{ 00117 geom::Vec infoCenter; 00118 geom::Vec infoRotation; 00119 geom::Mat infoPose; 00120 } *info3D; 00121 00123 inline FiducialImpl():supported(0),computed(0),id(-1),index(-1),info2D(0),info3D(0){} 00124 00126 inline FiducialImpl(FiducialDetectorPlugin *parent, 00127 Fiducial::FeatureSet supported, 00128 Fiducial::FeatureSet computed, 00129 int id, int index, 00130 const utils::Size32f &realSizeMM): 00131 parent(parent),supported(supported), 00132 computed(computed),id(id),index(index), 00133 realSizeMM(realSizeMM),info2D(0),info3D(0){} 00134 00136 FiducialImpl(const FiducialImpl &o); 00137 00139 FiducialImpl &operator=(const FiducialImpl &o); 00140 00142 inline ~FiducialImpl(){ 00143 if(info2D) delete info2D; 00144 if(info3D) delete info3D; 00145 } 00146 00148 inline Info2D *ensure2D(){ 00149 if(!info2D) info2D = new Info2D; 00150 return info2D; 00151 } 00152 00154 inline Info3D *ensure3D(){ 00155 if(!info3D) info3D = new Info3D; 00156 return info3D; 00157 } 00158 00159 }; 00160 00161 00162 } // namespace markers 00163 } 00164 00165