mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 00:02:52 +08:00
Added sanity check to LBP detector
This commit is contained in:
@@ -63,6 +63,12 @@ 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