Class CannyEdge<T extends ImageGray<T>,D extends ImageGray<D>>

java.lang.Object
boofcv.alg.feature.detect.edge.CannyEdge<T,D>
Direct Known Subclasses:
CannyEdgeDynamic

public class CannyEdge<T extends ImageGray<T>,D extends ImageGray<D>> extends Object
Implementation of canny edge detector. The canny edge detector detects the edges of objects using a hysteresis threshold. When scanning the image pixels with edge intensities below the high threshold are ignored. After a pixel is found that exceeds the high threshold any pixel that is connect to it directly or indirectly just needs to exceed the low threshold. The output from this class can be configured to output a binary edge image and/or a set of contours for each point in the contour image.
  • Field Details

  • Constructor Details

    • CannyEdge

      public CannyEdge(BlurFilter<T> blur, ImageGradient<T,D> gradient, boolean saveTrace)
      Specify internal algorithms and behavior.
      Parameters:
      blur - Initial blur applied to image.
      gradient - Computes the image gradient.
      saveTrace - Should it save a list of points that compose the objects contour/trace?
  • Method Details

    • process

      public void process(T input, float threshLow, float threshHigh, @Nullable @Nullable GrayU8 output)

      Runs a canny edge detector on the input image given the provided thresholds. If configured to save a list of trace points then the output image is optional.

      NOTE: Input and output can be the same instance, if the image type allows it.

      Parameters:
      input - Input image. Not modified.
      threshLow - Lower threshold. ≥ 0.
      threshHigh - Upper threshold. ≥ 0.
      output - (Might be option) Output binary image. Edge pixels are marked with 1 and everything else 0.
    • performThresholding

      protected void performThresholding(float threshLow, float threshHigh, @Nullable @Nullable GrayU8 output)
    • getContours

      public List<EdgeContour> getContours()