konstantint / PassportEye

Extraction of machine-readable zone information from passports, visas and id-cards via OCR
MIT License
382 stars 110 forks source link

When we scan passport in landscape mode , PassportEye couldn't read the passport. #3

Closed Abgaryan closed 6 years ago

Abgaryan commented 7 years ago

I am using PassportEye inside chatbot for facebook messenger developed in Node.js , it works perfectly when the phone is a portrait , but when the phone is landscape it doesn't work.

konstantint commented 7 years ago

Although PassportEye can sometimes recognize sideways passports, at the moment the code implicitly assumes the passport is more-or-less straight on the image.

Adding the possibility of recognizing landscape orientation is, in principle, not too complicated, but it would make the code slower overall (because it would basically have to go through extra image rotations to search the correct one). In the cases I've needed this library, it was more practical easier to simply make sure the passport on the image is properly rotated (e.g. by asking the user to rotate it as needed).