Dear all,<div><br></div><div>I was trying to apply&nbsp;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>&nbsp; &nbsp; &nbsp; &nbsp; typedef itk::Image&lt;short, 2 &gt; SliceType;&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; typedef itk::Image&lt; float, 2 &gt; AccumulatorImageType;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::HoughTransform2DCirclesImageFilter&lt;SliceType::PixelType,AccumulatorImageType::PixelType&gt; 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-&gt;SetInput(RescaleFilter-&gt;GetOutput());</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>houghFilter-&gt;SetNumberOfCircles( 3);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>houghFilter-&gt;SetMinimumRadius( 10 );</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>houghFilter-&gt;SetMaximumRadius( 30 );</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>houghFilter-&gt;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-&gt;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 &amp; 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 &lt;&lt; &quot;exception in file writer &quot; &lt;&lt; std::endl;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr &lt;&lt; e &lt;&lt; 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?&nbsp;</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>