public class FactoryKernel
extends java.lang.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 and Description |
|---|
FactoryKernel() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends KernelBase> |
createKernel(int width,
int offset,
int DOF,
boolean isFloat,
int numBits) |
static <T extends KernelBase> |
createKernelForImage(int width,
int offset,
int DOF,
java.lang.Class imageType) |
static <K1 extends Kernel1D,K2 extends Kernel2D> |
get1DType(java.lang.Class<K2> kernelType) |
static <K extends KernelBase,T extends ImageSingleBand> |
getKernelType(java.lang.Class<T> imageType,
int DOF) |
static <T extends KernelBase> |
random(java.lang.Class<?> type,
int width,
int offset,
int min,
int max,
java.util.Random rand) |
static <T extends KernelBase> |
random(java.lang.Class<?> type,
int radius,
int min,
int max,
java.util.Random rand)
Creates 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,
java.util.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,
java.util.Random rand) |
static Kernel1D_I32 |
random1D_I32(int width,
int offset,
int min,
int max,
java.util.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,
java.util.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,
java.util.Random rand)
Creates a random 2D kernel drawn from a uniform distribution.
|
static Kernel2D_I32 |
random2D_I32(int width,
int offset,
int min,
int max,
java.util.Random rand)
Creates a random 2D kernel drawn from a uniform distribution.
|
static Kernel1D_F32 |
table1D_F32(int radius,
boolean normalized)
Create an floating point table convolution kernel.
|
static Kernel1D_F64 |
table1D_F64(int radius,
boolean normalized) |
static Kernel1D_I32 |
table1D_I32(int radius)
Create an integer table convolution kernel.
|
public static <T extends KernelBase> T createKernelForImage(int width, int offset, int DOF, java.lang.Class imageType)
public static <T extends KernelBase> T createKernel(int width, int offset, int DOF, boolean isFloat, int numBits)
public static Kernel1D_I32 table1D_I32(int radius)
Create an integer table convolution kernel. All the elements are equal to one.
See ConvolveImageBox for faster ways to convolve these kernels.
radius - kernel's radius.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.
radius - kernel's radius.public static Kernel1D_F64 table1D_F64(int radius, boolean normalized)
public static <T extends KernelBase> T random(java.lang.Class<?> type, int radius, int min, int max, java.util.Random rand)
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.public static <T extends KernelBase> T random(java.lang.Class<?> type, int width, int offset, int min, int max, java.util.Random rand)
public static Kernel1D_I32 random1D_I32(int width, int offset, int min, int max, java.util.Random rand)
width - Kernel's width.offset - Offset for element zero in the kernelmin - minimum value.max - maximum value.rand - Random number generator.public static Kernel1D_F32 random1D_F32(int width, int offset, float min, float max, java.util.Random rand)
width - Kernel's width.offset - Offset for element zero in the kernelmin - minimum value.max - maximum value.rand - Random number generator.public static Kernel1D_F64 random1D_F64(int width, int offset, double min, double max, java.util.Random rand)
public static Kernel2D_I32 random2D_I32(int width, int offset, int min, int max, java.util.Random rand)
width - Kernel's width.offset - Offset for element zero in the kernelmin - minimum value.max - maximum value.rand - Random number generator.public static Kernel2D_F32 random2D_F32(int width, int offset, float min, float max, java.util.Random rand)
width - Kernel's width.offset - Offset for element zero in the kernelmin - minimum value.max - maximum value.rand - Random number generator.public static Kernel2D_F64 random2D_F64(int width, int offset, double min, double max, java.util.Random rand)
width - Kernel's width.offset - Offset for element zero in the kernelmin - minimum value.max - maximum value.rand - Random number generator.public static <K1 extends Kernel1D,K2 extends Kernel2D> java.lang.Class<K1> get1DType(java.lang.Class<K2> kernelType)
public static <K extends KernelBase,T extends ImageSingleBand> java.lang.Class<K> getKernelType(java.lang.Class<T> imageType, int DOF)