Windows vs Linux installation

538 views
Skip to first unread message

Hannes kruger

unread,
Jan 24, 2015, 8:02:49 AM1/24/15
to open...@googlegroups.com
I used the pre compiled windows program and got a perfect score with my sample license plates. alpr 1.2.0.

With linux I compiled openalpr 1.2.0 with opencv 2.4.10 , tesseract 3.03 and  leptonica-1.71.

With linux I got very bad results. Not even 50%. I compared the config files and trained data. It is the same for both operating systems.


Where can I look find out why the linux run is so bad. Linux is the platform I need to use.





Matt

unread,
Jan 24, 2015, 12:25:19 PM1/24/15
to open...@googlegroups.com
The same code will give you the exact same results regardless of platform.  Do you see any warnings or anything in the output?  Any compiler errors or warnings?

Piotr.23

unread,
Feb 16, 2015, 3:36:55 PM2/16/15
to open...@googlegroups.com
Hi, am also getting nice results with the Windows version and bad with Linux version. 
I go the following error codes during the "Easy installation" following https://github.com/openalpr/openalpr/wiki/Compilation-instructions-(Ubuntu-Linux)

[ 45%] Built target alpr
Scanning dependencies of target alprd
[ 46%] Building CXX object CMakeFiles/alprd.dir/daemon.cpp.o
[ 48%] Building C object CMakeFiles/alprd.dir/daemon/beanstalk.c.o
/home/piotr/_download/openalpr/src/daemon/beanstalk.c: In function ‘bs_put’:
/home/piotr/_download/openalpr/src/daemon/beanstalk.c:380:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat=]
     snprintf(command, 1024, "put %"PRIu32" %"PRIu32" %"PRIu32" %lu\r\n", priority, delay, ttr, bytes);
     ^
/home/piotr/_download/openalpr/src/daemon/beanstalk.c:380:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ [-Wformat=]
/home/piotr/_download/openalpr/src/daemon/beanstalk.c: In function ‘bs_reserve_job’:
/home/piotr/_download/openalpr/src/daemon/beanstalk.c:450:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int *’, but argument 4 has type ‘size_t *’ [-Wformat=]
         sscanf(message->status + strlen(bs_resp_reserved) + 1, "%"PRId64" %lu", &job->id, &job->size);
         ^
/home/piotr/_download/openalpr/src/daemon/beanstalk.c: In function ‘bs_peek_job’:
/home/piotr/_download/openalpr/src/daemon/beanstalk.c:534:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int *’, but argument 4 has type ‘size_t *’ [-Wformat=]
         sscanf(message->status + strlen(bs_resp_found) + 1, "%"PRId64" %lu", &job->id, &job->size);
         ^
/home/piotr/_download/openalpr/src/daemon/beanstalk.c: In function ‘bs_get_info’:
/home/piotr/_download/openalpr/src/daemon/beanstalk.c:599:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int *’, but argument 3 has type ‘size_t *’ [-Wformat=]
         sscanf(message->status + strlen(bs_resp_ok) + 1, "%lu", &size);
         ^
[ 49%] Building CXX object CMakeFiles/alprd.dir/daemon/beanstalk.cc.o
Linking CXX executable alprd

Can you help, please? | P

Vladimir Radnovic

unread,
Feb 17, 2015, 3:08:32 AM2/17/15
to open...@googlegroups.com
ALPRD - deamon don't work on windows

u can cansell intalations and you will get all work

Piotr.23

unread,
Feb 17, 2015, 3:50:32 AM2/17/15
to open...@googlegroups.com
I have no problems with Windows. My Ubuntu version doesn't work as expected (with EU plates; US plates appear to work) | P

Vladimir Radnovic

unread,
Feb 17, 2015, 4:16:00 AM2/17/15
to open...@googlegroups.com
What you use ? alpr -c eu nameimage.jpg or alprd ? 

can u past here configure file 

Piotr.23

unread,
Feb 17, 2015, 11:03:40 AM2/17/15
to open...@googlegroups.com
I use  alpr -c eu nameimage.jpg

Piotr.23

unread,
Feb 17, 2015, 11:15:42 AM2/17/15
to open...@googlegroups.com
Do you mean openalpr.conf.in?

[common]

; Specify the path to the runtime data directory
runtime_dir = ${CMAKE_INSTALL_PREFIX}/share/openalpr/runtime_data


ocr_img_size_percent = 1.33333333
state_id_img_size_percent = 2.0

; detection will ignore plates that are too large.  This is a good efficiency technique to use if the 
; plates are going to be a fixed distance away from the camera (e.g., you will never see plates that fill 
; up the entire image
max_plate_width_percent = 100
max_plate_height_percent = 100

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

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

; The detection doesn't necessarily need an extremely high resolution image in order to detect plates
; Using a smaller input image should still find the plates and will do it faster
; Tweaking the max_detection_input values will resize the input image if it is larger than these sizes 
; max_detection_input_width/height are specified in pixels
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

ocr_min_font_point = 6

; Minimum OCR confidence percent to consider.
postprocess_min_confidence = 65

; Any OCR character lower than this will also add an equally likely
; chance that the character is incorrect and will be skipped.  Value is a confidence percent
postprocess_confidence_skip_level = 80

; Reduces the total permutations to consider for scoring.
postprocess_max_substitutions = 2

; Results with fewer characters will be discarded
postprocess_min_characters = 4
postprocess_max_characters = 8

[debug]
general       = 0
timing        = 0
state_id      = 0
plate_lines   = 0
plate_corners = 0
char_segment  = 0
char_analysis = 0
color_filter  = 0
ocr           = 0
postprocess   = 0
show_images   = 0
pause_on_frame = 0

;;; Country Specific variables ;;;;

[us]

; 30-50, 40-60, 50-70, 60-80
char_analysis_min_pct = 0.30
char_analysis_height_range = 0.20
char_analysis_height_step_size = 0.10
char_analysis_height_num_steps = 4

segmentation_min_box_width_px = 4
segmentation_min_charheight_percent = 0.5;
segmentation_max_segment_width_percent_vs_average = 1.35;

plate_width_mm = 304.8
plate_height_mm = 152.4

multiline = 0

char_height_mm = 70
char_width_mm = 35
char_whitespace_top_mm = 38
char_whitespace_bot_mm = 38

template_max_width_px = 120
template_max_height_px = 60

; Higher sensitivity means less lines
plateline_sensitivity_vertical = 25
plateline_sensitivity_horizontal = 45

; Regions smaller than this will be disqualified
min_plate_size_width_px = 70
min_plate_size_height_px = 35

ocr_language = lus

[eu]
; One-line European style plates

; 35-50; 45-60, 55-70, 65-80, 75-90
char_analysis_min_pct = 0.35
char_analysis_height_range = 0.15
char_analysis_height_step_size = 0.10
char_analysis_height_num_steps = 5

segmentation_min_box_width_px = 5
segmentation_min_charheight_percent = 0.4;
segmentation_max_segment_width_percent_vs_average = 2.0;

plate_width_mm = 520
plate_height_mm = 110

multiline = 0

char_height_mm = 80
char_width_mm = 53
char_whitespace_top_mm = 10
char_whitespace_bot_mm = 10

template_max_width_px = 184
template_max_height_px = 46

; Higher sensitivity means less lines
plateline_sensitivity_vertical = 18
plateline_sensitivity_horizontal = 55

; Regions smaller than this will be disqualified
min_plate_size_width_px = 100
min_plate_size_height_px = 20

ocr_language = leu

Vladimir Radnovic

unread,
Feb 18, 2015, 2:14:51 AM2/18/15
to open...@googlegroups.com
plz add one image here to test it

tnx
vladimir

Piotr.23

unread,
Feb 18, 2015, 3:40:23 AM2/18/15
to open...@googlegroups.com
Thanks, Vladimir. 

I am attaching two images: 12 and 13. 

12 was perfectly recognized, and 13 almost perfectly recognized on Windows installation.
12 and 13 were initially not recognized on Ubuntu

piotr@piotr:~$ alpr -c eu --clock -n 1 /home/piotr/_download/3-20150208/3-20150208-0113-ALPR.jpg
Total Time to process image: 96.2574ms.
No license plates found.

I then tweaked alpr config file and changed:

- detection_iteration_increase = from 1.1 to 1.5
- detection_strictness = from 3 to 6
- max_plate_angle_degrees = from 15 to 30

Following this, image 12 was recognized and 13 still not. 

This is just an example, I tested many images. 
Windows is always much better than Ubuntu version
And I need Linux to have all on one system

Yes, there are some extra characters on the images, but they never confuse ALPR
Best | P
3-20150208-0112-ALPR.jpg
3-20150208-0113-ALPR.jpg

Vladimir Radnovic

unread,
Feb 18, 2015, 4:01:13 AM2/18/15
to open...@googlegroups.com
For start tray to put camera litle left, if you can put better resolution now is very small 768x512 optimal will be 1280x720

on second image plate is not good it's par of image/plate...

second remove txt from image ( on camera ) it's better

3) better result you will have if we read plate from back of care... in night time... you don't have light on front


In attach you have some exp image how to set up camera...
test2.jpg
test.jpg

Piotr.23

unread,
Feb 18, 2015, 5:18:36 AM2/18/15
to open...@googlegroups.com
Vladimir: the conditions are not perfect, but can't change them
However, this still does not explain the difference between Win and Linux

Here are the results of your examples:

F:\$Download\openalpr\ffmpeg\test>F:\$Download\openalpr\alpr.exe -c eu -n 1 test.jpg
plate0: 1 results
    - LSA001NN   confidence: 90.1882     template_match: 0

F:\$Download\openalpr\ffmpeg\test>F:\$Download\openalpr\alpr.exe -c eu -n 1 test2.jpg
plate0: 1 results
    - KI002YG    confidence: 88.7756     template_match: 0


piotr@piotr:~$ alpr -c eu --clock -n 1 /home/piotr/_download/test/test.jpg
Total Time to process image: 456.583ms.
No license plates found.

piotr@piotr:~$ alpr -c eu --clock -n 1 /home/piotr/_download/test/test2.jpg
Total Time to process image: 297.589ms.
plate0: 1 results -- Processing Time = 130.814ms.
    - KI002Y     confidence: 89.9517

Windows found partially correct number on 'test' and correct on 'test2'
Ubuntu did not find any on 'test' and partially correct on 'test2'

How to change Linux conf to match Win version? | P

Vladimir Radnovic

unread,
Feb 18, 2015, 8:47:05 AM2/18/15
to open...@googlegroups.com
it's 2 difrent version od alpr windows and linux

tipe alpr --version on linux and win. and past here

tnx
vladimir

Matt

unread,
Feb 18, 2015, 8:51:38 AM2/18/15
to open...@googlegroups.com
Are the Windows and Linux software running the exact same software code?  Did you compile both yourself?  What do you get when you type alpr --version on Windows and on Linux?

Are the runtime_data/region/eu.xml files the same?  Perhaps run a diff against them to see.

Are the openalpr.conf files the same?  Perhaps run a diff against them as well.
Message has been deleted

Piotr.23

unread,
Feb 18, 2015, 3:40:49 PM2/18/15
to open...@googlegroups.com
Apologies: I badly formatted the text of Windows files for diff comparison. 
NO: there are no differences in eu.xml file.
YES: there are small differences in openalpr.config file:

4c4
< runtime_dir = /usr/share/openalpr/runtime_data
---
> runtime_dir = C:/set/to/runtime_dir/path
20,21c20
< ; Piotr 20150217 was 1.1
< detection_iteration_increase = 1.5
---
> detection_iteration_increase = 1.1
26,27c25
< ; Piotr was 3
< detection_strictness = 6
---
> detection_strictness = 3
36,37c34
< ; Bypasses plate detection.  If this is set to 1, the library assumes that each region provided is a likely plate area.
< skip_detection = 0
---
> multithreading_cores = 1
39,40c36,38
< ; Piotr was 15
< max_plate_angle_degrees = 30
---
> max_plate_angle_degrees = 15
60c58
< timing        = 1
---
> timing        = 0
63a62
> char_regions  = 0
89,90d87
< multiline = 0
110d106
< ; One-line European style plates
124,125d119
< multiline = 0

P


On Wednesday, February 18, 2015 at 9:21:16 PM UTC+1, Piotr.23 wrote:
Hi, Matt

I did not compile Windows version. I just downloaded the exe file, its version is 1.2.0. I even did not realize that there is something to compile, it works OK on Windows 7
The way I downloaded Linux version (2.0.0) I described earlier in this thread. I used "Easy installation" following https://github.com/openalpr/openalpr/wiki/Compilation-instructions-(Ubuntu-Linux)

There is a number of differences in both eu.xml and openalpr.conf. I am attaching these files here.
What shall I change in Linux configuration to have as good results as with Win 1.2 version? | P

Matt

unread,
Feb 18, 2015, 6:38:11 PM2/18/15
to open...@googlegroups.com
It looks like you're comparing the 1.2 version compiled on Windows with the 2.0 version compiled on Linux.  The results will be different, since the code is different.


Whenever I make changes to the library, I run the new code against a benchmark test of many images.  There will be variations between versions, but the general trend (ideally) is increased accuracy and performance.

-Matt

Piotr.23

unread,
Feb 19, 2015, 7:09:32 AM2/19/15
to open...@googlegroups.com
Matt, I forgot to thank you for developing this marvelous project :)
Yes, I am comparing these versions, although, these are not apples and oranges... 
For the reason I'd like to identify, the older Win version appears to work better than recent Linux version, both on my samples as well as on samples provided by Vladimir. 
Could this be due to 32 (Linux)/64 (Windows) - bit systems? | P

Matt

unread,
Feb 19, 2015, 8:53:13 AM2/19/15
to open...@googlegroups.com
Much has changed between version 1.2 and 2.0, there's been almost 250 commits since the last release.  

I don't think we can claim that the accuracy has gone down if you're just comparing a handful of sample images.  We must also consider all the images that were not recognized in the past version and now are recognized.  With computer vision, even if you change a few pixels in an image, or slightly tweak the weighting rules/scores, the results can be completely different.  So there is an element of randomness to it.  

I have a large library of benchmark images that I run against the software with each new version.  At the end of the run I get an accuracy score.  The numbers between 1.2 and 2.0-dev have gone up in my benchmarks for both EU and US.  So, I just think the differences you are seeing are due to a small sample set.  Also, I don't believe that there is any difference in results between Windows and Linux when they're running the same version of the software.  Nor is there any difference between 32 and 64 bit.

Piotr.23

unread,
Feb 20, 2015, 5:01:19 AM2/20/15
to open...@googlegroups.com
Matt, you are absolutely right: only the comparison of a large set of images makes sense. 

Please forgive my ignorance... how to use alpr on several images? 
I have original AVI files. Since Windows version does not allow me to assess AVIs (Linux does)... in WIndows, I first convert AVI to several JPGs with ffmpeg and then, I run alpr on JPGs... this is time consuming...
How to run alpr -c eu *.jpg (doesn't work for me)?

In Linux, I tried something like this:

ls -latr *.jpg | awk '{print $9}' > file_list
alpr -c eu  `cat file_list`

but while this works for mencoder, it doesn't for alpr

Also, I could not find a method to store images with plates using aplpr -c eu something.avi 
I know this was discussed in the past... Any suggestion? | P

Matt

unread,
Feb 21, 2015, 7:29:22 PM2/21/15
to open...@googlegroups.com
Probably the easiest way would be to modify the alpr binary (main.cpp) to read a list of files and process them individually.

For my benchmarks, I put some code together here: https://github.com/openalpr/benchmarks

The end-to-end test takes a list of images, processes them, and compares the results against a known correct answer.  The end result is percentage scores for detection, and overall accuracy.

What do you mean by storing images with plates?
Reply all
Reply to author
Forward
0 new messages