mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 16:27:07 +08:00
Added sanity check to LBP detector
This commit is contained in:
@@ -60,9 +60,15 @@ namespace alpr
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vector<PlateRegion> detectedRegions;
|
vector<PlateRegion> detectedRegions;
|
||||||
for (int i = 0; i < regionsOfInterest.size(); i++)
|
for (int i = 0; i < regionsOfInterest.size(); i++)
|
||||||
{
|
{
|
||||||
|
// Sanity check. If roi width or height is less than minimum possible plate size,
|
||||||
|
// then skip it
|
||||||
|
if ((regionsOfInterest[i].width < config->minPlateSizeWidthPx) ||
|
||||||
|
(regionsOfInterest[i].height < config->minPlateSizeHeightPx))
|
||||||
|
continue;
|
||||||
|
|
||||||
Mat cropped = frame_gray(regionsOfInterest[i]);
|
Mat cropped = frame_gray(regionsOfInterest[i]);
|
||||||
vector<PlateRegion> subRegions = doCascade(cropped, regionsOfInterest[i].x, regionsOfInterest[i].y);
|
vector<PlateRegion> subRegions = doCascade(cropped, regionsOfInterest[i].x, regionsOfInterest[i].y);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user