public class RecursiveGaussianFilter
extends java.lang.Object
For large filter widths sigma, this recursive implementation can be much more efficient than convolution with a truncated Gaussian. Specifically, if the Gaussian is truncated for |n| > 4*sigma, then this recursive implementation requires 2/sigma of the multiplications required by convolution. In other words, for sigma > 2, this recursive implementation should be more efficient than convolution.
For any application of this filter, input and output arrays may be the same array. When the filter cannot be applied in-place, intermediate arrays are constructed internally.
This filter implements two different methods for approximating with difference equations a Gaussian filter and its derivatives.
The first method is that of Deriche, R., 1993, Recursively implementing the Gaussian and its derivatives: INRIA Research Report, number 1893. Deriche's method is used for small widths sigma, for which it is most accurate.
The second method is that of van Vliet, L.J., Young, I.T., and Verbeek, P.W., 1998, Recursive Gaussian derivative filters, Proceedings of the 14th International Conference on Pattern Recognition, IEEE Computer Society Press. The parallel implementation used here yields zero-phase impulse responses without the end effects caused by the serial (cascade) poles-only implementation recommended by van Vliet, et al. This second method is used for large widths sigma.
Modifier and Type | Class and Description |
---|---|
static class |
RecursiveGaussianFilter.Method
The method used to design the Gaussian filter.
|
Constructor and Description |
---|
RecursiveGaussianFilter(double sigma)
Construct a Gaussian filter with specified width.
|
RecursiveGaussianFilter(double sigma,
RecursiveGaussianFilter.Method method)
Construct a Gaussian filter with specified width and design method.
|
Modifier and Type | Method and Description |
---|---|
void |
apply0(float[] x,
float[] y)
Applies the 0th-derivative filter.
|
void |
apply00(float[][] x,
float[][] y)
Applies the 0th-derivative filter along the 1st and 2nd dimensions.
|
void |
apply000(float[][][] x,
float[][][] y)
Applies the 0th-derivative filter along the 1st, 2nd and 3rd dimensions.
|
void |
apply001(float[][][] x,
float[][][] y)
Applies the 1st-derivative filter along the 3rd dimension
and the 0th-derivative filter along the 1st and 2nd dimensions.
|
void |
apply002(float[][][] x,
float[][][] y)
Applies the 2nd-derivative filter along the 3rd dimension
and the 0th-derivative filter along the 1st and 2nd dimensions.
|
void |
apply01(float[][] x,
float[][] y)
Applies the 0th-derivative filter along the 1st dimension
and the 1st-derivative filter along the 2nd dimension.
|
void |
apply010(float[][][] x,
float[][][] y)
Applies the 1st-derivative filter along the 2nd dimension
and the 0th-derivative filter along the 1st and 3rd dimensions.
|
void |
apply011(float[][][] x,
float[][][] y)
Applies the 1st-derivative filter along the 2nd and 3rd dimensions
and the 0th-derivative filter along the 1st dimension.
|
void |
apply02(float[][] x,
float[][] y)
Applies the 0th-derivative filter along the 1st dimension
and the 2nd-derivative filter along the 2nd dimension.
|
void |
apply020(float[][][] x,
float[][][] y)
Applies the 2nd-derivative filter along the 2nd dimension
and the 0th-derivative filter along the 1st and 3rd dimensions.
|
void |
apply0X(float[][] x,
float[][] y)
Applies the 0th-derivative filter along the 1st dimension.
|
void |
apply0XX(float[][][] x,
float[][][] y)
Applies the 0th-derivative filter along the 1st dimension.
|
void |
apply1(float[] x,
float[] y)
Applies the 1st-derivative filter.
|
void |
apply10(float[][] x,
float[][] y)
Applies the 1st-derivative filter along the 1st dimension
and the 0th-derivative filter along the 2nd dimension.
|
void |
apply100(float[][][] x,
float[][][] y)
Applies the 1st-derivative filter along the 1st dimension
and the 0th-derivative filter along the 2nd and 3rd dimensions.
|
void |
apply101(float[][][] x,
float[][][] y)
Applies the 1st-derivative filter along the 1st and 3rd dimensions
and the 0th-derivative filter along the 2nd dimension.
|
void |
apply11(float[][] x,
float[][] y)
Applies the 1st-derivative filter along the 1st and 2nd dimensions.
|
void |
apply110(float[][][] x,
float[][][] y)
Applies the 1st-derivative filter along the 1st and 2nd dimensions
and the 0th-derivative filter along the 3rd dimension.
|
void |
apply1X(float[][] x,
float[][] y)
Applies the 1st-derivative filter along the 1st dimension.
|
void |
apply1XX(float[][][] x,
float[][][] y)
Applies the 1st-derivative filter along the 1st dimension.
|
void |
apply2(float[] x,
float[] y)
Applies the 2nd-derivative filter.
|
void |
apply20(float[][] x,
float[][] y)
Applies the 2nd-derivative filter along the 1st dimension
and the 0th-derivative filter along the 2nd dimension.
|
void |
apply200(float[][][] x,
float[][][] y)
Applies the 2nd-derivative filter along the 1st dimension
and the 0th-derivative filter along the 2nd and 3rd dimensions.
|
void |
apply2X(float[][] x,
float[][] y)
Applies the 2nd-derivative filter along the 1st dimension.
|
void |
apply2XX(float[][][] x,
float[][][] y)
Applies the 2nd-derivative filter along the 1st dimension.
|
void |
applyX0(float[][] x,
float[][] y)
Applies the 0th-derivative filter along the 2nd dimension.
|
void |
applyX0X(float[][][] x,
float[][][] y)
Applies the 0th-derivative filter along the 2nd dimension.
|
void |
applyX1(float[][] x,
float[][] y)
Applies the 1st-derivative filter along the 2nd dimension.
|
void |
applyX1X(float[][][] x,
float[][][] y)
Applies the 1st-derivative filter along the 2nd dimension.
|
void |
applyX2(float[][] x,
float[][] y)
Applies the 2nd-derivative filter along the 2nd dimension.
|
void |
applyX2X(float[][][] x,
float[][][] y)
Applies the 2nd-derivative filter along the 2nd dimension.
|
void |
applyXX0(float[][][] x,
float[][][] y)
Applies the 0th-derivative filter along the 3rd dimension.
|
void |
applyXX1(float[][][] x,
float[][][] y)
Applies the 1st-derivative filter along the 3rd dimension.
|
void |
applyXX2(float[][][] x,
float[][][] y)
Applies the 2nd-derivative filter along the 3rd dimension.
|
public RecursiveGaussianFilter(double sigma, RecursiveGaussianFilter.Method method)
sigma
- the width; must not be less than 1.method
- the method used to design the filter.public RecursiveGaussianFilter(double sigma)
sigma
- the width; must not be less than 1.public void apply0(float[] x, float[] y)
x
- the filter input.y
- the filter output.public void apply1(float[] x, float[] y)
x
- the filter input.y
- the filter output.public void apply2(float[] x, float[] y)
x
- the filter input.y
- the filter output.public void apply0X(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void apply1X(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void apply2X(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void applyX0(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void applyX1(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void applyX2(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void apply0XX(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply1XX(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply2XX(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void applyX0X(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void applyX1X(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void applyX2X(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void applyXX0(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void applyXX1(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void applyXX2(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply00(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void apply10(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void apply01(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void apply11(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void apply20(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void apply02(float[][] x, float[][] y)
x
- the filter input.y
- the filter output.public void apply000(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply100(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply010(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply001(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply110(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply101(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply011(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply200(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply020(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.public void apply002(float[][][] x, float[][][] y)
x
- the filter input.y
- the filter output.