فهرست منبع

added documentation to LocalFeatureColorWeijer

Sven Sickert 10 سال پیش
والد
کامیت
1b5cf63ee8
2فایلهای تغییر یافته به همراه29 افزوده شده و 1 حذف شده
  1. 20 1
      features/localfeatures/LocalFeatureColorWeijer.cpp
  2. 9 0
      features/localfeatures/LocalFeatureColorWeijer.h

+ 20 - 1
features/localfeatures/LocalFeatureColorWeijer.cpp

@@ -281,7 +281,26 @@ void LocalFeatureColorWeijer::getFeats( const NICE::ColorImage &img, MultiChanne
     }
   }
 
-  return;
+}
+
+void LocalFeatureColorWeijer::getFeats( const ColorImage &img, NICE::ImageT<double> &feats, int color )
+{
+  assert ( feats.width() > 0 );
+  assert ( feats.height() > 0 );
+
+  int width = ( int )img.width();
+  int height = ( int )img.height();
+
+  for ( int y = 0; y < height; y++ )
+    for ( int x = 0; x < width; x++ )
+    {
+      int r = img(x,y,0)/8;
+      int g = img(x,y,1)/8;
+      int b = img(x,y,2)/8;
+
+      feats.setPixel( x, y, hist[r][g][b][color] );
+    }
+
 }
 
 ///////////////////// INTERFACE PERSISTENT /////////////////////

+ 9 - 0
features/localfeatures/LocalFeatureColorWeijer.h

@@ -161,6 +161,15 @@ class LocalFeatureColorWeijer : public LocalFeature
      */
     void getFeats ( const NICE::ColorImage &img, NICE::MultiChannelImageT<double> &feats );
     
+
+    /**
+     * transform each pixel of an image
+     * @param img input image
+     * @param feats feature value for each pixel
+     * @param color which color name
+     */
+    void getFeats ( const NICE::ColorImage &img, NICE::ImageT<double> &feats, int color);
+
     ///////////////////// INTERFACE PERSISTENT /////////////////////
     // interface specific methods for store and restore
     ///////////////////// INTERFACE PERSISTENT /////////////////////