|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jscience.computing.ai.vision.Filter
org.jscience.computing.ai.vision.RankFilter
public class RankFilter
This class implements a simple rank filter: allowing you to select the median, minimum or maximum for any given neighbourhood size. Note that this class is unapologetically slow! There are no optimizations at all, to ensure the best code readability.
Field Summary | |
---|---|
static int |
MAXIMUM
Retrieve the maximum from the neighbourhood. |
static int |
MEDIAN
Calculate the median for the neighbourhood. |
static int |
MINIMUM
Retrieve the minimum from the neighbourhood. |
protected int |
neighbourhoodSize
The neighbourhood size. |
protected int |
rankPosition
The type of rank position (median, maximum, minimum). |
Constructor Summary | |
---|---|
RankFilter()
Creates a new instance of RankFilter |
|
RankFilter(int rank)
Creates a new instance of RankFilter, with the given rank type. |
|
RankFilter(int rank,
int neighbourhoodSize)
Creates a new instance of RankFilter, with the given rank type and neighbourhood size. |
Method Summary | |
---|---|
java.awt.image.BufferedImage |
filter(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output)
Rank filter an image. |
int |
getNeighbourhoodSize()
Get the neighbourhood size. |
int |
getRankPosition()
Get the rank position. |
static void |
main(java.lang.String[] args)
Utility method for the class. |
void |
setNeighbourhoodSize(int neighbourhoodSize)
Set the neighbourhood size. |
void |
setRankPosition(int rankPosition)
Set the rank position. |
java.lang.String |
toString()
DOCUMENT ME! |
Methods inherited from class org.jscience.computing.ai.vision.Filter |
---|
filter, verifyOutput, verifyOutput, verifyOutput |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MEDIAN
public static final int MINIMUM
public static final int MAXIMUM
protected int neighbourhoodSize
protected int rankPosition
Constructor Detail |
---|
public RankFilter()
public RankFilter(int rank)
rank
- the rank type.public RankFilter(int rank, int neighbourhoodSize)
rank
- the rank type.neighbourhoodSize
- the neighbourhood size.Method Detail |
---|
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image, java.awt.image.BufferedImage output)
filter
in class Filter
image
- the input image.output
- the output image (optional).
Filter.verifyOutput(BufferedImage,BufferedImage)
public int getNeighbourhoodSize()
public void setNeighbourhoodSize(int neighbourhoodSize)
neighbourhoodSize
- the new neighbourhood size.public int getRankPosition()
public void setRankPosition(int rankPosition)
MEDIAN
, MINIMUM
or
MAXIMUM
.
rankPosition
- the new rank position.public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
args
- the command line arguments
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |