OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

imgDynamicBinary

Contents

Menu Information

Dynamic Binary

Brief Information

Convert to binary using dynamic threshold

Additional Information

This feature is for OriginPro only.

Command Line Usage

1. imgDynamicBinary dim:=50 threshold:=10 oimg:=<new>;

2. imgDynamicBinary img:=mat(1) dim:=50 threshold:=10 oimg:=mat(2);

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Matrix img

Input

Image

<active>

Specifies the image to be manipulated. The default input is the active image.

Dimension dim

Input

int

2

Specifies the dimension of the neighborhood, which is used when evaluating each pixel.

Threshold threshold

Input

int

0

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

<input>

Specifies the output image. By default, the output image is the same as the input image.

See the syntax here.

Description

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.

Examples

In this example, we use the imgDynamicBinary function to convert the input image into a black and white image:

  1. When the input image is active, select Image: Conversion: Dynamic Binary. This opens the dialog of the X-Function.
  2. In the X-Function dialog, change the settings as the screenshot below and click OK to close the dialog.
    Image:imgDynamicBinary_help_English_files_image002.jpg
    A new image is created. We can see that it is monochromatic.
Image:imgDynamicBinary_help_English_files_image004.jpg
Image:imgDynamicBinary_help_English_files_image006.jpg
The original image
The output image


Algorithm

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.

Related X-Functions

imgAutoBinary, imgC2gray