Class GaussianKernel2D

java.lang.Object
imagingbook.common.filter.linear.Kernel2D
imagingbook.common.filter.linear.GaussianKernel2D

public class GaussianKernel2D extends Kernel2D
This class represents a 2D filter kernel.
Version:
2022/09/10
  • Constructor Details

    • GaussianKernel2D

      public GaussianKernel2D(double sigmaX, double sigmaY)
      Constructor with individual sigmas for x/y.
      Parameters:
      sigmaX - sigma for X
      sigmaY - sigma for Y
    • GaussianKernel2D

      public GaussianKernel2D(double sigma)
      Constructor with common sigma for x/y.
      Parameters:
      sigma - common sigma for X/Y
  • Method Details

    • makeGaussKernel2D

      public static float[][] makeGaussKernel2D(double sigmaX, double sigmaY)
      Creates and returns a 2D Gaussian filter kernel large enough to avoid truncation effects. The associated array is odd-sized in both dimensions. The returned kernel is normalized.
      Parameters:
      sigmaX - the width (standard deviation) of the Gaussian in x-direction
      sigmaY - the width (standard deviation) of the Gaussian in y-direction
      Returns:
      the Gaussian filter kernel
    • makeGaussKernel2D

      public static float[][] makeGaussKernel2D(double sigmaX, double sigmaY, boolean normalize)
      Creates and returns a 2D Gaussian filter kernel large enough to avoid truncation effects. The associated array is odd-sized in both dimensions. The returned kernel is optionally normalized.
      Parameters:
      sigmaX - the width (standard deviation) of the Gaussian in x-direction
      sigmaY - the width (standard deviation) of the Gaussian in y-direction
      normalize - set true to normalize the kernel
      Returns:
      the Gaussian filter kernel