@ALDDerivedClass @ALDAOperator(genericExecutionMode=ALL, level=APPLICATION) public class GaborFilter2D extends OrientedFilter2D
The implementation is based on the following definition of the Gabor family:
The only difference is the scaling factor of the Gaussian which is sometimes omitted.
The filter mask is rotated by transforming the x and y coordinates as follows:
Modifier and Type | Class and Description |
---|---|
protected static class |
GaborFilter2D.KernelPart
Allows to request kernel masks for real and complex parts independently.
|
static class |
GaborFilter2D.ResultType
Reponse mode.
|
OrientedFilter2D.ApplicationMode
Modifier and Type | Field and Description |
---|---|
protected double |
frequency
Filter frequency.
|
protected double |
gaussStdDevX
Standard deviation of the Gaussian in x.
|
protected double |
gaussStdDevY
Standard deviation of the Gaussian in x.
|
protected boolean |
invertMask
Flag to invert filter mask.
|
protected int |
kernelSize
Size of the (squared) kernel window.
|
protected GaborFilter2D.KernelPart |
kPart
Variable to configure which part of kernel mask is calculated.
|
protected GaborFilter2D.ResultType |
resultType
Desired type of result.
|
angle, inputImg, mode, resultImg, statusListeners
Constructor and Description |
---|
GaborFilter2D()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected MTBImageDouble |
getComplexKernel(double _angle)
Generates the sinus filter mask of the complex part of the Gabor filter.
|
protected MTBImageDouble |
getGaussianKernel(double _angle)
Generates the Gaussian part of the Gabor kernel for a given orientation.
|
MTBImageDouble |
getKernel(double _angle)
Calculates kernel for given angle and pre-defined sigmas.
|
protected MTBImageDouble |
getRealKernel(double _angle)
Generates the cosine filter mask of the complex part of the Gabor filter.
|
protected void |
operate() |
protected Object |
readResolve()
Init function for deserialized objects.
|
void |
setFrequency(double f)
Specify frequency.
|
void |
setInvertMask(boolean b)
Enable/disable inversion of mask.
|
protected void |
setKernelPart(GaborFilter2D.KernelPart k)
Specify which kernel part should be generated.
|
void |
setKernelSize(int s)
Specify size of the kernel.
|
void |
setResultType(GaborFilter2D.ResultType t)
Specify result type.
|
void |
setSigmaX(double sx)
Specify Gaussian standard deviation in x.
|
void |
setSigmaY(double sy)
Specify Gaussian standard deviation in y.
|
addStatusListener, getApplicationMode, getResultImage, notifyListeners, removeStatusListener, setAngle, setInputImage
addOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getDocumentation, getHidingMode, getInactiveParameterNames, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterDescriptorUnconditioned, getParameterNames, getParameterUnconditioned, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, hasInOutParameters, hasParameter, isAnnotatedParameter, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, removeParameter, runOp, runOp, runOp, setConstructionMode, setConstructionMode, setConstructionMode, setHidingMode, setName, setParameter, setParameterUnconditioned, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory
@Parameter(label="\u03c3 of Gaussian in x", required=false, dataIOOrder=2, direction=IN, mode=STANDARD, description="Std. deviation of Gaussian in x.") protected double gaussStdDevX
The mask width is derived from the standard deviation of the Gaussian,
i.e. the width is given by
$w = 2 \cdot (\text{int})(2 \cdot \sigma + 0.5)+1$.
Note that the minimum width is 3.
@Parameter(label="\u03c3 of Gaussian in y", required=false, dataIOOrder=3, direction=IN, mode=STANDARD, description="Std. deviation of Gaussian in y.") protected double gaussStdDevY
The mask width is derived from the standard deviation of the Gaussian,
i.e. the width is given by
$w = 2 \cdot (\text{int})(2 \cdot \sigma + 0.5)+1$.
Note that the minimum width is 3.
@Parameter(label="Filter Frequency \u03c6", required=true, direction=IN, mode=STANDARD, description="Frequency of the filter.", dataIOOrder=3) protected double frequency
@Parameter(label="Invert Mask", required=false, dataIOOrder=4, direction=IN, mode=STANDARD, description="If true, filter mask is inverted.") protected boolean invertMask
@Parameter(label="Result Type", required=false, dataIOOrder=6, direction=IN, mode=STANDARD, description="Type of desired result.") protected GaborFilter2D.ResultType resultType
@Parameter(label="Kernel Size", required=false, dataIOOrder=5, direction=IN, mode=STANDARD, description="Size of kernel window, if set to -1 it\'s determined automatically.") protected int kernelSize
If set to -1, the size is automatically derived from the given standard deviations in x and y.
protected GaborFilter2D.KernelPart kPart
This variable is mainly used internally for generating parts of the Gabor filter mask independently, and for unit testing. Due to this the variable is not annotated as parameter.
public GaborFilter2D() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected Object readResolve()
MTBOperator
This function is called on an instance of this class being deserialized from file, prior to handing the instance over to the user. It takes care of a proper initialization of transient member variables as they are not initialized to the default values during deserialization.
readResolve
in class OrientedFilter2D
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate
in class OrientedFilter2D
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public MTBImageDouble getKernel(double _angle)
Dependend on the value of this.kPart either the real or the complex part of the kernel mask is returned.
getKernel
in class OrientedFilter2D
_angle
- Rotation angle in degrees.protected MTBImageDouble getGaussianKernel(double _angle)
_angle
- Filter orientation.protected MTBImageDouble getRealKernel(double _angle)
_angle
- Orientation of the filter.protected MTBImageDouble getComplexKernel(double _angle)
_angle
- Filter orientation.public void setSigmaX(double sx)
sx
- Standard deviation.public void setSigmaY(double sy)
sy
- Standard deviation.public void setFrequency(double f)
f
- Frequency.public void setResultType(GaborFilter2D.ResultType t)
t
- Desired type of result.public void setInvertMask(boolean b)
b
- Flag for inversion.public void setKernelSize(int s)
s
- Size to apply.protected void setKernelPart(GaborFilter2D.KernelPart k)
k
- Part of kernel to apply, i.e. real or complex part.Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.