2.6.4.2 imgAutoBinary

Contents

Menu Information

Image: Conversion: Auto Binary

Brief Information

Auto convert image to binary

Additional Information

X-Function not designed for Auto GetN Dialog.

Command Line Usage

1. imgAutoBinary img:=mat(1) oimg:=mat(2);

X-Function Execution Options

Variables

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

Input

Image

<active>

Specifies the input image. The default input is the active image.

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 .

Description

This X-Function converts the input image into a binary image automatically. The threshold used to perform the conversion is calculated based on statistical features of the input image.

This X-Function works best with gray images. If the input image is a color image, each channel of it will be separately binarized.

Note that this X-Function does not have a dialog.

Examples

In this example, we use the imgAutoBinary function to convert the input image to a binary image:

  1. When the input image is active, select Image: Conversion: Auto Binary. This performs the conversion and the input image is modified.
The original image
The output image


Algorithm

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

References

LEADTOOLS Main API Help file, Version 14

Related X-Functions

,