openalpr / openalpr

Automatic License Plate Recognition library
http://www.openalpr.com
GNU Affero General Public License v3.0
10.99k stars 2.49k forks source link

Recognising mountain bike race boards - help needed #488

Open andrepferreira opened 7 years ago

andrepferreira commented 7 years ago

Hi folks

I'm trying to build a system that will detect bike boards mounted on the front of mountain bikes during a race. The boards are all the same, and use a single font for all the numbers. The board is 205mm x 145mm, but the top 85mm is covered with sponsor logos, with the numbers being in the lower 60mm. The numbers are all 38mm x 30mm max in size. I only need the numbers off the board.

I am treating this by adding a new country and adjusting the plate size to match the board size. I have created a conf file with the plate size, digit size etc as suggested in the Train OCR documentation and have a number of boards cropped to the correct aspect ratio for training.

The problem I have is that when I run classifychars on the images, I get the original popping up, but the OCR screen that appears is blank. I assume the OCR is not detecting anything in the image.

What am I doing wrong here? Is the plate with the logos etc too complex to be detected as a "plate", am I wasting my time trying to do this?

Any help would be much appreciated.

Below is a sample of one of the boards I am working with:

epicplate2

Thanks

matthill commented 7 years ago

Andre,

Yes, I think this should work. Normally I would think that the "CAPE EPIC" text would be fighting with the 558-1 line as the primary line for a single-line plate, but the CAPE and EPIC letters all blend together, so I suspect it should get ignored.

You'll definitely want to play with these values in your country config file: 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

Probably something like this would work better, but you may experiment with it to find a better number: char_analysis_min_pct = 0.05 char_analysis_height_range = 0.15 char_analysis_height_step_size = 0.07 char_analysis_height_num_steps = 5

Those parameters tell it to look for a text line starting at 5-20% of the height of the plate, and then moving up in increments of 7% 5 times. So it's looking for lines that are the following percentage of the plate height 5-20%, 12-27%, 19-34% and so on

When you run the ALPR utility on images, use the --debug option, it may give you some clues as to why your plate is being rejected.