CImage:FiltUnsharpMask


The FiltUnsharpMask method increases the crispness, or local contrast, of the image using the unsharp masking method.

Syntax

bSuccess = CImage:FiltUnsharpMask( nSigma )

bSuccess = CImage:FiltUnsharpMask( nSigma, CRect )

where

    nSigma is the sigma, or radius, of the unsharp mask filter.

    CRect is the rectangle defining the area to process. If omitted, it defaults to nil and the entire image is processed.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

This method increases the local contrast of the image by suppressing the diffuse component of the image. This has the effect of sharpening the image, making it "crisper" in appearance. The FiltSharpen method applies a simple crispening filter which runs faster but gives a slightly noisier result.

Example

Suppose an image is displayed in a CImageView named V. The following script applies an unsharp mask of sigma 1.0 pixels and strength 1.5 to the [100:300, 400:800] pixel region:

I = V:GetImage()

-- attach the current displayed image

R = NewRect(100,300,400,800)

-- setup the rectangle to process

I:FiltUnsharpMask(1,1.5,R)

-- apply the filter

V:Update()

-- update the display after the scale

R:delete()

-- done with the CRect

Related Topics

FiltSharpen

CImage class