Added config option to bypass detection.

If detection is bypassed, OpenALPR assumes the region provided is already a likely plate region
This commit is contained in:
Matt Hill
2014-12-27 21:40:09 -05:00
parent 5d75ae2990
commit e01919dd3e
4 changed files with 21 additions and 2 deletions

View File

@@ -31,7 +31,8 @@ detection_strictness = 3
max_detection_input_width = 1280 max_detection_input_width = 1280
max_detection_input_height = 720 max_detection_input_height = 720
; Bypasses plate detection. If this is set to 1, the library assumes that each region provided is a likely plate area.
skip_detection = 0
max_plate_angle_degrees = 15 max_plate_angle_degrees = 15

View File

@@ -104,7 +104,21 @@ namespace alpr
} }
// Find all the candidate regions // Find all the candidate regions
response.plateRegions = plateDetector->detect(img, regionsOfInterest); if (config->skipDetection == false)
{
response.plateRegions = plateDetector->detect(img, regionsOfInterest);
}
else
{
// They have elected to skip plate detection. Instead, return a list of plate regions
// based on their regions of interest
for (unsigned int i = 0; i < regionsOfInterest.size(); i++)
{
PlateRegion pr;
pr.rect = cv::Rect(regionsOfInterest[i]);
response.plateRegions.push_back(pr);
}
}
queue<PlateRegion> plateQueue; queue<PlateRegion> plateQueue;
for (unsigned int i = 0; i < response.plateRegions.size(); i++) for (unsigned int i = 0; i < response.plateRegions.size(); i++)

View File

@@ -137,6 +137,8 @@ namespace alpr
maxDetectionInputWidth = getInt("common", "max_detection_input_width", 1280); maxDetectionInputWidth = getInt("common", "max_detection_input_width", 1280);
maxDetectionInputHeight = getInt("common", "max_detection_input_height", 768); maxDetectionInputHeight = getInt("common", "max_detection_input_height", 768);
skipDetection = getBoolean("common", "skip_detection", false);
maxPlateAngleDegrees = getInt("common", "max_plate_angle_degrees", 15); 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);

View File

@@ -53,6 +53,8 @@ namespace alpr
float maxPlateHeightPercent; float maxPlateHeightPercent;
int maxDetectionInputWidth; int maxDetectionInputWidth;
int maxDetectionInputHeight; int maxDetectionInputHeight;
bool skipDetection;
int maxPlateAngleDegrees; int maxPlateAngleDegrees;