|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.MiToBo.core.operator.MTBOperator
de.unihalle.informatik.MiToBo.segmentation.thresholds.ImgThreshNiblack
@ALDAOperator(genericExecutionMode=ALL) public class ImgThreshNiblack
Niblack binarization.
Class that offers methods for applying Niblack thresholding to an image, using parameters as specified. Provided methods include conventional Niblack thresholding, application maskwise and, particularly suitable for granule detection, thresholding with additional local variance checks.
Nested Class Summary | |
---|---|
static class |
ImgThreshNiblack.Mode
Niblack processing mode. |
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode |
Field Summary | |
---|---|
private double |
enhanceR
Niblack factor R. |
private MTBImage |
inImg
Input image. |
private MTBImageByte |
mask
Optional mask for excluding image regions from processing. |
private MTBImageByte |
outImg
Binary result image. |
private ImgThreshNiblack.Mode |
processMode
Process mode. |
private double |
scalingK
Niblack scaling parameter k. |
private int |
varCheckNB
Size of neighborhood for local variance checks. |
private double |
varCheckThresh
Threshold for variance check. |
private int |
winSize
Size of local sliding window. |
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
completeDAG, name, portHashAccess, verbose, versionProvider |
Constructor Summary | |
---|---|
ImgThreshNiblack()
Default constructor. |
|
ImgThreshNiblack(MTBImage _inImg,
ImgThreshNiblack.Mode mode,
double k,
double R,
int wSize,
int vcNB,
double vcThresh,
MTBImageByte _mask)
Default destructor. |
Method Summary | |
---|---|
private MTBImageByte |
applyNiblackThreshold_withLocalVarCheck(MTBImage mimg,
int w,
double k,
double R,
int varCheckNeighborhood,
double localVarThresh)
This function implements the conventional Niblack binarization, enhanced with a local variance check. |
private MTBImageByte |
applyNiblackThreshold(MTBImage mimg,
int w,
double k,
double R)
This function implements the conventional (enhanced) Niblack binarization. |
private MTBImageByte |
applyNiblackThresholdMaskwise(MTBImage mimg,
int w,
double k,
double R)
Enhanced Niblack binarization applied maskwise to the image, i.e. all pixels inside the mask get the same threshold. |
ij.ImagePlus |
applyNiblackThresholdWholeImage(ij.process.ImageProcessor ip,
double k,
double R,
ij.ImagePlus _mask)
Deprecated. |
private MTBImageByte |
applyNiblackThresholdWholeImage(MTBImage mimg,
double k,
double R)
This function implements the conventional (enhanced) Niblack binarization. |
MTBImageByte |
getResultImage()
Get the resulting thresholded image. |
protected void |
operate()
|
void |
setInputImage(MTBImage img)
Set input image. |
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, validateCustom, 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 |
---|
@Parameter(label="R", direction=IN, description="Enhancement factor R, disabled if -1.", dataIOOrder=-7) private double enhanceR
@Parameter(label="Input image", required=true, direction=IN, description="Input image.") private transient MTBImage inImg
@Parameter(label="Exclude Mask", direction=IN, required=false, description="Exclude mask", dataIOOrder=-10) private MTBImageByte mask
@Parameter(label="Result image", required=true, direction=OUT, description="Output image.") private transient MTBImageByte outImg
@Parameter(label="Mode", required=true, direction=IN, description="Process Mode.") private ImgThreshNiblack.Mode processMode
@Parameter(label="K", direction=IN, description="Scaling factor K.", dataIOOrder=-8) private double scalingK
@Parameter(label="Variance check neighborhood", direction=IN, description="Variance check neighborhood size.", dataIOOrder=-5) private int varCheckNB
varCheckThresh
@Parameter(label="Variance threshold", direction=IN, description="Variance check threshold", dataIOOrder=-4) private double varCheckThresh
Image areas with a variance below the threshold are classified as background because the Niblack criterion will most likely fail.
varCheckNB
@Parameter(label="Window size", direction=IN, description="Local window size.", dataIOOrder=-15) private int winSize
Constructor Detail |
---|
public ImgThreshNiblack() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public ImgThreshNiblack(MTBImage _inImg, ImgThreshNiblack.Mode mode, double k, double R, int wSize, int vcNB, double vcThresh, MTBImageByte _mask) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
_inImg
- Image to work on.mode
- Mode for Niblack operator.k
- Scaling factor for standard deviation.R
- If unequal to -1, enhanced Niblack is applied.wSize
- Size of sliding window for local thresholding.varCheckNB
- Size of neighborhood for local variance check.varCheckThresh
- Threshold for local variance check._mask
- Image mask for excluding image sections.
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail |
---|
private MTBImageByte applyNiblackThreshold_withLocalVarCheck(MTBImage mimg, int w, double k, double R, int varCheckNeighborhood, double localVarThresh)
private MTBImageByte applyNiblackThreshold(MTBImage mimg, int w, double k, double R)
ip
- input image processorw
- size of sliding windowk
- Niblack factorR
- Niblack normalization constant
private MTBImageByte applyNiblackThresholdMaskwise(MTBImage mimg, int w, double k, double R)
@Deprecated public ij.ImagePlus applyNiblackThresholdWholeImage(ij.process.ImageProcessor ip, double k, double R, ij.ImagePlus _mask)
private MTBImageByte applyNiblackThresholdWholeImage(MTBImage mimg, double k, double R)
ip
- input image processork
- Niblack factorR
- Niblack normalization constant
public MTBImageByte getResultImage()
protected void operate()
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
public void setInputImage(MTBImage img)
img
- Image to process.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |