00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2010 University of Malaga | 00007 | | 00008 | This software was written by the Machine Perception and Intelligent | 00009 | Robotics Lab, University of Malaga (Spain). | 00010 | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | 00011 | | 00012 | This file is part of the MRPT project. | 00013 | | 00014 | MRPT is free software: you can redistribute it and/or modify | 00015 | it under the terms of the GNU General Public License as published by | 00016 | the Free Software Foundation, either version 3 of the License, or | 00017 | (at your option) any later version. | 00018 | | 00019 | MRPT is distributed in the hope that it will be useful, | 00020 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00021 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00022 | GNU General Public License for more details. | 00023 | | 00024 | You should have received a copy of the GNU General Public License | 00025 | along with MRPT. If not, see <http://www.gnu.org/licenses/>. | 00026 | | 00027 +---------------------------------------------------------------------------+ */ 00028 00029 #ifndef mrpt_vision_types_H 00030 #define mrpt_vision_types_H 00031 00032 #include <mrpt/utils/CImage.h> 00033 #include <mrpt/utils/CLoadableOptions.h> 00034 #include <mrpt/utils/TMatchingPair.h> 00035 00036 #include <mrpt/vision/link_pragmas.h> 00037 00038 namespace mrpt 00039 { 00040 namespace vision 00041 { 00042 using namespace mrpt::slam; 00043 using namespace mrpt::math; 00044 using namespace mrpt::utils; 00045 00046 /** Landmark ID */ 00047 typedef uint64_t TLandmarkID; 00048 00049 /** Just an index type that uniquely identifies a camera frame. */ 00050 typedef uint64_t TCameraPoseID; 00051 00052 /** A collection of camera poses from which a given feature has been observed, and its pixel coordinates for each of them. */ 00053 typedef std::map<TCameraPoseID,mrpt::utils::TPixelCoordf> TFeatureObservations; 00054 00055 /** Input data used by some (Bundle-adjustment) methods in mrpt::vision 00056 * \sa mrpt::vision::camera_calib_ba 00057 */ 00058 struct TSequenceFeatureObservations : public std::map<TFeatureID, TFeatureObservations> 00059 { 00060 00061 }; 00062 00063 /** Data returned by mrpt::vision::camera_calib_ba */ 00064 struct VISION_IMPEXP TCamCalibBAResults 00065 { 00066 std::vector<mrpt::poses::CPose3DQuat> camera_poses; 00067 std::vector<mrpt::math::TPoint3D> landmark_positions; 00068 }; 00069 00070 00071 00072 /** Parameters associated to a stereo system 00073 */ 00074 struct VISION_IMPEXP TStereoSystemParams : public mrpt::utils::CLoadableOptions 00075 { 00076 /** Initilization of default parameters 00077 */ 00078 TStereoSystemParams( ); 00079 00080 /** See utils::CLoadableOptions 00081 */ 00082 void loadFromConfigFile( 00083 const mrpt::utils::CConfigFileBase &source, 00084 const std::string §ion); 00085 00086 /** See utils::CLoadableOptions 00087 */ 00088 void dumpToTextStream(CStream &out) const; 00089 00090 /** Method for propagating the feature's image coordinate uncertainty into 3D space. Default value: Prop_Linear 00091 */ 00092 enum TUnc_Prop_Method 00093 { 00094 /** Linear propagation of the uncertainty 00095 */ 00096 Prop_Linear = -1, 00097 /** Uncertainty propagation through the Unscented Transformation 00098 */ 00099 Prop_UT, 00100 /** Uncertainty propagation through the Scaled Unscented Transformation 00101 */ 00102 Prop_SUT 00103 }; 00104 00105 TUnc_Prop_Method uncPropagation; 00106 00107 /** Intrinsic parameters 00108 */ 00109 CMatrixDouble33 K; 00110 /** Baseline. Default value: baseline = 0.119f; [Bumblebee] 00111 */ 00112 float baseline; 00113 /** Standard deviation of the error in feature detection. Default value: stdPixel = 1 00114 */ 00115 float stdPixel; 00116 /** Standard deviation of the error in disparity computation. Default value: stdDisp = 1 00117 */ 00118 float stdDisp; 00119 /** Maximum allowed distance. Default value: maxZ = 20.0f 00120 */ 00121 float maxZ; 00122 /** Maximum allowed distance. Default value: minZ = 0.5f 00123 */ 00124 float minZ; 00125 /** Maximum allowed height. Default value: maxY = 3.0f 00126 */ 00127 float maxY; 00128 /** K factor for the UT. Default value: k = 1.5f 00129 */ 00130 float factor_k; 00131 /** Alpha factor for SUT. Default value: a = 1e-3 00132 */ 00133 float factor_a; 00134 /** Beta factor for the SUT. Default value: b = 2.0f 00135 */ 00136 float factor_b; 00137 00138 /** Parameters initialization 00139 */ 00140 //TStereoSystemParams(); 00141 00142 }; // End struct TStereoSystemParams 00143 00144 /** A structure for storing a 3D ROI 00145 */ 00146 struct VISION_IMPEXP TROI 00147 { 00148 // Constructors 00149 TROI(); 00150 TROI(float x1, float x2, float y1, float y2, float z1, float z2); 00151 00152 // Members 00153 float xMin; 00154 float xMax; 00155 float yMin; 00156 float yMax; 00157 float zMin; 00158 float zMax; 00159 }; // end struct TROI 00160 00161 /** A structure for defining a ROI within an image 00162 */ 00163 struct VISION_IMPEXP TImageROI 00164 { 00165 // Constructors 00166 TImageROI(); 00167 TImageROI( float x1, float x2, float y1, float y2 ); 00168 00169 // Members 00170 /** X coordinate limits [0,imageWidth) 00171 */ 00172 float xMin, xMax; 00173 /** Y coordinate limits [0,imageHeight) 00174 */ 00175 float yMin, yMax; 00176 }; // end struct TImageROI 00177 00178 /** A structure containing options for the matching 00179 */ 00180 struct VISION_IMPEXP TMatchingOptions : public mrpt::utils::CLoadableOptions 00181 { 00182 00183 /** Method for propagating the feature's image coordinate uncertainty into 3D space. Default value: Prop_Linear 00184 */ 00185 enum TMatchingMethod 00186 { 00187 /** Matching by cross correlation of the image patches 00188 */ 00189 mmCorrelation = 0, 00190 /** Matching by Euclidean distance between SIFT descriptors 00191 */ 00192 mmDescriptorSIFT, 00193 /** Matching by Euclidean distance between SURF descriptors 00194 */ 00195 mmDescriptorSURF, 00196 /** Matching by sum of absolute differences of the image patches 00197 */ 00198 mmSAD 00199 }; 00200 00201 // For determining 00202 bool useEpipolarRestriction; //!< Whether or not take into account the epipolar restriction for finding correspondences 00203 bool hasFundamentalMatrix; //!< Whether or not there is a fundamental matrix 00204 bool parallelOpticalAxis; //!< Whether or not the stereo rig has the optical axes parallel 00205 bool useXRestriction; //!< Whether or not employ the x-coord restriction for finding correspondences (bumblebee camera, for example) 00206 00207 CMatrixDouble33 F; 00208 00209 // General 00210 TMatchingMethod matching_method; //!< Matching method 00211 float epipolar_TH; //!< Epipolar constraint (rows of pixels) 00212 00213 // SIFT 00214 float maxEDD_TH; //!< Maximum Euclidean Distance Between SIFT Descriptors 00215 float EDD_RATIO; //!< Boundary Ratio between the two lowest EDD 00216 00217 // KLT 00218 float minCC_TH; //!< Minimum Value of the Cross Correlation 00219 float minDCC_TH; //!< Minimum Difference Between the Maximum Cross Correlation Values 00220 float rCC_TH; //!< Maximum Ratio Between the two highest CC values 00221 00222 // SURF 00223 float maxEDSD_TH; //!< Maximum Euclidean Distance Between SURF Descriptors 00224 float EDSD_RATIO; //!< Boundary Ratio between the two lowest SURF EDSD 00225 00226 // SAD 00227 double minSAD_TH; 00228 double SAD_RATIO; 00229 00230 /** Constructor 00231 */ 00232 TMatchingOptions( ); 00233 00234 /** See utils::CLoadableOptions 00235 */ 00236 void loadFromConfigFile( 00237 const mrpt::utils::CConfigFileBase &source, 00238 const std::string §ion); 00239 00240 /** See utils::CLoadableOptions 00241 */ 00242 void dumpToTextStream(CStream &out) const; 00243 00244 }; // end struct TMatchingOptions 00245 00246 } 00247 } 00248 00249 00250 #endif
| Page generated by Doxygen 1.7.1 for MRPT 0.9.1 SVN:exported at Fri Aug 6 10:31:35 UTC 2010 |
