evermeer / PassportScanner

Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.
BSD 3-Clause "New" or "Revised" License
457 stars 101 forks source link

Taking too much time to load first. #38

Open visionsIT opened 5 years ago

visionsIT commented 5 years ago

It is taking too much time to load its first time, and also taking long time to scan.

mjurfest commented 4 years ago

The same it's happening to me. It takes 5+ seconds to load camera and it doesn't scan the passport. @evermeer do you plan to fix this issue?

evermeer commented 4 years ago

The phone speed and camera quality really matters here. I recommend using an iPhone 8 or later. When I use the demo project on my phone the scan starts within 2 seconds after pressing the button. The speed for recognizing the text depends much on the light plus the phone speed. On my phone it's able to do more than 2 OCR tests a second. A lot of filters are applied to the image to make the OCR as good as possible.

Using Tesseract as the OCR engine gives the best results. There are not any other open source OCR libraries that have better results. If you do know any OCR library with better results then please let me know. I already have done quite some optimizations to make the OCR as good as possible. You could try playing around with the filters. If you find a more optimal setting, then please let me know.

mjurfest commented 4 years ago

I am trying on an iPhone 8 and the first time it still takes around 5 seconds, then yes it loads fast. Anyway I wasn't able to scan my passport.