CogOCRMaxSegmenter CharacterMaxWidth Property Cognex VisionPro 9.5
The maximum allowable width of a character's mark rectangle, in pixels. A character wider than this value will be split into pieces that are not too wide.

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

public int CharacterMaxWidth { get; set; }

Property Value

Type: Int32
The CharacterMaxWidth value. The default value is 50.
Events

Event TypeReason
ICogChangedEvent Changed

Fires when this property changes.

The following state flag may be affected:

  • SfCharacterMaxWidth
Exceptions

ExceptionCondition
ArgumentOutOfRangeException Thrown if set to a value less than 1 or greater than System::Int32::MaxValue
Remarks

The mark rectangle of a character is a tight bounding box enclosing all of the foreground (e.g. ink) pixels in the character image.

This value is used only if UseCharacterMaxWidth is true.

The technique used to split the character into pieces depends on the value of WidthType. If WidthType is FontCharWidthTypeFixed, the segmenter will try to break the character into pieces of approximately equal width. If WidthType is FontCharWidthTypeVariable or FontCharWidthTypeUnknown, the segmenter will try to break the character into pieces that are not required to be approximately the same width.

The segmenter may sometimes choose to return characters slightly wider than this value if it cannot find a reasonable split.

CharacterMinAspect is another way of specifying a maximum character width.

Stage: Group, Analyze

Setting this property to a value less than CharacterMinWidth will cause CharacterMinWidth to be adjusted accordingly.

See Also