B4A Library OCR, FaceRecognition, BarcodeScanner using Google Vision

Discussion in 'Additional libraries, classes and official updates' started by DonManfred, Aug 23, 2017.

  1. DonManfred

    DonManfred Expert Licensed 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]
     

    Attached Files:

    Last edited: Oct 30, 2017
  2. Rantor777

    Rantor777 Member Licensed User

  3. DonManfred

    DonManfred Expert Licensed User

    Prepare for crashes :D

    It is just a quick hack to try if it works. I just tested some barcodes..
    ORC i get not recognized texts. But i was using blurry texts...
    And for facregocnition i need to switch camera :D i could not try so far
     
  4. mczubel

    mczubel Member Licensed User

    I have this error:
     
  5. DonManfred

    DonManfred Expert Licensed User

    Hmm... Looks like an old lib version somehow...

    Try this please
    The event must have another name. I changed it....

    Based on the log it did not recognized something it seems.
     

    Attached Files:

  6. DonManfred

    DonManfred Expert Licensed User

    Ohh, a typo ;)
     
  7. mczubel

    mczubel Member Licensed User

    Barcodescan work perfect
     
  8. MarcoRome

    MarcoRome Expert Licensed User

    oh ohhhh .... this is great great work dear DON :D:D:D
     
    DonManfred likes this.
  9. mczubel

    mczubel Member Licensed User

    No, The same error:
     
  10. DonManfred

    DonManfred Expert Licensed User

    I checked the code. I forget to change one event....
     

    Attached Files:

    MarcoRome likes this.
  11. mczubel

    mczubel Member Licensed User

    Okay, this is the log now:
    is a simple text:"Documentacion con vencimiento" in a white paper.
     
  12. DonManfred

    DonManfred Expert Licensed User

    As i wrote. I did not get any results as yet with the Textrecognizer.
     
  13. JordiCP

    JordiCP Well-Known Member Licensed User

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

     
  14. mczubel

    mczubel Member Licensed User

    work perfect!!!
     
    DonManfred likes this.
  15. sz4t4n

    sz4t4n Member Licensed User

    confirm, work perfect :)
     
  16. Levit

    Levit Member Licensed User

  17. Chicao99

    Chicao99 Member Licensed User

    Always getting "Face_onFaceDetectResult(false,Scan Failed: Found nothing to scan)", any suggestions?
    Regards.
     
  18. sdujolo

    sdujolo Member Licensed User

    I get the same error
     
  19. wes58

    wes58 Active Member Licensed 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
     
  20. sdujolo

    sdujolo Member Licensed User

    Hi,

    I have tested both portrait and landscape.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice