@ALDAOperator(genericExecutionMode=ALL, level=STANDARD, allowBatchMode=true) public class GradientFieldNonMaxSuppression extends MTBOperator
The input image is expected to include at least two channels, the first one with the components of the gradient field in x-direction and the second one with the components of the field in y-direction.
The operator first extracts pixel-wise gradient magnitudes and directions from the given input image channels and then removes all non-maximal gradients, e.g. sets the corresponding pixel positions in the result magnitude image to zero. Note that the gradient direction is discritized into intervals of 45 degrees for this procedure.
After non-maximum suppression an optional hysteresis thresholding may be applied which removes all pixels with gradient magnitudes below a lower threshold or lying between the upper and lower threshold but not being linked by a path to a pixel exceeding the upper threshold.
As result a gradient magnitude image is returned which only contains values different from zero at positions with locally maximal gradients and which survived the (optional) hysteresis thresholding step.
Modifier and Type | Field and Description |
---|---|
private boolean |
doHysteresisThresholding
Flag to enable/disable additional hysteresis thresholding.
|
private MTBImageDouble |
resultImage
Resulting thinned (and thresholded) magnitude image.
|
private MTBImage |
vectorFieldImage
Image with input 2D gradient field.
|
Constructor and Description |
---|
GradientFieldNonMaxSuppression()
Standard constructor.
|
Modifier and Type | Method and Description |
---|---|
protected MTBImageDouble |
doHS(MTBImageDouble magImg)
Does the hysteresis thresholding.
|
protected MTBImageDouble |
doNMS()
Applies non-maximum-suppression to the input data.
|
MTBImageDouble |
getResultImage()
Returns the result image.
|
protected static void |
labelNeighbors(MTBImage magImg,
MTBImage hsImg,
int x,
int y,
double lt,
double ht)
Function for recursive labeling of contour pixels.
|
protected void |
operate() |
readResolve
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="Gradient Vector Field Image", required=true, direction=IN, dataIOOrder=0, description="Gradient field image.") private transient MTBImage vectorFieldImage
@Parameter(label="Do hysteresis thresholding?", required=true, direction=IN, dataIOOrder=1, description="Enable/disable additional hysteresis thresholding.") private boolean doHysteresisThresholding
@Parameter(label="Thinned and thresholded magnitude image.", direction=OUT, description="Resulting magnitude image") private transient MTBImageDouble resultImage
public GradientFieldNonMaxSuppression() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of failure.protected void operate()
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
protected MTBImageDouble doNMS()
protected MTBImageDouble doHS(MTBImageDouble magImg)
magImg
- Image with gradient magnitudes.protected static void labelNeighbors(MTBImage magImg, MTBImage hsImg, int x, int y, double lt, double ht)
Refer to the hysteresis threshold algorithm for details.
magImg
- Image with gradient magnitudes.hsImg
- Current hysteresis filtered image.x
- Current x-position.y
- Current y-position.lt
- Lower threshold.ht
- Higher threshold.public MTBImageDouble getResultImage()
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.