Class TextRecognitionResult

java.lang.Object
com.codename1.ai.vision.TextRecognitionResult

public final class TextRecognitionResult extends Object
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.
  • Field Details

  • Constructor Details

    • TextRecognitionResult

      public TextRecognitionResult(String text, TextRecognitionResult.TextBlock[] blocks)
      Creates an OCR result without backend metadata.
      Parameters:
      text - full recognized text in reading order
      blocks - 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 order
      blocks - structured text regions, defensively copied
      metadata - 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