Class OcrElement

  • Direct Known Subclasses:
    Block, Glyph, Line, Page, Word

    public abstract class OcrElement
    extends java.lang.Object
    Base class for units of text, e.g. glyphs, words, lines, blocks, pages.
    • Constructor Summary

      Constructors 
      Constructor Description
      OcrElement​(java.lang.String text, double confidence, java.util.List<PointF> roi)
      Constructs OcrElement with the given params.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getConfidence()
      Getter for confidence field.
      java.util.List<PointF> getRoi()
      Getter for roi field.
      java.lang.String getText()
      Getter for text field.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OcrElement

        public OcrElement​(java.lang.String text,
                          double confidence,
                          java.util.List<PointF> roi)
        Constructs OcrElement with the given params.
        Parameters:
        text - The recognized text.
        confidence - Text confidence. Range is [0-1].
        roi - Quad where the text was found in image coordinates. The order of the points is clockwise starting from the top left.
    • Method Detail

      • getText

        public java.lang.String getText()
        Getter for text field. See constructor documentation for more information about the field.
        Returns:
        text
      • getConfidence

        public double getConfidence()
        Getter for confidence field. See constructor documentation for more information about the field.
        Returns:
        confidence
      • getRoi

        public java.util.List<PointF> getRoi()
        Getter for roi field. See constructor documentation for more information about the field.
        Returns:
        roi