這是我的代碼
private void button3_Click(object sender, EventArgs e)
{
Mat img = Cv2.ImRead("P1050219.JPG");
List<Point2f> pts1 = new List<Point2f>();
pts1.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));
IEnumerable<Point2f> pts11 = pts1 as IEnumerable<Point2f>;
List<Point2f> pts2 = new List<Point2f>();
pts2.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));
IEnumerable<Point2f> pts22 = pts1 as IEnumerable<Point2f>;
Mat M = Cv2.GetPerspectiveTransform( pts1, pts2);
Mat dst = null;
OpenCvSharp.Size q = new OpenCvSharp.Size(750,1000);
Cv2.WarpPerspective(img, dst, M, q, InterpolationFlags.Linear, BorderTypes.Constant);
this.pictureBox.Show();
this.pictureBox.Image = dst.ToBitmap();
}
運行后報錯,不知道咋改,求大神解答。
報錯顯示:system.argumentnullexception值不能為null.
arg_paramname_name
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/31954.html
標籤:圖形處理/算法
上一篇:xyd00.exe 中的 0x0f9dab46 (XYD_dll.dll) 處有未經處理的例外: 0xC0000005: 讀取位置 0x30001708 時發生
