Skip to content

Commit 9132633

Browse files
committed
Update to Open ALPR 2.3
1 parent 81db37f commit 9132633

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+5483
-897
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,64 @@
1-
[common]
2-
31
; Specify the path to the runtime data directory
42
runtime_dir = /data/data/com.sandro.openalprsample/runtime_data
53

6-
74
ocr_img_size_percent = 1.33333333
85
state_id_img_size_percent = 2.0
96

10-
; detection will ignore plates that are too large. This is a good efficiency technique to use if the
11-
; plates are going to be a fixed distance away from the camera (e.g., you will never see plates that fill
7+
; Calibrating your camera improves detection accuracy in cases where vehicle plates are captured at a steep angle
8+
; Use the openalpr-utils-calibrate utility to calibrate your fixed camera to adjust for an angle
9+
; Once done, update the prewarp config with the values obtained from the tool
10+
prewarp =
11+
12+
; detection will ignore plates that are too large. This is a good efficiency technique to use if the
13+
; plates are going to be a fixed distance away from the camera (e.g., you will never see plates that fill
1214
; up the entire image
1315
max_plate_width_percent = 100
1416
max_plate_height_percent = 100
1517

1618
; detection_iteration_increase is the percentage that the LBP frame increases each iteration.
17-
; It must be greater than 1.0. A value of 1.01 means increase by 1%, 1.10 increases it by 10% each time.
18-
; So a 1% increase would be ~10x slower than 10% to process, but it has a higher chance of landing
19+
; It must be greater than 1.0. A value of 1.01 means increase by 1%, 1.10 increases it by 10% each time.
20+
; So a 1% increase would be ~10x slower than 10% to process, but it has a higher chance of landing
1921
; directly on the plate and getting a strong detection
2022
detection_iteration_increase = 1.1
2123

22-
; The minimum detection strength determines how sure the detection algorithm must be before signaling that
23-
; a plate region exists. Technically this corresponds to LBP nearest neighbors (e.g., how many detections
24+
; The minimum detection strength determines how sure the detection algorithm must be before signaling that
25+
; a plate region exists. Technically this corresponds to LBP nearest neighbors (e.g., how many detections
2426
; are clustered around the same area). For example, 2 = very lenient, 9 = very strict.
2527
detection_strictness = 3
2628

2729
; The detection doesn't necessarily need an extremely high resolution image in order to detect plates
2830
; Using a smaller input image should still find the plates and will do it faster
29-
; Tweaking the max_detection_input values will resize the input image if it is larger than these sizes
31+
; Tweaking the max_detection_input values will resize the input image if it is larger than these sizes
3032
; max_detection_input_width/height are specified in pixels
3133
max_detection_input_width = 1280
3234
max_detection_input_height = 720
3335

34-
opencl_enabled = 0
35-
multithreading_cores = 1
36+
; detector is the technique used to find license plate regions in an image. Value can be set to
37+
; lbpcpu - default LBP-based detector uses the system CPU
38+
; lbpgpu - LBP-based detector that uses Nvidia GPU to increase recognition speed.
39+
; lbpopencl - LBP-based detector that uses OpenCL GPU to increase recognition speed. Requires OpenCV 3.0
40+
; morphcpu - Experimental detector that detects white rectangles in an image. Does not require training.
41+
detector = lbpcpu
42+
43+
; If set to true, all results must match a postprocess text pattern if a pattern is available.
44+
; If not, the result is disqualified.
45+
must_match_pattern = 0
3646

47+
; Bypasses plate detection. If this is set to 1, the library assumes that each region provided is a likely plate area.
48+
skip_detection = 0
3749

50+
; Specifies the full path to an image file that constrains the detection area. Only the plate regions allowed through the mask
51+
; will be analyzed. The mask image must match the resolution of your image to be analyzed. The mask is black and white.
52+
; Black areas will be ignored, white areas will be searched. An empty value means no mask (scan the entire image)
53+
detection_mask_image =
54+
55+
; OpenALPR can scan the same image multiple times with different randomization. Setting this to a value larger than
56+
; 1 may increase accuracy, but will increase processing time linearly (e.g., analysis_count = 3 is 3x slower)
57+
analysis_count = 1
58+
59+
; OpenALPR detects high-contrast plate crops and uses an alternative edge detection technique. Setting this to 0.0
60+
; would classify ALL images as high-contrast, setting it to 1.0 would classify no images as high-contrast.
61+
contrast_detection_threshold = 0.3
3862

3963
max_plate_angle_degrees = 15
4064

@@ -47,92 +71,18 @@ postprocess_min_confidence = 65
4771
; chance that the character is incorrect and will be skipped. Value is a confidence percent
4872
postprocess_confidence_skip_level = 80
4973

50-
; Reduces the total permutations to consider for scoring.
51-
postprocess_max_substitutions = 2
52-
53-
; Results with fewer characters will be discarded
54-
postprocess_min_characters = 4
55-
postprocess_max_characters = 8
56-
57-
[debug]
58-
general = 0
59-
timing = 0
60-
state_id = 0
61-
plate_lines = 0
62-
plate_corners = 0
63-
char_regions = 0
64-
char_segment = 0
65-
char_analysis = 0
66-
color_filter = 0
67-
ocr = 0
68-
postprocess = 0
69-
show_images = 0
70-
pause_on_frame = 0
71-
72-
;;; Country Specific variables ;;;;
73-
74-
[us]
75-
76-
; 30-50, 40-60, 50-70, 60-80
77-
char_analysis_min_pct = 0.30
78-
char_analysis_height_range = 0.20
79-
char_analysis_height_step_size = 0.10
80-
char_analysis_height_num_steps = 4
81-
82-
segmentation_min_box_width_px = 4
83-
segmentation_min_charheight_percent = 0.5;
84-
segmentation_max_segment_width_percent_vs_average = 1.35;
85-
86-
plate_width_mm = 304.8
87-
plate_height_mm = 152.4
88-
89-
char_height_mm = 70
90-
char_width_mm = 35
91-
char_whitespace_top_mm = 38
92-
char_whitespace_bot_mm = 38
93-
94-
template_max_width_px = 120
95-
template_max_height_px = 60
96-
97-
; Higher sensitivity means less lines
98-
plateline_sensitivity_vertical = 25
99-
plateline_sensitivity_horizontal = 45
100-
101-
; Regions smaller than this will be disqualified
102-
min_plate_size_width_px = 70
103-
min_plate_size_height_px = 35
104-
105-
ocr_language = lus
106-
107-
[eu]
108-
109-
; 35-50; 45-60, 55-70, 65-80, 75-90
110-
char_analysis_min_pct = 0.35
111-
char_analysis_height_range = 0.15
112-
char_analysis_height_step_size = 0.10
113-
char_analysis_height_num_steps = 5
114-
115-
segmentation_min_box_width_px = 5
116-
segmentation_min_charheight_percent = 0.4;
117-
segmentation_max_segment_width_percent_vs_average = 2.0;
118-
119-
plate_width_mm = 520
120-
plate_height_mm = 110
121-
122-
char_height_mm = 80
123-
char_width_mm = 53
124-
char_whitespace_top_mm = 10
125-
char_whitespace_bot_mm = 10
126-
127-
template_max_width_px = 184
128-
template_max_height_px = 46
129-
130-
; Higher sensitivity means less lines
131-
plateline_sensitivity_vertical = 18
132-
plateline_sensitivity_horizontal = 55
133-
134-
; Regions smaller than this will be disqualified
135-
min_plate_size_width_px = 100
136-
min_plate_size_height_px = 20
13774

138-
ocr_language = leu
75+
debug_general = 0
76+
debug_timing = 0
77+
debug_detector = 0
78+
debug_prewarp = 0
79+
debug_state_id = 0
80+
debug_plate_lines = 0
81+
debug_plate_corners = 0
82+
debug_char_segment = 0
83+
debug_char_analysis = 0
84+
debug_color_filter = 0
85+
debug_ocr = 0
86+
debug_postprocess = 0
87+
debug_show_images = 0
88+
debug_pause_on_frame = 0

Sample/OpenALPRSample/app/src/main/java/com/sandro/openalprsample/MainActivity.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,14 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
8080
AsyncTask.execute(new Runnable() {
8181
@Override
8282
public void run() {
83-
String result = OpenALPR.Factory.create(MainActivity.this, ANDROID_DATA_DIR).recognizeWithCountryRegionNConfig("us", "", destination.getAbsolutePath(), openAlprConfFile, 10);
83+
//AlprJNIWrapper instance = AlprJNIWrapper.Factory.create(MainActivity.this, ANDROID_DATA_DIR, openAlprConfFile, "eu", "pt", 10);
84+
OpenALPR instance = OpenALPR.create(MainActivity.this, ANDROID_DATA_DIR, openAlprConfFile, "eu", "pt", 10);
85+
86+
Log.d("ALPR VERSION", instance.getVersion());
87+
88+
String result = instance.recognize(destination.getAbsolutePath());
89+
90+
instance.dispose();
8491

8592
Log.d("OPEN ALPR", result);
8693

Sample/OpenALPRSample/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.5.0'
9-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
8+
classpath 'com.android.tools.build:gradle:2.2.3'
9+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
1010

1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Oct 21 11:34:03 PDT 2015
1+
#Sun Mar 05 22:41:36 WET 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

0 commit comments

Comments
 (0)