Added parameter for max plate rotation (was previously hardcoded at 10 degrees). Upped the default to 15

This commit is contained in:
Matt Hill
2014-04-08 15:11:11 -05:00
parent a226d2bad1
commit 84e1df8c7c
4 changed files with 9 additions and 2 deletions

View File

@@ -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.

View File

@@ -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;

View File

@@ -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);

View File

@@ -50,6 +50,8 @@ class Config
float maxPlateWidthPercent; float maxPlateWidthPercent;
float maxPlateHeightPercent; float maxPlateHeightPercent;
int maxPlateAngleDegrees;
float minPlateSizeWidthPx; float minPlateSizeWidthPx;
float minPlateSizeHeightPx; float minPlateSizeHeightPx;