ImageEn, unit ievision

TIEVisionImage.adaptiveThreshold

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

Apply 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

// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );

  

ImageEnView1.IEBitmap.PixelFormat := ie8g;
ImageEnView1.IEBitmap.GetIEVisionImage().adaptiveThreshold( 255 );
ImageEnView1.Update();