Community
cancel
Showing results for 
Search instead for 
Did you mean: 
56 Views

Canny filter

Hi Forum

I have difficulties to implement correctly the Canny filter. I noticed that in the IPP implementation there is no smoothing included so at the beginning I added a Gauss filter to my image. After computing the Sobel filters as inputs to the Canny filter, as noted in the IPP examples, I had the impression of getting to many edges segmented in the result.

I then made a comparison to another framework, applying there also the Canny edge detection to the same image and using the same absolute thresholds for hysteresis thresholding and got a more meaningful result.

Could you please help me with my implementations? Could you provide me with information about the usage of the two threshold values in the algorithm? Do they represent absolute image values in the gradient image?

Is there a "correct" or "standard" workflow in IPP for the implementation of the standard canny edge detection algorithm?

0 Kudos
3 Replies
Jeffrey_M_Intel1
Employee
56 Views

My apologies for the delay in getting back to you. At first glance the "Edge detection using the ippiCanny function" example in the manual appears to find the right edges. However, I'm also interested in trying out at least one other framework. I'll let you know what I find as I dig deeper.

Part of my investigation will be following up on the usage of the high and low threshold parameters. In any case, we will want to make the documentation clearer.

More soon,

Jeff
Lamp
Beginner
56 Views

The sample code is quite clear,
1. calculate horiz gradient, get gradient map dx
2. calculate vert gradient, get gradient map dy
3. calculate the graidient image, pixel value = sqrt(dx^2 + dy^2), direction = dy / dx
4. first loop, mark the values that greater than the high threshold as edge
5. second loop, check the values between low and high, if it's near the existing edge with the correct direction, mark it as edge.
Jeffrey_M_Intel1
Employee
56 Views

Just thought I'd add the results of investigating Canny implementations. At least with the inputs I've looked at, results match OpenCV.

It is simple enough to find edgegradient threshold values that work for a specific image. The image processing literature recommends a 2-3x ratio between high and low threshold values.

There are severalalgorithms to automatethreshold value selection. This topic had some additional discussion in Premier. I've entered a feature request to consider adding automatic thresholding capability to IPP in the future.

Best regards,

Jeff

Reply