googlesamples / mlkit

A collection of sample apps to demonstrate how to use Google's ML Kit APIs on Android and iOS
Apache License 2.0
3.45k stars 2.9k forks source link

TextRecognizer can't recognize credit card font #338

Open venator85 opened 2 years ago

venator85 commented 2 years ago

Hi, Text Recognition can't recognize the font used in embossed credit cards for the card number:

creditcard_digits1

tw-visa-platinum-card-498x280

I've tried with both "stable" com.google.android.gms:play-services-mlkit-text-recognition:17.0.0 and the beta v2 com.google.mlkit:text-recognition:16.0.0-beta1, but instead of the card number I just get garbage...

Is there a chance you may introduce support for it? Thanks ;)

chrisito commented 2 years ago

Embossed credit card numbers are notoriously difficult to recognize. We are working on a solution specifically for credit card scanning that takes the formatting of the credit card number (typically xxxx xxxx xxxx xxxx, but not always) as well as the check digit (a kind of checksum) into account to get to reliable detection. Note that we don't have a committed timeline to release this API yet, but will update this issue when we do.

mcasalinuovo commented 2 years ago

Note that we don't have a committed timeline to release this API yet, but will update this issue when we do.

Thanks. Any chance this has been updated yet?

aric-brown commented 1 year ago

Any updates?

lyon-zas commented 11 months ago

Hi, has this been resolved by any chance?

khuwajahassan15 commented 9 months ago

I also facing issues for recognize the embossed text of debit card. I used the following approach, but result contains wrong detection and sometime replace 1 with 7, replace 5 with 6 and sometime not detecting the 1 ,7.

   implementation("com.google.mlkit:text-recognition:16.0.0")

   implementation ("com.google.firebase:firebase-ml-vision:24.0.3")

   Kindly guide me what should I do now,
   I need a custom solution for scanning the debit card I got success result in case of flat surface. 
muhammadhassanjeenyme commented 9 months ago

I also facing issues for recognize the embossed text of debit card. I used the following approach, but result contains wrong detection and sometime replace 1 with 7, replace 5 with 6 and sometime not detecting the 1 ,7.

   implementation("com.google.mlkit:text-recognition:16.0.0")

   implementation ("com.google.firebase:firebase-ml-vision:24.0.3")

   Kindly guide me what should I do now,
   I need a custom solution for scanning the debit card I got success result in case of flat surface. 

   I have attached the target image and result that I am getting.

f

   Result:     implementation("com.google.mlkit:text-recognition:16.0.0")
                                                                                                1234 5578 9875 5432
                                                                                                1234
                                                                                                VALID
                                                                                                THRU
                                                                                                Bank Name
                                                                                                CARDHOLDER
                                                                                                MONTH/YEAR
                                                                                                Le/49

                                                                                                Result for firebase ml kit 

                                                                                                1234 5578 9875 5432
                                                                                                1234
                                                                                                VALID
                                                                                                THRU
                                                                                                Bank Name
                                                                                                CARDHOLDER
                                                                                                MONTH/YEAR
                                                                                                Le/49
                                                                                                1/99
Meldryt commented 3 months ago

How do you create a TextRecognitionProcessor with TextRecognizerOptionsInterface.CREDIT_CARD parameter? i could not find any example.

mdupierreux commented 2 months ago

Hi, I'm also facing the same issue, credit cards with non embossed numbers work fine. Do you have any update on this issue ?

ivanpataki commented 2 months ago

Same here. Someone knows what the difficulty is? Works like a charm on iOS and there are old Android libraries (C/C++) that do this very well.

shahwaiz90 commented 1 month ago

@chrisito any update on this feature?