源码:
- PointF[] points_camera = new PointF[9];
- PointF[] points_robot = new PointF[9];
- points_camera[0] = new PointF(1372.36f, 869f);
- points_camera[1] = new PointF(1758.86f, 979.07f);
- points_camera[2] = new PointF(2145.75f, 1090.03f);
- points_camera[3] = new PointF(2040.02f, 1461.64f);
- points_camera[4] = new PointF(1935.01f, 1833.96f);
- points_camera[5] = new PointF(1546.79f, 1724.21f);
- points_camera[6] = new PointF(1158.53f, 1613.17f);
- points_camera[7] = new PointF(1265.07f, 1240.49f);
- points_camera[8] = new PointF(1652.6f, 1351.27f);
- points_robot[0] = new PointF(98.884f, 320.881f);
- points_robot[1] = new PointF(109.81f, 322.27f);
- points_robot[2] = new PointF(120.62f, 323.695f);
- points_robot[3] = new PointF(121.88f, 313.154f);
- points_robot[4] = new PointF(123.111f, 302.671f);
- points_robot[5] = new PointF(112.23f, 301.107f);
- points_robot[6] = new PointF(101.626f, 299.816f);
- points_robot[7] = new PointF(100.343f, 310.447f);
- points_robot[8] = new PointF(111.083f, 311.665f);
- Mat warpMat;
- warpMat = CvInvoke.EstimateRigidTransform(points_camera, points_robot, true);
- Image<Gray, float> img = warpMat.ToImage<Gray, float>();
- float A = img.Data[0, 0, 0];
- float B = img.Data[0, 1, 0];
- float C = img.Data[0, 2, 0];
- float D = img.Data[1, 0, 0];
- float E = img.Data[1, 1, 0];
- float F = img.Data[1, 2, 0];
复制代码
报错位置:warpMat = CvInvoke.EstimateRigidTransform(points_camera, points_robot, true);
异常提示:引发的异常:“System.TypeInitializationException"
已尝试解决方法:
1.修改86/64平台
2.添加环境变量 D:\Program Files\Emgu\emgucv-windesktop 3.4.3.3016\bin
以上均无效
请大神提供解决思路 |