- java.lang.Object
-
- com.uddernetworks.newocr.recognition.OCRScan
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringRAW_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 newOCRScanwith 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).ScannedImagescanImage(java.io.File file)Scans the input image and returns aDefaultScannedImagecontaining all the characters and their info.intspaceRound(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- TheDatabaseManagerto useoptions- TheOCROptionsto use
-
OCRScan
public OCRScan(DatabaseManager databaseManager, OCROptions options, SimilarityManager similarityManager)
Creates a newOCRScanwith a defaultMergenceManager.- Parameters:
databaseManager- TheDatabaseManagerto useoptions- TheOCROptionsto usesimilarityManager- TheSimilarityManagerto use
-
OCRScan
public OCRScan(DatabaseManager databaseManager, OCROptions options, SimilarityManager similarityManager, MergenceManager mergenceManager)
Creates a newOCRScan.- Parameters:
databaseManager- TheDatabaseManagerto useoptions- TheOCROptionsto usesimilarityManager- TheSimilarityManagerto usemergenceManager- TheMergenceManagerto use
-
OCRScan
public OCRScan(DatabaseManager databaseManager, SimilarityManager similarityManager, MergenceManager mergenceManager, Actions actions)
Creates a newOCRScan.- Parameters:
databaseManager- TheDatabaseManagerto usesimilarityManager- TheSimilarityManagerto usemergenceManager- TheMergenceManagerto useactions- TheActionsto use
-
-
Method Detail
-
scanImage
public ScannedImage scanImage(java.io.File file)
Description copied from interface:ScanScans the input image and returns aDefaultScannedImagecontaining all the characters and their info.- Specified by:
scanImagein interfaceScan- Parameters:
file- The input image to be scanned- Returns:
- A
DefaultScannedImagecontaining all scanned character data
-
getSpacesFor
public java.util.List<ImageLetter> getSpacesFor(java.util.List<ImageLetter> line, int fontSize)
Description copied from interface:ScanGets 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:
getSpacesForin 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
ImageLetterList, but with spaces appended to the end
-
spaceRound
public int spaceRound(double input)
Description copied from interface:ScanGets 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:
spaceRoundin 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
-
-