Class TextRecognitionResult
java.lang.Object
com.codename1.ai.vision.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 Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOne recognized text block with confidence and normalized bounds. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTextRecognitionResult(String text, TextRecognitionResult.TextBlock[] blocks) Creates an OCR result without backend metadata.TextRecognitionResult(String text, TextRecognitionResult.TextBlock[] blocks, VisionMetadata metadata) Creates an OCR result with backend diagnostics. -
Method Summary
-
Field Details
-
EMPTY
-
-
Constructor Details
-
TextRecognitionResult
Creates an OCR result without backend metadata.- Parameters:
text- full recognized text in reading orderblocks- structured text regions, defensively copied
-
TextRecognitionResult
public TextRecognitionResult(String text, TextRecognitionResult.TextBlock[] blocks, VisionMetadata metadata) Creates an OCR result with backend diagnostics.- Parameters:
text- full recognized text in reading orderblocks- structured text regions, defensively copiedmetadata- backend details, ornull
-
-
Method Details
-
getText
- Returns:
- complete recognized text in reading order
-
getBlocks
- Returns:
- defensive copy of recognized blocks
-
getMetadata
- Returns:
- backend metadata, or
nullwhen manually constructed
-