Module imagingbook.common
Class PeronaMalikFilterScalar
java.lang.Object
imagingbook.common.filter.generic.GenericFilter
imagingbook.common.filter.generic.GenericFilterScalar
imagingbook.common.filter.edgepreserving.PeronaMalikFilterScalar
- All Implemented Interfaces:
PeronaMalikF
,ProgressReporter
Scalar version of the Perona-Malik filter, without gradient array. This code is based on the Anisotropic Diffusion filter proposed by Perona and Malik, as proposed in [1]. See Sec. 17.3.2 of [2] for additional details. The filter operates on all types of grayscale (scalar) and RGB color images. Consult the source code of the related ImageJ plugins for examples.
[1] Pietro Perona and Jitendra Malik, "Scale-space and edge detection using anisotropic diffusion", IEEE Transactions
on Pattern Analysis and Machine Intelligence, vol. 12, no. 4, pp. 629-639 (July 1990).
[2] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer
(2022).
- Version:
- 2021/01/02
-
Nested Class Summary
Nested classes/interfaces inherited from interface imagingbook.common.filter.edgepreserving.PeronaMalikF
PeronaMalikF.ColorMode, PeronaMalikF.ConductanceFunction, PeronaMalikF.Parameters
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected float
doPixel
(PixelPack.PixelSlice plane, int u, int v) This method defines the steps to be performed for a single image pixel and must be implemented by any concrete sub-class.protected final int
Returns the necessary number of passes, which may change during execution of the filter.Methods inherited from class imagingbook.common.filter.generic.GenericFilterScalar
reportProgress, runPass
Methods inherited from class imagingbook.common.filter.generic.GenericFilter
abort, applyTo, applyTo, applyTo, closeFilter, getDepth, getHeight, getPass, getProgress, getWidth, initFilter, initPass, reportProgress
-
Constructor Details
-
PeronaMalikFilterScalar
public PeronaMalikFilterScalar() -
PeronaMalikFilterScalar
-
-
Method Details
-
doPixel
Description copied from class:GenericFilterScalar
This method defines the steps to be performed for a single image pixel and must be implemented by any concrete sub-class. The source data are passed as aPixelPack.PixelSlice
container, which holds the scalar values of one image component. The methodPixelPack.PixelSlice.getVal(int, int)
should be used to read individual pixel values. These data should not be modified but the (float) result of the single-pixel calculation must be returned.- Specified by:
doPixel
in classGenericFilterScalar
- Parameters:
plane
- the scalar-valued data for a single image componentu
- the current x-positionv
- the current y-position- Returns:
- the result of the filter calculation for this pixel
-
passesRequired
Description copied from class:GenericFilter
Returns the necessary number of passes, which may change during execution of the filter. The value 1 is returned by default. Multi-pass filters must override this method. The filter terminates as soon as the requested number of passes is reached. This this method can be used to terminate filter execution once some desired state has been reached (e.g., convergence). See alsoGenericFilter.getPass()
.- Overrides:
passesRequired
in classGenericFilter
- Returns:
- the required number of filter passes
-