Class 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
  • Constructor Details

  • Method Details

    • doPixel

      protected float doPixel(PixelPack.PixelSlice plane, int u, int v)
      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 a PixelPack.PixelSlice container, which holds the scalar values of one image component. The method PixelPack.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 class GenericFilterScalar
      Parameters:
      plane - the scalar-valued data for a single image component
      u - the current x-position
      v - the current y-position
      Returns:
      the result of the filter calculation for this pixel
    • passesRequired

      protected final int 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 also GenericFilter.getPass().
      Overrides:
      passesRequired in class GenericFilter
      Returns:
      the required number of filter passes