OCR-Reader | Android Application that will allow you to identify | Computer Vision library
kandi X-RAY | OCR-Reader Summary
kandi X-RAY | OCR-Reader Summary
An Android Application that will allow you to identify the text seen from your phone camera, and also be able to speak the text that's identified, using Google's Mobile Vision Text API for Android.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Override method used to set the preview of the view
- Calculates the rotation of a camera
- Generate a list of acceptable preview sizes for the camera
- Opens the camera
- From interface TextBlock
- Returns the graphic at the specified location
- Draw the TextBlock on the TextBlock
- Gets the bounding box of the text box
- Initializes the camera
- Request the camera permission
- Returns a callback for the permissions result
- Creates the camera source
- Start auto - focus on the camera
- Sets the focus mode
- Takes a picture
- Performs the zoom level of the camera
- Set the flash mode
- Set the auto - focus callback
- This is called when a text block is detected
- Draws the overlay
OCR-Reader Key Features
OCR-Reader Examples and Code Snippets
Community Discussions
Trending Discussions on OCR-Reader
QUESTION
Starting with this sample project [ https://github.com/googlesamples/android-vision/tree/master/visionSamples/ocr-reader ], I have been able to implement filtering in the OcrDetectorProcessor.receiveDetections()
method.
This works, but com.google.android.gms.vision.text.TextRecognizer
appears to search the the entire screen for characters.
I presume that the receiveDetections()
method could be called more frequently if a smaller portion of the screen were being scanned for characters instead of the entire screen.
Is it possible to specify a smaller portion of the screen to be scanned? It should be straight-forward to direct the user, through a change to the graphic overly, to position their camera so that this smaller portion of the screen contained the target text, but I'm unsure as to how to tell the processor to use just a small portion of the frame when doing it's OCR processing.
What would need to be altered to specify that the OCR should operate on a subset of the frame?
ADDITIONAL INFORMATION:
I tried to subclass TextRecognizer
, but it's marked final
, and the source appears to be closed.
So I'm expanding the question to how the functionality of the ocr-reader sample could be replicated using Tesseract.
I found this link, but haven't explored converting the concepts there into camera frames as opposed to a single image file.
...ANSWER
Answered 2019-Aug-21 at 17:04I had a similar issue and resolved it by using Tesseract and a simple cropping library called "Android Image Cropper" - Link here .
Basically I just crop the image before passing it for processing. Here is a small sample of my code:
This line will start new activity for a result:
QUESTION
In this sample Android OCR application, that uses com.google.android.gms:play-services-vision
, there is a OcrDetectorProcessor.receiveDetections()
method which gets repeatedly called. In that method, while the user points the camera at things in the environment, we have access to whatever text is detected.
If the user presses the back
button, the process ends, but I would like to have the process end when a certain condition occurs within the receiveDetections()
method.
I tried calling mParentActivity.onBackPressed()
, but that threw an exception from super.onBackPressed()
:
OpenCameraSource: Exception thrown from receiver. java.lang.IllegalStateException: Must be called from main thread of fragment host
So although the exception is caught and the app continues to run, calling onBackPressed()
is not the right approach. What is the right way to programatically back-out of receiveDetections()
?
ANSWER
Answered 2018-Dec-11 at 19:30Instead of:
QUESTION
In this sample Android program, the device's camera is used to perform optical character recognition through the com.google.android.gms:play-services-vision
library.
In visionSamples\ocr-codelab\ocr-reader-complete\app\src\main\java\com\google\android\gms\samples\vision\ocrreader\OcrDetectorProcessor.receiveDetections()
I am able to see the text that is identified using logging:
ANSWER
Answered 2017-Nov-29 at 22:26Generally what you need to do is to save a reference to the OcrDetectorProcessor
, then write a data retrieval method and call it from OcrCaptureActivity
.
So make this change to your 'onCreate()':
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install OCR-Reader
You can use OCR-Reader like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the OCR-Reader component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page