public class FImageConvolveSeparable extends Object implements SinglebandImageProcessor<Float,FImage>
SinglebandImageProcessor.Processable<T,S extends Image<T,S>,I extends Image<?,I>>
Constructor and Description |
---|
FImageConvolveSeparable(float[] kernel)
Specify a single kernel to be used as the horizontal and vertical.
|
FImageConvolveSeparable(float[] hkernel,
float[] vkernel)
Specify the horizontal kernel and vertical kernel separately.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
convolveBuffer(float[] buffer,
float[] kernel) |
static void |
convolveHorizontal(FImage image,
float[] kernel)
Convolve the image in the horizontal direction with the kernel.
|
static void |
convolveVertical(FImage image,
float[] kernel)
Convolve the image in the vertical direction with the kernel.
|
static void |
fastConvolve3(FImage source,
FImage dest,
float[] kx,
float[] ky,
float[] buffer)
Fast convolution for separated 3x3 kernels.
|
void |
processImage(FImage image)
Process an image.
|
public FImageConvolveSeparable(float[] hkernel, float[] vkernel)
hkernel
- horizontal kernelvkernel
- vertical kernelpublic FImageConvolveSeparable(float[] kernel)
kernel
- both kernelspublic void processImage(FImage image)
ImageProcessor
Image.internalAssign(Image)
.processImage
in interface ImageProcessor<FImage>
image
- The image to process in place.protected static void convolveBuffer(float[] buffer, float[] kernel)
public static void convolveHorizontal(FImage image, float[] kernel)
image
- the image to convolve.kernel
- the convolution kernel.public static void convolveVertical(FImage image, float[] kernel)
image
- the image to convolve.kernel
- the convolution kernel.public static void fastConvolve3(FImage source, FImage dest, float[] kx, float[] ky, float[] buffer)
source
- the source imagedest
- the destination imagekx
- the x-kernel (can be null, implying [0 1 0] )ky
- the y-kernel (can be null, implying [0 1 0])buffer
- the working buffer (can be null, but ideally the same width as
the source image)