UnsharpMask method (Main Control)
Builder Syntax |
int __fastcall UnsharpMask (int nAmount, int nRadius, int nThreshold,unsigned uColorType); |
Delphi Syntax |
Function UnsharpMask (nAmount: Integer; nRadius: Integer; nThreshold: Integer; uColorType: Cardinal): Integer; |
Overview |
Refer to Detecting and Enhancing Edges and Lines. |
Remarks
This method is actually considered a sharpening method. It is used to sharpen the image with a minimum of noise by applying the unsharp mask. To reduce the noise, it starts by blurring a copy of the original image. The amount of blur depends on iRadius. The method then determines the difference between each pixel's value of the original image and the corresponding pixel's value in the blurred image. If the difference is greater than the iThreshold value, then the difference between the pixel values is multiplied by the value in the iAmount parameter and added to the original pixel value.
To get the same results with your images, you can use the following settings:
iAmount = 500 // (or more)
iRadius = 1
iThreshold = 0
To increase the thickness of the sharpened edges, increase the value of iRadius.
To increase the amount of sharpness, increase the value of iAmount.
To reduce the noise and eliminate the small edges or individual pixels that will produce noise in image, increase the value of iThreshold.
Using the YUV color space decreases the processing time.
This method supports 12 and 16-bit grayscale images and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.
This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.
See Also