public class LocalSmoothingFilter
extends java.lang.Object
The sparse system of filter equations (I+G'DG)y = x is solved iteratively, beginning with y = x. Iterations continue until either the error in the solution y is below a specified threshold or the number of iterations exceeds a specified limit.
For low wavenumbers the output of this filter approximates the solution to an anisotropic inhomogeneous diffusion equation, where the filter input x corresponds to the initial condition at time t = 0 and filter output y corresponds to the solution at some later time t.
Additional smoothing filters may be applied to the input image x before or after solving the sparse system of equations for the smoothed output image y. These additional filters compensate for deficiencies in the gradient operator G, which is a finite-difference approximation that is poor for high wavenumbers near the Nyquist limit. The extra smoothing filters attenuate these high wavenumbers.
The additional smoothing filter S is a simple 3x3 (or, in 3D, 3x3x3) weighted-average filter that zeros Nyquist wavenumbers. This filter is fast and has non-negative coefficients. However, it may smooth too much, as it attenuates all non-zero wavenumbers, not only the highest wavenumbers. Moreover, this filter is not isotropic.
The other additional smoothing operator L is an isotropic low-pass filter designed to pass wavenumbers up to a specified maximum. Although slower than S, the cost of applying L to the input image x is likely to be insignificant relative to the cost of solving the sparse system of equations for the output image y.
Constructor and Description |
---|
LocalSmoothingFilter()
Constructs a local smoothing filter with default parameters.
|
LocalSmoothingFilter(double small,
int niter)
Constructs a local smoothing filter with specified iteration parameters.
|
LocalSmoothingFilter(double small,
int niter,
LocalDiffusionKernel ldk)
Constructs a local smoothing filter with specified parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(float[][][] x,
float[][][] y)
Applies this filter for identity tensors.
|
void |
apply(float[][] x,
float[][] y)
Applies this filter for identity tensors.
|
void |
apply(float c,
float[][][] x,
float[][][] y)
Applies this filter for identity tensors and specified scale factor.
|
void |
apply(float c,
float[][][] s,
float[][][] x,
float[][][] y)
Applies this filter for identity tensors and specified scale factors.
|
void |
apply(float c,
float[][] x,
float[][] y)
Applies this filter for identity tensors and specified scale factor.
|
void |
apply(float c,
float[][] s,
float[][] x,
float[][] y)
Applies this filter for identity tensors and specified scale factors.
|
void |
apply(float c,
float[] x,
float[] y)
Applies this filter for specified constant scale factor.
|
void |
apply(float c,
float[] s,
float[] x,
float[] y)
Applies this filter for specified scale factors.
|
void |
apply(Tensors2 d,
float[][] x,
float[][] y)
Applies this filter for specified tensors.
|
void |
apply(Tensors2 d,
float c,
float[][] x,
float[][] y)
Applies this filter for specified tensors and scale factor.
|
void |
apply(Tensors2 d,
float c,
float[][] s,
float[][] x,
float[][] y)
Applies this filter for specified tensors and scale factors.
|
void |
apply(Tensors3 d,
float[][][] x,
float[][][] y)
Applies this filter for specified tensors.
|
void |
apply(Tensors3 d,
float c,
float[][][] x,
float[][][] y)
Applies this filter for specified tensors and scale factor.
|
void |
apply(Tensors3 d,
float c,
float[][][] s,
float[][][] x,
float[][][] y)
Applies this filter for specified tensors and scale factors.
|
void |
applySmoothL(double kmax,
float[][][] x,
float[][][] y)
Applies an isotropic low-pass smoothing filter L.
|
void |
applySmoothL(double kmax,
float[][] x,
float[][] y)
Applies an isotropic low-pass smoothing filter L.
|
void |
applySmoothS(float[][][] x,
float[][][] y)
Applies a simple 3x3x3 weighted-average smoothing filter S.
|
void |
applySmoothS(float[][] x,
float[][] y)
Applies a simple 3x3 weighted-average smoothing filter S.
|
void |
setPreconditioner(boolean pc)
Sets the use of a preconditioner in this local smoothing filter.
|
public LocalSmoothingFilter()
public LocalSmoothingFilter(double small, int niter)
small
- stop when norm of residuals is less than this factor
times the norm of the input array.niter
- stop when number of iterations exceeds this limit.public LocalSmoothingFilter(double small, int niter, LocalDiffusionKernel ldk)
small
- stop when norm of residuals is less than this factor
times the norm of the input array.niter
- stop when number of iterations exceeds this limit.ldk
- the local diffusion kernel that computes y += (I+G'DG)x.public void setPreconditioner(boolean pc)
pc
- true, to use a preconditioner; false, otherwise.public void apply(float c, float[] x, float[] y)
c
- constant scale factor.x
- input array.y
- output array.public void apply(float c, float[] s, float[] x, float[] y)
c
- constant scale factor.s
- array of scale factors.x
- input array.y
- output array.public void apply(float[][] x, float[][] y)
x
- input array.y
- output array.public void apply(float c, float[][] x, float[][] y)
c
- constant scale factor.x
- input array.y
- output array.public void apply(float c, float[][] s, float[][] x, float[][] y)
c
- constant scale factor.s
- array of scale factors.x
- input array.y
- output array.public void apply(Tensors2 d, float[][] x, float[][] y)
d
- tensors.x
- input array.y
- output array.public void apply(Tensors2 d, float c, float[][] x, float[][] y)
d
- tensors.c
- constant scale factor for tensors.x
- input array.y
- output array.public void apply(Tensors2 d, float c, float[][] s, float[][] x, float[][] y)
d
- tensors.c
- constant scale factor for tensors.s
- array of scale factors for tensors.x
- input array.y
- output array.public void apply(float[][][] x, float[][][] y)
x
- input array.y
- output array.public void apply(float c, float[][][] x, float[][][] y)
c
- constant scale factor.x
- input array.y
- output array.public void apply(float c, float[][][] s, float[][][] x, float[][][] y)
c
- constant scale factor.s
- array of scale factors.x
- input array.y
- output array.public void apply(Tensors3 d, float[][][] x, float[][][] y)
d
- tensors.x
- input array.y
- output array.public void apply(Tensors3 d, float c, float[][][] x, float[][][] y)
d
- tensors.c
- constant scale factor for tensors.x
- input array.y
- output array.public void apply(Tensors3 d, float c, float[][][] s, float[][][] x, float[][][] y)
d
- tensors.c
- constant scale factor for tensors.s
- array of scale factors for tensors.x
- input array.y
- output array.public void applySmoothS(float[][] x, float[][] y)
x
- input array.y
- output array.public void applySmoothS(float[][][] x, float[][][] y)
x
- input array.y
- output array.public void applySmoothL(double kmax, float[][] x, float[][] y)
kmax
- maximum wavenumber not attenuated, in cycles/sample.x
- input array.y
- output array.public void applySmoothL(double kmax, float[][][] x, float[][][] y)
kmax
- maximum wavenumber not attenuated, in cycles/sample.x
- input array.y
- output array.