Эх сурвалжийг харах

ConvolutionFeature: fixed missing parameters in cloning functions

Sven Sickert 10 жил өмнө
parent
commit
ed54f7e11b

+ 13 - 6
features/fpfeatures/ConvolutionFeature.cpp

@@ -34,12 +34,13 @@ ConvolutionFeature::ConvolutionFeature ( )
 ConvolutionFeature::ConvolutionFeature (
         const int wsize_x,
         const int wsize_y,
-        const bool color )
+        const bool color,
+        const bool prior )
 {
     window_size_x = wsize_x;
     window_size_y = wsize_y;
     isColor = color;
-    useSpatialPriors = false;
+    useSpatialPriors = prior;
 
     initializeParameterVector();
 }
@@ -272,8 +273,11 @@ double ConvolutionFeature::val ( const Example *example ) const
 /** creature feature pool */
 void ConvolutionFeature::explode ( FeaturePool &featurePool, bool variableWindow ) const
 {
-    ConvolutionFeature *f =
-            new ConvolutionFeature ( this->window_size_x, this->window_size_y, this->isColor );
+    ConvolutionFeature *f = new ConvolutionFeature (
+                this->window_size_x,
+                this->window_size_y,
+                this->isColor,
+                this->useSpatialPriors );
 
     featurePool.addFeature(f);
 }
@@ -281,8 +285,11 @@ void ConvolutionFeature::explode ( FeaturePool &featurePool, bool variableWindow
 /** clone current feature */
 Feature *ConvolutionFeature::clone ( ) const
 {
-    ConvolutionFeature *f =
-            new ConvolutionFeature ( this->window_size_x, this->window_size_y, this->isColor );
+    ConvolutionFeature *f = new ConvolutionFeature (
+                this->window_size_x,
+                this->window_size_y,
+                this->isColor,
+                this->useSpatialPriors );
 
     f->setParameterVector( *beta );
 

+ 2 - 1
features/fpfeatures/ConvolutionFeature.h

@@ -56,7 +56,8 @@ class ConvolutionFeature : public Feature
     /** alternative constructor */
     ConvolutionFeature ( const int wsize_x,
                          const int wsize_y,
-                         const bool color = false );
+                         const bool color = false,
+                         const bool prior = false );
 
     /** default constructor */
     ConvolutionFeature ( const NICE::Config *conf );