net.sourceforge.jiu.filters
Class MaximumFilter
public class MaximumFilter
Filter operation that replaces each sample by the maximum value of itself
and its neighbor samples.
Note that this is not the maximum operation that takes two input images
and, for each position, takes the maximum sample value and writes it
to output.
Usage example
MaximumFilter filter = new MaximumFilter();
filter.setArea(7, 5);
filter.setInputImage(image);
filter.process();
PixelImage filteredImage = filter.getOutputImage();
int | computeSample(int[] samples, int numSamples)- Determine the resulting sample for an array with the source sample
and zero or more of its neighbors.
|
checkAreaHeight, checkAreaWidth, computeSample, getAreaHeight, getAreaWidth, process, process, process, processBorders, processCenter, setArea, setAreaHeight, setAreaWidth |
computeSample
public final int computeSample(int[] samples,
int numSamples) Determine the resulting sample for an array with the source sample
and zero or more of its neighbors.
This abstract method must be implemented by classes extending this operation.
The array will hold
numSamples samples, which will be stored
starting at offset
0.
Normally,
numSamples is equal to
AreaFilterOperation.getAreaWidth() times
AreaFilterOperation.getAreaHeight().
Near the border of the image you may get less samples.
Example: the top left sample of an image has only three neighbors (east, south-east and south),
so you will only get four samples (three neighbors and the sample itself).
- computeSample in interface AreaFilterOperation
samples - the array holding the sample(s)numSamples - number of samples in the array
- sample to be written to the output image