
Contents |
Dynamic Binary
Convert to binary using dynamic threshold
This feature is for OriginPro only.
1. imgDynamicBinary dim:=50 threshold:=10 oimg:=<new>;
2. imgDynamicBinary img:=mat(1) dim:=50 threshold:=10 oimg:=mat(2);
| Display Name | Variable Name | I/O and Type | Default Value | Description |
|---|---|---|---|---|
| Input Matrix | img |
Input Image | |
Specifies the image to be manipulated. The default input is the active image. |
| Dimension | dim |
Input int | |
Specifies the dimension of the neighborhood, which is used when evaluating each pixel. |
| Threshold | threshold |
Input int | |
Specifies the local contrast threshold. If the contrast of the area surrounding the pixel is below this threshold, the pixel is converted to black or white using a global pre-calculated threshold. If the contrast of the area surrounding the pixel is higher than this threshold, the local threshold value is calculated and used. |
| Output Image | oimg |
Output Image | |
Specifies the output image. By default, the output image is the same as the input image. See the syntax here. |
The imgDynamicBinary function converts a specified image into a black and white image without changing its bits per pixel, using a local threshold value for each pixel of the image.
Each pixel is compared to a dynamically-calculated threshold. If the intensity of the pixel is higher (that is, the pixel is brighter) than the dynamic threshold, the pixel will be set to white. If the intensity of the pixel is lower (that is, the pixel is darker) than the dynamic threshold, the pixel will be set to black.
In this example, we use the imgDynamicBinary function to convert the input image into a black and white image:

The computation uses L_DynamicBinaryBitmap () function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_DynamicBinaryBitmap topic.