public class SeparableKernelConvolution extends Object
| Constructor and Description |
|---|
SeparableKernelConvolution() |
| Modifier and Type | Method and Description |
|---|---|
static Convolution<NumericType<?>> |
convolution(Kernel1D... kernels)
Return an object, that performs the separable convolution with the given
kernel.
|
static Convolution<NumericType<?>> |
convolution1d(Kernel1D kernel,
int direction)
Apply a convolution only in one dimension.
|
static void |
convolve(Kernel1D[] kernels,
RandomAccessible<? extends NumericType<?>> source,
RandomAccessibleInterval<? extends NumericType<?>> target)
Convolve source with a separable kernel and write the result to output.
|
public static Convolution<NumericType<?>> convolution(Kernel1D... kernels)
ExecutorService to use or to query for the
required input image size, ...
A small example how it works:
double[][] values = { { 1, 2, 1 }, { -1, 0, 1 } }; int[] center = { 1, 1 };
Kernel1D[] sobelKernel = Kernel1D.asymmetric( values, center );
SeparableKernelConvolution.convolution( sobelKernel ).process( Views.extendBorder( inputImage ), outputImage );
Convolutionpublic static Convolution<NumericType<?>> convolution1d(Kernel1D kernel, int direction)
double[] values = { -0.5, 0, 0.5 }; int center = 1;
Kernel1D[] sobelKernel = Kernel1D.asymmetric( values, center );
SeparableKernelConvolution.convolution1d( sobelKernel, 0 ).process( Views.extendBorder( inputImage ), outputImage );
Convolutionpublic static void convolve(Kernel1D[] kernels, RandomAccessible<? extends NumericType<?>> source, RandomAccessibleInterval<? extends NumericType<?>> target)
If the target type T is DoubleType, all calculations are done in
double precision. For all other target RealTypes float
precision is used. General NumericTypes are computed
in their own precision. The source type S and target type T are either
both RealTypes or both the same type.
kernels - an array containing kernels for every dimension.source - source image, must be sufficiently padded (use e.g.
Views.extendMirrorSingle(RandomAccessibleInterval))
the required source interval.target - target image.Copyright © 2015–2022 ImgLib2. All rights reserved.