title: How to crop circles (found with Hough Transform) in OpenCV?
body: <p>I'm using the code from the <a href="http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.html" rel="nofollow">page</a>. It works very well and I get a circle that I am looking for. All my image have only 1 circle and I have modified parameters of <code>HoughCircles()</code> such that the code returns only 1 circle. </p>
  
  <p>How can I crop my original image so that the new image has only the circle (and area within it) and save the new image as a JPEG or PNG file?</p>
  
  <p>Based upon original code, the center of the circle is given by</p>
  
  <pre><code>(cvRound(circles[1][0]), cvRound(circles[1][1]));
  </code></pre>
  
  <p>and the radius is given by</p>
  
  <pre><code>cvRound(circles[1][2]);
  </code></pre>