public static <T extends KernelBase> T createKernelForImage( int width , int offset, int DOF , Class imageType ) { boolean isFloat = GeneralizedImageOps.isFloatingPoint(imageType); int numBits = Math.max(32, GeneralizedImageOps.getNumBits(imageType)); return createKernel(width,offset,DOF,isFloat,numBits); }
/** * Creates a 2D Gaussian kernel of the specified type. * * @param imageType The type of image which is to be convolved by this kernel. * @param sigma The distributions stdev. If ≤ 0 then the sigma will be computed from the radius. * @param radius Number of pixels in the kernel's radius. If ≤ 0 then the sigma will be computed from the sigma. * @return The computed Gaussian kernel. */ public static <T extends ImageGray<T>, K extends Kernel2D> K gaussian2D(Class<T> imageType, double sigma, int radius ) { boolean isFloat = GeneralizedImageOps.isFloatingPoint(imageType); int numBits = Math.max(32, GeneralizedImageOps.getNumBits(imageType)); return gaussian(2,isFloat, numBits, sigma,radius); }
/** * Creates a 1D Gaussian kernel of the specified type. * * @param imageType The type of image which is to be convolved by this kernel. * @param sigma The distributions stdev. If ≤ 0 then the sigma will be computed from the radius. * @param radius Number of pixels in the kernel's radius. If ≤ 0 then the sigma will be computed from the sigma. * @return The computed Gaussian kernel. */ public static <T extends ImageGray<T>, K extends Kernel1D> K gaussian1D(Class<T> imageType, double sigma, int radius ) { boolean isFloat = GeneralizedImageOps.isFloatingPoint(imageType); int numBits = GeneralizedImageOps.getNumBits(imageType); if( numBits < 32 ) numBits = 32; return gaussian(1,isFloat, numBits, sigma,radius); }