|
@@ -1,7 +1,7 @@
|
|
|
/**
|
|
|
* @file LFReadCache.h
|
|
|
* @brief read local features from file
|
|
|
-* @author Erik Rodner
|
|
|
+* @author Erik Rodner, Alexander Freytag
|
|
|
* @date 02/14/2008
|
|
|
|
|
|
*/
|
|
@@ -19,68 +19,74 @@
|
|
|
|
|
|
namespace OBJREC {
|
|
|
|
|
|
-/** read local features from file */
|
|
|
-class LFReadCache : public LocalFeatureRepresentation
|
|
|
-{
|
|
|
-
|
|
|
- protected:
|
|
|
- int numFeatures;
|
|
|
- const LocalFeatureRepresentation *lfrep;
|
|
|
- std::string cachedir;
|
|
|
-
|
|
|
- int descFormat;
|
|
|
- int cachemode;
|
|
|
-
|
|
|
- template <class ImageClass>
|
|
|
- int extractFeaturesTemplate ( const ImageClass & img,
|
|
|
- NICE::VVector & features,
|
|
|
- NICE::VVector & positions) const;
|
|
|
-
|
|
|
- public:
|
|
|
-
|
|
|
- /** constructor
|
|
|
- * @param conf Configuration
|
|
|
- * @param lfrep a LocalFeatureRepresentation (i.e. LFColorSande)
|
|
|
- * @param _numfeatures how many features should be returned (-1 for all)
|
|
|
- */
|
|
|
- LFReadCache( const NICE::Config *conf,
|
|
|
- const LocalFeatureRepresentation *lfrep,
|
|
|
- int _numFeatures = -1 );
|
|
|
-
|
|
|
- /** simple destructor */
|
|
|
- virtual ~LFReadCache();
|
|
|
-
|
|
|
- int getDescSize () const;
|
|
|
-
|
|
|
- /**
|
|
|
- * extract features for gray images
|
|
|
- * @param img input image
|
|
|
- * @param features output features
|
|
|
- * @param positions position of the features
|
|
|
- * @return
|
|
|
- */
|
|
|
- int extractFeatures ( const NICE::Image & img,
|
|
|
- NICE::VVector & features,
|
|
|
- NICE::VVector & positions ) const;
|
|
|
-
|
|
|
- /**
|
|
|
- * extract features for color images
|
|
|
- * @param img input image
|
|
|
- * @param features output features
|
|
|
- * @param positions position of the features
|
|
|
- * @return
|
|
|
- */
|
|
|
- int extractFeatures ( const NICE::ColorImage & img,
|
|
|
- NICE::VVector & features,
|
|
|
- NICE::VVector & positions ) const;
|
|
|
-
|
|
|
- void visualize ( NICE::Image & img,
|
|
|
- const NICE::Vector & feature ) const;
|
|
|
-
|
|
|
- void visualizeFeatures ( NICE::Image & mark,
|
|
|
- const NICE::VVector & positions,
|
|
|
- size_t color ) const;
|
|
|
-};
|
|
|
+ /** @class LFReadCache
|
|
|
+ * @brief Read local features from file
|
|
|
+ *
|
|
|
+ */
|
|
|
+ class LFReadCache : public LocalFeatureRepresentation
|
|
|
+ {
|
|
|
+
|
|
|
+ protected:
|
|
|
+ int numFeatures;
|
|
|
+ const LocalFeatureRepresentation *lfrep;
|
|
|
+ std::string cachedir;
|
|
|
+
|
|
|
+ int descFormat;
|
|
|
+ int cachemode;
|
|
|
+
|
|
|
+ template <class ImageClass>
|
|
|
+ int extractFeaturesTemplate ( const ImageClass & img,
|
|
|
+ NICE::VVector & features,
|
|
|
+ NICE::VVector & positions) const;
|
|
|
+
|
|
|
+ public:
|
|
|
+
|
|
|
+ /** standard constructor
|
|
|
+ * @param conf Configuration
|
|
|
+ * @param lfrep a LocalFeatureRepresentation (i.e. LFColorSande)
|
|
|
+ * @param _numfeatures how many features should be returned (-1 for all)
|
|
|
+ * @param _section specify the block in the config object we read
|
|
|
+ */
|
|
|
+ LFReadCache( const NICE::Config *conf,
|
|
|
+ const LocalFeatureRepresentation *lfrep,
|
|
|
+ int _numFeatures = -1,
|
|
|
+ const std::string & _section = "cache"
|
|
|
+ );
|
|
|
+
|
|
|
+ /** simple destructor */
|
|
|
+ virtual ~LFReadCache();
|
|
|
+
|
|
|
+ int getDescSize () const;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * extract features for gray images
|
|
|
+ * @param img input image
|
|
|
+ * @param features output features
|
|
|
+ * @param positions position of the features
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ int extractFeatures ( const NICE::Image & img,
|
|
|
+ NICE::VVector & features,
|
|
|
+ NICE::VVector & positions ) const;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * extract features for color images
|
|
|
+ * @param img input image
|
|
|
+ * @param features output features
|
|
|
+ * @param positions position of the features
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ int extractFeatures ( const NICE::ColorImage & img,
|
|
|
+ NICE::VVector & features,
|
|
|
+ NICE::VVector & positions ) const;
|
|
|
+
|
|
|
+ void visualize ( NICE::Image & img,
|
|
|
+ const NICE::Vector & feature ) const;
|
|
|
+
|
|
|
+ void visualizeFeatures ( NICE::Image & mark,
|
|
|
+ const NICE::VVector & positions,
|
|
|
+ size_t color ) const;
|
|
|
+ };
|
|
|
|
|
|
} // namespace
|
|
|
|