Package boofcv.factory.filter.kernel
Class FactoryKernel
java.lang.Object
boofcv.factory.filter.kernel.FactoryKernel
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends KernelBase>
TcreateKernel
(int width, int offset, int DOF, boolean isFloat, int numBits) static Kernel1D
createKernel1D
(int offset, int[] data, Class kernelType) static <T extends KernelBase>
TcreateKernelForImage
(int width, int offset, int DOF, ImageDataType type) static <T extends KernelBase>
TcreateKernelForImage
(int width, int offset, int DOF, Class imageType) static <K extends KernelBase,
T extends ImageGray>
Class<K>getKernelType
(ImageDataType type, int DOF) static <K extends KernelBase,
T extends ImageGray>
Class<K>getKernelType
(Class<T> imageType, int DOF) static <T extends KernelBase>
Tstatic <T extends KernelBase>
TCreates a random kernel of the specified type where each element is drawn from an uniform distribution.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.static Kernel1D_F64
random1D_F64
(int width, int offset, double min, double max, Random rand) 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.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.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.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.static void
setTable
(KernelBase kernel) static Kernel1D_F32
table1D_F32
(int radius, boolean normalized) Create an floating point table convolution kernel.static Kernel1D_F32
table1D_F32
(int offset, int length, boolean normalized) static Kernel1D_F64
table1D_F64
(int radius, boolean normalized) static Kernel1D_F64
table1D_F64
(int offset, int length, boolean normalized) static Kernel1D_S32
table1D_S32
(int radius) Create an integer table convolution kernel.static Kernel1D_S32
table1D_S32
(int offset, int length)
-
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
-
setTable
-
table1D_S32
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
-
table1D_F32
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
orConvolveImageMean
for faster ways to convolve these kernels.- Parameters:
radius
- kernel's radius.- Returns:
- table kernel.
-
table1D_F32
-
table1D_F64
-
table1D_F64
-
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
Creates a random 1D kernel drawn from a uniform distribution.- Parameters:
width
- Kernel's width.offset
- Offset for element zero in the kernelmin
- minimum value.max
- maximum value.rand
- Random number generator.- Returns:
- Randomized kernel.
-
random1D_F32
Creates a random 1D kernel drawn from a uniform distribution.- Parameters:
width
- Kernel's width.offset
- Offset for element zero in the kernelmin
- minimum value.max
- maximum value.rand
- Random number generator.- Returns:
- Randomized kernel.
-
random1D_F64
-
random2D_I32
Creates a random 2D kernel drawn from a uniform distribution.- Parameters:
width
- Kernel's width.offset
- Offset for element zero in the kernelmin
- minimum value.max
- maximum value.rand
- Random number generator.- Returns:
- Randomized kernel.
-
random2D_F32
Creates a random 2D kernel drawn from a uniform distribution.- Parameters:
width
- Kernel's width.offset
- Offset for element zero in the kernelmin
- minimum value.max
- maximum value.rand
- Random number generator.- Returns:
- Randomized kernel.
-
random2D_F64
Creates a random 2D kernel drawn from a uniform distribution.- Parameters:
width
- Kernel's width.offset
- Offset for element zero in the kernelmin
- minimum value.max
- maximum value.rand
- Random number generator.- Returns:
- Randomized kernel.
-
get1DType
-
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)
-