Coder Social home page Coder Social logo

Comments (20)

maechler avatar maechler commented on August 19, 2024 3

I attach the trained data files for anyone interested in using them until this issue is resolved.
The file lch.traineddata contains only the Swiss font data, the file leu.traineddata contains the EU fonts and the Swiss font. Even though our test data only consisted of Swiss license plates we got better results using leu.traineddata.

traineddata.zip

from train-ocr.

bhavna7 avatar bhavna7 commented on August 19, 2024

Hie maechler,
Can you help with how to attach our custom fonts to the leu.traineddata.
it would be a great help.

looking forward to hear from you soon.
thanks in advance

from train-ocr.

maechler avatar maechler commented on August 19, 2024

@bhavna7 The documentation chapter "Training OCR" tells you how to add your custom fonts: http://doc.openalpr.com/opensource.html#training-ocr

from train-ocr.

PetarMG-BG avatar PetarMG-BG commented on August 19, 2024

@bhavna7 The documentation chapter "Training OCR" tells you how to add your custom fonts: http://doc.openalpr.com/opensource.html#training-ocr

Hi @bhavna7 , I'm trying to train tessaract for austrian lp, but I have an issue. Could you please spend some time to tell or show us about your approach how you train the data. Especially how did you make the tif file, and how you combine the files for leu.traineddata.
Thanks!

from train-ocr.

maechler avatar maechler commented on August 19, 2024

@PetarMG-BG we had a similar discussion starting here: #33 (comment)

Maybe @alucard079 could help you, as he recently used the training tools.

from train-ocr.

alucard079 avatar alucard079 commented on August 19, 2024

@PetarMG-BG what part are you now?

from train-ocr.

PetarMG-BG avatar PetarMG-BG commented on August 19, 2024

@alucard079 currently I'm using a tif and box files for austrian lp, provided in some of the treads here.
The problem of this files are the quality of the images. How did you generate them?

from train-ocr.

alucard079 avatar alucard079 commented on August 19, 2024

@PetarMG-BG markus @maechler provided a train.py for me. I think his code with a minimum revision will make it work.

@PetarMG-BG anw, I recompiled again the openalpr because I reinstalled my linux again, will you help me in compilling it again? I'm having a problem with "make".

from train-ocr.

PetarMG-BG avatar PetarMG-BG commented on August 19, 2024

@alucard079 what is the error of make?

from train-ocr.

alucard079 avatar alucard079 commented on August 19, 2024

@PetarMG-BG openalpr/openalpr#775

from train-ocr.

jayjupdhig avatar jayjupdhig commented on August 19, 2024

What exactly do i need to to with that swiss data?

There are many directories:

  • /usr/share/openalpr/runtime_data/config/
    -> There is NO ch.conf !!
  • /usr/share/openalpr/runtime_data/region
    -> There is NO ch.xml
  • /usr/share/openalpr/runtime_data/ocr/tessdata
    -> There is a file leu.traineddata but no lch.traineddata

What are the steps from A-Z so OpenAlpr (Open Sopurce) is able to recognize swiss car numbers?

Thank you for your feedback.

from train-ocr.

maechler avatar maechler commented on August 19, 2024

@martijintro

I have not used OpenALPR in a while, so I might be missing something here, but I'll try my best to answer your question.

  1. Download the trained data: traineddata.zip
  2. Decide whether you want to use it for EU and Swiss plates (a) or for Swiss plates only (b):
    a.1. Copy leu.traineddata to runtime_data/ocr/tessdata and overwrite the existing file. Use the regular EU configuration and you are probably done.
    b.1. Copy lch.traineddata to runtime_data/ocr/tessdata
    b.2. Add a file ch.conf to runtime_data/config with the content from below. We use eu.xml for the detector as it works well enough.
    b.3. Add a file ch.patterns to runtime_data/postprocess with the content from below.

runtime_data/config/ch.conf

; Single-line Swiss 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_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;

plate_width_mm = 300
plate_height_mm = 80

multiline = 0

char_height_mm = 55
char_width_mm = 30
char_whitespace_top_mm = 13
char_whitespace_bot_mm = 13

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 = 65
min_plate_size_height_px = 18

; Results with fewer or more characters will be discarded
postprocess_min_characters = 3
postprocess_max_characters = 8

detector_file = eu.xml

ocr_language = lch

; Override for postprocess letters/numbers regex. 
postprocess_regex_letters = [ABDEFGHIJLNORSTUVWZ]
postprocess_regex_numbers = [0-9]


; Whether the plate is always dark letters on light background, light letters on dark background, or both
; value can be either always, never, or auto
invert = auto

runtime_data/postprocess/ch.patterns

ch	[ABDEFGHIJLNORSTUVWZ][ABDEFGHIJLNORSTUVWZ]######
ch	[APM]######

from train-ocr.

jayjupdhig avatar jayjupdhig commented on August 19, 2024

thank you very much, will try it!! :-)

from train-ocr.

jayjupdhig avatar jayjupdhig commented on August 19, 2024

and: so i saw, a swiss configuration was not added until now: openalpr/openalpr#881

from train-ocr.

jayjupdhig avatar jayjupdhig commented on August 19, 2024

OpenALPR seems to have a bug with TESSDATA_xxx variable: openalpr/openalpr#882

The only possible way seems to be that:

cp /usr/share/openalpr/runtime_data/ocr/tessdata/leu.traineddata /usr/share/openalpr/runtime_data/ocr

Act of resignation!!!!!!!!!!!!!!

from train-ocr.

jayjupdhig avatar jayjupdhig commented on August 19, 2024

OK, so:

1. wget https://github.com/openalpr/train-ocr/files/1597439/traineddata.zip
2. unzip traineddata.zip
3. cp ./leu.traineddata /usr/share/openalpr/runtime_data/ocr (So NO tessdata directory due to this [CENSORED] bug!!!)
4. alpr -c eu n.jpg -> "No license plates found."

So: Doesn't work, all in all...

from train-ocr.

jayjupdhig avatar jayjupdhig commented on August 19, 2024

I think it's a product strategy to make the opensource version completely unusable, so the people buy it because they are resignated.

I think i'm right with that.

from train-ocr.

jayjupdhig avatar jayjupdhig commented on August 19, 2024

So the OS version is just a decoy, nothing else....!!

from train-ocr.

jayjupdhig avatar jayjupdhig commented on August 19, 2024

And i don't like that strategy. Because it's not honest.

Because of that, now i try it with https://platerecognizer.com, hehe!! :-)

from train-ocr.

jayjupdhig avatar jayjupdhig commented on August 19, 2024

OK thx...

from train-ocr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.