Catalano.Imaging.Filters
Class Clahe
- java.lang.Object
-
- Catalano.Imaging.Filters.Clahe
-
- All Implemented Interfaces:
- IApplyInPlace
public class Clahe extends java.lang.Object implements IApplyInPlace
Contrast Limited Adaptive Histogram Equalization.This feature can also be applied to global histogram equalization, giving rise to contrast limited histogram equalization (CLHE) which is rarely used in practice.
References: http://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE- Supported types: Grayscale, RGB.
- Coordinate System: Matrix.
-
-
Constructor Summary
Constructors Constructor and Description Clahe()Initialize a new instance of the CLAHE class.Clahe(int blockRadius, int bins)Initialize a new instance of the CLAHE class.Clahe(int blockRadius, int bins, float slope)Initialize a new instance of the CLAHE class.Clahe(int blockRadius, int bins, float slope, Grayscale.Algorithm algorithm)Initialize a new instance of the CLAHE class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidapplyInPlace(FastBitmap fastBitmap)Apply filter to an image.Grayscale.AlgorithmgetAlgorithm()Get Grayscale algorithm.intgetBins()Get the number of histogram bins used for histogram equalization.intgetBlockRadius()Get Block radius.floatgetSlope()Get Slope.voidsetAlgorithm(Grayscale.Algorithm algorithm)Set Grayscale algorithm.voidsetBins(int bins)Set the number of histogram bins used for histogram equalization.voidsetBlockRadius(int blockRadius)Set Block radius.voidsetSlope(float slope)Set Slope.
-
-
-
Constructor Detail
-
Clahe
public Clahe()
Initialize a new instance of the CLAHE class.
Block radius: 63.
Bins: 255.
Slope: 3.
-
Clahe
public Clahe(int blockRadius, int bins)Initialize a new instance of the CLAHE class.- Parameters:
blockRadius- Block radius.bins- Bins.
-
Clahe
public Clahe(int blockRadius, int bins, float slope)Initialize a new instance of the CLAHE class.- Parameters:
blockRadius- Block radius.bins- Bins.slope- Slope.
-
Clahe
public Clahe(int blockRadius, int bins, float slope, Grayscale.Algorithm algorithm)Initialize a new instance of the CLAHE class.- Parameters:
blockRadius- Block radius.bins- Bins.slope- Slope.algorithm- Grayscale algorithm.
-
-
Method Detail
-
getBlockRadius
public int getBlockRadius()
Get Block radius. The size of the local region around a pixel for which the histogram is equalized. This size should be larger than the size of features to be preserved.- Returns:
- Size of block radius.
-
setBlockRadius
public void setBlockRadius(int blockRadius)
Set Block radius. The size of the local region around a pixel for which the histogram is equalized. This size should be larger than the size of features to be preserved.- Parameters:
blockRadius- Size of block radius.
-
getBins
public int getBins()
Get the number of histogram bins used for histogram equalization.- Returns:
- Number of histogram bins.
-
setBins
public void setBins(int bins)
Set the number of histogram bins used for histogram equalization.- Parameters:
bins- Number of histogram bins.
-
getSlope
public float getSlope()
Get Slope. Limits the contrast stretch in the intensity transfer function. Very large values will let the histogram equalization do whatever it wants to do, that is result in maximal local contrast. The value 1 will result in the original image.- Returns:
- Slope.
-
setSlope
public void setSlope(float slope)
Set Slope. Limits the contrast stretch in the intensity transfer function. Very large values will let the histogram equalization do whatever it wants to do, that is result in maximal local contrast. The value 1 will result in the original image.- Parameters:
slope- Slope.
-
getAlgorithm
public Grayscale.Algorithm getAlgorithm()
Get Grayscale algorithm.- Returns:
- Grayscale algorithm.
-
setAlgorithm
public void setAlgorithm(Grayscale.Algorithm algorithm)
Set Grayscale algorithm.- Parameters:
algorithm- Grayscale algorithm.
-
applyInPlace
public void applyInPlace(FastBitmap fastBitmap)
Description copied from interface:IApplyInPlaceApply filter to an image.- Specified by:
applyInPlacein interfaceIApplyInPlace- Parameters:
fastBitmap- Image to be processed.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG