Documentation of 'boofcv.alg.segmentation.ms.ClusterLabeledImage' Java class
ClusterLabeledImage
boofcv.alg.segmentation.ms

Class ClusterLabeledImage



  • public class ClusterLabeledImage
    extends RegionMergeTree

    Given a labeled image in which pixels that contains the same label may or may not be connected to each other, create a new labeled image in which only connected pixels have the same label. A two pass algorithm is used. In the first pass pixels are examined from top to bottom, left to right. For each pixel (the target), the input image and output image labels of its adjacent pixels are examined. If an adjacent pixel has the same input label as the target then it is either assigned the same output label or marked for being merged. Depending if it is not labeled or has an output label already, respectively. After all the pixels are process the merge requests are examined and a new set of output labels is created. A pass across the output image is done to relabel the inputs.

    Clustering can be done using 4 or 8 connect, which defines what an adjacent pixel is. 4-connect just considers pixels which are (+1,0) (0,1) (-1,0) (0,-1). 8-connect considers (+1,0) (0,1) (-1,0) (0,-1) and (1,1) (-1,1) (-1,-1) (1,-1).

    • Constructor Detail

      • ClusterLabeledImage

        public ClusterLabeledImage(ConnectRule connectRule)
        Configures labeling
        Parameters:
        connectRule - Which connectivity rule to use. 4 or 8
    • Method Detail

      • process

        public void process(GrayS32 input,
                            GrayS32 output,
                            GrowQueue_I32 regionMemberCount)
        Relabels the image such that all pixels with the same label are a member of the same graph.
        Parameters:
        input - Labeled input image.
        output - Labeled output image.
        regionMemberCount - (Input/Output) Number of pixels which belong to each group.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.