title: Find distance from contour to a Point opencv C++
body: <p>I would create a Matrix that has in the coloumn[i] the distances from a fixed Point (mass center(mc(i)) of a contour) to the Points of the contour[i]. </p>
  
  <p>This is the code where I find contours and mass centers:</p>
  
  <pre><code>findContours(binMat, contours, cv::RETR_EXTERNAL, CHAIN_APPROX_SIMPLE,Point(0,0));
  
  /// Get the moments
  vector&lt;Moments&gt; mu(contours.size());
  for (int i = 0; i &lt; contours.size(); i++)
  {
      mu[i] = moments(contours[i], false);
  }
  
  ///  Get the mass centers
  vector&lt;Point2f&gt; mc(contours.size());
  for (int i = 0; i &lt; contours.size(); i++)
  {
      mc[i] = Point2d(mu[i].m10 / mu[i].m00, mu[i].m01 / mu[i].m00);
  }
  </code></pre>
  
  <p>This code is working well.</p>
  
  <p>Next, I tried many way to find the distance, but having many problems because I'm new programming with C++ and using OpenCV.</p>