|
||||||||||
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.DistanceTransform
@ALDAOperator(genericExecutionMode=ALL, level=APPLICATION) @ALDMetaInfo(export=MANDATORY) public class DistanceTransform
Class to calculate a distance map / field from a binary image using the Champfer-algorithm from G. Borgefors, "Distance transformations in digital images", Computer Vision, Graphics, and Image Processing, vol. 34, pp. 344–371, 1986. Several distance metrics (Euclide, Chessboard, Cityblock) and the foreground (0 for black and 1 for white) can be specified. A 8-way neighborhood is used. NOTE! The distance is calculated for each background pixel to the nearest foreground pixel. For example, if the distance should be calculated inside a white object, the black background should be set as foreground color. The distance field is created as MTBImage or as a two dimensional double array. First dimension specifies the y-coordinate of the field, and the second dimension specifies the x-coordinate of the field.
Nested Class Summary | |
---|---|
static class |
DistanceTransform.DistanceMetric
Several distance metrics. |
static class |
DistanceTransform.ForegroundColor
Color of binary image foreground. |
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 | |
---|---|
DistanceTransform()
Standard constructor. |
|
DistanceTransform(MTBImageByte image,
DistanceTransform.DistanceMetric dm,
DistanceTransform.ForegroundColor fg)
Constructor to create a new DistanceTransform object. |
Method Summary | |
---|---|
MTBImage |
getDistanceImage()
Get the calculated distance map image. |
double[][] |
getDistanceMap()
Get the calculated distance map. |
DistanceTransform.DistanceMetric |
getDistMetric()
Get the used distance metric. |
DistanceTransform.ForegroundColor |
getForeground()
Get the used foreground color. |
int |
getHeight()
Get image height. |
MTBImageByte |
getInImg()
Get the input image. |
int |
getWidth()
Get image width. |
protected void |
operate()
|
void |
setDistMetric(DistanceTransform.DistanceMetric metric)
Set the distance metric. |
void |
setForeground(DistanceTransform.ForegroundColor fColor)
Set the foreground color. |
void |
setHeight(int height)
Set image height. |
void |
setInImg(MTBImageByte inImg)
Set the input image. |
void |
setWidth(int width)
Set image width. |
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 DistanceTransform() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public DistanceTransform(MTBImageByte image, DistanceTransform.DistanceMetric dm, DistanceTransform.ForegroundColor fg) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
image
- the input image to calculate the distance map on itdm
- the distance metricfg
- set foreground white or black
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail |
---|
public MTBImageByte getInImg()
public void setInImg(MTBImageByte inImg)
public DistanceTransform.DistanceMetric getDistMetric()
public void setDistMetric(DistanceTransform.DistanceMetric metric)
public DistanceTransform.ForegroundColor getForeground()
public void setForeground(DistanceTransform.ForegroundColor fColor)
public MTBImage getDistanceImage()
public double[][] getDistanceMap()
public int getWidth()
public void setWidth(int width)
public int getHeight()
public void setHeight(int height)
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |