[Insight-users] Sobel operator gives fat edges

Emma Ryan eryanvtk at yahoo.com
Fri Mar 16 10:24:58 EDT 2012


Thank you for your reply, Kent. I have been trying that with little success. Anyways, I'm investigating change my input to the Sobel.  So let's c.

regards,
Emma



________________________________
 From: Kent Ogden <ogdenk at upstate.edu>
To: Emma Ryan <eryanvtk at yahoo.com> 
Sent: Friday, March 16, 2012 5:36 AM
Subject: Re: [Insight-users] Sobel operator gives fat edges
 

Emma, 

You could try applying an erosion filter to thin the edge.  You have to be careful, it could 'erode' all the way through and break the connectivity.  I'm not an ITK expert, but I'm sure there is an erosion filter in there somewhere, that's a very basic image processing algorithm (complemented by dilation, so you will hear them together sometimes, as in erosion/dilation). 

Kent 



>>> Emma Ryan <eryanvtk at yahoo.com> 3/15/2012 07:18 PM >>>

Hi All, 

   Any guesses as to how I can address this 'fat edge' issue.  Or does anybody have an idea  how Matlab manages to get the thin lines ? 

Thank you, 
Emma

   
 


________________________________
 From: Sergio Vera <sergio.vera at alma3d.com>
To: Emma Ryan <eryanvtk at yahoo.com>
Cc: "insight-users at itk.org" <insight-users at itk.org>
Sent: Wednesday, March 14, 2012 1:22 AM
Subject: Re: [Insight-users] Sobel operator gives fat edges


Have you tried CannyEdge Detection Filter? Canny always returns the thinnest edges. 

Hope to help Regards


On Wed, Mar 14, 2012 at 2:59 AM, Emma Ryan <eryanvtk at yahoo.com> wrote:


>
>Hi ,
>
>   I am using the sobelOperator provided in itk.  The following is my code snippet. I would like to understand
>
>1.  the default setting of the sobel and
>2. how I can tune it. There dont seem to be too many member functions to manipulate the sobel.
>3. If I need to use Erosion filter to thin the edges, how do I design a 'line' structuring element. My code ( also added below) does not seem to allow line (which I am guessing derives from Box, line = 1-D Box)
>
>Any help/suggestions is truly appreciated.
>
>Thank you,
>Emma
>
>
>typedef itk::ConstNeighborhoodIterator<ImageType> NeighborhoodIteratorType;
>    typedef itk::ImageRegionIterator< ImageType>        IteratorType;
>
>    itk::SobelOperator<PixelType, 2> sobel;
>    sobel.SetDirection(1); 
>    itk::Size<2> radius_s;
>    radius_s.Fill(1);
>    sobel.CreateToRadius(radius_s);
>
>  
>    NeighborhoodIteratorType::RadiusType radius = sobel.GetRadius();
>    NeighborhoodIteratorType it( radius, my_image, my_image->GetRequestedRegion() );
>    itk::NeighborhoodInnerProduct<ImageType> inner_product;
>
>    ImageType::Pointer output = ImageType::New();
>    output->SetRegions(my_image->GetRequestedRegion());
>    output->Allocate();
> 
>    IteratorType out(output, my_image->GetRequestedRegion());
>   
>    for (it.GoToBegin(), out.GoToBegin(); !it.IsAtEnd(); ++it, ++out)
>    {
>     out.Set( inner_product( it, sobel ) );
>    }
>
>    output->Update();
>   
>
>//Erosion Structuring Element: The following fails to compile if I use '1' instead of '2'
>typedef itk::FlatStructuringElement<2> StructuringElementType;
>    StructuringElementType::RadiusType element_radius;
>    element_radius.Fill(5);
> 
>    StructuringElementType strel = StructuringElementType::Box(element_radius);
>
>
>_____________________________________
>Powered by www.kitware.com
>
>Visit other Kitware open-source projects at
>http://www.kitware.com/opensource/opensource.html
>
>Kitware offers ITK Training Courses, for more information visit:
>http://www.kitware.com/products/protraining.php
>
>Please keep messages on-topic and check the ITK FAQ at:
>http://www.itk.org/Wiki/ITK_FAQ
>
>Follow this link to subscribe/unsubscribe:
>http://www.itk.org/mailman/listinfo/insight-users
>
>



--
Sergio Vera

 Alma IT Systems
 C/ Vilana, 4B, 4º 1ª
 08022 Barcelona
 T. (+34) 932 380 592
 www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120316/147b31be/attachment.htm>


More information about the Insight-users mailing list