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

imgUnsharpmask

Contents

Menu Information

Unsharp Mask

Brief Information

Apply unsharp mask

Command Line Usage

1. imgUnsharpmask a:=40;

2. imgUnsharpmask a:=20 r:=3 t:=3 option:=yuv img:=mat(1) oimg:=mat(2);

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Adjust a

Input

int

0

Specifies the adjustment factor, which is a percentage. The range is from 0 to 500.

Neighborhood r

Input

int

1

Specifies the size of the neighborhood used for detecting edges. The range is from 0 to 1000.

Threshold t

Input

int

0

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

rgb

Specifies the color space in which to apply the unsharp mask.

Option list

  • rgb:RGB_Space
Uses the RGB space.
  • yuv:YUV_Space
Uses the YUV space. Generally, computation is faster than using RGB space.
Input Matrix img

Input

Image

<active>

Specifies the source image to be manipulated. 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 here.

Description

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.

Examples

In this example, we use the imgUnsharpmask function to process the input image:

  1. When the image is active, select Image: Spatial Filters: Unsharp mask to open the dialog of the X-Function.
  2. In the dialog, change the settings as the screenshot below and click OK to close the dialog.
    Image:imgUnsharpmask_help_English_files_image002.jpg
    A new image is created. We can see that the edges look clearer in the output image.
Image:imgUnsharpmask_help_English_files_image004.jpg
Image:imgUnsharpmask_help_English_files_image006.jpg
The original image
The output image


For more examples, please refer to XF Script Dialog (press F11).

Algorithm

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.

References

LEADTOOLS Main API Help file, Version 14

Related X-Functions

imgSharpen, imgUserfilter