title: Detect a circular shape inside image in MATLAB
body: <p>Whats the fastest way to detect these circular shapes in a image?</p>
  
  <p><img src="https://i.stack.imgur.com/sWiP6.jpg" alt="Red Circle to be detected"></p>
  
  <p>The radius is always between(80-100mm). Background is always white. And the circle will always be in center. </p>
  
  <p>I have tried <a href="http://www.mathworks.in/matlabcentral/fileexchange/9168-detect-circles-with-various-radii-in-grayscale-image-via-hough-transform" rel="nofollow noreferrer">Hough Transform</a> but I couldn't really get it to work. I am new to this, and I get a feeling like <em>Hough Transform</em> is a overkill for this. Kindly suggest me the right approach to do this.
  <img src="https://i.stack.imgur.com/pmBp1.jpg" alt="enter image description here"></p>
  
  <hr>
  
  <p>UPDATE</p>
  
  <p>Here is what I got after applying hough transform.</p>
  
  <p>I have used the algorithm mentioned <a href="http://www.mathworks.in/matlabcentral/fileexchange/9168-detect-circles-with-various-radii-in-grayscale-image-via-hough-transform" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Following is the relevant code from the bigger algorithm</p>
  
  <pre><code>% applying Hough Below
  [accum, circen, cirrad] = ...
      CircularHough_Grd(gR, [89 93],...
      17.4, 13, 1);   % this executes in 0.72 sec
  
  % Lets see what we got
  imshow(gR);
  hold on;
  plot(circen(:,1), circen(:,2), 'r+');
  for ii = 1 : size(circen, 1)
      rectangle('Position',[circen(ii,1) - cirrad(ii), circen(ii,2) - cirrad(ii), 2*cirrad(ii), 2*cirrad(ii)],...
          'Curvature', [1,1], 'edgecolor', 'b', 'linewidth', 1.5);
  end
  hold off;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/X8Q2n.jpg" alt="enter image description here"></p>
  
  <p>The meaningful circle is the one in the middle.</p>