[Insight-users] Sobel operator gives fat edges

Richard Beare richard.beare at gmail.com
Tue Mar 20 17:54:05 EDT 2012


Hi,
I'm not sure if you've posted any pictures, but have you checked the
profile of your edges? If the edges are wide (blurry), then gradient
operators will tend to give wide edges. Also, why are you doing edge
detection? Are you aiming to move on to a segmentation process, or do
something else? If the former then it is likely that the width of the
edge won't matter.

On Wed, Mar 21, 2012 at 7:25 AM, Emma Ryan <eryanvtk at yahoo.com> wrote:
> Hi Bradley and All,
>
>   Thank you for your reply.  But Laplacian is also not doing a good job. I
> have played around with a few values, but no luck.  I finallly tried Canny,
> But not sure what my threshold should be.  I apply the Canny filter to a
> image of type 'double'.  The min and max value in my image is -4.0 to +4.0
> .   The necessary edges are seen as weak edges by canny. Not sure how to
> workaround this.
>
> Any suggestions ?
>
> Thank you,
> Emma
>
> ________________________________
> From: Bradley Lowekamp <blowekamp at mail.nih.gov>
> To: Sergio Vera <sergio.vera at alma3d.com>
> Cc: Emma Ryan <eryanvtk at yahoo.com>; "insight-users at itk.org"
> <insight-users at itk.org>
> Sent: Wednesday, March 14, 2012 6:59 AM
> Subject: Re: [Insight-users] Sobel operator gives fat edges
>
> I would also suggest looking at the
> ZeroCrossingBasedEdgeDetectionImageFilter. This extracts where the laplacian
> of the image crosses zero.
>
>
> On Mar 14, 2012, at 4:22 AM, Sergio Vera wrote:
>
> 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
> _____________________________________
> 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
>
>
> ========================================================
> Bradley Lowekamp
> Medical Science and Computing for
> Office of High Performance Computing and Communications
> National Library of Medicine
> blowekamp at mail.nih.gov
>
>
>
>
>
>
> _____________________________________
> 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
>


More information about the Insight-users mailing list