|
@@ -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 );
|
|
|
|