Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Barcode scanner not scanning PDF417 barcode on south african driving license #53

Closed
ostwalankit opened this issue Feb 28, 2019 · 38 comments

Comments

@ostwalankit
Copy link

Step 1: Describe your environment

  • Android device: _Google Pixel
  • Android OS version: 9
  • Google Play Services version: "com.google.firebase:firebase-ml-vision:19.0.2"
  • Firebase/Play Services SDK version: _____

Step 2: Describe the problem:

I am not able to scan PDF417 barcode on south african driving license (attached below) . It dosent scan anything. I am using default mlkit project of github. I have added Firebase to the project.

Following are dependencies used.

// ML Kit dependencies
implementation 'com.google.firebase:firebase-ml-vision:19.0.2'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
implementation 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'
implementation 'com.google.firebase:firebase-ml-model-interpreter:17.0.3'

Steps to reproduce:

  1. Load the project ML kit.
  2. Select Java ML Kit
  3. Select Live Preview Activity
  4. Select Barcode detection from spinner at bottom
  5. Now scan the south african driving license.

Observed Results:

There are constant recurring logs.
2019-02-28 21:10:34.172 3508-3746/com.google.firebase.samples.apps.mlkit D/MIDemoApp:CameraSource: Process an image
2019-02-28 21:10:34.172 3508-3746/com.google.firebase.samples.apps.mlkit D/skia: onFlyCompress

Expected Results:

Scan the PDF417 barcode and show appropriate result in context to it. I scanned the same driving license via. Microblink app and it scans perfectly.

Relevant Code:

Used the mlkit code on github.

drivers - back

@samtstern
Copy link

I am able to reproduce the same thing using my California driver's license. And I can confirm that other barcodes, like QR codes, scan in the app.

Let me report this to the ML Kit team.

@DavidBriglio
Copy link

I am also experiencing similar issues with license PDF417 scanning. When scanning an Ontario Canada license it will return the result as TYPE_TEXT instead of the expected TYPE_DRIVER_LICENSE, and will not be encoded properly.

@ulukaya
Copy link
Collaborator

ulukaya commented Jun 24, 2019

Reported internally b/135923143

@gvincent81
Copy link

any further updates on this bug?

@mp3killa
Copy link

mp3killa commented Sep 26, 2019

Experiencing same thing, this bug was opened on 28th Feb, it's now basically Oct. How much time is needed to get some kinda fix or feedback?

@IronBlossom
Copy link

Any update on that ?? Not even working for Bangladesh National ID

@jhnplotim
Copy link

Any update on this?? Not working for Uganda National ID as well

@ravirajcm
Copy link

Experiencing same issue with Ontario Health card

Screen Shot 2019-11-19 at 7 47 12 PM

Pic taken from Ohip manual
http://www.health.gov.on.ca/english/providers/pub/ohip/ohipvalid_manual/ohipvalid_manual.pdf

@marcoschicote
Copy link

Hi! Any update on this? Same issue with argentinean license

@sybrin-innovations
Copy link

Hi! I am also curious to see if any work has been done on this.

What i have seen is it works on older SA driver license not newer ones.

Not sure if its a change in the PDF417's that's not catered for in ML kit

@waqaramjad
Copy link

same issue

@zeckyUs
Copy link

zeckyUs commented Mar 7, 2020

Tested PDF417 decoding (US DL) from camera feed and it was not working at the beginning.
I had to raise the picture resolution (switched from 480x360 to 1280x720) to make it work. Did you try increasing the picture resolution?

@ostwalankit
Copy link
Author

ostwalankit commented Mar 9, 2020 via email

@aantelov87
Copy link

I am facing the same issue as described above for the new Florida DL.

Almost one year that this bug was reported but there is not a feedback from firebase_ml_vision team.

Please, this feature is really important for us. Thank you

@sybrin-innovations
Copy link

sybrin-innovations commented Apr 7, 2020

So i managed to get the DL scanning using image processing. This is not the best solution as it reduces the speed of the capturing process significantly.

The Issue i am speculating with the DL above is basically FB is looking for the Start and End but can't find it.

@ANY FIRE BASE ADMIN. I would love to test this out. Is there a way i can pull the PDF417 code?

I am sure this will help a lot of people.

@rohitr308
Copy link

Any updates on this bug? This was reported a year ago.

@zhouyiself
Copy link
Collaborator

Have you tried the new bundled model version which has better accuracy & latency but size is bigger though?

It's mentioned at the top of this page (https://firebase.google.com/docs/ml-kit/android/read-barcodes) and requires a new dependency ("firebase-ml-vision-barcode-model") in addition to "firebase-ml-vision".

@rohitr308
Copy link

rohitr308 commented May 11, 2020

@zhouyiself I tried with firebase-ml-vision-barcode-model and it still does not work.

I tired the Barcode Scanning in quickstart-android. It does not work for PDF417 formats

@zhouyiself
Copy link
Collaborator

@rohitr308 Thanks for the confirmation! Any chance you can share a test image that didn't work?

@zhouyiself
Copy link
Collaborator

BTW, be aware of that the input image should not be too small for these denser formats.
https://firebase.google.com/docs/ml-kit/android/read-barcodes

@rohitr308
Copy link

I think that is the problem. It works when the input images are large. Sorry for the wrong information.

@johan-schoeman
Copy link

The SA drivers license (first post) has the following information (Andoid App that I am working on that uses the Android Mobile Vision scanner):

License type 1: EB
License type 2:
License Type 3:
License Type 4:
Surname: KRIGE
Initials: ZA
PrDP Code:
ID Country of Issue: ZA
License Country of Issue: ZA
Vehicle Restriction L1: 0
Vehicle Restriction L2:
Vehicle Restriction L3:
Vehicle Restriction L4:
License Number: 6039000286BY
ID Number: 790211xxxxxxx 'have "x'ed" out the last 7 digits in the ID Number
ID Number Type: 02
Issue Date L1: 20021126
Issue Date L2: ........
Issue Date L3: ........
Issue Date L4: ........
Driver Restrictions: 00
PrDP Expiry Date: ........
License Issue Number: 01
Birth Date: 19790211
Valid From: 20180119
Valid To: 20230118
Gender: Male

@ulukaya ulukaya transferred this issue from firebase/quickstart-android Jun 30, 2020
@ulukaya ulukaya transferred this issue from another repository Jun 30, 2020
@bcdj bcdj closed this as completed Sep 25, 2020
@Gilboot
Copy link

Gilboot commented Dec 26, 2020

Any solution here?

@donaldjansen
Copy link

Has anybody found a way to scan this barcode ?
I have used 1280x720 and 1920x1080 neither worked on this barcode in the image, other PDF417 does work. but if I use the sample apps on Play Store it works

@Gilboot
Copy link

Gilboot commented Mar 22, 2021

I had to switch to zxing

@blen7777
Copy link

Zxing is it working for you?

@rjmangubat23
Copy link

rjmangubat23 commented Jul 1, 2021

Did this work for anyone? I am also facing this issue, the workaround I did was adjusting the zoom ratio of camera to 0.8F and used 1920x1080 for the size but it does not 100% work fully, especially on complex PDF417 like stated above. Should I consider using zxing? or anyone have a better solution? Thank you in advance!

@donaldjansen
Copy link

Unfortunately I have not come right, I have also not tried XZing yet. I used the normal google vision library and it worked 100% everytime on a Samsung A2 Core but not on newer devices for somereason. I am busy switching to MLKit at the moment and if that doesn't work I am going to try ZXing

@ptlkundan
Copy link

ptlkundan commented Jul 14, 2021

Any update on this?? Not working for Uganda National ID as well

Do you have any solution for this issue ? facing same issue

@Hxsyed
Copy link

Hxsyed commented Jul 19, 2021

Hey there, I am trying to scan format PDF 417 as well and it always recognizes it as a TYPE_TEXT. When I scanned my own drivers license it does recognize it was a TYPE_DRIVER_LICENSE. This is weird does anyone know why?

@rsgilbert
Copy link

rsgilbert commented Jul 27, 2021

You have to use Zxing for barcode scanning and MLkit for everything else such as text-in-image scanning. As for Uganda national Id, Zxing can to a good accuracy (around 90%) scan the bar code of the Uganda National ID but ffor other things like scanning National Id Number, Name, Village etc, please use MLKit.

@jtlz2
Copy link

jtlz2 commented Oct 1, 2021

My company (https://www.sprinthive.com) has a commercial service for decoding of the ZA driver's licence (both the alphanumeric and image data - all versions) from the base64-encoded string.

@hendrelouw73
Copy link

I have the same problem with the South African driver's license and the ID card. See attached image.

SouthAfrica
hed image.

@nkosingaleka
Copy link

Has anybody found a way to scan this RSA drivers license barcode ?

@donaldjansen
Copy link

Yes on Android and Windows. both the image and DL information

@Marvine89
Copy link

Marvine89 commented Apr 1, 2024

Apr 2024, Has anybody found a workaround?

@donaldjansen
Copy link

Yes, I will have to go look for my code. but I had used MLKIT to do it with the correct optimizations.

@Marvine89
Copy link

Sorted, I was using the wrong resolution, the license requires a larger resolution.

https://developers.google.com/ml-kit/vision/barcode-scanning/android#input-image-guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests