Class FactoryKernel

java.lang.Object
boofcv.factory.filter.kernel.FactoryKernel

public class FactoryKernel extends Object

Factory used to create standard convolution kernels for floating point and integer images. The size of a kernel is specified by its radius. The number of elements in a kernel (or its width) is equal to 2*radius+1.

Types of kernels include; Gaussian.

  • Constructor Details

    • FactoryKernel

      public FactoryKernel()
  • Method Details

    • createKernelForImage

      public static <T extends KernelBase> T createKernelForImage(int width, int offset, int DOF, ImageDataType type)
    • createKernelForImage

      public static <T extends KernelBase> T createKernelForImage(int width, int offset, int DOF, Class imageType)
    • createKernel

      public static <T extends KernelBase> T createKernel(int width, int offset, int DOF, boolean isFloat, int numBits)
    • createKernel1D

      public static Kernel1D createKernel1D(int offset, int[] data, Class kernelType)
    • setTable

      public static void setTable(KernelBase kernel)
    • table1D_S32

      public static Kernel1D_S32 table1D_S32(int radius)

      Create an integer table convolution kernel. All the elements are equal to one.

      See ConvolveImageBox for faster ways to convolve these kernels.

      Parameters:
      radius - kernel's radius.
      Returns:
      table kernel.
    • table1D_S32

      public static Kernel1D_S32 table1D_S32(int offset, int length)
    • table1D_F32

      public static Kernel1D_F32 table1D_F32(int radius, boolean normalized)

      Create an floating point table convolution kernel. If un-normalized then all the elements are equal to one, otherwise they are equal to one over the width.

      See ConvolveImageBox or ConvolveImageMean for faster ways to convolve these kernels.

      Parameters:
      radius - kernel's radius.
      Returns:
      table kernel.
    • table1D_F32

      public static Kernel1D_F32 table1D_F32(int offset, int length, boolean normalized)
    • table1D_F64

      public static Kernel1D_F64 table1D_F64(int radius, boolean normalized)
    • table1D_F64

      public static Kernel1D_F64 table1D_F64(int offset, int length, boolean normalized)
    • random

      public static <T extends KernelBase> T random(Class<?> type, int radius, int min, int max, Random rand)
      Creates a random kernel of the specified type where each element is drawn from an uniform distribution.
      Parameters:
      type - Class of the kernel which is to be created.
      radius - The kernel's radius.
      min - Min value.
      max - Max value.
      rand - Random number generator.
      Returns:
      The generated kernel.
    • random

      public static <T extends KernelBase> T random(Class<?> type, int width, int offset, int min, int max, Random rand)
    • random1D_I32

      public static Kernel1D_S32 random1D_I32(int width, int offset, int min, int max, Random rand)
      Creates a random 1D kernel drawn from a uniform distribution.
      Parameters:
      width - Kernel's width.
      offset - Offset for element zero in the kernel
      min - minimum value.
      max - maximum value.
      rand - Random number generator.
      Returns:
      Randomized kernel.
    • random1D_F32

      public static Kernel1D_F32 random1D_F32(int width, int offset, float min, float max, Random rand)
      Creates a random 1D kernel drawn from a uniform distribution.
      Parameters:
      width - Kernel's width.
      offset - Offset for element zero in the kernel
      min - minimum value.
      max - maximum value.
      rand - Random number generator.
      Returns:
      Randomized kernel.
    • random1D_F64

      public static Kernel1D_F64 random1D_F64(int width, int offset, double min, double max, Random rand)
    • random2D_I32

      public static Kernel2D_S32 random2D_I32(int width, int offset, int min, int max, Random rand)
      Creates a random 2D kernel drawn from a uniform distribution.
      Parameters:
      width - Kernel's width.
      offset - Offset for element zero in the kernel
      min - minimum value.
      max - maximum value.
      rand - Random number generator.
      Returns:
      Randomized kernel.
    • random2D_F32

      public static Kernel2D_F32 random2D_F32(int width, int offset, float min, float max, Random rand)
      Creates a random 2D kernel drawn from a uniform distribution.
      Parameters:
      width - Kernel's width.
      offset - Offset for element zero in the kernel
      min - minimum value.
      max - maximum value.
      rand - Random number generator.
      Returns:
      Randomized kernel.
    • random2D_F64

      public static Kernel2D_F64 random2D_F64(int width, int offset, double min, double max, Random rand)
      Creates a random 2D kernel drawn from a uniform distribution.
      Parameters:
      width - Kernel's width.
      offset - Offset for element zero in the kernel
      min - minimum value.
      max - maximum value.
      rand - Random number generator.
      Returns:
      Randomized kernel.
    • get1DType

      public static <K1 extends Kernel1D, K2 extends Kernel2D> Class<K1> get1DType(Class<K2> kernelType)
    • getKernelType

      public static <K extends KernelBase, T extends ImageGray> Class<K> getKernelType(ImageDataType type, int DOF)
    • getKernelType

      public static <K extends KernelBase, T extends ImageGray> Class<K> getKernelType(Class<T> imageType, int DOF)