Added labels to debug segmentation image

This commit is contained in:
Matt Hill
2014-06-20 22:35:24 -04:00
parent 35f829e365
commit 334feec9ac

View File

@@ -130,7 +130,9 @@ CharacterSegmenter::CharacterSegmenter(Mat img, bool invertedColors, Config* con
Mat histoCopy(vertHistogram.histoImg.size(), vertHistogram.histoImg.type()); Mat histoCopy(vertHistogram.histoImg.size(), vertHistogram.histoImg.type());
//vertHistogram.copyTo(histoCopy); //vertHistogram.copyTo(histoCopy);
cvtColor(vertHistogram.histoImg, histoCopy, CV_GRAY2RGB); cvtColor(vertHistogram.histoImg, histoCopy, CV_GRAY2RGB);
allHistograms.push_back(histoCopy);
string label = "threshold: " + toString(i);
allHistograms.push_back(addLabel(histoCopy, label));
} }
// //
@@ -144,7 +146,7 @@ CharacterSegmenter::CharacterSegmenter(Mat img, bool invertedColors, Config* con
rectangle(allHistograms[i], charBoxes[cboxIdx], Scalar(0, 255, 0)); rectangle(allHistograms[i], charBoxes[cboxIdx], Scalar(0, 255, 0));
} }
Mat histDashboard = drawImageDashboard(allHistograms, allHistograms[0].type(), 3); Mat histDashboard = drawImageDashboard(allHistograms, allHistograms[0].type(), 1);
displayImage(config, "Char seg histograms", histDashboard); displayImage(config, "Char seg histograms", histDashboard);
} }