Assembly: Cognex.VisionPro.OCRMax (in Cognex.VisionPro.OCRMax.dll) Version: 65.1.0.0
Property Value
Type: DoubleThe ForegroundThresholdFrac value. The default value is 0.5.
| Event Type | Reason |
|---|---|
| ICogChangedEvent Changed | Fires when this property changes. The following state flag may be affected:
|
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown if set to a value less than 0.0 or greater than 1.0 |
When the input character polarity is LightOnDark:
Threshold = round(max((1 - ForegroundThresholdFrac) * 255, 1))
Invert = false
A value of zero results in a binarization threshold value of 255, indicating that only the pixels with value 255 (considered most certain to be foreground) should be treated as foreground. A value of one gives a binarization threshold value of 1, indicating that all pixels should be treated as foreground except for those with the value 0 (considered most certain to be background) should be treated as background.
When the input character polarity is DarkOnLight:
Threshold = round(max(ForegroundThresholdFrac * 255, 1))
Invert = true
A value of zero results in a binarization threshold value of 1, indicating that only the pixels with value 0 (considered most certain to be foreground) should be treated as foreground. A value of one gives a threshold value of 255, indicating that all pixels should be treated as foreground except for those with the value 255 (considered most certain to be background) should be treated as background.
In summary, a value of zero indicates that only the pixels considered most certain to be foreground should be treated as foreground, and a value of one indicates that all pixels should be treated as foreground except for those considered most certain to be background.
Stage: Binarize