mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-05 13:26:53 +08:00
Parameterized the speckle removal (based on char height) for each country
This commit is contained in:
@@ -4,6 +4,7 @@ char_analysis_height_range = 0.15
|
||||
char_analysis_height_step_size = 0.10
|
||||
char_analysis_height_num_steps = 5
|
||||
|
||||
segmentation_min_speckle_height_percent = 0.3
|
||||
segmentation_min_box_width_px = 4
|
||||
segmentation_min_charheight_percent = 0.4;
|
||||
segmentation_max_segment_width_percent_vs_average = 1.6;
|
||||
|
@@ -6,6 +6,7 @@ char_analysis_height_range = 0.15
|
||||
char_analysis_height_step_size = 0.10
|
||||
char_analysis_height_num_steps = 5
|
||||
|
||||
segmentation_min_speckle_height_percent = 0.2
|
||||
segmentation_min_box_width_px = 5
|
||||
segmentation_min_charheight_percent = 0.4;
|
||||
segmentation_max_segment_width_percent_vs_average = 2.0;
|
||||
|
@@ -5,6 +5,7 @@ char_analysis_height_range = 0.15
|
||||
char_analysis_height_step_size = 0.10
|
||||
char_analysis_height_num_steps = 5
|
||||
|
||||
segmentation_min_speckle_height_percent = 0.15
|
||||
segmentation_min_box_width_px = 4
|
||||
segmentation_min_charheight_percent = 0.4;
|
||||
segmentation_max_segment_width_percent_vs_average = 2.0;
|
||||
|
@@ -4,6 +4,7 @@ char_analysis_height_range = 0.20
|
||||
char_analysis_height_step_size = 0.10
|
||||
char_analysis_height_num_steps = 4
|
||||
|
||||
segmentation_min_speckle_height_percent = 0.3
|
||||
segmentation_min_box_width_px = 4
|
||||
segmentation_min_charheight_percent = 0.5;
|
||||
segmentation_max_segment_width_percent_vs_average = 1.35;
|
||||
|
@@ -270,6 +270,7 @@ namespace alpr
|
||||
charAnalysisHeightStepSize = getFloat(ini, "", "char_analysis_height_step_size", 0);
|
||||
charAnalysisNumSteps = getInt(ini, "", "char_analysis_height_num_steps", 0);
|
||||
|
||||
segmentationMinSpeckleHeightPercent = getFloat(ini, "", "segmentation_min_speckle_height_percent", 0);
|
||||
segmentationMinBoxWidthPx = getInt(ini, "", "segmentation_min_box_width_px", 0);
|
||||
segmentationMinCharHeightPercent = getFloat(ini, "", "segmentation_min_charheight_percent", 0);
|
||||
segmentationMaxCharWidthvsAverage = getFloat(ini, "", "segmentation_max_segment_width_percent_vs_average", 0);
|
||||
|
@@ -97,6 +97,7 @@ namespace alpr
|
||||
float plateLinesSensitivityVertical;
|
||||
float plateLinesSensitivityHorizontal;
|
||||
|
||||
float segmentationMinSpeckleHeightPercent;
|
||||
int segmentationMinBoxWidthPx;
|
||||
float segmentationMinCharHeightPercent;
|
||||
float segmentationMaxCharWidthvsAverage;
|
||||
|
@@ -379,7 +379,7 @@ namespace alpr
|
||||
void CharacterSegmenter::removeSmallContours(vector<Mat> thresholds, float avgCharHeight, TextLine textLine)
|
||||
{
|
||||
//const float MIN_CHAR_AREA = 0.02 * avgCharWidth * avgCharHeight; // To clear out the tiny specks
|
||||
const float MIN_CONTOUR_HEIGHT = 0.3 * avgCharHeight;
|
||||
const float MIN_CONTOUR_HEIGHT = config->segmentationMinSpeckleHeightPercent * avgCharHeight;
|
||||
|
||||
Mat textLineMask = Mat::zeros(thresholds[0].size(), CV_8U);
|
||||
fillConvexPoly(textLineMask, textLine.linePolygon.data(), textLine.linePolygon.size(), Scalar(255,255,255));
|
||||
|
Reference in New Issue
Block a user