mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 06:46:53 +08:00
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:
@@ -31,7 +31,8 @@ detection_strictness = 3
|
||||
max_detection_input_width = 1280
|
||||
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
|
||||
|
||||
|
@@ -104,7 +104,21 @@ namespace alpr
|
||||
}
|
||||
|
||||
// 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;
|
||||
for (unsigned int i = 0; i < response.plateRegions.size(); i++)
|
||||
|
@@ -137,6 +137,8 @@ namespace alpr
|
||||
maxDetectionInputWidth = getInt("common", "max_detection_input_width", 1280);
|
||||
maxDetectionInputHeight = getInt("common", "max_detection_input_height", 768);
|
||||
|
||||
skipDetection = getBoolean("common", "skip_detection", false);
|
||||
|
||||
maxPlateAngleDegrees = getInt("common", "max_plate_angle_degrees", 15);
|
||||
|
||||
minPlateSizeWidthPx = getInt(country, "min_plate_size_width_px", 100);
|
||||
|
@@ -53,6 +53,8 @@ namespace alpr
|
||||
float maxPlateHeightPercent;
|
||||
int maxDetectionInputWidth;
|
||||
int maxDetectionInputHeight;
|
||||
|
||||
bool skipDetection;
|
||||
|
||||
int maxPlateAngleDegrees;
|
||||
|
||||
|
Reference in New Issue
Block a user