title: get the center of the detected circle in an image / opencv / c++
body: <p>I am using this code to get the coordinate of the center of detected circles in the image.</p>
  
  <pre><code>vector&lt;Vec3f&gt; circles;
  
      cv::HoughCircles( t, circles, CV_HOUGH_GRADIENT, 1, t.rows/8, 200,         100, 0, 0 );
  
         for( size_t i = 0; i &lt; circles.size(); i++ ){
              Point center(cvRound(circles[i][0]), cvRound(circles[i][1]));
              cout &lt;&lt; "center" &lt;&lt; center &lt;&lt; endl;
          int radius = cvRound(circles[i][2]);
              // circle center
              circle( t2, center, 3,  1 , -1, 8, 0 );        
               // circle outline
              circle( t2, center, radius,  1  , 3, 8, 0 );  
          }
  
          imshow( "circles", t2 );
  </code></pre>
  
  <p>I can detect the circles but did no get any result for cooardinate of the center points :(</p>
  
  <p>thanks in advance.</p>
  
  <p>after edition:</p>
  
  <p>I added this line but the answer was zero.</p>
  
  <pre><code>cout &lt;&lt; "number of circles found: " &lt;&lt; circles.size() &lt;&lt; endl;
  </code></pre>
  
  <p>images:
  the first one is the main circle and the second one is after applying gaussian filter and HoughCircles function:</p>
  
  <p><img src="https://i.stack.imgur.com/ZrqsM.png" alt="enter image description here"></p>