|
@@ -54,7 +54,6 @@ SemSegContextTree3D::SemSegContextTree3D () : SemanticSegmentation ()
|
|
this->useGradient = true;
|
|
this->useGradient = true;
|
|
this->useAdditionalLayer = false;
|
|
this->useAdditionalLayer = false;
|
|
this->numAdditionalLayer = 0;
|
|
this->numAdditionalLayer = 0;
|
|
- this->useHoiemFeatures = false;
|
|
|
|
this->useCategorization = false;
|
|
this->useCategorization = false;
|
|
this->cndir = "";
|
|
this->cndir = "";
|
|
this->fasthik = NULL;
|
|
this->fasthik = NULL;
|
|
@@ -98,7 +97,6 @@ SemSegContextTree3D::SemSegContextTree3D (
|
|
|
|
|
|
this->useAltTristimulus = conf->gB ( featsec, "use_alt_trist", false );
|
|
this->useAltTristimulus = conf->gB ( featsec, "use_alt_trist", false );
|
|
this->useGradient = conf->gB ( featsec, "use_gradient", true );
|
|
this->useGradient = conf->gB ( featsec, "use_gradient", true );
|
|
- this->useHoiemFeatures = conf->gB ( featsec, "use_hoiem_features", false );
|
|
|
|
this->useAdditionalLayer = conf->gB ( featsec, "use_additional_layer", false );
|
|
this->useAdditionalLayer = conf->gB ( featsec, "use_additional_layer", false );
|
|
if (useAdditionalLayer)
|
|
if (useAdditionalLayer)
|
|
this->numAdditionalLayer = conf->gI ( featsec, "num_additional_layer", 1 );
|
|
this->numAdditionalLayer = conf->gI ( featsec, "num_additional_layer", 1 );
|
|
@@ -539,9 +537,6 @@ void SemSegContextTree3D::train ( const LabeledSet * trainp )
|
|
rawChannels *= 3; // gx, gy
|
|
rawChannels *= 3; // gx, gy
|
|
}
|
|
}
|
|
|
|
|
|
- if ( useHoiemFeatures ) // geometrische Kontextmerkmale
|
|
|
|
- rawChannels += 8;
|
|
|
|
-
|
|
|
|
if ( useAdditionalLayer ) // beliebige Merkmale in extra Bilddateien
|
|
if ( useAdditionalLayer ) // beliebige Merkmale in extra Bilddateien
|
|
rawChannels += numAdditionalLayer;
|
|
rawChannels += numAdditionalLayer;
|
|
|
|
|
|
@@ -1229,50 +1224,6 @@ void SemSegContextTree3D::addFeatureMaps (
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- // read the geometric cues produced by Hoiem et al.
|
|
|
|
- if ( useHoiemFeatures )
|
|
|
|
- {
|
|
|
|
- string hoiemDirectory = conf->gS ( "Features", "hoiem_directory" );
|
|
|
|
- // we could also give the following set as a config option
|
|
|
|
- string hoiemClasses_s = "sky 000 090-045 090-090 090-135 090 090-por 090-sol";
|
|
|
|
- vector<string> hoiemClasses;
|
|
|
|
- StringTools::split ( hoiemClasses_s, ' ', hoiemClasses );
|
|
|
|
-
|
|
|
|
- int currentsize = imgData.channels();
|
|
|
|
- imgData.addChannel ( hoiemClasses.size() );
|
|
|
|
- for ( int z = 0; z < zsize; z++ )
|
|
|
|
- {
|
|
|
|
- FileName fn ( filelist[z] );
|
|
|
|
- fn.removeExtension();
|
|
|
|
- FileName fnBase = fn.extractFileName();
|
|
|
|
-
|
|
|
|
- for ( vector<string>::const_iterator i = hoiemClasses.begin(); i != hoiemClasses.end(); i++, currentsize++ )
|
|
|
|
- {
|
|
|
|
- string hoiemClass = *i;
|
|
|
|
- FileName fnConfidenceImage ( hoiemDirectory + fnBase.str() + "_c_" + hoiemClass + ".png" );
|
|
|
|
- if ( ! fnConfidenceImage.fileExists() )
|
|
|
|
- {
|
|
|
|
- fthrow ( Exception, "Unable to read the Hoiem geometric confidence image: " << fnConfidenceImage.str() << " (original image is " << filelist[z] << ")" );
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- Image confidenceImage ( fnConfidenceImage.str() );
|
|
|
|
- if ( confidenceImage.width() != xsize || confidenceImage.height() != ysize )
|
|
|
|
- {
|
|
|
|
- fthrow ( Exception, "The size of the geometric confidence image does not match with the original image size: " << fnConfidenceImage.str() );
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // copy standard image to double image
|
|
|
|
- for ( int y = 0 ; y < confidenceImage.height(); y++ )
|
|
|
|
- for ( int x = 0 ; x < confidenceImage.width(); x++ )
|
|
|
|
- imgData ( x, y, z, currentsize ) = ( double ) confidenceImage ( x, y );
|
|
|
|
-
|
|
|
|
- currentsize++;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
// region feature (unsupervised segmentation)
|
|
// region feature (unsupervised segmentation)
|
|
int shift = 0;
|
|
int shift = 0;
|