Package 

Class PageIterator

    • Method Summary

      Modifier and Type Method Description
      void begin() Resets the iterator to point to the start of the page.
      boolean next(int level) Moves to the start of the next object at the given level in the pagehierarchy, and returns false if the end of the page was reached.
      Array<int> getBoundingBox(int level) Get bounding box: x, y, w, h============= Accessing data ==============.
      Rect getBoundingRect(int level) Get a bounding box as an Android Rect.
      • Methods inherited from class java.lang.Object

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

      • begin

         void begin()

        Resets the iterator to point to the start of the page.

      • next

         boolean next(int level)

        Moves to the start of the next object at the given level in the pagehierarchy, and returns false if the end of the page was reached.

        NOTE that RIL_SYMBOL will skip non-text blocks,but all other PageIteratorLevel level values will visit eachnon-text block once. Think of non text blocks as containing a singlepara, with a single line, with a single imaginary word.

        Calls to this method with different levels may be freely intermixed.

        This function iterates words in right-to-left scripts correctly, if theappropriate language has been loaded into Tesseract.

        Parameters:
        level - the page iterator level.
      • getBoundingBox

         Array<int> getBoundingBox(int level)

        Get bounding box: x, y, w, h

        ============= Accessing data ==============.

        Coordinate system:

        • Integer coordinates are at the cracks between the pixels.
        • The top-left corner of the top-left pixel in the image is at (0,0).
        • The bottom-right corner of the bottom-right pixel in the image is at(width, height).
        • Every bounding box goes from the top-left of the top-left containedpixel to the bottom-right of the bottom-right contained pixel, sothe bounding box of the single top-left pixel in the image is:(0,0)->(1,1).
        • If an image rectangle has been set in the API, then returned coordinatesrelate to the original (full) image, rather than the rectangle.

        Returns the bounding rectangle of the current object at the given level.See comment on coordinate system above.

        The returned bounding box may clip foreground pixels from a grey image.

        Parameters:
        level - the page iterator level.
      • getBoundingRect

         Rect getBoundingRect(int level)

        Get a bounding box as an Android Rect.

        Parameters:
        level - the page iterator level.