OCR, FaceRecognition, BarcodeScanner using Google Vision

DonManfred

Expert
Licensed User
Longtime User
This is a wrap for this github project.

It is basically the same as the one posted by @Johan Schoeman plus facerecognition and Barcodescanner (as of now it is configigured to scan all know formats.)


MobileVision

Author:
Version: 1.51
  • BarcodeDetector
    • Events:
      • onBarcodeResult (success As Boolean, info As String, result As List)
      • Result (info As String, scanresults As List)
    • Functions:
      • decodeBitmapUri (ctx As android.content.Context, uri As android.net.Uri) As android.graphics.Bitmap
      • detect (frame As com.google.android.gms.vision.Frame)
      • Initialize (EventName As String)
      • launchMediaScanIntent
      • receiveFrame (frame As com.google.android.gms.vision.Frame)
      • release
      • scanBitmap (b As android.graphics.Bitmap)
      • setFocus (focus As Int) As Boolean
      • takePicture
    • Properties:
      • isOperational As Boolean [read only]
  • FaceDetector
    • Events:
      • onFaceDetectResult (success As Boolean, result As String)
      • Result (info As String, scanresults As List)
    • Functions:
      • decodeBitmapUri (ctx As android.content.Context, uri As android.net.Uri) As android.graphics.Bitmap
      • detect (frame As com.google.android.gms.vision.Frame)
      • Initialize (EventName As String)
      • launchMediaScanIntent
      • receiveFrame (frame As com.google.android.gms.vision.Frame)
      • release
      • scanBitmap (b As android.graphics.Bitmap)
      • setFocus (focus As Int) As Boolean
      • takePicture
    • Properties:
      • isOperational As Boolean [read only]
  • TextRecognizer
    • Events:
      • onOCRScanResult (success As Boolean, result As String)
      • Result (info As String, blocks As String, lines As String, words As String, scanresults As List)
    • Functions:
      • decodeBitmapUri (ctx As android.content.Context, uri As android.net.Uri) As android.graphics.Bitmap
      • detect (frame As com.google.android.gms.vision.Frame)
      • Initialize (EventName As String)
      • launchMediaScanIntent
      • receiveFrame (frame As com.google.android.gms.vision.Frame)
      • release
      • scanBitmap (b As android.graphics.Bitmap)
      • setFocus (focus As Int) As Boolean
      • takePicture
    • Properties:
      • isOperational As Boolean [read only]
      • Processor As com.google.android.gms.vision.Detector.Processor [write only]
 

Attachments

  • MobileVisionEx.zip
    8.3 KB · Views: 1,278
  • MobileVisionV1.24.zip
    17.7 KB · Views: 655
  • MobileVisionV1.51.zip
    19.3 KB · Views: 1,196
Last edited:

mczubel

Member
Licensed User
Longtime User
I have this error:
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
Start Recognize... Recognizer ready = true
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
ResultArrived(-1)
ResultArrived()
arg0 = -1
** Activity (main) Resume **
java.lang.Exception: Sub txtrecognizer_onscanresult was not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:192)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6692)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
 

mczubel

Member
Licensed User
Longtime User
Okay, this is the log now:
TxtRecognizer_onScanResults(false,Scan Failed: Found nothing to scan)
is a simple text:"Documentacion con vencimiento" in a white paper.
 

JordiCP

Expert
Licensed User
Longtime User
I have just tested it pointing my camera at this same thread, and worked perfectly!:)

--------- beginning of system
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
Start Recognize... Recognizer ready = true
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
ResultArrived(-1)
ResultArrived()
arg0 = -1
** Activity (main) Resume **
TxtRecognizer_onScanResults(true,Blocks:
MarcoRome likes this,
s i wrote. I did not get any results as yet with the Textrecognizer.
Donate
Multipart Fileupload bAA S PHP IC
a I My Libraries
Create dynamic
Okay, this is the log now:
- TxtRecogni
is a simple text:"Documentacion con vencimiento" in a white paper.
pnScanResults(false, Sc an Failed: Found nothing to scan)
---------
Lines:
MarcoRome likes this,
s i wrote. I did not get any results as yet with the Textrecognizer.
Donate
Multipart Fileupload bAA S PHP IC
a I My Libraries
Create dynamic
Okay, this is the log now:
- TxtRecogni
is a simple text:"Documentacion con vencimiento" in a white paper.
pnScanResults(false, Sc an Failed: Found nothing to scan)
---------
Words:
MarcoRome, likes, this,, s, i, wrote., I, did, not, get, any, results, as, yet, with, the, Textrecognizer., Donate, Multipart, Fileupload, bAA, S, PHP, IC, a, I, My, Libraries, Create, dynamic, Okay,, this, is, the, log, now:, -, TxtRecogni, is, a, simple, text:"Documentacion, con, vencimiento", in, a, white, paper., pnScanResults(false,, Sc, an, Failed:, Found, nothing, to, scan),
---------
)
** Activity (main) Pause, UserClosed = false **
 

mczubel

Member
Licensed User
Longtime User
work perfect!!!
Start Recognize... Recognizer ready = true
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
ResultArrived(-1)
ResultArrived()
arg0 = -1
** Activity (main) Resume **
TxtRecognizer_onScanResults(true,Blocks:
t
01985
7428
---------
Lines:
t
01985
7428
---------
Words:
t, 01985, 7428,
---------
)
** Activity (main) Pause, UserClosed = false **
 

Chicao99

Member
Licensed User
Longtime User
Always getting "Face_onFaceDetectResult(false,Scan Failed: Found nothing to scan)", any suggestions?
Regards.
 

wes58

Active Member
Licensed User
Longtime User
I get the same error
I wouldn't be surprised that this is the same issure I posted in Johan's thread about OCR.
Are you taking the photo with camera in Portrait? If so, the problem probably is the way the camera saves the picture, and it need to be
 

sdujolo

Member
Licensed User
Longtime User
I wouldn't be surprised that this is the same issure I posted in Johan's thread about OCR.
Are you taking the photo with camera in Portrait? If so, the problem probably is the way the camera saves the picture, and it need to be
Hi,

I have tested both portrait and landscape.
 
Top