title: OpenCV2.4.2 converting vector<Point2f> to Mat, and releasing the mat causes error
body: <p>I am changing vector to Mat because for some reason findHomography() produces only zero matrix if vector is taken.</p>
  
  <p>So Following is brief code.</p>
  
  <pre><code>{
  std::vector&lt;Point2f&gt; img1;
  std::vector&lt;Point2f&gt; img2;
  Mat mat_from_img1 = Mat(img1,true); 
  Mat mat_from_img2 = Mat(img2,true); 
  Mat H = cv::findHomography(mat_from_img1,mat_from_img2, CV_RANSAC);
  
  //Do THINGS
  
  }//as soons as getting out of this scope, 
  //it calls ~MAT() then Mat::release and causes memory reading violation error.
  </code></pre>
  
  <p>How can I properly convert vector to mat in order to avoid the error?
  I tried </p>
  
  <p>Mat mat_from_img1 = Mat(img1,true); either</p>