Class ContourTracer


  • public class ContourTracer
    extends java.lang.Object
    Used to trace the external and internal contours around objects for LinearContourLabelChang2004. As it is tracing an object it will modify the binary image by labeling. The input binary image is assumed to have a 1-pixel border that needs to be compensated for.
    • Constructor Summary

      Constructors 
      Constructor Description
      ContourTracer​(boofcv.struct.ConnectRule rule)
      Specifies connectivity rule
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boofcv.struct.ConnectRule getConnectRule()  
      void setInputs​(boofcv.struct.image.GrayU8 binary, boofcv.struct.image.GrayS32 labeled, boofcv.struct.PackedSetsPoint2D_I32 storagePoints)  
      void setMaxContourSize​(int maxContourSize)  
      void trace​(int label, int initialX, int initialY, boolean external)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContourTracer

        public ContourTracer​(boofcv.struct.ConnectRule rule)
        Specifies connectivity rule
        Parameters:
        rule - Specifies 4 or 8 as connectivity rule
    • Method Detail

      • setInputs

        public void setInputs​(boofcv.struct.image.GrayU8 binary,
                              boofcv.struct.image.GrayS32 labeled,
                              boofcv.struct.PackedSetsPoint2D_I32 storagePoints)
        Parameters:
        binary - Binary image with a border of zeros added to the outside.
        labeled - Labeled image. Size is the same as the original binary image without border.
        storagePoints -
      • trace

        public void trace​(int label,
                          int initialX,
                          int initialY,
                          boolean external)
        Parameters:
        label -
        initialX -
        initialY -
        external - True for tracing an external contour or false for internal.
      • setMaxContourSize

        public void setMaxContourSize​(int maxContourSize)
      • getConnectRule

        public boofcv.struct.ConnectRule getConnectRule()