TIEVisionImage.adaptiveThreshold
Declaration
procedure adaptiveThreshold(maxValue: double; adaptiveMethod: TIEVisionAdaptiveMethod = ievADAPTIVE_THRESH_MEAN_C; thresholdType: TIEVisionThresholdType = ievTHRESH_BINARY; blockSize: int32_t = 3; C: double = 5); safecall;
Description
Applies an adaptive threshold.
Note: Pixel format of input image must be ie8g.
Parameter | Description |
maxValue | Non-zero value assigned to the pixels for which the condition is satisfied. |
adaptiveMethod | Adaptive thresholding algorithm to use. |
thresholdType | Thresholding type. This can be ievTHRESH_BINARY or ievTHRESH_BINARY_INV. |
blockSize | Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on. |
C | Constant subtracted from the mean or weighted mean. |
Example
begin
ImageEnView.IO.LoadFromFile('input.jpg');
ImageEnView.IEBitmap.PixelFormat := ie8g;
ImageEnView.IEBitmap.GetIEVisionImage().adaptiveThreshold(255);
ImageEnView.Update();
end;