|
@@ -112,8 +112,27 @@ SemSegContextTree::SemSegContextTree ( const Config *conf, const MultiDataset *m
|
|
|
cops.push_back ( new Haar3Vert() );
|
|
|
if ( conf->gB ( featsec, "glob", true ) )
|
|
|
cops.push_back ( new GlobalFeats() );
|
|
|
-
|
|
|
useGradient = conf->gB ( featsec, "use_gradient", true );
|
|
|
+ useRegionFeature = conf->gB ( featsec, "use_region", true );
|
|
|
+
|
|
|
+
|
|
|
+ //define which featurextraction methods should be used for each channel
|
|
|
+#ifdef LOCALFEATS
|
|
|
+ int colorchannels = 9;
|
|
|
+#else
|
|
|
+ int colorchannels = 3;
|
|
|
+#endif
|
|
|
+
|
|
|
+ if(useGradient)
|
|
|
+ colorchannels *= 2;
|
|
|
+
|
|
|
+ for(int i = 0; i < colorchannels; i++)
|
|
|
+ {
|
|
|
+ channelType.push_back(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(useRegionFeature)
|
|
|
+ channelType.push_back(1);
|
|
|
|
|
|
opOverview = vector<int> ( NBOPERATIONS, 0 );
|
|
|
contextOverview = vector<vector<double> > ( maxDepth, vector<double> ( 2, 0.0 ) );
|
|
@@ -600,7 +619,6 @@ void SemSegContextTree::train ( const MultiDataset *md )
|
|
|
#endif
|
|
|
vector<MultiChannelImageT<SparseVectorInt> > integralTexton;
|
|
|
|
|
|
-
|
|
|
std::string forbidden_classes_s = conf->gS ( "analysis", "donttrain", "" );
|
|
|
|
|
|
if ( forbidden_classes_s == "" )
|
|
@@ -1372,7 +1390,6 @@ void SemSegContextTree::semanticseg ( CachedExample *ce, NICE::Image & segresult
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
#endif
|
|
|
|
|
|
for ( int c = 0; c < classes; c++ )
|