public class Kernel extends AbstractDescriptor
ImageProcessor.convolve(float[], int, int)
Descriptor.Supports
Modifier and Type | Field and Description |
---|---|
static float[] |
PREWITT
3x3 PREWITT mask (-1, 0, 1, ...)
|
static float[] |
SCHARR
Standard 3x3 SCHARR mask (1 0 -1, 2, 0, -2, 1, 0, -1 )
See http://en.wikipedia.org/wiki/Sobel_operator
|
static float[] |
SOBEL
Standard 3x3 SOBEL mask (1 0 -1, 2, 0, -2, 1, 0, -1 )
See http://en.wikipedia.org/wiki/Sobel_operator
|
DOES_ALL
Constructor and Description |
---|
Kernel()
Constructs a new detector with standart Sobel kernel
|
Kernel(double[] kernel)
Constructs a new detector with given double[] kernel.
|
Kernel(float[] kernel)
Constructs a new detector with given float[] kernel and according width.
|
Kernel(float[] kernel,
int width)
Constructs a new detector with given float[] kernel and according width.
|
Modifier and Type | Method and Description |
---|---|
float[] |
getKernel()
Return the convolution kernel before transformation
|
int |
getKernelWidth()
Returns width of the kernel
|
int |
getTreshold()
Returns treshold
|
void |
process()
Proceses the image applying the kernel in x- and y-direction
|
void |
run(ij.process.ImageProcessor ip)
Start processing of this algorithm on the given image processor.
|
void |
setKernel(float[] kernel)
Sets the convolution kernel (must be odd sized).
|
void |
setKernelWidth(int kernelWidth)
Deprecated.
since 1.5.0
|
void |
setTreshold(int treshold)
Setter for treshold, default zero
|
EnumSet<Descriptor.Supports> |
supports()
Defines the capability of the algorithm.
|
addPropertyChangeListener, endProgress, setProperties, startProgress
public static final float[] SOBEL
public static final float[] SCHARR
public static final float[] PREWITT
public Kernel()
public Kernel(double[] kernel)
kernel
- double[] with kernelpublic Kernel(float[] kernel)
kernel
- float[] with kernelpublic Kernel(float[] kernel, int width)
kernel
- float[] with kernelwidth
- width of kernelpublic float[] getKernel()
public void setKernel(float[] kernel)
kernel
- float[] with kernelIllegalArgumentException
- if the size is evenpublic int getKernelWidth()
@Deprecated public void setKernelWidth(int kernelWidth)
kernelWidth
- int with widthpublic int getTreshold()
public void setTreshold(int treshold)
treshold
- public void process()
public EnumSet<Descriptor.Supports> supports()
PlugInFilter
,
supports()
public void run(ij.process.ImageProcessor ip)
Descriptor
ip
- ImageProcessor of the source imageCopyright © 2013. All Rights Reserved.