@ALDAOperator(genericExecutionMode=ALL, level=APPLICATION) public class GlobalContrastStretching extends MTBOperator
This operator performs a linear global contrast stretching on the intensity histogram of the given image. Since outliers may seriously affect the stretching, fractions of outliers at the left and right margins of the histogram can be defined which are then ignored in determining the minimal and maximal intensity values in the image.
The new intensity value of a pixel is calculated by the following equation:
Note that we always assume positive image intensities here, i.e. a is always 0. In case of negative values being present in the input image the result is undefined.
Target values being larger than b or smaller than a are mapped to b and a, respectively.
More information can be found at Image Processing Learning Resources.
Modifier and Type | Field and Description |
---|---|
private MTBImage |
inImg
Input grayscale image.
|
private double |
leftOutlierFraction
Fraction of outlier pixels at left histogram margin.
|
private MTBImage |
resultImg
Result image with stretched contrast.
|
private double |
rightOutlierFraction
Fraction of outlier pixels at right histogram margin.
|
Constructor and Description |
---|
GlobalContrastStretching()
Default constructor.
|
GlobalContrastStretching(MTBImage img)
Constructor with default image.
|
Modifier and Type | Method and Description |
---|---|
MTBImage |
getResultImage()
Returns the result image.
|
protected void |
operate()
This method does the actual work.
|
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="Input Image", required=true, dataIOOrder=0, direction=IN, description="Input image.") private transient MTBImage inImg
@Parameter(label="Expected Fraction of Left Outliers", required=true, direction=IN, dataIOOrder=1, description="Lower Outlier Fraction.") private double leftOutlierFraction
@Parameter(label="Expected Fraction of Right Outliers", required=true, direction=IN, dataIOOrder=2, description="Right Outlier Fraction.") private double rightOutlierFraction
@Parameter(label="Result Image", required=true, direction=OUT, description="Result image.") private transient MTBImage resultImg
public GlobalContrastStretching() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of failure.public GlobalContrastStretching(MTBImage img) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
img
- Image to enhance.de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of failure.public MTBImage getResultImage()
protected void operate()
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.