- java.lang.Object
-
- com.uddernetworks.newocr.recognition.OCRScan
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
RAW_STRING
-
Constructor Summary
Constructors Constructor Description OCRScan(DatabaseManager databaseManager, SimilarityManager similarityManager, MergenceManager mergenceManager, Actions actions)
Creates a newOCRScan
.OCRScan(DatabaseManager databaseManager, OCROptions options)
OCRScan(DatabaseManager databaseManager, OCROptions options, SimilarityManager similarityManager)
Creates a newOCRScan
with a defaultMergenceManager
.OCRScan(DatabaseManager databaseManager, OCROptions options, SimilarityManager similarityManager, MergenceManager mergenceManager)
Creates a newOCRScan
.
-
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 aDefaultScannedImage
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.
-
-
-
Field Detail
-
RAW_STRING
public static final java.lang.String RAW_STRING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OCRScan
public OCRScan(DatabaseManager databaseManager, OCROptions options)
- Parameters:
databaseManager
- TheDatabaseManager
to useoptions
- TheOCROptions
to use
-
OCRScan
public OCRScan(DatabaseManager databaseManager, OCROptions options, SimilarityManager similarityManager)
Creates a newOCRScan
with a defaultMergenceManager
.- Parameters:
databaseManager
- TheDatabaseManager
to useoptions
- TheOCROptions
to usesimilarityManager
- TheSimilarityManager
to use
-
OCRScan
public OCRScan(DatabaseManager databaseManager, OCROptions options, SimilarityManager similarityManager, MergenceManager mergenceManager)
Creates a newOCRScan
.- Parameters:
databaseManager
- TheDatabaseManager
to useoptions
- TheOCROptions
to usesimilarityManager
- TheSimilarityManager
to usemergenceManager
- TheMergenceManager
to use
-
OCRScan
public OCRScan(DatabaseManager databaseManager, SimilarityManager similarityManager, MergenceManager mergenceManager, Actions actions)
Creates a newOCRScan
.- Parameters:
databaseManager
- TheDatabaseManager
to usesimilarityManager
- TheSimilarityManager
to usemergenceManager
- TheMergenceManager
to useactions
- TheActions
to use
-
-
Method Detail
-
scanImage
public ScannedImage scanImage(java.io.File file)
Description copied from interface:Scan
Scans the input image and returns aDefaultScannedImage
containing all the characters and their info.- Specified by:
scanImage
in interfaceScan
- Parameters:
file
- The input image to be scanned- Returns:
- A
DefaultScannedImage
containing all scanned character data
-
getSpacesFor
public java.util.List<ImageLetter> getSpacesFor(java.util.List<ImageLetter> line, int fontSize)
Description copied from interface:Scan
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.- Specified by:
getSpacesFor
in interfaceScan
- Parameters:
line
- The line to add spaces tofontSize
- 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
public int spaceRound(double input)
Description copied from interface:Scan
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.- Specified by:
spaceRound
in interfaceScan
- 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
-
-