Module NewOCR

Interface ScannedImage

  • All Known Implementing Classes:
    DefaultScannedImage

    public interface ScannedImage
    The resulting object from an image being scanned.
    Since:
    April 25, 2019
    • Method Detail

      • getPrettyString

        java.lang.String getPrettyString()
        Gets the string of a scanned image
        Returns:
        The string of a scanned image
      • letterAt

        java.util.Optional<ImageLetter> letterAt​(int index)
        Gets the letter at the given index of the actual getPrettyString() position, meaning newlines are not returned.
        Parameters:
        index - The character index
        Returns:
        The ImageLetter at the given position, if found
      • getGridLineAtIndex

        java.util.Optional<java.util.List<ImageLetter>> getGridLineAtIndex​(int index)
                                                                    throws java.lang.IndexOutOfBoundsException
        Gets the line at the stored index. This is NOT by the y value.
        Parameters:
        index - The index of the row
        Returns:
        The row
        Throws:
        java.lang.IndexOutOfBoundsException
      • getLineCount

        int getLineCount()
        gets the amount of lines in the image.
        Returns:
        The amount of lines in the image
      • getGrid

        it.unimi.dsi.fastutil.ints.Int2ObjectMap<java.util.List<ImageLetter>> getGrid()
        Returns the raw, mutable grid of ImageLetters internally used with the key of the mpa being the exact Y position of the line.
        Returns:
        The raw, mutable grid of values
      • addLine

        void addLine​(int y,
                     java.util.List<ImageLetter> databaseCharacterList)
        Adds a line containing ImageLetters.
        Parameters:
        y - The exact Y position of the line
        databaseCharacterList - A list of ImageLetters as the line
      • getLine

        java.util.List<ImageLetter> getLine​(int y)
        Gets the line at the given index value.
        Parameters:
        y - The index of the line
        Returns:
        The line at the given index value
      • getLineEntry

        it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry<java.util.List<ImageLetter>> getLineEntry​(int y)
        Gets both the line Y and values at the given index value.
        Parameters:
        y - The index of the line
        Returns:
        The line at the given Y index value
      • getBinarizedImage

        java.awt.image.BufferedImage getBinarizedImage()
        Gets the binarized image before any preprocessing
        Returns:
        The binarized image, which may be null if pulled from caches
      • getOriginalImage

        java.awt.image.BufferedImage getOriginalImage()
        Gets the original image scanned by the OCR.
        Returns:
        The original image, which may be null if pulled from caches
      • getOriginalFile

        java.io.File getOriginalFile()
        Gets the original File scanned by the OCR.
        Returns:
        The original File, which may be null if pulled from caches