public class ConnectedComponentLabeler extends Object implements ImageAnalyser<FImage>
Modifier and Type | Class and Description |
---|---|
static class |
ConnectedComponentLabeler.Algorithm
Different algorithms for finding
ConnectedComponent s. |
Modifier and Type | Field and Description |
---|---|
protected ConnectedComponentLabeler.Algorithm |
algorithm |
protected float |
bgThreshold |
protected List<ConnectedComponent> |
components |
protected ConnectedComponent.ConnectMode |
mode |
Constructor and Description |
---|
ConnectedComponentLabeler(ConnectedComponent.ConnectMode mode)
Construct using the default (two-pass) algorithm, background pixels
having a value of 0 or less, and the given
ConnectedComponent.ConnectMode . |
ConnectedComponentLabeler(ConnectedComponentLabeler.Algorithm algorithm,
ConnectedComponent.ConnectMode mode)
Construct using the given algorithm, background pixels having a value of
0 or less, and the given
ConnectedComponent.ConnectMode . |
ConnectedComponentLabeler(ConnectedComponentLabeler.Algorithm algorithm,
float bgThreshold,
ConnectedComponent.ConnectMode mode)
Construct using the given algorithm, background pixel threshold, and the
given
ConnectedComponent.ConnectMode . |
Modifier and Type | Method and Description |
---|---|
void |
analyseImage(FImage image)
Analyse an image.
|
List<ConnectedComponent> |
findComponents(FImage image)
Syntactic sugar for calling
analyseImage(FImage) followed by
getComponents() ; |
List<ConnectedComponent> |
getComponents() |
protected float bgThreshold
protected ConnectedComponentLabeler.Algorithm algorithm
protected ConnectedComponent.ConnectMode mode
protected List<ConnectedComponent> components
public ConnectedComponentLabeler(ConnectedComponent.ConnectMode mode)
ConnectedComponent.ConnectMode
.mode
- the connection mode.public ConnectedComponentLabeler(ConnectedComponentLabeler.Algorithm algorithm, ConnectedComponent.ConnectMode mode)
ConnectedComponent.ConnectMode
.algorithm
- the algorithm to usemode
- the connection mode.public ConnectedComponentLabeler(ConnectedComponentLabeler.Algorithm algorithm, float bgThreshold, ConnectedComponent.ConnectMode mode)
ConnectedComponent.ConnectMode
.algorithm
- the algorithm to usebgThreshold
- threshold at which pixels with lower values are considered to
be the backgroundmode
- the connection mode.public List<ConnectedComponent> findComponents(FImage image)
analyseImage(FImage)
followed by
getComponents()
;image
- the image to extract components frompublic void analyseImage(FImage image)
ImageAnalyser
analyseImage
in interface ImageAnalyser<FImage>
image
- The image to process in place.public List<ConnectedComponent> getComponents()
analyseImage(FImage)
.