Home > Software engineering >  About c # opencv warpPerspective function problem
About c # opencv warpPerspective function problem

Time:11-22

This is my code
 
Private void button3_Click (object sender, EventArgs e)
{
Mat img=Cv2. ImRead (" P1050219. JPG ");
ListPts1. Add (new OpenCvSharp. Point (69, 163));
Pts1. Add (new OpenCvSharp. Point (704, 62));
Pts1. Add (new OpenCvSharp. Point (162, 675));
Pts1. Add (new OpenCvSharp. Point (970, 411));
IEnumerableListPts2. Add (new OpenCvSharp. Point (0, 1000));
Pts2. Add (new OpenCvSharp. Point (0, 0));
Pts2. Add (new OpenCvSharp. Point (750, 1000));
Pts2. Add (new OpenCvSharp. Point (750, 0));
IEnumerableMat M=Cv2 GetPerspectiveTransform (pts1 pts2);
Mat DST=null;
OpenCvSharp. Size q=new OpenCvSharp. Size (750100);
Cv2. WarpPerspective (img, DST, M, q, InterpolationFlags. Linear, BorderTypes. Constant);
This. The pictureBox. The Show ();
Enclosing pictureBox. Image=DST. ToBitmap ();
}


After the operation error, don't know how to change, a great god answers,

Error, according to the system. Argumentnullexception value cannot be null.
Arg_paramname_name

  • Related