Parameterized the speckle removal (based on char height) for each country

This commit is contained in:
Matt Hill
2015-09-24 22:15:49 -04:00
parent 61f37ba596
commit c2921081e7
7 changed files with 7 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -97,6 +97,7 @@ namespace alpr
float plateLinesSensitivityVertical;
float plateLinesSensitivityHorizontal;
float segmentationMinSpeckleHeightPercent;
int segmentationMinBoxWidthPx;
float segmentationMinCharHeightPercent;
float segmentationMaxCharWidthvsAverage;

View File

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