T
- the type of the target image.public class PeronaMalikAnisotropicDiffusion<T extends RealType<T>> extends MultiThreadedBenchmarkAlgorithm
Perona and Malik. Scale-Space and Edge Detection Using Anisotropic Diffusion. IEEE Transactions on Pattern Analysis and Machine Intelligence (1990) vol. 12 pp. 629-639
process()
method does only one iteration of the process on the given
image. This allow to change all parameters at each iteration if desired.
This implementation is dimension generic: the filtering is done considering a 3x3 neighborhood for a 2D image, a 3x3x3 neighborhood for a 3D image, and so on.
For every pixel of the image, the contribution
of all close neighbors in a cube (whatever is the dimensionality) around the central pixel
is considered. Image gradient is evaluated by finite differences in direction of the neighbor
currently inspected. The value of this component of the gradient is used to compute the
diffusion coefficient, through a function that must implements the PeronaMalikAnisotropicDiffusion.DiffusionFunction
interface. Users can specify their own function. Two functions are offered, taken from
Perona and Malik original paper: PeronaMalikAnisotropicDiffusion.StrongEdgeEnhancer
and PeronaMalikAnisotropicDiffusion.WideRegionEnhancer
.
This implementation is multithreaded; the number of used thread can
be specified with the MultiThreadedAlgorithm.setNumThreads(int)
or MultiThreadedAlgorithm.setNumThreads()
methods.
Modifier and Type | Class and Description |
---|---|
static interface |
PeronaMalikAnisotropicDiffusion.DiffusionFunction
The interface that function suitable to be diffusion function must implement.
|
static class |
PeronaMalikAnisotropicDiffusion.StrongEdgeEnhancer
The first diffusion function proposed by Perona & Malik.
|
static class |
PeronaMalikAnisotropicDiffusion.WideRegionEnhancer
The second diffusion function proposed by Perona & Malik.
|
processingTime
errorMessage, numThreads
Constructor and Description |
---|
PeronaMalikAnisotropicDiffusion(Img<T> image,
double deltat,
double kappa)
Instantiate the Perona & Malik anisotropic diffusion process, with the default strong-edge
diffusion function.
|
PeronaMalikAnisotropicDiffusion(Img<T> img,
double deltat,
PeronaMalikAnisotropicDiffusion.DiffusionFunction function)
Instantiate the Perona & Malik anisotropic diffusion process, with a custom diffusion function.
|
PeronaMalikAnisotropicDiffusion(RandomAccessibleInterval<T> image,
ImgFactory<FloatType> factory,
double deltat,
double kappa)
Instantiate the Perona & Malik anisotropic diffusion process, with the default strong-edge
diffusion function.
|
PeronaMalikAnisotropicDiffusion(RandomAccessibleInterval<T> image,
ImgFactory<FloatType> factory,
double deltat,
PeronaMalikAnisotropicDiffusion.DiffusionFunction function)
Instantiate the Perona & Malik anisotropic diffusion process, with a custom diffusion function.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkInput() |
protected static <T extends RealType<T>> |
copy(RandomAccessibleInterval<T> input,
ImgFactory<FloatType> factory)
|
static <T extends RealType<T>> |
inFloatInPlace(Img<T> input,
double deltat,
double kappa) |
static <T extends RealType<T>> |
inFloatInPlace(Img<T> input,
double deltat,
PeronaMalikAnisotropicDiffusion.DiffusionFunction function) |
static <T extends RealType<T>> |
inFloatInPlace(RandomAccessibleInterval<T> input,
ImgFactory<FloatType> factory,
double deltat,
double kappa) |
static <T extends RealType<T>> |
inFloatInPlace(RandomAccessibleInterval<T> input,
ImgFactory<FloatType> factory,
double deltat,
PeronaMalikAnisotropicDiffusion.DiffusionFunction function) |
boolean |
process()
Execute one step of the numerical integration scheme.
|
void |
setDeltaT(float deltat)
Set the integration constant value for the numerical integration scheme.
|
void |
setDiffusionFunction(PeronaMalikAnisotropicDiffusion.DiffusionFunction function)
Set the diffusion function used to compute conduction coefficients.
|
static <T extends RealType<T>> |
toFloat(Img<T> input,
double deltat,
double kappa) |
static <T extends RealType<T>> |
toFloat(Img<T> input,
double deltat,
PeronaMalikAnisotropicDiffusion.DiffusionFunction function) |
static <T extends RealType<T>> |
toFloat(RandomAccessibleInterval<T> input,
ImgFactory<FloatType> factory,
double deltat,
double kappa) |
static <T extends RealType<T>> |
toFloat(RandomAccessibleInterval<T> input,
ImgFactory<FloatType> factory,
double deltat,
PeronaMalikAnisotropicDiffusion.DiffusionFunction function) |
getProcessingTime
getErrorMessage, getNumThreads, setNumThreads, setNumThreads
public PeronaMalikAnisotropicDiffusion(Img<T> img, double deltat, PeronaMalikAnisotropicDiffusion.DiffusionFunction function)
img
- the target image, will be modified in placedeltat
- the integration constant for the numerical integration scheme. Typically less that 1.function
- the custom diffusion function.PeronaMalikAnisotropicDiffusion.DiffusionFunction
public PeronaMalikAnisotropicDiffusion(RandomAccessibleInterval<T> image, ImgFactory<FloatType> factory, double deltat, PeronaMalikAnisotropicDiffusion.DiffusionFunction function)
image
- the target image, will be modified in placedeltat
- the integration constant for the numerical integration scheme. Typically less that 1.function
- the custom diffusion function.PeronaMalikAnisotropicDiffusion.DiffusionFunction
public PeronaMalikAnisotropicDiffusion(Img<T> image, double deltat, double kappa)
image
- the target image, will be modified in placedeltat
- the integration constant for the numerical integration scheme. Typically less that 1.kappa
- the constant for the diffusion function that sets its gradient thresholdPeronaMalikAnisotropicDiffusion.StrongEdgeEnhancer
public PeronaMalikAnisotropicDiffusion(RandomAccessibleInterval<T> image, ImgFactory<FloatType> factory, double deltat, double kappa)
image
- the target image, will be modified in placedeltat
- the integration constant for the numerical integration scheme. Typically less that 1.kappa
- the constant for the diffusion function that sets its gradient thresholdPeronaMalikAnisotropicDiffusion.StrongEdgeEnhancer
public boolean checkInput()
public boolean process()
public void setDeltaT(float deltat)
deltat
- public void setDiffusionFunction(PeronaMalikAnisotropicDiffusion.DiffusionFunction function)
public static final <T extends RealType<T>> Img<FloatType> toFloat(Img<T> input, double deltat, PeronaMalikAnisotropicDiffusion.DiffusionFunction function)
public static final <T extends RealType<T>> Img<FloatType> toFloat(Img<T> input, double deltat, double kappa)
public static final <T extends RealType<T>> Img<FloatType> toFloat(RandomAccessibleInterval<T> input, ImgFactory<FloatType> factory, double deltat, PeronaMalikAnisotropicDiffusion.DiffusionFunction function)
public static final <T extends RealType<T>> Img<FloatType> toFloat(RandomAccessibleInterval<T> input, ImgFactory<FloatType> factory, double deltat, double kappa)
public static final <T extends RealType<T>> void inFloatInPlace(Img<T> input, double deltat, PeronaMalikAnisotropicDiffusion.DiffusionFunction function)
public static final <T extends RealType<T>> void inFloatInPlace(Img<T> input, double deltat, double kappa)
public static final <T extends RealType<T>> void inFloatInPlace(RandomAccessibleInterval<T> input, ImgFactory<FloatType> factory, double deltat, PeronaMalikAnisotropicDiffusion.DiffusionFunction function)
public static final <T extends RealType<T>> void inFloatInPlace(RandomAccessibleInterval<T> input, ImgFactory<FloatType> factory, double deltat, double kappa)
protected static final <T extends RealType<T>> Img<FloatType> copy(RandomAccessibleInterval<T> input, ImgFactory<FloatType> factory)
Copyright © 2015–2022 ImgLib2. All rights reserved.