public class BinaryImageEndpointTools extends Object
Constructor and Description |
---|
BinaryImageEndpointTools() |
Modifier and Type | Method and Description |
---|---|
static Vector<Vector<Point2D.Double>> |
findEndpointBranches(MTBImageByte img)
Extracts set of endpoint branches from a given binary image.
|
static Vector<Point2D.Double> |
findEndpoints(MTBImageByte img)
Extracts set of endpoints from a given binary image.
|
private static void |
traceBranch(MTBImageByte img,
Vector<Point2D.Double> branch,
Point2D.Double p)
Continues a given branch at the given pixel recursively.
|
public static Vector<Point2D.Double> findEndpoints(MTBImageByte img)
An endpoint (e.g., of a skeleton) is defined as a foreground pixel having exactly one neighbor or having two neighbors which are located side by side. For determining the endpoints in an image the 8-neighborhood of all foreground pixels is checked.
img
- Image to analyze (background black, skeleton white).public static Vector<Vector<Point2D.Double>> findEndpointBranches(MTBImageByte img)
An endpoint branch (e.g., of a skeleton) is defined as a sequence
of pixels starting at an endpoint
(see findEndpoints(MTBImageByte)
for details) and ending
up at the next branch point. In this context a branch point is a
pixel with more than two neighbors.
Note that strict 8-neighborhood is assumed within the branch paths. Particularly, a branch point is assumed if a pixel has more than two neighbors. If the 8-neighborhood assumption is broken, a pixel not being a branch point can also have three neighbors. In such a case the algorithm will fail!
img
- Image to analyze (background black, foreground white).private static void traceBranch(MTBImageByte img, Vector<Point2D.Double> branch, Point2D.Double p)
Note that strict 8-neighborhood is assumed in the path. If this assumption is broken and a pixel in the middle of the path which is not a branch point has more than two neighbors, the tracing will fail!
img
- Image to analyze.branch
- List of already detected points of the branch.p
- Next branch pixel to examine.Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.