|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.generation5.vision.Filter
org.generation5.vision.ThresholdFilter
This class encapsulates a variety of thresholding algorithms. The current available thresholding algorithms are:
| Field Summary | |
static int |
ERROR_DIFFUSION
Error-diffusion thresholding. |
static int |
ONE_POINT
One-point thresholding. |
static int |
PATTERN_DIFFUSION
Pattern-diffusion thresholding. |
protected int |
thresholdLimit
The threshold limit using by one-point thresholding. |
protected int |
thresholdMode
The thresholding mode |
static int |
TWO_POINT
Two-point thresholding. |
protected int |
upperLimit
The upper limit used in two-point thresholding. |
| Constructor Summary | |
ThresholdFilter()
Creates a new instance of Threshold |
|
ThresholdFilter(int threshold)
Creates a new instances of Threshold, and sets the threshold limit |
|
| Method Summary | |
protected java.awt.image.BufferedImage |
errorDiffusion(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output)
Performs error diffusion. |
java.awt.image.BufferedImage |
filter(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output)
Threshold the image according to the mode selected. |
int |
getThresholdLimit()
Retrieve the thresholding limit for one- or two-point thresholding. |
int |
getThresholdMode()
Return the threshold mode. |
int |
getUpperLimit()
Retrieve the upper threshold limit for two-point thresholding. |
protected java.awt.image.BufferedImage |
onePoint(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output,
int thresholdLimit)
Performs one-point thresholding. |
protected java.awt.image.BufferedImage |
patternDiffusion(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output)
Performs pattern diffusion on the input image. |
void |
setThresholdLimit(int limit)
Sets the threshold limit used by one- or two-point thresholding. |
void |
setThresholdLimits(int threshold,
int upper)
Set the upper and lower threshold limits used in two-point thresholding. |
void |
setThresholdMode(int mode)
Set the threshold mode. |
void |
setUpperLimit(int upper)
Set the upper threshold limit for two-point thresholding. |
java.lang.String |
toString()
|
protected java.awt.image.BufferedImage |
twoPoint(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output,
int lowerLimit,
int upperLimit)
Perform two-point thresholding on the input image. |
| Methods inherited from class org.generation5.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 ONE_POINT
public static final int PATTERN_DIFFUSION
public static final int ERROR_DIFFUSION
public static final int TWO_POINT
protected int thresholdMode
protected int thresholdLimit
ONE_POINTprotected int upperLimit
| Constructor Detail |
public ThresholdFilter()
public ThresholdFilter(int threshold)
threshold - the threshold limitsetThresholdLimit(int)| Method Detail |
public void setThresholdLimit(int limit)
limit - the threshold limitpublic int getThresholdLimit()
public void setUpperLimit(int upper)
upper - the upper threshold limit.public int getUpperLimit()
public void setThresholdLimits(int threshold,
int upper)
threshold - the lower threshold limit.upper - the upper threshold limit.public void setThresholdMode(int mode)
mode - the threshold mode.public int getThresholdMode()
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output)
filter in class Filteroutput - the output image (optional).image - the input image.
Filter.verifyOutput(BufferedImage, BufferedImage)
protected java.awt.image.BufferedImage patternDiffusion(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output)
output - the output image.image - the input image.
protected java.awt.image.BufferedImage onePoint(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output,
int thresholdLimit)
output - the output image.image - the input image.thresholdLimit - the threshold limit.
protected java.awt.image.BufferedImage twoPoint(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output,
int lowerLimit,
int upperLimit)
filter, which passes the lower and upper limits specified in
setThresholdLimits.
output - the output image.image - the input image.lowerLimit - the lower limit.upperLimit - the upper limit.
setThresholdLimits(int, int)
protected java.awt.image.BufferedImage errorDiffusion(java.awt.image.BufferedImage image,
java.awt.image.BufferedImage output)
output - the output image.image - the input image.
public java.lang.String toString()
|
This documentation is part of the Generation5 JDK.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||