de.unihalle.informatik.MiToBo.segmentation.thresholds
Class HysteresisThresholding

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.MiToBo.core.operator.MTBOperator
          extended by de.unihalle.informatik.MiToBo.segmentation.thresholds.HysteresisThresholding
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator, de.unihalle.informatik.Alida.operator.events.ALDOperatorExecutionProgressEventListener, EventListener

@ALDAOperator(genericExecutionMode=ALL,
              level=APPLICATION)
public class HysteresisThresholding
extends MTBOperator

Hysteresis thresholding on gray-scale images.

This thresholding scheme applies two thresholds $t_{l}$ and $t_{h}$ to the image. All pixels having an intensity value equal or larger than $t_{h}$ are assigned to the foreground. In addition, also pixels with an intensity value equal or higher to the lower threshold are included in the foreground if they transitively link to a pixel with an intensity value equal or larger than $t_{h}$.

This thresholding heuristic is, e.g., used in the Canny edge detector.

Author:
moeller

Nested Class Summary
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
protected  MTBImage inImg
          Image to process.
protected  MTBImageByte resultImage
          Resulting binarized image.
protected  Double threshHigh
          Upper threshold.
protected  Double threshLow
          Lower threshold.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider
 
Constructor Summary
HysteresisThresholding()
          Standard constructor.
 
Method Summary
 MTBImageByte getResultImage()
          Returns the result image.
protected static void labelNeighbors(MTBImage img, MTBImage result, boolean[][] procMap, int x, int y, double tl, double th)
          Function for recursive labeling of foreground pixels.
protected  void operate()
           
 void setHigherThreshold(double d)
          Specify higher threshold.
 void setInputImage(MTBImage image)
          Set input image.
 void setLowerThreshold(double d)
          Specify lower threshold.
 
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator
readResolve
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
addOperatorExecutionProgressEventListener, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getHidingMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, runOp, runOp, runOp, setConstructionMode, setHidingMode, setName, setParameter, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inImg

@Parameter(label="Input Image",
           required=true,
           dataIOOrder=0,
           direction=IN,
           description="Input image.")
protected transient MTBImage inImg
Image to process.


threshHigh

@Parameter(label="Upper Threshold",
           required=true,
           dataIOOrder=1,
           direction=IN,
           description="Higher threshold.")
protected Double threshHigh
Upper threshold.


threshLow

@Parameter(label="Lower Threshold",
           required=true,
           dataIOOrder=2,
           direction=IN,
           description="Lower threshold.")
protected Double threshLow
Lower threshold.


resultImage

@Parameter(label="Thresholded Image",
           direction=OUT,
           description="Thresholded binary image.")
protected transient MTBImageByte resultImage
Resulting binarized image.

Constructor Detail

HysteresisThresholding

public HysteresisThresholding()
                       throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Standard constructor. A new empty operator object is initialized.

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

operate

protected void operate()
Specified by:
operate in class de.unihalle.informatik.Alida.operator.ALDOperator

labelNeighbors

protected static void labelNeighbors(MTBImage img,
                                     MTBImage result,
                                     boolean[][] procMap,
                                     int x,
                                     int y,
                                     double tl,
                                     double th)
Function for recursive labeling of foreground pixels.

Refer to the hysteresis threshold algorithm for details.

Parameters:
img - Input image.
result - Binary result image.
procMap - Map to remember pixels already processed.
x - Current x-position.
y - Current y-position.
tl - Lower threshold.
th - Higher threshold.

setInputImage

public void setInputImage(MTBImage image)
Set input image.

Parameters:
image - Image to process.

setLowerThreshold

public void setLowerThreshold(double d)
Specify lower threshold.

Parameters:
d - Threshold value.

setHigherThreshold

public void setHigherThreshold(double d)
Specify higher threshold.

Parameters:
d - Threshold value.

getResultImage

public MTBImageByte getResultImage()
Returns the result image.

Returns:
Binary result image.


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.