
Contents |
AutoTrim
Trim image with auto threshold settings
1. imgTrim t:=20;
2. imgTrim t:=20 img:=1 oimg:=2 o:=3;
| Display Name | Variable Name | I/O and Type | Default Value | Description |
|---|---|---|---|---|
| Threshold | t |
Input int | |
Specifies the threshold value for detecting blank space. This X-Function starts at each edge of the input image and scans toward the center. If it finds that the change in intensity that is less than or equal to the threshold, the current area will be considered blank space. Valid values of this variable range from 0 to 255. |
| Input Matrix | img |
Input Image | |
Specifies the image to be manipulated. The default input is the active image. |
| 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. |
| Edge | o |
Input int | |
Specifies the edges to trim. Option list
|
This function trims blank space around the edges of the input image automatically.
In this example, we use the imgTrim function to trim the empty spaces near the edges of the input image:

For more examples, please refer to XF Script Dialog (press F11).
The computation uses L_TrimBitmap() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_TrimBitmap topic.
LEADTOOLS Main API Help file, Version 14