public final class TextRecognitionResult
- Object
- TextRecognitionResult
OCR output containing the complete recognized text and portable
block-level geometry. Block bounds use normalized top-left-origin
coordinates; a language tag may be absent when the backend does not expose
per-block language identification.
Nested types
class TextRecognitionResult.TextBlock | One recognized text block with confidence and normalized bounds. |
Fields
public static final TextRecognitionResult EMPTY |
Constructors
Methods
public String getText() | |
public TextRecognitionResult.TextBlock[] getBlocks() | |
public VisionMetadata getMetadata() |
Inherited methods
Field details
EMPTY
public static final TextRecognitionResult EMPTYConstructor details
TextRecognitionResult
public TextRecognitionResult(String text, TextRecognitionResult.TextBlock[] blocks)Creates an OCR result without backend metadata.
Parameters
textString- full recognized text in reading order
blocksTextRecognitionResult.TextBlock[]- structured text regions, defensively copied
TextRecognitionResult
public TextRecognitionResult(String text, TextRecognitionResult.TextBlock[] blocks, VisionMetadata metadata)Creates an OCR result with backend diagnostics.
Parameters
textString- full recognized text in reading order
blocksTextRecognitionResult.TextBlock[]- structured text regions, defensively copied
metadataVisionMetadata- backend details, or
null
Method details
getText
public String getText()Returns
complete recognized text in reading order
getBlocks
public TextRecognitionResult.TextBlock[] getBlocks()Returns
defensive copy of recognized blocks
getMetadata
public VisionMetadata getMetadata()Returns
backend metadata, or
null when manually constructed