Documentation of 'boofcv.alg.filter.binary.LinearContourLabelChang2004' Java class
LinearContourLabelChang2004
boofcv.alg.filter.binary

Class LinearContourLabelChang2004



  • public class LinearContourLabelChang2004
    extends java.lang.Object

    Finds objects in a binary image by tracing their contours. The output is labeled binary image, set of external and internal contours for each object/blob. Blobs can be defined using a 4 or 8 connect rule. The algorithm works by processing the image in a single pass. When a new object is encountered its contour is traced. Then the inner pixels are labeled. If an internal contour is found it will also be traced. See [1] for all the details. The original algorithm has been modified to use different connectivity rules.

    Output: Background pixels (0 in input image) are assigned a value of 0, Each blob is then assigned a unique ID starting from 1 up to the number of blobs.

    Internally, the input binary image is copied into another image which will have a 1 pixel border of all zeros around it. This ensures that boundary checks will not need to be done, speeding up the algorithm by about 25%.

    [1] Fu Chang and Chun-jen Chen and Chi-jen Lu, "A linear-time component-labeling algorithm using contour tracing technique" Computer Vision and Image Understanding, 2004

    • Constructor Detail

      • LinearContourLabelChang2004

        public LinearContourLabelChang2004(ConnectRule rule)
        Configures the algorithm.
        Parameters:
        rule - Connectivity rule. 4 or 8
    • Method Detail

      • process

        public void process(GrayU8 binary,
                            GrayS32 labeled)
        Processes the binary image to find the contour of and label blobs.
        Parameters:
        binary - Input binary image. Not modified.
        labeled - Output. Labeled image. Modified.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.