Module NewOCR

Interface Scan

  • All Known Implementing Classes:
    OCRScan

    public interface Scan
    The main class that handles character scanning of an image.
    Since:
    April 25, 2019
    • Method Summary

      Modifier and Type Method Description
      java.util.List<ImageLetter> getSpacesFor​(java.util.List<ImageLetter> line, int fontSize)
      Gets and inserts all the spaces of the current line based on the font size given (The first character of the line by default).
      ScannedImage scanImage​(java.io.File file)
      Scans the input image and returns a DefaultScannedImage containing all the characters and their info.
      int spaceRound​(double input)
      Gets the full space character count for the blank gap divided by the space width.
    • Method Detail

      • getSpacesFor

        java.util.List<ImageLetter> getSpacesFor​(java.util.List<ImageLetter> line,
                                                 int fontSize)
        Gets and inserts all the spaces of the current line based on the font size given (The first character of the line by default). This method adds the spaces to the end of the line currently, so a resort is needed.
        Parameters:
        line - The line to add spaces to
        fontSize - The font size to base the space widths off of
        Returns:
        A copy of the input ImageLetter List, but with spaces appended to the end
      • spaceRound

        int spaceRound​(double input)
        Gets the full space character count for the blank gap divided by the space width. This is calculated by getting the amount of times the space can fit in evenly (x % 1) and if the remaining value is within 0.2 of 1, it is considered a space.
        Parameters:
        input - The amount of spaces that fit in the gap (gap / spaceWidth)
        Returns:
        The amount of spaces that is found as a whole number