mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 06:46:53 +08:00
Added parameter for max plate rotation (was previously hardcoded at 10 degrees). Upped the default to 15
This commit is contained in:
@@ -17,6 +17,9 @@ opencl_enabled = 0
|
|||||||
multithreading_cores = 1
|
multithreading_cores = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
max_plate_angle_degrees = 15
|
||||||
|
|
||||||
ocr_min_font_point = 6
|
ocr_min_font_point = 6
|
||||||
|
|
||||||
; Minimum OCR confidence percent to consider.
|
; Minimum OCR confidence percent to consider.
|
||||||
|
@@ -75,10 +75,10 @@ CharacterRegion::CharacterRegion(Mat img, Config* config)
|
|||||||
confidenceDrainers += (5 - charSegmentCount) * 10;
|
confidenceDrainers += (5 - charSegmentCount) * 10;
|
||||||
|
|
||||||
int absangle = abs(charAnalysis->topLine.angle);
|
int absangle = abs(charAnalysis->topLine.angle);
|
||||||
if (absangle > 10)
|
if (absangle > config->maxPlateAngleDegrees)
|
||||||
confidenceDrainers += 91;
|
confidenceDrainers += 91;
|
||||||
else if (absangle > 1)
|
else if (absangle > 1)
|
||||||
confidenceDrainers += (10 - absangle) * 5;
|
confidenceDrainers += (config->maxPlateAngleDegrees - absangle) ;
|
||||||
|
|
||||||
if (confidenceDrainers >= 100)
|
if (confidenceDrainers >= 100)
|
||||||
this->confidence=1;
|
this->confidence=1;
|
||||||
|
@@ -78,6 +78,8 @@ void Config::loadValues(string country)
|
|||||||
maxPlateWidthPercent = getFloat("common", "max_plate_width_percent", 100);
|
maxPlateWidthPercent = getFloat("common", "max_plate_width_percent", 100);
|
||||||
maxPlateHeightPercent = getFloat("common", "max_plate_height_percent", 100);
|
maxPlateHeightPercent = getFloat("common", "max_plate_height_percent", 100);
|
||||||
|
|
||||||
|
maxPlateAngleDegrees = getInt("common", "max_plate_angle_degrees", 15);
|
||||||
|
|
||||||
minPlateSizeWidthPx = getInt(country, "min_plate_size_width_px", 100);
|
minPlateSizeWidthPx = getInt(country, "min_plate_size_width_px", 100);
|
||||||
minPlateSizeHeightPx = getInt(country, "min_plate_size_height_px", 100);
|
minPlateSizeHeightPx = getInt(country, "min_plate_size_height_px", 100);
|
||||||
|
|
||||||
|
@@ -50,6 +50,8 @@ class Config
|
|||||||
float maxPlateWidthPercent;
|
float maxPlateWidthPercent;
|
||||||
float maxPlateHeightPercent;
|
float maxPlateHeightPercent;
|
||||||
|
|
||||||
|
int maxPlateAngleDegrees;
|
||||||
|
|
||||||
float minPlateSizeWidthPx;
|
float minPlateSizeWidthPx;
|
||||||
float minPlateSizeHeightPx;
|
float minPlateSizeHeightPx;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user