From 509e2a05fd1fef4db602593e146eb4b5a1c08996 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 4 Jun 2015 23:56:32 -0400 Subject: [PATCH] Removed segmentation filter that sometimes removed 'I' and '1' characters --- .../segmentation/charactersegmenter.cpp | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/src/openalpr/segmentation/charactersegmenter.cpp b/src/openalpr/segmentation/charactersegmenter.cpp index 3729438..bb16cd0 100644 --- a/src/openalpr/segmentation/charactersegmenter.cpp +++ b/src/openalpr/segmentation/charactersegmenter.cpp @@ -161,7 +161,6 @@ namespace alpr filterEdgeBoxes(pipeline_data->thresholds, candidateBoxes, medianCharWidth, avgCharHeight); candidateBoxes = filterMostlyEmptyBoxes(pipeline_data->thresholds, candidateBoxes); candidateBoxes = combineCloseBoxes(candidateBoxes, medianCharWidth); - cleanMostlyFullBoxes(pipeline_data->thresholds, candidateBoxes); candidateBoxes = filterMostlyEmptyBoxes(pipeline_data->thresholds, candidateBoxes); @@ -648,31 +647,6 @@ namespace alpr } } - void CharacterSegmenter::cleanMostlyFullBoxes(vector thresholds, const vector charRegions) - { - float MAX_FILLED = 0.95 * 255; - - for (unsigned int i = 0; i < charRegions.size(); i++) - { - Mat mask = Mat::zeros(thresholds[0].size(), CV_8U); - rectangle(mask, charRegions[i], Scalar(255,255,255), -1); - - for (unsigned int j = 0; j < thresholds.size(); j++) - { - if (mean(thresholds[j], mask)[0] > MAX_FILLED) - { - // Empty the rect - rectangle(thresholds[j], charRegions[i], Scalar(0,0,0), -1); - - if (this->config->debugCharSegmenter) - { - Rect inset(charRegions[i].x + 2, charRegions[i].y - 2, charRegions[i].width - 4, charRegions[i].height - 4); - rectangle(imgDbgCleanStages[j], inset, COLOR_DEBUG_FULLBOX, 1); - } - } - } - } - } vector CharacterSegmenter::filterMostlyEmptyBoxes(vector thresholds, const vector charRegions) {