|
||||||||
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.contours.extraction.ContourOnLabeledComponents
@ALDAOperator(genericExecutionMode=NONE, level=APPLICATION) public class ContourOnLabeledComponents
Class to segment contours from a binary image using the contour following algorithm. The contours are only segmented from a set of given image regions in this binary image. If no image regions exist you should use one of the LabelComponent methods from the package de.unihalle.informatik.MiToBo.segmentation.regions.labeling.
Outer contours as well as inner contours (length greater than a given value) are segmented.
Nested Class Summary | |
---|---|
static class |
ContourOnLabeledComponents.ContourType
The possible type of contours for segmentation. |
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode |
Field Summary | |
---|---|
private ContourOnLabeledComponents.ContourType |
contourType
Special type of contours to calculate. |
private int |
height
Image height. |
private int |
innerContourLengthMin
Minimum number of pixels a inner contour must have (length of the contour). |
private MTBImageByte |
inputImage
The binary input image where the contours should be calculated from. |
private MTBRegion2DSet |
inputRegions
The input regions where the contours should be calculated from. |
private MTBContour2DSet |
resultContours
* The calculated contours, every contour can include several inner contours. |
private MTBImageByte |
resultImage
* The binary image with the calculated contours and the contours as possible outputs from the operator. |
private int |
width
Image width. |
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator |
---|
completeDAG, name, portHashAccess, verbose, versionProvider |
Constructor Summary | |
---|---|
ContourOnLabeledComponents()
Standard constructor. |
|
ContourOnLabeledComponents(MTBImageByte inImg,
MTBRegion2DSet inRegions,
ContourOnLabeledComponents.ContourType type,
int length)
Constructor. |
Method Summary | |
---|---|
protected MTBContour2DSet |
addInnerContours()
Adding the possible inner contours to the outer contour of a region. |
protected MTBImageByte |
calcContours()
Get all inner- and outer-contours for the given regions. |
protected int |
findNextPoint(java.awt.geom.Point2D.Double Xc,
int dir,
MTBImageByte theImage)
Find direction to next pixel in specific direction from the last pixel. |
ContourOnLabeledComponents.ContourType |
getContourType()
Get reference to the current contour type. |
int |
getHeight()
Get image height. |
int |
getInnerContourLengthMin()
Get the minimum number of pixels in the inner contour (length of the contour). |
MTBImageByte |
getInputImage()
Get reference to the current input image. |
MTBRegion2DSet |
getInputRegions()
Get reference to the input regions. |
protected MTBContour2DSet |
getOuterContours(MTBRegion2DSet theRegions,
MTBImageByte theImage)
Calculate the outer contours of the given regions in a image. |
MTBContour2DSet |
getResultContours()
Get reference to the calculated contours. |
MTBImageByte |
getResultImage()
Get reference to the binary image with the calculated contours. |
int |
getWidth()
Get image width. |
protected void |
operate()
This method does the actual work. |
void |
setContourType(ContourOnLabeledComponents.ContourType type)
Set reference to the contour type. |
void |
setHeight(int h)
Set image height. |
void |
setInnerContourLengthMin(int length)
Set the minimum number of pixels in the inner contour (length of the contour). |
void |
setInputImage(MTBImageByte inImg)
Set reference to the current input image. |
void |
setInputRegions(MTBRegion2DSet inRegions)
Set reference to the the input regions. |
void |
setWidth(int w)
Set image width. |
protected MTBImageByte |
toMTBImageByte()
Method to save all contours from the regions on a binary image with specific width and height. |
protected MTBContour2D |
traceContour(int xS,
int yS,
MTBImageByte theImage)
Trace contour, starting at (xS, yS) in direction dS. |
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="Contour Type", required=true, direction=IN, description="Contour type.") private ContourOnLabeledComponents.ContourType contourType
private transient int height
@Parameter(label="Inner Contour Length Min", required=true, direction=IN, description="Minimum of inner contour length.") private int innerContourLengthMin
@Parameter(label="Input Image", required=true, direction=IN, description="Input image.") private transient MTBImageByte inputImage
@Parameter(label="Input Regions", required=true, direction=IN, description="Input regions.") private transient MTBRegion2DSet inputRegions
@Parameter(label="Result Contours", required=true, direction=OUT, description="Resulting contour set.") private transient MTBContour2DSet resultContours
@Parameter(label="Result Image", required=true, direction=OUT, description="Result image with contours.") private transient MTBImageByte resultImage
private transient int width
Constructor Detail |
---|
public ContourOnLabeledComponents() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public ContourOnLabeledComponents(MTBImageByte inImg, MTBRegion2DSet inRegions, ContourOnLabeledComponents.ContourType type, int length) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
inImg
- input image to work oninRegions
- regions to get the contours fromtype
- type of the resulting contour regions to get the contours fromlength
- minimum number of pixels that a inner region must have (length ofimport de.unihalle.informatik.MiToBo.core.exceptions.*;
the inner contour) to calculate the inner contour
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail |
---|
protected MTBContour2DSet addInnerContours() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImageByte calcContours() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected int findNextPoint(java.awt.geom.Point2D.Double Xc, int dir, MTBImageByte theImage)
Xc
- starting pointdir
- direction of last pointtheImage
- the binary image to validate if pixel is black or white (get the
label)
public ContourOnLabeledComponents.ContourType getContourType()
public int getHeight()
public int getInnerContourLengthMin()
public MTBImageByte getInputImage()
public MTBRegion2DSet getInputRegions()
protected MTBContour2DSet getOuterContours(MTBRegion2DSet theRegions, MTBImageByte theImage)
theRegions
- Regions to get contours from.theImage
- Binary image of the regions to get the contours from.
public MTBContour2DSet getResultContours()
public MTBImageByte getResultImage()
public int getWidth()
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
public void setContourType(ContourOnLabeledComponents.ContourType type)
public void setHeight(int h)
public void setInnerContourLengthMin(int length)
public void setInputImage(MTBImageByte inImg)
public void setInputRegions(MTBRegion2DSet inRegions)
public void setWidth(int w)
protected MTBImageByte toMTBImageByte()
protected MTBContour2D traceContour(int xS, int yS, MTBImageByte theImage)
xS
- starting x-coordinateyS
- starting y-coordinatetheImage
- the binary image to validate if pixel is black or white (get the
label)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |