canny edge detection algorithm

Which is why I chose an example with Gaussian and Sobel. It is the de facto implementation anyway.

Thanks for placing it in stdlib @David_Tschumperle and your contributions @garagecoder (and @Reptorian). People (including myself) have been hoping for it to be officially in G’MIC.

1 Like

@afre
Just for information. I use the Canny algorithm (or Sobel Canny), since many years in Rawtherapee :

  • to act on the structure in Local adjustments (Spot structure)
  • edge sharpness - Wavelet: main and Local adjustments

:wink:

jacques

@jdc Certainly food for thought for developing G’MIC GUI filters!

First tests from my side:

  • it looks difficult to properly adjust the values of parameters, very sensitive to the image, but when found the proper values for the specific image the result could be fantastic.
    Thanks.

Thinking about the possibility to use the canny edge detection inside a filter, is there some simple suggestion on how to correlate the setup of the parameters values to the histogram values of the image? like the mean and the standard deviation in the histogram, for instance, to the sigma and the lower/upper thresholds in the filter?.
Thanks in advance.

For the method it uses (thresholds), I’m not so sure there’s an easy way. The background in an image can vary as much as the foreground objects of interest, unless you have some very uniform images. That means even within one image, the “ideal” thresholds are not simple to find. I think that’s the main reason for them being human controlled.

Edit: just to add, the upper threshold is relative to the maximum gradient norm. The lower threshold is relative to the upper threshold. You might get better consistency by adjusting local contrast first (there are many methods for that).

Thanks for the clarification, GC.
Hence it’s a very good nethod for the use online (interactive control), not much from inside a filter.

I tend to abstract my filters so its parameter sliders are more intuitive and proportionally sensitive. Auto-set or interactive filters are also possible, but would take more effort to implement.

It would be great if you could provide examples of what you have been working on: to sate my curiosity and also to give us an idea how we can improve usability.

Well, I work on developing filters for Gimp+Gmic, were the detection of contours is very often used, for simulating drawings, sketches, etc
I usually tend to “uniform” the mean value of the image before starting processing, as well as using local contrast enhancement as one of the first steps.

I’ve seen that the default sigma=5 set by David in his official version gives excellent and quick results. Thanks David, I think it’s usable on filters directly.

1 Like

Any way to port this into the GIMP G’MIC plugin? :slight_smile:

It is already a Gimp-GMIC filter, both as “standard” by David and as “test” by garagecoder

Did a search for canny, but found no hits before I posted, but now, I do. Thanks for the head’s up, Diego. :slight_smile:

Look at Duomo using the new Canny Edges…

2 Likes