OCR, FaceRecognition, BarcodeScanner using Google Vision

DonManfred

Expert
Licensed User
Longtime User
Among other: where should these pictures be stored? A short description how it works would be appreciated.
there is nothing to describe.

YOU are storing the bitmaps you are capturing. Remember where you did store it.
The scanbitmap just get an bitmap object. That´s it... YOU need to know where you load this bitmap from.
 

DonManfred

Expert
Licensed User
Longtime User
Is that (going to be) part of your library too?
Google just detect the content. If there is an Barcode which contains a URL then the url will be filled...

the available possible contents of the Maps are:
B4X:
        case Barcode.CONTACT_INFO:
          m.Put("BarcodeType", "CONTACTINFO");
          //m.Put("CONTACTINFO", code.contactInfo.organization);
            //Log.i(LOG_TAG, code.contactInfo.title);
            break;
        case Barcode.EMAIL:
          m.Put("BarcodeType", "EMAIL");
          m.Put("EMAIL",code.email.address);
            //Log.i(LOG_TAG, code.email.address);
            break;
        case Barcode.ISBN:
          m.Put("BarcodeType", "ISBN");
          m.Put("ISBN",code.rawValue);
            //Log.i(LOG_TAG, code.rawValue);
            break;
        case Barcode.PHONE:
          m.Put("BarcodeType", "PHONE");
          m.Put("PHONE",code.phone.number);
            //Log.i(LOG_TAG, code.phone.number);
            break;
        case Barcode.PRODUCT:
          m.Put("BarcodeType", "PRODUCT");
            //Log.i(LOG_TAG, code.rawValue);
            break;
        case Barcode.SMS:
          m.Put("BarcodeType", "SMS");
            //Log.i(LOG_TAG, code.sms.message);
            break;
        case Barcode.TEXT:
          m.Put("BarcodeType", "TEXT");
            break;
        case Barcode.URL:
          m.Put("BarcodeType", "URL");
            //Log.i(LOG_TAG, "url: " + code.url.url);
            break;
        case Barcode.WIFI:
          m.Put("BarcodeType", "WIFI");
          m.Put("WIFI",code.wifi.ssid);
            //Log.i(LOG_TAG, code.wifi.ssid);
            break;
        case Barcode.GEO:
          m.Put("BarcodeType", "GEO");
          m.Put("GEO.lat",code.geoPoint.lat);
          m.Put("GEO.lon",code.geoPoint.lng);
            //Log.i(LOG_TAG, code.geoPoint.lat + ":" + code.geoPoint.lng);
            break;
        case Barcode.CALENDAR_EVENT:
          m.Put("BarcodeType", "CALENDAR_EVENT");
          m.Put("CALENDAR_EVENT",code.calendarEvent.description);
            //Log.i(LOG_TAG, code.calendarEvent.description);
            break;
        case Barcode.DRIVER_LICENSE:
          m.Put("BarcodeType", "DRIVER_LICENSE");
          m.Put("DRIVER_LICENSE",code.driverLicense.licenseNumber);
            //Log.i(LOG_TAG, code.driverLicense.licenseNumber);
            break;
        default:
          m.Put("BarcodeType", "OTHER");
          m.Put("OTHER",code.rawValue);
            //Log.i(LOG_TAG, code.rawValue);
            break;
        }
 

DonManfred

Expert
Licensed User
Longtime User
Simply deriving the bar code is not really enough.
Right! This is up to YOU as the Developer to built your own Database about the Productbarcodes or about the available Barcodeinfos.
You are free to use any available Rest api to fill the Value based on the Scanned Barcode.

Google Vision does not provide this functionality inside the Library.
It is even not part (and will not be) of my Wrapper. It is just a wrap around the GoogleVision.
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
https://codelabs.developers.google.com/codelabs/bar-codes/#6
Check this image. Scan i with the Lib. I guess it will read the content as one string.
Don´t know if it will fill in the URL into the Map-Properties...

i did a small test
Logger verbunden mit: 9885e6514556383552
--------- beginning of crash
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Start Recognize... Recognizer ready = true
Barcode_Result(BARCODE,[{Index=0, displayValue=Psycho Puppy: https://40.media.tumblr.com/tumblr_m9lk21cIj41rrtgfno1_500.jpg, CornerPoints=(ArrayList) [{x=29, y=273}, {x=489, y=273}, {x=489, y=732}, {x=29, y=732}], BarcodeType=TEXT, Barcodes=(ArrayList) []}])
{Index=0, displayValue=Psycho Puppy: https://40.media.tumblr.com/tumblr_m9lk21cIj41rrtgfno1_500.jpg, CornerPoints=(ArrayList) [{x=29, y=273}, {x=489, y=273}, {x=489, y=732}, {x=29, y=732}], BarcodeType=TEXT, Barcodes=(ArrayList) []}
Index - 0
displayValue - Psycho Puppy: https://40.media.tumblr.com/tumblr_m9lk21cIj41rrtgfno1_500.jpg
CornerPoints - (ArrayList) [{x=29, y=273}, {x=489, y=273}, {x=489, y=732}, {x=29, y=732}]
BarcodeType - TEXT
Barcodes - (ArrayList) []
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **

So it does recognize the QR-Code inside the image. displayValue contains the Value of the QR-Code.
So, in this case, it is up to my own app to recognize the image url inside the content and/or to download the image for example.

Google Vision just get the content stored.
 

ctd

Member
Licensed User
Trying MobileVisionex and get the following error:
java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@Integer/google_play_services_version" />
Can someone point me th way to go to solve my problem ?
Kindly
 

DonManfred

Expert
Licensed User
Longtime User
You are using an up to date b4a and using the uptodate maven repositories?

The Library just uses an DependsOn for
B4X:
com.google.android.gms:play-services-vision
There is no need to add anything to the Manifest. It is working fine here.
 

ctd

Member
Licensed User
Thank for you reply.
Please new to B4A. Let me know where i have to put this peace of code
 

DonManfred

Expert
Licensed User
Longtime User
You dont need anything. It is inside the library.

Seems like your b4a setup is not up to date or incomplete or something. Use this tool to install all needed components: https://www.b4x.com/android/forum/t...-versions-of-android-tools.80090/#post-507157
Make sure to change the path to android.jar in Tools Configure Paths after installing the SDK Components...

Please create a new thread in the questions forum about your issue.

The example in post #1 does work unchanged.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
If, as a general principle, no questions in threads are allowed (anymore) then threads will become very short and to my opinion it will hamper the debate and the clustering of information. Already I find myself searching through half a dozen of threads regarding Snowboy as well as this library.
This is the forum policy. Please respect it.
 

DonManfred

Expert
Licensed User
Longtime User
No yet imagecontext settings support ? For languages.
You are confusing "Google CLOUD Vision" (Paid Service) (you are talking about) and Google Vision (Free) (this lib is a wrap for the Google Vision).

They are TWO DIFFERENT products.
 

peacemaker

Expert
Licensed User
Longtime User
Ooopps, indeed important details, i did not mention it.
So, here in your lib - impossible to work with non-EN letters ?
 

uniplan

Active Member
Licensed User
Longtime User
I have barcode.isOperational = false
so I can not use the barcode scanner.
Depends on what?
How can I get barcode.isOperational = true?
 
Top