Class ContourTracer

java.lang.Object
boofcv.alg.filter.binary.ContourTracer

public class ContourTracer extends 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 Details

    • ContourTracer

      public ContourTracer(ConnectRule rule)
      Specifies connectivity rule
      Parameters:
      rule - Specifies 4 or 8 as connectivity rule
  • Method Details

    • setInputs

      public void setInputs(GrayU8 binary, GrayS32 labeled, PackedSetsPoint2D_I32 storagePoints)
      Specifies the input images.
      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.
    • trace

      public void trace(int label, int initialX, int initialY, boolean external)
      Traces the contour starting at the specified seed.
      Parameters:
      external - True for tracing an external contour or false for internal.
    • setMaxContourSize

      public void setMaxContourSize(int maxContourSize)
    • getConnectRule

      public ConnectRule getConnectRule()