Ask Your Question

Does the canny method apply Gaussian Blur?

asked 2013-05-02 19:34:11 -0500

basheer gravatar image

I was just wondering whether the canny() method in openCV applies a gaussian blur or not (I want to know whether I should use a gaussian blur before applying canny). Also, if it does, what parameter does it use by default for the blur?

It doesn't mention blur in the docs. However, the canny example here applies blur before applying canny(). So, I'm guessing the answer is no. I just wanted to make sure.

I went through the source code for canny(), but it doesn't explicitly call gaussian blur. I was thinking maybe it manually applies it (but I can't really read the source and understand it)...

I'm using openCV 2.4.5 btw

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-05-03 02:20:04 -0500

efanucar gravatar image

I'm pretty sure that canny() does not apply any blur to the image. You have to do it before calling canny().

Take a look at bilateralFilter as an alternative to GaussianBlur - it keeps the edges sharper.

edit flag offensive delete link more

answered 2013-05-03 02:26:25 -0500

Guanta gravatar image

You are right, it doesn't blur the image beforehand (you should do it, see also first link).

Since you are interested in Canny more than others I guess the following links are of interest for you (esp. the first one):

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-05-02 19:34:11 -0500

Seen: 1,630 times

Last updated: May 03 '13