Module NewOCR

Class CoordinateCharacter

  • All Implemented Interfaces:
    java.lang.Comparable<Character>
    Direct Known Subclasses:
    ImageLetter, SearchCharacter

    public abstract class CoordinateCharacter
    extends Character
    The superclass for characters containing data from the input image.
    Since:
    April 25, 2019
    • Constructor Detail

      • CoordinateCharacter

        public CoordinateCharacter()
    • Method Detail

      • getCoordinates

        public java.util.List<IntPair> getCoordinates()
        Gets the coordinates of the character.
        Returns:
        The coordinates
      • getValues

        public boolean[][] getValues()
        Gets the black (true) and white (false) pixels of the scanned character.
        Returns:
        The grid of black or white values
      • setValues

        public void setValues​(boolean[][] values)
        Sets the black (true) and white (false) pixels of the scanned character.
        Parameters:
        values - The grid of black or white values. Will return `null` for spaces
      • getAmountOfMerges

        public int getAmountOfMerges()
        Gets how many times the current ImageLetter has been merged via merge(CoordinateCharacter) with another ImageLetter. This value is added every time merge(CoordinateCharacter) is invoked, and adds the amount of merges the argument of that method to the current merge value, as well as incrementing normally.
        Returns:
        The amount of merge operations affecting the current ImageLetter
      • getMergedPieces

        public java.util.Optional<java.util.Map<Letter,​CoordinateCharacter>> getMergedPieces()
        Gets the individual pieces before merging.
        Returns:
        The CoordinateCharacters that have been merged, or null if there have been no merges
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Character