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

Zachary Pincus zpincus at stanford.edu
Fri Oct 14 04:18:43 EDT 2005


I often just like perusing the ITK doxygen pages when looking to see  
what's in the ITK. I've found a lot of neat stuff there:
http://www.itk.org/Doxygen/html/classes.html

Without knowing more about your specific task, I can't help too much,  
but you might want to check out the Hough lines filter which could be  
used to extract parameterized lines from a canny edge image; you  
could then measure these lines by stepping along them or some such.

As far as corners go, a classic method for doing that is the KLT  
corner detection, which involves looking at the eigenvectors of a  
function calculated based on the image gradient. (Less intimidating  
than that may sound, though.) This could be implemented simply with  
an ITK neighborhood iterator and a derivative filter.

See: http://ssip2003.info.uvt.ro/lectures/chetverikov/ 
corner_detection.pdf and http://www.cs.cornell.edu/courses/ 
CS664/2003fa/handouts/664-l6-edges-03.pdf

Zach

On Oct 13, 2005, at 10:21 PM, arctic sliver wrote:

> Hi Zach,
>
> Thanks for the response. I managed to fiddle with the parameters  
> properly and get a much better result than before.
>
> Yeah, sorry i think i sounded a little confusing in my previous  
> mail. I am using the canny filter on the original image and the  
> thresholding was done for something else.
>
> If i may just ask one more question (to highlight my lack of  
> experience with feature detection), what other ITK features can be  
> used to analyse the results of the canny filter? (I'm keen to  
> mainly find the corners of the silhouettes) and get the lengths of  
> line segments etc.
>
> Thanks for your help!
>
> Cheers,
> Sosati
>
> On 10/14/05, Zachary Pincus <zpincus at stanford.edu> wrote: 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
> >
>
>
> _______________________________________________
> 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