|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.media.jai.OperationDescriptorImpl
javax.media.jai.operator.UnsharpMaskDescriptor
An OperationDescriptor describing the "UnsharpMask" operation.
Unsharp masking is derived from a photographic technique for improving the sharpness of images. In its digital form it is implemented using convolution to create a low-pass filtered version of a source image. The low-pass image is then subtracted from the original image, creating a high-pass image. The high pass image is then added back to the original image, creating enhanced edge contrast. By adjusting a scaling factor, the degree of high pass add-back can be controlled.
The operation is implemented algorithmically as follows. At each original pixel location x,y:
result = original + (original - lowpass) * gainFactor
where
original = value at position x,y of source image
lowpass = result of convolution with lowpass filter
centered at pixel x,y
gain = controlling parameter for degree of sharpness
gain = 0 : no effect
gain > 0 : sharpening
-1 < gain < 0 : smoothing
In general gain factors should be restricted to a range of [-1, 2], as higher magnitude values are likely to cause overflows or underflows which must be clamped to the image data type's range.
The default gain factor is set to 1,0F.
This operation is widely applied to scanned image enhancement. The typical gain factor for scanned images takes values in the range of [1/4, 2] (page 278 in Digital Image Processing by William K. Pratt, 3rd).
| Name | Value |
|---|---|
| GlobalName | UnsharpMask |
| LocalName | UnsharpMask |
| Vendor | com.sun.media.jai |
| Description | Performs unsharp masking to sharpen or smooth an image. |
| DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/UnsharpMaskDescriptor.html |
| Version | 1.1 |
| arg0Desc | The convolution kernel. |
| arg1Desc | The gain factor. |
| Name | Class Type | Default Value |
|---|---|---|
| kernel | javax.media.jai.KernelJAI | 3 X 3 average |
| gain | java.lang.Float | 1.0F |
OperationDescriptor,
KernelJAI,
ConvolveDescriptor,
Serialized Form| Field Summary |
| Fields inherited from class javax.media.jai.OperationDescriptorImpl |
sourceNames, supportedModes |
| Fields inherited from interface javax.media.jai.OperationDescriptor |
NO_PARAMETER_DEFAULT |
| Constructor Summary | |
UnsharpMaskDescriptor()
Constructor. |
|
| Method Summary | |
static RenderedOp |
create(RenderedImage source0,
KernelJAI kernel,
Float gain,
RenderingHints hints)
Performs UnsharpMask operation on the image. |
PropertyGenerator[] |
getPropertyGenerators()
Returns an array of PropertyGenerators implementing
property inheritance for the "UnsharpMask" operation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public UnsharpMaskDescriptor()
| Method Detail |
public PropertyGenerator[] getPropertyGenerators()
PropertyGenerators implementing
property inheritance for the "UnsharpMask" operation.
getPropertyGenerators in interface OperationDescriptorgetPropertyGenerators in class OperationDescriptorImplOperationDescriptorImpl.getPropertyGenerators(java.lang.String)
public static RenderedOp create(RenderedImage source0,
KernelJAI kernel,
Float gain,
RenderingHints hints)
Creates a ParameterBlockJAI from all
supplied arguments except hints and invokes
JAI.create(String,ParameterBlock,RenderingHints).
source0 - RenderedImage source 0.kernel - The low-pass convolution kernel.
May be null.gain - The sharpening value.
May be null.hints - The RenderingHints to use.
May be null.
RenderedOp destination.
IllegalArgumentException - if source0 is null.JAI,
ParameterBlockJAI,
RenderedOp
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||