Class BinaryContours

  • All Implemented Interfaces:
    CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, SizeOfHandler, Stoppable, Serializable

    public class BinaryContours
    extends AbstractObjectLocator
    Uses the BoofCV contour-finding algorithm to locate objects.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -center-on-canvas <boolean> (property: centerOnCanvas)
        If enabled, the located objects get centered on a canvas of fixed size.
        default: false
     
    -canvas-width <int> (property: canvasWidth)
        The width of the canvas in pixels.
        default: 100
        minimum: 1
     
    -canvas-height <int> (property: canvasHeight)
        The height of the canvas in pixels.
        default: 100
        minimum: 1
     
    -canvas-color <java.awt.Color> (property: canvasColor)
        The color to use for filling the canvas.
        default: #ffffff
     
    -remove-small-blobs <boolean> (property: removeSmallBlobs)
        If enabled, small blobs are removed using erode8/dilate8.
        default: false
     
    -connect-rule <FOUR|EIGHT> (property: connectRule)
        The connect rule to apply.
        default: EIGHT
     
    Version:
    $Revision: 78 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_RemoveSmallBlobs

        protected boolean m_RemoveSmallBlobs
        whether to remove small blobs.
      • m_ConnectRule

        protected boofcv.struct.ConnectRule m_ConnectRule
        the connect rule.
    • Constructor Detail

      • BinaryContours

        public BinaryContours()
    • Method Detail

      • setRemoveSmallBlobs

        public void setRemoveSmallBlobs​(boolean value)
        Sets whether to remove small blobs using erode8/dilate8.
        Parameters:
        value - true if to remove blobs
      • getRemoveSmallBlobs

        public boolean getRemoveSmallBlobs()
        Returns whether to remove small blobs using erode8/dilate8.
        Returns:
        true if blobs removed
      • removeSmallBlobsTipText

        public String removeSmallBlobsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • setConnectRule

        public void setConnectRule​(boofcv.struct.ConnectRule value)
        Sets the connect rule to apply.
        Parameters:
        value - the rule
      • getConnectRule

        public boofcv.struct.ConnectRule getConnectRule()
        Returns the connect rule to apply.
        Returns:
        the rule
      • connectRuleTipText

        public String connectRuleTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • doLocate

        protected LocatedObjects doLocate​(BufferedImage image,
                                          boolean annotateOnly)
        Returns the input image as output.
        Specified by:
        doLocate in class AbstractObjectLocator
        Parameters:
        image - the image to process
        annotateOnly - whether to annotate only
        Returns:
        the containers of located objects