|
@@ -65,26 +65,22 @@ void startClassification (SemanticSegmentation *semseg,
|
|
std::string file = info.img();
|
|
std::string file = info.img();
|
|
filelist.push_back ( file );
|
|
filelist.push_back ( file );
|
|
depthCount++;
|
|
depthCount++;
|
|
|
|
+ NICE::ImageT<int> lm, lm_gt;
|
|
|
|
|
|
- NICE::ImageT<int> lm;
|
|
|
|
- NICE::ImageT<int> lm_gt;
|
|
|
|
if ( info.hasLocalizationInfo() )
|
|
if ( info.hasLocalizationInfo() )
|
|
{
|
|
{
|
|
const LocalizationResult *l_gt = info.localization();
|
|
const LocalizationResult *l_gt = info.localization();
|
|
-
|
|
|
|
- lm.resize ( l_gt->xsize, l_gt->ysize );
|
|
|
|
- lm.set ( 0 );
|
|
|
|
-
|
|
|
|
lm_gt.resize ( l_gt->xsize, l_gt->ysize );
|
|
lm_gt.resize ( l_gt->xsize, l_gt->ysize );
|
|
- lm_gt.set ( 0 );
|
|
|
|
-
|
|
|
|
- l_gt->calcLabeledImage ( lm, classNames.getBackgroundClass() );
|
|
|
|
#ifdef DEBUG
|
|
#ifdef DEBUG
|
|
cout << "testSemanticSegmentation3D: Generating Labeled NICE::Image (Ground-Truth)" << endl;
|
|
cout << "testSemanticSegmentation3D: Generating Labeled NICE::Image (Ground-Truth)" << endl;
|
|
#endif
|
|
#endif
|
|
l_gt->calcLabeledImage ( lm_gt, classNames.getBackgroundClass() );
|
|
l_gt->calcLabeledImage ( lm_gt, classNames.getBackgroundClass() );
|
|
|
|
+
|
|
}
|
|
}
|
|
- segresult.addChannel ( lm );
|
|
|
|
|
|
+ else
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ segresult.addChannel ( lm_gt );
|
|
gt.addChannel ( lm_gt );
|
|
gt.addChannel ( lm_gt );
|
|
|
|
|
|
int depthBoundary = 0;
|
|
int depthBoundary = 0;
|
|
@@ -100,6 +96,7 @@ void startClassification (SemanticSegmentation *semseg,
|
|
semseg->classify ( filelist, segresult, probabilities );
|
|
semseg->classify ( filelist, segresult, probabilities );
|
|
|
|
|
|
// save to file
|
|
// save to file
|
|
|
|
+ lm = lm_gt;
|
|
for ( int z = 0; z < segresult.channels(); z++ )
|
|
for ( int z = 0; z < segresult.channels(); z++ )
|
|
{
|
|
{
|
|
NICE::ColorImage orig ( filelist[z] );
|
|
NICE::ColorImage orig ( filelist[z] );
|
|
@@ -110,6 +107,8 @@ void startClassification (SemanticSegmentation *semseg,
|
|
for ( int x = 0 ; x < orig.width(); x++ )
|
|
for ( int x = 0 ; x < orig.width(); x++ )
|
|
{
|
|
{
|
|
lm.setPixel ( x, y, segresult.get ( x, y, ( uint ) z ) );
|
|
lm.setPixel ( x, y, segresult.get ( x, y, ( uint ) z ) );
|
|
|
|
+
|
|
|
|
+ // get current <slice> of ground truth
|
|
if ( run_3Dseg )
|
|
if ( run_3Dseg )
|
|
lm_gt.setPixel ( x, y, gt.get ( x, y, ( uint ) z ) );
|
|
lm_gt.setPixel ( x, y, gt.get ( x, y, ( uint ) z ) );
|
|
}
|
|
}
|