title: How to use cv::warpPerspective for the perspective transformation?
body: <p>I am trying to rectify images. I have point correspondences and I computed both of the matrices F1 and F2. After that, I want to rectify. following is my code</p>
  
  <pre><code>     cv::Mat F1(4,4, CV_64FC1);
       cv::Mat F2(4,4, CV_64FC1);
  
      CvMat* points1 = cvCreateMat(8,1,CV_64FC2);
  CvMat* points2 = cvCreateMat(8,1,CV_64FC2);
  
  
  
      for (int i=0; i&lt;8; i++) {
                  cvSet2D(points1,i,0,cvScalar(gt[i].xL,gt[i].yL));
          cvSet2D(points2,i,0,cvScalar(gt[i].xR,gt[i].yR));
      }
  
      cv::Size size (imgL-&gt;width, imgL-&gt;height);
      cv::stereoRectifyUncalibrated(points1, points2, F, size, F1, F2);
  
  
  IplImage* rectL = cvCreateImage(cvSize(imgL-&gt;width,imgL-&gt;height), imgL-&gt;depth, imgL-&gt;nChannels);
  
  
  cv::warpPerspective(imgL, rectL , F1, size);
  
  
  cvSaveImage("rectL.jpg", rectL);
  </code></pre>
  
  <p>The error is the following </p>
  
  <pre><code>    error: in passing argument 2 of ‘void cv::warpPerspective(const cv::Mat&amp;, cv::Mat&amp;, const cv::Mat&amp;, cv::Size, int, int, const cv::Scalar&amp;)’
  </code></pre>
  
  <p>And if I do create a CvMat as follows</p>
  
  <pre><code>    CvMat* rectified1 = cvCreateMat(imgL-&gt;width,imgL-&gt;height,imgL-&gt;depth);
  
  
      cv::warpPerspective(imgL, *rectified1, F1,size);
  
  
     cvSaveImage("rectified1.png", imgL);
  </code></pre>
  
  <p>Then the error is in saving the image. It say that this array is not recognized.</p>
  
  <p>I am wondering if someone could please help me in this.</p>
  
  <p>Thanks a lot.</p>