|
@@ -167,7 +167,7 @@ void SemanticSegmentation::getDepthVector ( const LabeledSet *Files, vector<int>
|
|
|
{
|
|
|
std::string oldName;
|
|
|
int zsize = 0;
|
|
|
- bool isInit = false;
|
|
|
+ bool isInit = false;
|
|
|
|
|
|
LOOP_ALL_S ( *Files )
|
|
|
{
|
|
@@ -179,11 +179,11 @@ void SemanticSegmentation::getDepthVector ( const LabeledSet *Files, vector<int>
|
|
|
std::string filename = list.back();
|
|
|
uint found = filename.find_last_of ( "_" );
|
|
|
std::string curName = filename.substr ( found-3,3 );
|
|
|
- if (!isInit)
|
|
|
- {
|
|
|
- oldName = curName;
|
|
|
- isInit = true;
|
|
|
- }
|
|
|
+ if ( !isInit )
|
|
|
+ {
|
|
|
+ oldName = curName;
|
|
|
+ isInit = true;
|
|
|
+ }
|
|
|
if ( curName.compare ( oldName ) == 0 )
|
|
|
{
|
|
|
zsize++;
|
|
@@ -259,4 +259,27 @@ void SemanticSegmentation::make3DImage ( const std::vector<std::string> & fileli
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if ( imagetype == IMAGETYPE_GRAY )
|
|
|
+ {
|
|
|
+ imgData.correctShading( 0 );
|
|
|
+ double val_max, val_min;
|
|
|
+ imgData.statistics(val_min, val_max, 0);
|
|
|
+ if ( val_max > 255 )
|
|
|
+ {
|
|
|
+ for( int z = 0; z < imgData.depth(); z++ )
|
|
|
+ {
|
|
|
+ for ( int y = 0; y < imgData.height(); y++ )
|
|
|
+ {
|
|
|
+ for ( int x = 0; x < imgData.width(); x++ )
|
|
|
+ {
|
|
|
+ double val = imgData.get ( x, y, z, 0 );
|
|
|
+ val = val / val_max * 255;
|
|
|
+ imgData.set(x, y, z, val, 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|