- java.lang.Object
-
- com.uddernetworks.newocr.recognition.OCRTrain
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TRAIN_STRING
-
Constructor Summary
Constructors Constructor Description OCRTrain(DatabaseManager databaseManager, SimilarityManager similarityManager, OCROptions options)
Creates a newOCRTrain
.OCRTrain(DatabaseManager databaseManager, OCROptions options)
Creates a newOCRTrain
.OCRTrain(DatabaseManager databaseManager, OCROptions options, Actions actions)
Creates a newOCRTrain
.OCRTrain(DatabaseManager databaseManager, OCROptions options, Actions actions, TrainGeneratorOptions generatorOptions)
Creates a newOCRTrain
.
-
Method Summary
Modifier and Type Method Description TrainedCharacterData
getTrainedCharacter(java.util.List<TrainedCharacterData> trainedCharacterDataList, char current, int finalModifier)
Gets theTrainedCharacterData
with the known letter value of the given character, with the same modifier.void
trainImage(java.io.File file)
Scans the input image and creates training data based off of it.void
trainImage(java.io.File file, TrainGeneratorOptions generatorOptions)
Scans the input image and creates training data based off of it.
-
-
-
Field Detail
-
TRAIN_STRING
public static final java.lang.String TRAIN_STRING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OCRTrain
public OCRTrain(DatabaseManager databaseManager, OCROptions options)
Creates a newOCRTrain
.- Parameters:
databaseManager
- TheDatabaseManager
to useoptions
- TheOCROptions
to use
-
OCRTrain
public OCRTrain(DatabaseManager databaseManager, SimilarityManager similarityManager, OCROptions options)
Creates a newOCRTrain
.- Parameters:
databaseManager
- TheDatabaseManager
to usesimilarityManager
- TheSimilarityManager
to useoptions
- TheOCROptions
to use
-
OCRTrain
public OCRTrain(DatabaseManager databaseManager, OCROptions options, Actions actions)
Creates a newOCRTrain
.- Parameters:
databaseManager
- TheDatabaseManager
to useoptions
- TheOCROptions
to useactions
- TheActions
to use
-
OCRTrain
public OCRTrain(DatabaseManager databaseManager, OCROptions options, Actions actions, TrainGeneratorOptions generatorOptions)
Creates a newOCRTrain
.- Parameters:
databaseManager
- TheDatabaseManager
to useoptions
- TheOCROptions
to useactions
- TheActions
to usegeneratorOptions
- TheTrainGeneratorOptions
to use during training
-
-
Method Detail
-
trainImage
public void trainImage(java.io.File file)
Description copied from interface:Train
Scans the input image and creates training data based off of it. It must be an input image created fromComputerTrainGenerator
or something of a similar format.- Specified by:
trainImage
in interfaceTrain
- Parameters:
file
- The input image to be trained from
-
trainImage
public void trainImage(java.io.File file, TrainGeneratorOptions generatorOptions)
Description copied from interface:Train
Scans the input image and creates training data based off of it. It must be an input image created fromComputerTrainGenerator
or something of a similar format.- Specified by:
trainImage
in interfaceTrain
- Parameters:
file
- The input image to be trained fromgeneratorOptions
- The options to use, in order to detect font sizes
-
getTrainedCharacter
public TrainedCharacterData getTrainedCharacter(java.util.List<TrainedCharacterData> trainedCharacterDataList, char current, int finalModifier)
Description copied from interface:Train
Gets theTrainedCharacterData
with the known letter value of the given character, with the same modifier. If a character is not found, it will be created and added to the given list.- Specified by:
getTrainedCharacter
in interfaceTrain
- Parameters:
trainedCharacterDataList
- The list ofTrainedCharacterData
s to search thoughcurrent
- The character to findfinalModifier
- The modifier for the character to find- Returns:
- The
TrainedCharacterData
with the same character and modifier
-
-