Pārlūkot izejas kodu

ConvolutionFeature: fixed missing parameters in cloning functions

Sven Sickert 10 gadi atpakaļ
vecāks
revīzija
ed54f7e11b

+ 13 - 6
features/fpfeatures/ConvolutionFeature.cpp

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

+ 2 - 1
features/fpfeatures/ConvolutionFeature.h

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