- java.lang.Object
-
- com.uddernetworks.newocr.recognition.OCRTrain
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTRAIN_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 TrainedCharacterDatagetTrainedCharacter(java.util.List<TrainedCharacterData> trainedCharacterDataList, char current, int finalModifier)Gets theTrainedCharacterDatawith the known letter value of the given character, with the same modifier.voidtrainImage(java.io.File file)Scans the input image and creates training data based off of it.voidtrainImage(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- TheDatabaseManagerto useoptions- TheOCROptionsto use
-
OCRTrain
public OCRTrain(DatabaseManager databaseManager, SimilarityManager similarityManager, OCROptions options)
Creates a newOCRTrain.- Parameters:
databaseManager- TheDatabaseManagerto usesimilarityManager- TheSimilarityManagerto useoptions- TheOCROptionsto use
-
OCRTrain
public OCRTrain(DatabaseManager databaseManager, OCROptions options, Actions actions)
Creates a newOCRTrain.- Parameters:
databaseManager- TheDatabaseManagerto useoptions- TheOCROptionsto useactions- TheActionsto use
-
OCRTrain
public OCRTrain(DatabaseManager databaseManager, OCROptions options, Actions actions, TrainGeneratorOptions generatorOptions)
Creates a newOCRTrain.- Parameters:
databaseManager- TheDatabaseManagerto useoptions- TheOCROptionsto useactions- TheActionsto usegeneratorOptions- TheTrainGeneratorOptionsto use during training
-
-
Method Detail
-
trainImage
public void trainImage(java.io.File file)
Description copied from interface:TrainScans the input image and creates training data based off of it. It must be an input image created fromComputerTrainGeneratoror something of a similar format.- Specified by:
trainImagein interfaceTrain- Parameters:
file- The input image to be trained from
-
trainImage
public void trainImage(java.io.File file, TrainGeneratorOptions generatorOptions)Description copied from interface:TrainScans the input image and creates training data based off of it. It must be an input image created fromComputerTrainGeneratoror something of a similar format.- Specified by:
trainImagein 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:TrainGets theTrainedCharacterDatawith 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:
getTrainedCharacterin interfaceTrain- Parameters:
trainedCharacterDataList- The list ofTrainedCharacterDatas to search thoughcurrent- The character to findfinalModifier- The modifier for the character to find- Returns:
- The
TrainedCharacterDatawith the same character and modifier
-
-