[Insight-users] tunning parameters for canny edge detection and hough transform

Zachary Pincus zpincus at stanford.edu
Thu Oct 13 13:44:06 EDT 2005


The documentation for this filter (http://www.itk.org/Doxygen/html/ 
classitk_1_1CannyEdgeDetectionImageFilter.html , or simply embedded  
in the header file) clearly specifies the parameters:

> There are four parameters for this filter that control the sub- 
> filters used by the algorithm.
>
> Variance and Maximum error are used in the Gaussian smoothing of  
> the input image. See itkDiscreteGaussianImageFilter for information  
> on these parameters.
>
> Threshold is the lowest allowed value in the output image. Its data  
> type is the same as the data type of the output image. Any values  
> below the Threshold level will be replaced with the OutsideValue  
> parameter value, whose default is zero.
>
Note also that the traditional Canny filter uses two thresholds for  
the "hysteresis thresholding" process. If you desire to do the same  
(which I highly recommend), the filter provides methods to set the  
upper and lower thresholds separately.

There is a great deal of literature about the Canny filter available  
online, which covers in detail what the parameters do and how to set  
them. Basically, you'll want to choose a variance that smoothes out  
the noise in your image but not the edges of interest. Then choose a  
high threshold that will only be obtained on a real image edge, and a  
low threshold which is more permissive. You'll probably need to play  
with the parameters to do this, but it shouldn't be too hard.

Zach

PS. Why use the Canny filter at all if you have a binary thresholded  
image of box versus background? I presume that the Canny filter is  
used in a different step?


On Oct 13, 2005, at 6:47 AM, arctic sliver wrote:

> Hi,
>
> I'm trying to apply ITK for a small project with robot vision.  
> Essentially, I'm taking a snapshot of a box with a certain  
> silhouette with a digital camera and i'm trying to classify the  
> type of silhouette in that insert. The silouettes are white and the  
> box is black, so I've used a binary threshold and obtained a pretty  
> accurate white on black image.
>
> I'm trying to use the canny filter, but can't seem to get the  
> results i'm after.  i think there's too much noise in the image, as  
> i'm getting random lines all over the place as well as the outline  
> of the shape. I've actually tried this tool : http:// 
> homepages.inf.ed.ac.uk/rbf/HIPR2/cannydemo.htm  with my image and  
> it detects the exact edge i want.
>
> Can anyone please point out where i can get information about  
> tuning the parameters? the website i saw mentioned several tuning  
> parameters for the canny filter, but with ITK, i have only seen the  
> SetThreshold function as a parameter. In the end, i'd like to use  
> hough transform to detect the image.  the actual silouette looks  
> like this:
>
>
>
>               _________
>                |                |
>    ______|                |
>    |                            |
>    |                            |
>    |______________|
>
> Any help would be greatly appreciated.
>
> Cheers,
>
> Sos
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>



More information about the Insight-users mailing list