- java.lang.Object
-
- com.uddernetworks.newocr.character.Character
-
- com.uddernetworks.newocr.character.DatabaseCharacter
-
-
Constructor Summary
Constructors Constructor Description DatabaseCharacter(char letter)
Creates a DatabaseCharacter from the given character with a modifier of 0.DatabaseCharacter(char letter, int modifier)
Creates a DatabaseCharacter from the given character.
-
Method Summary
Modifier and Type Method Description void
addDataPoint(int index, double data)
Sets a percentage value to the data.boolean
equals(java.lang.Object obj)
double
getAvgHeight()
Gets the average height of the character.double
getAvgWidth()
Gets the average width of the character.double[]
getData()
Gets the 16 sectioned percentages for the stored character.double
getMaxCenter()
Gets the maximum relative center value from the top of the character found in the training set for this font size.double
getMinCenter()
Gets the minimum relative center value from the top of the character found in the training set for this font size.void
setData(double avgWidth, double avgHeight, double minCenter, double maxCenter)
Sets multiple used data points.-
Methods inherited from class com.uddernetworks.newocr.character.Character
compareTo, getHeight, getLetter, getModifier, getWidth, getX, getY, hashCode, isInBounds, isInXBounds, isInYBounds, isOverlappingX, isOverlappingY, setHeight, setLetter, setModifier, setWidth, setX, setY, toString
-
-
-
-
Constructor Detail
-
DatabaseCharacter
public DatabaseCharacter(char letter)
Creates a DatabaseCharacter from the given character with a modifier of 0.- Parameters:
letter
- The letter of the object
-
DatabaseCharacter
public DatabaseCharacter(char letter, int modifier)
Creates a DatabaseCharacter from the given character.- Parameters:
letter
- The letter of the objectmodifier
- The modifier of the character
-
-
Method Detail
-
getData
public double[] getData()
Gets the 16 sectioned percentages for the stored character.- Returns:
- An array of percentages <= 1 with a length of 17
-
addDataPoint
public void addDataPoint(int index, double data)
Sets a percentage value to the data.- Parameters:
index
- The index of the data to setdata
- The percentage of filled in pixels found
-
setData
public void setData(double avgWidth, double avgHeight, double minCenter, double maxCenter)
Sets multiple used data points.- Parameters:
avgWidth
- The average width across all used characters in the font sizesavgHeight
- The average height across all used characters in the font sizesminCenter
- The minimum relative center value in the training ste for this character and font sizemaxCenter
- The maximum relative center value in the training ste for this character and font size
-
getAvgWidth
public double getAvgWidth()
Gets the average width of the character.- Returns:
- The average width of the character
-
getAvgHeight
public double getAvgHeight()
Gets the average height of the character.- Returns:
- The average height of the character
-
getMinCenter
public double getMinCenter()
Gets the minimum relative center value from the top of the character found in the training set for this font size.- Returns:
- The minimum relative center value from the top of the character found in the training set for this font size
-
getMaxCenter
public double getMaxCenter()
Gets the maximum relative center value from the top of the character found in the training set for this font size.- Returns:
- The maximum relative center value from the top of the character found in the training set for this font size
-
-