public final class TextRecognitionResult

  1. Object
  2. 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.TextBlockOne recognized text block with confidence and normalized bounds.

Fields

public static final TextRecognitionResult EMPTY

Constructors

public TextRecognitionResult(String text, TextRecognitionResult.TextBlock[] blocks)Creates an OCR result without backend metadata.
public TextRecognitionResult(String text, TextRecognitionResult.TextBlock[] blocks, VisionMetadata metadata)Creates an OCR result with backend diagnostics.

Methods

public String getText()
public TextRecognitionResult.TextBlock[] getBlocks()
public VisionMetadata getMetadata()

Inherited methods

Field details

EMPTY

public static final TextRecognitionResult EMPTY

Constructor details

TextRecognitionResult

public TextRecognitionResult(String text, TextRecognitionResult.TextBlock[] blocks)
Creates an OCR result without backend metadata.

Parameters

text String
full recognized text in reading order
blocks TextRecognitionResult.TextBlock[]
structured text regions, defensively copied

TextRecognitionResult

public TextRecognitionResult(String text, TextRecognitionResult.TextBlock[] blocks, VisionMetadata metadata)
Creates an OCR result with backend diagnostics.

Parameters

text String
full recognized text in reading order
blocks TextRecognitionResult.TextBlock[]
structured text regions, defensively copied
metadata VisionMetadata
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