mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 11:56:52 +08:00
Performance improvement -- stop processing filters if the character count is already 0.
This commit is contained in:
@@ -573,12 +573,12 @@ vector<bool> CharacterAnalysis::filter(Mat img, vector<vector<Point> > 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<Point> lines = getBestVotedLines(img, contours, goodIndices);
|
||||
|
@@ -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<Mat> tempDash;
|
||||
for (int z = 0; z < charAnalysis->thresholds.size(); z++)
|
||||
|
Reference in New Issue
Block a user