Dear all,<div><br></div><div>I was trying to apply itk::HoughTransform2DCirclesImageFilter to extract the circle in red in the following PNG file.</div><div><br></div><div><img src="cid:ii_1378346b04ba7161" alt="內置圖片 2"><br>
</div><div>And following is my code for setting up the filter.</div><div><br></div><div><div> typedef itk::Image<short, 2 > SliceType; </div><div> typedef itk::Image< float, 2 > AccumulatorImageType;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::HoughTransform2DCirclesImageFilter<SliceType::PixelType,AccumulatorImageType::PixelType> HoughTransformFilterType;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>HoughTransformFilterType::Pointer houghFilter = HoughTransformFilterType::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>houghFilter->SetInput(RescaleFilter->GetOutput());</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>houghFilter->SetNumberOfCircles( 3);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>houghFilter->SetMinimumRadius( 10 );</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>houghFilter->SetMaximumRadius( 30 );</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>houghFilter->SetSweepAngle(0.52);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>try</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>houghFilter->Update();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>catch (itk::ExceptionObject & e)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr << "exception in file writer " << std::endl;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr << e << std::endl;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return EXIT_FAILURE;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
</div><div><br></div><div>And the result is shown in the following PNG file.</div><div><img src="cid:ii_137834fa3b5bfce9" alt="內置圖片 3"><br></div><div>Comparing this image with previous one, there are three circles in white.</div>
<div><br></div><div>The result puzzled me a lot,</div><div>1. Two of the circles detected are not circles, obviously. And there is a circle which is more like a circle, actually.</div><div>2. In my understanding, this filter would create many circles, which would be organized in some order, value of radius? </div>
<div><br></div><div>And I have tried other values for SweepAngle, but still result similar to above is present.</div><div><br></div><div>Expect your help!</div><div><br></div>