public class AllConnectedComponents extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
AllConnectedComponents.PositionStack |
Constructor and Description |
---|
AllConnectedComponents() |
Modifier and Type | Method and Description |
---|---|
static Iterator<Integer> |
getIntegerNames(int start)
Return an iterator that (endlessly) dispenses increasing integer
values for labeling components.
|
static int[][] |
getStructuringElement(int dimensions)
Return an array of offsets to the 8-connected (or N-d equivalent)
structuring element for the dimension space.
|
static <T extends Comparable<T>> |
labelAllConnectedComponents(Labeling<T> labeling,
Image<BitType> img,
Iterator<T> names)
Label all connected components in the given image using an 8-connected
structuring element or it's N-dimensional analog (connect if touching
along diagonals as well as +/- one element in any direction).
|
static <T extends Comparable<T>> |
labelAllConnectedComponents(Labeling<T> labeling,
Image<BitType> img,
Iterator<T> names,
int[][] structuringElement)
Label all connected components in the given image using an arbitrary
structuring element.
|
public static <T extends Comparable<T>> void labelAllConnectedComponents(Labeling<T> labeling, Image<BitType> img, Iterator<T> names) throws NoSuchElementException
T
- the type of the labels to applylabeling
- Assign labels to this labeling spaceimg
- a binary image where true indicates parts of componentsnames
- supplies names for the different components as neededNoSuchElementException
- if there are not enough namespublic static <T extends Comparable<T>> void labelAllConnectedComponents(Labeling<T> labeling, Image<BitType> img, Iterator<T> names, int[][] structuringElement) throws NoSuchElementException
T
- the type of the labels to applylabeling
- Assign labels to this labeling spaceimg
- a binary image where true indicates parts of componentsnames
- supplies names for the different components as neededstructuringElement
- an array of offsets to a pixel of the
pixels which are considered connected. For instance, a 4-connected
structuring element would be "new int [][] {{-1,0},{1,0},{0,-1},{0,1}}".NoSuchElementException
- if there are not enough namespublic static int[][] getStructuringElement(int dimensions)
dimensions
- Copyright © 2015–2021 Fiji. All rights reserved.