TextRecognizer Stay organized with collections Save and categorize content based on your preferences.
Finds and recognizes text in a suppliedFrame.
Build new TextRecognizer instances usingTextRecognizer.Builder.
Recognition results are returned by detect(Frame). The OCR algorithm tries to infer the text layout and organizes each paragraph intoTextBlock instances. If any text is detected, at least oneTextBlock instance will be returned.
Adding the ocr functionalitydependency to your project's AndroidManifest.xml will indicate to the installer that it should download the dependency on application install.
Nested Class Summary
| class | TextRecognizer.Builder | TextRecognizer Builder. | |
Public Method Summary
| SparseArray<TextBlock> | detect(Frame frame) Detects and recognizes text in a image. |
| boolean | |
| void | release() |
Inherited Method Summary
| abstractSparseArray<TextBlock> | detect(Frame arg0) |
| boolean | isOperational() |
| void | receiveFrame(Frame arg0) |
| void | release() |
| boolean | setFocus(int arg0) |
| void | setProcessor(Processor<TextBlock> arg0) |
Public Methods
publicSparseArray<TextBlock>detect(Frame frame)
Detects and recognizes text in a image. Only supports bitmap andImageFormat.NV21 for now.
Returns
- mapping of int to
TextBlock, where the int domain represents an opaque ID for the text block.
public booleanisOperational()
public voidrelease()
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-06-17 UTC.