Redth / ZXing.Net.Mobile

Barcode Scanner for Xamarin.iOS, Xamarin.Android, UWP and Tizen
MIT License
1.07k stars 703 forks source link

PDF417 SA Driver License scanning not working #295

Closed bnroode closed 8 years ago

bnroode commented 8 years ago

Could you perhaps have a look at the scanning of South African driver's licenses?

I have implemented a cross-platform Xamarin application and am able to scan Vehicle License Disks successfully on Winphone, iOS and Android but Driver's License scanning doesn't work at all on any one of the platforms.

I have used different CameraResolution settings on a Samsung Galaxy S4, I have tried native scanning on an iPhone 5s, but nothing works so far.

Any advice would be appreciated. I've attached a small sample, can privately share a higher quality image.

sa-driving-licence-back

Redth commented 8 years ago

The best thing to do in this case is try the upstream project without the variables of a device thrown in the mix. You can load the image directly with ZXing.Net and see if it's able to analyze it.

jon-peel commented 6 years ago

@bnroode did you come right with this? Out of interest, what are you using to decode once you get the barcode data?

bnroode commented 6 years ago

@Thorocaine I couldn't get ZXing and a few other PDF417 scanners to scan the SA driver's license barcode. One package worked - PDF417. PDF417 is not free and therefore our client decided against the functionality. To decode I used a local provider's APK VerifyID, this also costs money per decode but is very reasonably priced, depending on your use case obviously. Hope this helps.

jon-peel commented 6 years ago

Thank you, I found a service to decode, I was just interested to see what else is there. I am having a hard time getting the camera scanning working, but it is good (I guess) to know that I don't need to carry on trying with ZXing.

I saw PDF427 yesterday, it did not look as easy to implement, but maybe I must give that a try. For now I just need to get a demo unit working, that will give me time then to decide if I want to pay for a licence, or try find a different solution.

On Mon, 29 Jan 2018 at 10:51 bnroode notifications@github.com wrote:

@Thorocaine https://github.com/thorocaine I couldn't get ZXing and a few other PDF417 scanners to scan the SA driver's license barcode. One package worked - PDF417 https://github.com/PDF417/pdf417-xamarin. PDF417 is not free and therefore our client decided against the functionality. To decode I used a local provider's APK VerifyID http://www.verifyid.co.za/, this also costs money per decode but is very reasonably priced, depending on your use case obviously. Hope this helps.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Redth/ZXing.Net.Mobile/issues/295#issuecomment-361177742, or mute the thread https://github.com/notifications/unsubscribe-auth/AON4uEl1NjcRPn4Yr8wX-ZGnthA2GvFqks5tPYaZgaJpZM4IAHJ- .

bnroode commented 6 years ago

@Thorocaine may I ask which service you use to decode? Were you able to get the PDF427 working on Xamarin Forms?

jon-peel commented 6 years ago

I haven't tried PDF417/Blink yet. I found a scanner called Manatee which seems to be working, and very easy to implement (I would be happy to share anything with you).

For decoding, I am using http://apextechnology.co.za Their website didn't seem to have a sign-up, but I can share contact details if you need them.

zkrige commented 6 years ago

yeh - https://scan.apextechnology.co.za seem to be able to decrypt the data and the image in the barcode just fine

deonvisser commented 6 years ago

Hi Guys Thorocaine, you said Manatee works for you. I tried their Cognex Scanner on both PDF 417 Standard and PDF417 Micro. Neither worked. Just got garbage. What scanner are you using?

jon-peel commented 6 years ago

I am using PDF417 with Manatee. The result looks like garbage, but it isn't. The barcode on the driving licence is binary data, not a string.

So you want to use result.bytes to get a byte array.

On Thu, 22 Feb 2018 at 20:19 deonvisser notifications@github.com wrote:

Hi Guys Thorocaine, you said Manatee works for you. I tried their Cognex Scanner on both PDF 417 Standard and PDF417 Micro. Neither worked. Just got garbage. What scanner are you using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Redth/ZXing.Net.Mobile/issues/295#issuecomment-367772422, or mute the thread https://github.com/notifications/unsubscribe-auth/AON4uBOmLaw-C4K2S--VkpTrVQT3HRRuks5tXa-XgaJpZM4IAHJ- .

zkrige commented 6 years ago

To follow on, those hex bytes need to then be decrypted to get anything useful out of them.

deonvisser commented 6 years ago

Hey Guys

Thank you for pointing in the right direction. That explains the garbage :):)

Baby steps for me.

Have you managed to decrypt. I see there is something here that may help https://github.com/ugommirikwe/sa-license-decoder

zkrige commented 6 years ago

Unfortunately the link you posted has 2 flaws

1) it only works with a small percentage of licenses 2) it cannot decode the image

there is a link above that handles everything

deonvisser commented 6 years ago

Ok, thank you. I see they charge per scan though. Can register with them and their contact us is broken as well.

deonvisser commented 6 years ago

Ok, getting somewhere. @Thorocaine or @zkrige do you perhaps have contact details for Apex Technology? Their online reg does not work, neither does their contact form. A bit dodgy if you ask me but if you guys are using them, I will give them a shot. Thxs

jon-peel commented 6 years ago

Did you manage to get hold of them?

deonvisser commented 6 years ago

Yes, I did. Will not work for my requirements due to a few reasons. I have the public keys and currently busy decrypting it myself now.

zkrige commented 6 years ago

I've seen public keys floating around, but have yet to see a successful implementation. Also, the public keys wont help you much getting the image out of the barcode. Thats a whole other layer of pain. Good luck and let us know of any progress

deonvisser commented 6 years ago

I will bear that in mind, thks.