
Contents |
Unsharp Mask
Apply unsharp mask
1. imgUnsharpmask a:=40;
2. imgUnsharpmask a:=20 r:=3 t:=3 option:=yuv img:=mat(1) oimg:=mat(2);
| Display Name | Variable Name | I/O and Type | Default Value | Description |
|---|---|---|---|---|
| Adjust | a |
Input int | |
Specifies the adjustment factor, which is a percentage. The range is from 0 to 500. |
| Neighborhood | r |
Input int | |
Specifies the size of the neighborhood used for detecting edges. The range is from 0 to 1000. |
| Threshold | t |
Input int | |
Specifies the threshold for determining the edges. If the difference between a pixel and its neighborhood is greater than this threshold, this pixel will be considered an edge pixel and will be sharpened. Valid range of this variable is from 0 to 255. |
| Color | option |
Input int | |
Specifies the color space in which to apply the unsharp mask. Option list
|
| Input Matrix | img |
Input Image | |
Specifies the source 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. |
This X-Function can be used to remove the blurring from the input image. It identifies pixels that are different from neighboring pixels and increases their contrast. This function can be viewed as a sharpening function. The edges and details in the output image are emphasized and have an enhanced appearance.
In this example, we use the imgUnsharpmask function to process the input image:

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