CogOCRMaxTuneData Tune Method Cognex VisionPro 9.5

Performs a full Tune of the CogOCRMaxTuneRecords contained in this object.

After calling this function the TuneData will be in the "tuned" state.

When in the tuned state the user can call GetTunedSegmenter(), and GetTunedFont() to extract the tuned OCRMax operators.

Note that performing a full Tune may produce different results than calling the incremental AutoTune() on the same set of CogOCRMaxTuneRecords data.

Namespace: Cognex.VisionPro.OCRMax
Assembly: Cognex.VisionPro.OCRMax (in Cognex.VisionPro.OCRMax.dll) Version: 69.0.0.0
Syntax

public void Tune(
	CogOCRMaxTuneParams tuneParams,
	CogOCRMaxSegmenter segmenter,
	CogOCRMaxClassifierTrainParams classifierTrainParams,
	CogOCRMaxClassifierRunParams classifierRunParams
)

Parameters

tuneParams
Type: Cognex.VisionPro.OCRMax CogOCRMaxTuneParams
A CogOCRMaxTuneParams object which controls the AutoCorrect process.
segmenter
Type: Cognex.VisionPro.OCRMax CogOCRMaxSegmenter
The current CogOCRMaxSegmenter to use 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.
Events

Event TypeReason
ICogChangedEvent Changed

Fires when this function is called.

The following state flag may be affected:

  • SfTuned
Exceptions

ExceptionCondition
ArgumentNullException
  • Thrown if tuneParams is null.
  • Thrown if segmenter is null.
  • Thrown if classifierTrainParams is null.
  • Thrown if classifierRunParams is null.
InvalidOperationException
  • Thrown if tune data contains zero tune records.
CogOCRMaxInvalidTuneRecordException
  • Thrown if any tune record has an unallocated image
  • Thrown if any tune record contains no character codes
  • Thrown if any tune record has a character code which is the unknown character marker
  • Thrown if any tune records has a mark rect which has an angle or skew greater than 45 degrees relative to the region
  • Thrown if (number of mark rects != number of cell rects != number of character codes) for any tune record
See Also