Have you tried CannyEdge Detection Filter? Canny always returns the thinnest edges.<div><br></div><div>Hope to help Regards<br><br><div class="gmail_quote">On Wed, Mar 14, 2012 at 2:59 AM, Emma Ryan <span dir="ltr"><<a href="mailto:eryanvtk@yahoo.com">eryanvtk@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><br> <div style="font-family:times new roman,new york,times,serif;font-size:12pt">
Hi ,<br><br> I am using the sobelOperator provided in itk. The following is my code snippet. I would like to understand<br><br>1. the default setting of the sobel and <br>2. how I can tune it. There dont seem to be too many member functions to manipulate the sobel.<br>
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)<br>
<br>Any help/suggestions is truly appreciated.<br><br>Thank you,<br>Emma<br><br><br>typedef itk::ConstNeighborhoodIterator<ImageType> NeighborhoodIteratorType;<br> typedef itk::ImageRegionIterator<
ImageType> IteratorType;<br><br> itk::SobelOperator<PixelType, 2> sobel;<br> sobel.SetDirection(1); <br> itk::Size<2> radius_s;<br> radius_s.Fill(1);<br> sobel.CreateToRadius(radius_s);<br>
<br> <br> NeighborhoodIteratorType::RadiusType radius = sobel.GetRadius();<br> NeighborhoodIteratorType it( radius, my_image, my_image->GetRequestedRegion() );<br> itk::NeighborhoodInnerProduct<ImageType> inner_product;<br>
<br> ImageType::Pointer output = ImageType::New();<br> output->SetRegions(my_image->GetRequestedRegion());<br> output->Allocate();<br> <br> IteratorType out(output, my_image->GetRequestedRegion());<br>
<br> for (it.GoToBegin(), out.GoToBegin(); !it.IsAtEnd(); ++it, ++out)<br> {<br> out.Set( inner_product( it, sobel ) );<br> }<br><br> output->Update();<br> <br><br>//Erosion Structuring Element: The following fails to compile if I use '1' instead of '2'<br>
typedef itk::FlatStructuringElement<2> StructuringElementType;<br> StructuringElementType::RadiusType element_radius;<br> element_radius.Fill(5);<br> <br> StructuringElementType strel = StructuringElementType::Box(element_radius);<br>
</div> </div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Sergio Vera<br><br> Alma IT Systems<br> C/ Vilana, 4B, 4º 1ª<br> 08022 Barcelona<br> T. (+34) 932 380 592<br> <a href="http://www.alma3d.com">www.alma3d.com</a><br>
</div>