public class BernsenThreshold extends java.lang.Object implements IApplyInPlace
The method uses a user-provided contrast threshold. If the local contrast (max-min) is above or equal to the contrast threshold, the threshold is set at the local midgrey value (the mean of the minimum and maximum grey values in the local window). If the local contrast is below the contrast threshold the neighbourhood is considered to consist only of one class and the pixel is set to object or background depending on the value of the midgrey.
Properties:
| Constructor and Description |
|---|
BernsenThreshold()
Initialize a new instance of the BernsenThreshold class.
|
BernsenThreshold(int radius)
Initialize a new instance of the BernsenThreshold class.
|
BernsenThreshold(int radius,
double contrastThreshold)
Initialize a new instance of the BernsenThreshold class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyInPlace(FastBitmap fastBitmap)
Apply filter to an image.
|
double |
getContrastThreshold()
Get Contrast threshold.
|
int |
getRadius()
Get radius.
|
void |
setContrastThreshold(double c)
Set Contrast threshold.
|
void |
setRadius(int radius)
Set radius.
|
public BernsenThreshold()
public BernsenThreshold(int radius)
radius - Radius.public BernsenThreshold(int radius,
double contrastThreshold)
radius - RadiuscontrastThreshold - Contrast Threshold.public int getRadius()
public void setRadius(int radius)
radius - Radius.public double getContrastThreshold()
public void setContrastThreshold(double c)
c - Contrast threshold.public void applyInPlace(FastBitmap fastBitmap)
IApplyInPlaceapplyInPlace in interface IApplyInPlacefastBitmap - Image to be processed.