orca-robotics INTRODUCTION Overview Download and Install Documentation REPOSITORY Interfaces Drivers Libraries Utilities Software Map DEVELOPER Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
lineextractor.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 #ifndef HYDROLFEXTRACT_LINEEXTRACTOR__H 00011 #define HYDROLFEXTRACT_LINEEXTRACTOR__H 00012 00013 #include <hydrofeatureobs/features.h> 00014 #include <hydrolaserfeatureextract/scanutil.h> 00015 #include <hydrolaserfeatureextract/annotatedlines.h> 00016 #include <hydroutil/context.h> 00017 #include <assert.h> 00018 00019 namespace hydrolfextract { 00020 00022 00028 class LineExtractor 00029 { 00030 00031 public: 00032 00033 struct Config { 00034 Config( const ScannerConfig &scannerCfg ) 00035 : scannerConfig(scannerCfg), 00036 maxDeltaRangeInCluster(0.5), 00037 maxDeltaInLine(0.2), 00038 minPointsInLine(6), 00039 minLineLengthForVisibleEndpoints(0.5) 00040 {} 00041 00042 ScannerConfig scannerConfig; 00043 00044 // config 00045 double maxDeltaRangeInCluster; 00046 double maxDeltaInLine; 00047 int minPointsInLine; 00048 double minLineLengthForVisibleEndpoints; 00049 00050 bool isSane() const; 00051 }; 00052 00054 00055 LineExtractor( const Config &config, 00056 const hydroutil::Context &context ) 00057 : config_(config), 00058 context_(context) 00059 { assert( config.isSane() ); } 00060 00061 AnnotatedLines extractLines( const std::vector<float> &ranges ) const; 00062 00063 const Config &config() const { return config_; } 00064 00065 private: 00066 00067 Config config_; 00068 hydroutil::Context context_; 00069 }; 00070 00072 00073 class LineFeatureExtractor { 00074 public: 00075 00076 LineFeatureExtractor( double minLineLength, 00077 double rangeSd, 00078 double bearingSd, 00079 double pFalsePositive, 00080 double pTruePositive ) 00081 : minLineLength_(minLineLength), 00082 rangeSd_(rangeSd), 00083 bearingSd_(bearingSd), 00084 pFalsePositive_(pFalsePositive), 00085 pTruePositive_(pTruePositive) 00086 {} 00087 00088 std::vector<hydrofeatureobs::LineFeatureObs*> extractFeatures( const AnnotatedLines &annLines ) const; 00089 00090 private: 00091 00092 double minLineLength_; 00093 double rangeSd_; 00094 double bearingSd_; 00095 double pFalsePositive_; 00096 double pTruePositive_; 00097 }; 00098 00099 class CornerFeatureExtractor { 00100 public: 00101 00102 CornerFeatureExtractor( double rangeSd, 00103 double bearingSd, 00104 double pFalsePositive, 00105 double pTruePositive ) 00106 : rangeSd_(rangeSd), 00107 bearingSd_(bearingSd), 00108 pFalsePositive_(pFalsePositive), 00109 pTruePositive_(pTruePositive) 00110 {} 00111 00112 std::vector<hydrofeatureobs::PointFeatureObs*> extractFeatures( const AnnotatedLines &annLines ) const; 00113 00114 private: 00115 00116 double rangeSd_; 00117 double bearingSd_; 00118 double pFalsePositive_; 00119 double pTruePositive_; 00120 }; 00121 } 00122 00123 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)