|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.OperationDescriptorImpl | +--javax.media.jai.operator.MedianFilterDescriptor
An OperationDescriptor
describing the "MedianFilter" operation.
The "MedianFilter" operation is a non-linear filter which is useful for removing isolated lines or pixels while preserving the overall appearance of an image. The filter is implemented by moving a mask over the image. For each position of the mask, the center pixel is replaced by the median of the pixel values covered by the mask.
There are several shapes possible for the mask. The MedianFilter operation supports three shapes, as follows:
Square Mask:
x x x x x x x x x
Plus Mask:
x x x x x
X Mask:
x x x x x
The Median operation may also be used to compute the "separable median" of a 3x3 or 5x5 region of pixels. The separable median is defined as the median of the medians of each row. For example, if the pixel values in a 3x3 window are equal to:
[ 1 2 3 ] [ 5 6 7 ] [ 4 8 9 ]then the overall (non-separable) median value is 5, while the separable median is equal to the median of the three row medians: median(1, 2, 3) = 2, median(5, 6, 7) = 6, and median(4, 8, 9) = 8, yielding an overall median of 6. The separable median may be obtained by specifying a mask of type MEDIAN_MASK_SQUARE_SEPARABLE. It should be noted that this operation automatically adds a value of
Boolean.TRUE
for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
to the given
configuration
so that the operation is performed
on the pixel values instead of being performed on the indices into
the color map if the source(s) have an IndexColorModel
.
This addition will take place only if a value for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
has not already been
provided by the user. Note that the configuration
Map
is cloned before the new hint is added to it. The operation can be
smart about the value of the JAI.KEY_REPLACE_INDEX_COLOR_MODEL
RenderingHints
, i.e. while the default value for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
is
Boolean.TRUE
, in some cases the operator could set the
default.
Name | Value |
---|---|
GlobalName | MedianFilter |
LocallName | MedianFilter |
Vendor | com.sun.media.jai |
Description | Performs median filtering on an image. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jaiapi/javax.media.jai.operator.MedianFilterDescriptor.html |
Version | 1.0 |
arg0Desc | The shape of the mask to be used for Median Filtering. |
arg1Desc | The size (width/height) of the mask to be used in Median Filtering. |
Name | Class Type | Default Value |
---|---|---|
maskShape | javax.media.jai.operator.MedianFilterShape | MEDIAN_MASK_SQUARE |
maskSize | java.lang.Integer | 3 |
OperationDescriptor
,
MedianFilterShape
, Serialized FormField Summary | |
static MedianFilterShape |
MEDIAN_MASK_PLUS
Plus shaped mask. |
static MedianFilterShape |
MEDIAN_MASK_SQUARE
Square shaped mask. |
static MedianFilterShape |
MEDIAN_MASK_SQUARE_SEPARABLE
Separable square mask. |
static MedianFilterShape |
MEDIAN_MASK_X
X shaped mask. |
Fields inherited from class javax.media.jai.OperationDescriptorImpl |
resources, sourceNames, supportedModes |
Fields inherited from interface javax.media.jai.OperationDescriptor |
NO_PARAMETER_DEFAULT |
Constructor Summary | |
MedianFilterDescriptor()
Constructor for the MedianFilterDescriptor. |
Method Summary | |
static RenderedOp |
create(RenderedImage source0,
MedianFilterShape maskShape,
Integer maskSize,
RenderingHints hints)
Performs median filtering on an image. |
Number |
getParamMaxValue(int index)
Returns the maximum legal value of a specified numeric parameter for this operation. |
Number |
getParamMinValue(int index)
Returns the minimum legal value of a specified numeric parameter for this operation. |
PropertyGenerator[] |
getPropertyGenerators()
Returns an array of PropertyGenerators implementing
property inheritance for the "MedianFilter" operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final MedianFilterShape MEDIAN_MASK_SQUARE
public static final MedianFilterShape MEDIAN_MASK_PLUS
public static final MedianFilterShape MEDIAN_MASK_X
public static final MedianFilterShape MEDIAN_MASK_SQUARE_SEPARABLE
Constructor Detail |
public MedianFilterDescriptor()
Method Detail |
public Number getParamMinValue(int index)
getParamMinValue
in class OperationDescriptorImpl
javax.media.jai.OperationDescriptorImpl
index
- The index of the parameter to be queried.Number
representing the minimum legal value,
or null
if the specified parameter is not
numeric.IllegalArgumentException
- if this operation has no parameters.ArrayIndexOutOfBoundsException
- if there is no parameter
corresponding to the specified index
.ParameterListDescriptor.getParamValueRange(java.lang.String)
,
ParameterListDescriptor.getEnumeratedParameterValues(java.lang.String)
,
ParameterListDescriptor.isParameterValueValid(java.lang.String, java.lang.Object)
public Number getParamMaxValue(int index)
getParamMaxValue
in class OperationDescriptorImpl
javax.media.jai.OperationDescriptorImpl
index
- The index of the parameter to be queried.Number
representing the maximum legal value,
or null
if the specified parameter is not
numeric.IllegalArgumentException
- if this operation has no parameters.ArrayIndexOutOfBoundsException
- if there is no parameter
corresponding to the specified index
.ParameterListDescriptor.getParamValueRange(java.lang.String)
,
ParameterListDescriptor.getEnumeratedParameterValues(java.lang.String)
,
ParameterListDescriptor.isParameterValueValid(java.lang.String, java.lang.Object)
public PropertyGenerator[] getPropertyGenerators()
PropertyGenerators
implementing
property inheritance for the "MedianFilter" operation.getPropertyGenerators
in class OperationDescriptorImpl
public static RenderedOp create(RenderedImage source0, MedianFilterShape maskShape, Integer maskSize, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
source0
- RenderedImage
source 0.maskShape
- The mask shape to be used for Median Filtering.
May be null
.maskSize
- The mask size to be used for Median Filtering.
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: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |