diff --git a/src/openalpr/characteranalysis.cpp b/src/openalpr/characteranalysis.cpp index 5cc040e..6333599 100644 --- a/src/openalpr/characteranalysis.cpp +++ b/src/openalpr/characteranalysis.cpp @@ -573,12 +573,12 @@ vector CharacterAnalysis::filter(Mat img, vector > contours, goodIndices = this->filterByBoxSize(contours, goodIndices, STARTING_MIN_HEIGHT + (i * HEIGHT_STEP), STARTING_MAX_HEIGHT + (i * HEIGHT_STEP)); goodIndicesCount = getGoodIndicesCount(goodIndices); - if ( goodIndicesCount > 0 && goodIndicesCount <= bestFitScore) // Don't bother doing more filtering if we already lost... + if ( goodIndicesCount == 0 || goodIndicesCount <= bestFitScore) // Don't bother doing more filtering if we already lost... continue; goodIndices = this->filterContourHoles(contours, hierarchy, goodIndices); goodIndicesCount = getGoodIndicesCount(goodIndices); - if ( goodIndicesCount > 0 && goodIndicesCount <= bestFitScore) // Don't bother doing more filtering if we already lost... + if ( goodIndicesCount == 0 || goodIndicesCount <= bestFitScore) // Don't bother doing more filtering if we already lost... continue; //goodIndices = this->filterByParentContour( contours, hierarchy, goodIndices); vector lines = getBestVotedLines(img, contours, goodIndices); diff --git a/src/openalpr/characterregion.cpp b/src/openalpr/characterregion.cpp index f3996b2..4f0f621 100644 --- a/src/openalpr/characterregion.cpp +++ b/src/openalpr/characterregion.cpp @@ -37,7 +37,7 @@ CharacterRegion::CharacterRegion(Mat img, Config* config) charAnalysis = new CharacterAnalysis(img, config); charAnalysis->analyze(); - if (this->debug) + if (this->debug && charAnalysis->linePolygon.size() > 0) { vector tempDash; for (int z = 0; z < charAnalysis->thresholds.size(); z++)