|
@@ -99,18 +99,13 @@ void SemSegTools::computeClassificationStatistics(
|
|
|
std::cout << "\nPERFORMANCE" << std::endl;
|
|
|
std::cout << "###########\n" << std::endl;
|
|
|
|
|
|
- double overallTrue = 0.0;
|
|
|
+ double overallTrue = confMat.trace();
|
|
|
double sumAll = 0.0;
|
|
|
|
|
|
// overall recognition rate
|
|
|
for ( int r = 0; r < (int) confMat.rows(); r++ )
|
|
|
for ( int c = 0; c < (int) confMat.cols(); c++ )
|
|
|
- {
|
|
|
- if ( r == c )
|
|
|
- overallTrue += confMat( r, c );
|
|
|
-
|
|
|
sumAll += confMat( r, c );
|
|
|
- }
|
|
|
|
|
|
overallTrue /= sumAll;
|
|
|
|
|
@@ -125,9 +120,9 @@ void SemSegTools::computeClassificationStatistics(
|
|
|
double precision = truePos / (truePos+falsePos);
|
|
|
double recall = truePos / (truePos+falseNeg);
|
|
|
double f1score = 2.0*(precision*recall)/(precision+recall);
|
|
|
- std::cout << "\nPrecision: " << precision;
|
|
|
+ std::cout << "Precision: " << precision;
|
|
|
std::cout << "\nRecall: " << recall;
|
|
|
- std::cout << "\nF1Score: " << f1score;
|
|
|
+ std::cout << "\nF1Score: " << f1score << "\n\n";
|
|
|
}
|
|
|
|
|
|
// normalizing confMat using rows
|
|
@@ -175,8 +170,8 @@ void SemSegTools::computeClassificationStatistics(
|
|
|
}
|
|
|
|
|
|
// print classification statistics
|
|
|
- std::cout << "\nOverall Recogntion Rate: " << overallTrue;
|
|
|
- std::cout << "\nAverage Recogntion Rate: " << confMat.trace() / (double)classMappingInv.size();
|
|
|
+ std::cout << "\nOverall Recognition Rate: " << overallTrue;
|
|
|
+ std::cout << "\nAverage Recognition Rate: " << confMat.trace() / (double)classMappingInv.size();
|
|
|
std::cout << "\nLower Bound: " << 1.0 /(double)classMappingInv.size();
|
|
|
std::cout << std::endl;
|
|
|
}
|
|
@@ -187,7 +182,8 @@ void SemSegTools::saveResultsToImageFile(
|
|
|
const ColorImage &orig,
|
|
|
const ColorImage >ruth,
|
|
|
const ColorImage &segment,
|
|
|
- const string &file )
|
|
|
+ const string &file,
|
|
|
+ string & outStr )
|
|
|
{
|
|
|
std::string resultDir = conf->gS ( section, "resultdir", "." );
|
|
|
std::string outputType = conf->gS ( section, "output_type", "ppm" );
|
|
@@ -212,6 +208,7 @@ void SemSegTools::saveResultsToImageFile(
|
|
|
overlaySegment.write ( out.str() + "_overlay_res." + outputType );
|
|
|
overlayGTruth.write ( out.str() + "_overlay_gt." + outputType );
|
|
|
|
|
|
+ outStr = out.str();
|
|
|
}
|
|
|
|
|
|
void SemSegTools::collectTrainingExamples (
|