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

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.CalcGlobalThreshOtsu
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator

@ALDAOperator(genericExecutionMode=ALL)
public class CalcGlobalThreshOtsu
extends MTBOperator

This class implements routines to calculate Otsu's threshold from given grayscale images.

Basically, a threshold is extracted that separates the image histogram in two classes, more or less equal in size and well-separated in terms of their average intensities.

Otsu thresholding is based on the following goal function,

%preamble{\usepackage{amssymb}}
which is to be maximized with regard to threshold T.

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
private  MTBImageHistogram inHisto
          Input image.
private  MTBImage inImg
          Input image.
private  MTBDoubleData threshold
          Result threshold.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, portHashAccess, verbose, versionProvider
 
Constructor Summary
CalcGlobalThreshOtsu()
          Default constructor.
CalcGlobalThreshOtsu(MTBImage img)
          Default constructor with input image as argument.
CalcGlobalThreshOtsu(MTBImageHistogram histo)
          Default constructor with input histogram as argument.
 
Method Summary
private  MTBDoubleData calcThreshold(MTBImage image)
          Calculate Otsu threshold on given image.
private  MTBDoubleData calcThreshold(MTBImageHistogram histo)
          Calculate Otsu threshold on given histogram.
 MTBDoubleData getOtsuThreshold()
          Get the resulting threshold.
protected  void operate()
           
 void validateCustom()
           
 
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator
readResolve
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
deserializeFromXmlFile, fieldContained, getALDPortHashAccessKey, getConstructionMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, isConfigured, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, runOp, runOp, runOp, serializeToXmlFile, setConstructionMode, setName, setParameter, setParametersFromXml, setParametersFromXml, setVerbose, toStringVerbose, unconfiguredItems, validate, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inHisto

@Parameter(label="Input Histogram",
           required=false,
           supplemental=false,
           dataIOOrder=-1,
           direction=IN,
           description="Input histogram")
private MTBImageHistogram inHisto
Input image.


inImg

@Parameter(label="Input Image",
           required=false,
           supplemental=false,
           dataIOOrder=-2,
           direction=IN,
           description="Input image")
private transient MTBImage inImg
Input image.


threshold

@Parameter(label="Threshold",
           supplemental=false,
           direction=OUT,
           description="Result threshold")
private MTBDoubleData threshold
Result threshold.

Constructor Detail

CalcGlobalThreshOtsu

public CalcGlobalThreshOtsu()
                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Default constructor.

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

CalcGlobalThreshOtsu

public CalcGlobalThreshOtsu(MTBImage img)
                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Default constructor with input image as argument.

Parameters:
img - Input image.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

CalcGlobalThreshOtsu

public CalcGlobalThreshOtsu(MTBImageHistogram histo)
                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Default constructor with input histogram as argument.

Parameters:
histo - Input histogram.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

calcThreshold

private MTBDoubleData calcThreshold(MTBImage image)
Calculate Otsu threshold on given image.

Parameters:
image - MiToBo image.
Returns:
Calculated Otsu threshold.

calcThreshold

private MTBDoubleData calcThreshold(MTBImageHistogram histo)
Calculate Otsu threshold on given histogram.

Parameters:
histo - Histogram.
Returns:
Calculated Otsu threshold.

getOtsuThreshold

public MTBDoubleData getOtsuThreshold()
Get the resulting threshold.

Returns:
Otsu threshold.

operate

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

validateCustom

public void validateCustom()
                    throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Overrides:
validateCustom in class de.unihalle.informatik.Alida.operator.ALDOperator
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException