[Insight-users] Apply itk::HoughTransform2DCirclesImageFilter to extract circles
Gaby Tu
gabytu1986 at gmail.com
Fri May 25 05:34:04 EDT 2012
Dear all,
I was trying to apply itk::HoughTransform2DCirclesImageFilter to extract
the circle in red in the following PNG file.
[image: 內置圖片 2]
And following is my code for setting up the filter.
typedef itk::Image<short, 2 > SliceType;
typedef itk::Image< float, 2 > AccumulatorImageType;
typedef
itk::HoughTransform2DCirclesImageFilter<SliceType::PixelType,AccumulatorImageType::PixelType>
HoughTransformFilterType;
HoughTransformFilterType::Pointer houghFilter =
HoughTransformFilterType::New();
houghFilter->SetInput(RescaleFilter->GetOutput());
houghFilter->SetNumberOfCircles( 3);
houghFilter->SetMinimumRadius( 10 );
houghFilter->SetMaximumRadius( 30 );
houghFilter->SetSweepAngle(0.52);
try
{
houghFilter->Update();
}
catch (itk::ExceptionObject & e)
{
std::cerr << "exception in file writer " << std::endl;
std::cerr << e << std::endl;
return EXIT_FAILURE;
}
And the result is shown in the following PNG file.
[image: 內置圖片 3]
Comparing this image with previous one, there are three circles in white.
The result puzzled me a lot,
1. Two of the circles detected are not circles, obviously. And there is a
circle which is more like a circle, actually.
2. In my understanding, this filter would create many circles, which would
be organized in some order, value of radius?
And I have tried other values for SweepAngle, but still result similar to
above is present.
Expect your help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120525/0ddd90a0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 7033 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120525/0ddd90a0/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 20619 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120525/0ddd90a0/attachment-0001.png>
More information about the Insight-users
mailing list