title: Hough Circle in c# , dynamic memory
body: <p>I have problem in dynamic memory allocation getting data from matrix</p>
  
  <pre><code>Image image_gray = new Image("im1.jpg");
  Matrix circles = new Matrix(100, 1, 3);
  </code></pre>
  
  <p>Question 1: How can I locate dynamic memory because I don't know the number of circles?</p>
  
  <pre><code>Emgu.CV.CvInvoke.cvHoughCircles(image_gray, circles, HOUGH_TYPE.CV_HOUGH_GRADIENT,
      2, 100, 200, 100, 10, 500);
  </code></pre>
  
  <p>Question 2: Now circle is matrix with [100 ,3], How can I get</p>
  
  <pre><code>point center= Round (circle[i][1], circle[i][1])
  </code></pre>
  
  <p>How can I get </p>
  
  <pre><code>int radius= circle[i][2]; 
  </code></pre>
  
  <p>what should my for loop look like to get data from matrix and casting should be point and int.</p>
  
  <p>I tried already (NOT WORKING / ERROR)</p>
  
  <pre><code>for (int i=0; i &lt; circles.Rows; i++) 
  { Matrix entry = circles.GetRow(i);
  
   float x = entry[0]; 
   float y = entry[1]; 
  float r = entry[2];} // NOT WORKING
  </code></pre>
  
  <p>because instead of copying (required) only (i) row it copies whole matrix( circles) and float x=......gives errors</p>
  
  <pre><code>No overload for method 'this' takes '1' arguments
  </code></pre>
  
  <p>please help me in this regard</p>
  
  <p>regards</p>
  
  <hr>
  
  <p>sorry to answer my question. please give some hint to dynamic memory allocation and matrix data</p>