|
||||||||||
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.morphology.ComponentPostprocess
@ALDAOperator(genericExecutionMode=ALL, level=STANDARD) @ALDMetaInfo(export=ALLOWED) public class ComponentPostprocess
Methods for post-processing components/pixels in binary images.
Thresholding algorithms yield binary images with distinct connected components of foreground pixels, i.e. regions. The routines of this class provide functionality for post-processing such binary (unlabeled) component images. Exemplary post-processing steps might include linking/merging adjacent components or changing a component's morphological shape.
Note that the different processing modes may require different parameter settings. These settings have to be done explicitly by calling the corresponding setter-functions the class provides. If the parameters are not set by the user default values are used.
Nested Class Summary | |
---|---|
static class |
ComponentPostprocess.ProcessMode
Processing mode identifiers. |
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode |
Field Summary |
---|
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider |
Constructor Summary | |
---|---|
ComponentPostprocess()
Default constructor. |
|
ComponentPostprocess(MTBImage img,
ComponentPostprocess.ProcessMode pm)
Default constructor. |
|
ComponentPostprocess(MTBImage img,
ComponentPostprocess.ProcessMode pm,
int _minCompSize,
int _maxCompDist,
int maxVoroExpandDist)
Deprecated. |
|
ComponentPostprocess(MTBImage img,
ComponentPostprocess.ProcessMode pm,
int _minCompSize,
int _maxCompDist,
int maxVoroExpandDist,
double _roundnessThreshold)
Deprecated. |
Method Summary | |
---|---|
protected MTBImageByte |
EraseLargeComponents(MTBImageByte binIP,
int maxComponentSize)
Function to remove large components from a binary image. |
protected MTBImageByte |
eraseNonCompactComponents(MTBImageByte binImage,
double threshold)
Function to remove all non compact/circular components of a binary image. |
protected MTBImageByte |
EraseRoundComponents(MTBImageByte binImage,
double threshold)
Remove components with small eccentricity. |
protected MTBImageByte |
EraseSmallComponents(MTBImageByte binIP,
int minComponentSize)
Function to remove small components from a binary image. |
double |
getCompactnessThreshold()
Returns the actual value of compactness threshold. |
boolean |
getDiagonalNeighbors()
Get value of Parameter argument DiagonalNeighbors. |
MTBImage |
getInputImage()
Get reference to the current input image. |
int |
getMaximalComponentDist()
Returns the maximal component distance for linking. |
int |
getMaximalComponentSize()
Returns the maximal valid component size for component removal. |
int |
getMaxVoronoiExpandDist()
Returns the maximal distance of pixels considered in Voronoi expansion. |
int |
getMinimalComponentSize()
Returns the minimal valid component size for component removal. |
ComponentPostprocess.ProcessMode |
getProcessMode()
Get current process mode. |
MTBImageByte |
getResultImage()
Get the result image after applying operator. |
double |
getRoundnessThreshold()
Returns the currently active roundness threshold. |
protected MTBImageByte |
LinkAdjacentComponents(MTBImageByte binIP)
Function for linking adjacent components/regions in a binary image. |
protected MTBImageByte |
LinkAdjacentPixels(MTBImageByte binIP,
int maxDist)
Function for linking adjacent pixels in a binary image. |
protected void |
operate()
|
void |
setCompactnessThreshold(double _compactnessTrheshold)
Set the compactness threshold for eliminating non compact components. |
void |
setDiagonalNeighbors(boolean value)
If true 8-neighborhood, i.e. diagonal neighbors, will be used in mode 'VORONOI_EXPAND' for Voronoi dilation. |
void |
setMaximalComponentDistance(int _maxCompDist)
Set maximal component/pixel distance for linking. |
void |
setMaximalComponentSize(int _maxCompSize)
Set maximal component size for erasing large components. |
void |
setMaximalVoronoiExpansionDistance(int _maxVoroExpandDist)
Set radius of dilation mask in Voronoi expansion. |
void |
setMinimalComponentSize(int _minCompSize)
Set minimal component size for erasing small components. |
void |
setRoundnessThreshold(double _roundnessThreshold)
Set roundness threshold for eliminating round components. |
protected MTBImageByte |
VoronoiExpandComponents(MTBImageByte binImg,
int maxDist)
Dilate components, but avoid merges. |
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 |
Constructor Detail |
---|
public ComponentPostprocess() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public ComponentPostprocess(MTBImage img, ComponentPostprocess.ProcessMode pm) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Note that parameters for the chosen processing mode have to be set explicitly. Parameters for other modes are ignored.
img
- Image to work on.pm
- Process mode of operator.
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- @Deprecated public ComponentPostprocess(MTBImage img, ComponentPostprocess.ProcessMode pm, int _minCompSize, int _maxCompDist, int maxVoroExpandDist) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
img
- Image to work on.pm
- Process mode of operator._minCompSize
- Minimal region size for eliminating small comps._maxCompDist
- Maximal region distance in linking.maxVoroExpandDist
- Max. distance of pixel considered in Voronoi expansion.
Note: Depending on the process mode each time only one of the
parameters is actually in use.
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
@Deprecated public ComponentPostprocess(MTBImage img, ComponentPostprocess.ProcessMode pm, int _minCompSize, int _maxCompDist, int maxVoroExpandDist, double _roundnessThreshold) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
img
- pm
- Process mode of operator.
_minCompSize
- _maxCompDist
- maxVoroExpandDist
- _roundnessThreshold
-
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail |
---|
public void setMinimalComponentSize(int _minCompSize)
Only used in mode 'ERASE_SMALL_COMPS'.
_minCompSize
- public void setMaximalComponentSize(int _maxCompSize)
Only used in mode 'ERASE_LARGE_COMPS'.
public void setMaximalComponentDistance(int _maxCompDist)
Only used in modes 'LINK_ADJ_COMPS' and 'LINK_ADJ_PIXELS'.
public void setMaximalVoronoiExpansionDistance(int _maxVoroExpandDist)
Only used in mode 'VORONOI_EXPAND'.
_maxVoroExpandDist
- public void setRoundnessThreshold(double _roundnessThreshold)
Only used in mode 'ERASE_ROUND_COMPS'.
_roundnessThreshold
- public void setCompactnessThreshold(double _compactnessTrheshold)
_compactnessTrheshold
- public void setDiagonalNeighbors(boolean value)
value
- public MTBImage getInputImage()
public ComponentPostprocess.ProcessMode getProcessMode()
public int getMinimalComponentSize()
public int getMaximalComponentSize()
public int getMaximalComponentDist()
public int getMaxVoronoiExpandDist()
public boolean getDiagonalNeighbors()
public double getRoundnessThreshold()
public double getCompactnessThreshold()
public MTBImageByte getResultImage()
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImageByte EraseSmallComponents(MTBImageByte binIP, int minComponentSize) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Small components are components that have a size below the given threshold. Suitable for noise reduction in binary images.
binIP
- binary input imageminComponentSize
- minimum size of valid components
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImageByte EraseLargeComponents(MTBImageByte binIP, int maxComponentSize) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Large components are components that have a size above the given threshold.
binIP
- binary input imagemaxComponentSize
- maximum size of valid components
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImageByte EraseRoundComponents(MTBImageByte binImage, double threshold) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
binImage
- Input image.threshold
- Eccentricity threshold.
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImageByte eraseNonCompactComponents(MTBImageByte binImage, double threshold) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
binImage
- The input image.threshold
- The threshold of compactness
threshold
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImageByte LinkAdjacentComponents(MTBImageByte binIP) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
This function processes a binary image with foreground objects being white. Based on an initial component labeling step and subsequent skeletonization of resulting components, adjacent components are linked by a line of width one pixel in the result image.
The criterion for two components to be adjacent is defined based on the distance of pairs of skeleton endpoints of both components. If there exists at least one pair of endpoints between two components with a distance below the given threshold, the components are linked. If there is more than one pair of such points, the pair with the smallest distance is selected to be linked to each other.
binIP
- input binary image with regions
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImageByte LinkAdjacentPixels(MTBImageByte binIP, int maxDist) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
This function processes a binary image containing only isolated pixels in the foreground. The foreground color is white. Based on the given maximal distance adjacent pixels are linked together to components. The result is comparable to a single-linkage clustering. As result an image is returned where adjacent pixels are linked to each other by a line of width one.
Note that the behaviour of the function is undefined if there are foreground objects present in the image other than single pixels!
binIP
- input binary image with regionsmaxDist
-
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
-
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImageByte VoronoiExpandComponents(MTBImageByte binImg, int maxDist) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
binImg
- Input image.maxDist
- Size of dilation mask.
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |