AutoCorrect makes educated guesses at a "correct" tune record by searching for an OCRMax result that matches the character codes contained in the partially correct input record.
The primary input to AutoCorrect() is a tune record which contains an image, a region, and the correct string of character codes. It is important for the inputRecords to already contain the character codes that the user expects the OCRMaxTool to eventually read in order for the AutoCorrect function to work properly.
The output of AutoCorrect() is a set of tune records which now includes the corrected mark and cell rects location of each character.
Assembly: Cognex.VisionPro.OCRMax (in Cognex.VisionPro.OCRMax.dll) Version: 65.1.0.0
Parameters
- inputRecord
- Type: Cognex.VisionPro.OCRMax CogOCRMaxTuneRecord
A tune record which contains the image, region, and correct character codes.Note that the input tune records Mark and Cell Rectangles may not be filled in, or may be incorrect.
- tuneParams
- Type: Cognex.VisionPro.OCRMax CogOCRMaxTuneParams
A CogOCRMaxTuneParams object which controls the AutoCorrect process.
- segmenter
- Type: Cognex.VisionPro.OCRMax CogOCRMaxSegmenter
The current CogOCRMaxSegmenter to be used as a hint or starting point for the AutoCorrect process.
- classifierTrainParams
- Type: Cognex.VisionPro.OCRMax CogOCRMaxClassifierTrainParams
The current CogOCRMaxClassifierTrainParams, this argument is ignored by AutoCorrect.
- classifierRunParams
- Type: Cognex.VisionPro.OCRMax CogOCRMaxClassifierRunParams
The current CogOCRMaxClassifierRunParams, this argument is ignored by AutoCorrect.
Return Value
Type: CogOCRMaxTuneRecordCollectionA set of corrected tune records which have the mark and cell rects locations of each character filled in or fixed.
| Exception | Condition |
|---|---|
| ArgumentNullException |
|
| CogOCRMaxInvalidTuneRecordException |
|
AutoCorrect() is primarily used during tuning to aid the user in creating "correct" tune records that can be then passed to AutoTune(). In many cases calling AutoCorrect() will be easier than manually constructing the corrected record.
AutoCorrect may use data from other records contained in the tune data, as well as any of the segmenter, classifier, and classifierTrainParams as hints or starting points when when trying to find a correct record.