错误CS0119:表达式表示“类型”,其中需要“变量”,“值”或“方法组”

时间:2015-10-26 14:35:41

标签: opencv unity3d opencvsharp

public Point[] calc_peaks (Mat im,
                   Point[] points,
                   OpenCvSharp.CvSize ssize)
    {
            int n = points.Length;
            Mat matpoints = OpenCvSharp.CPlusPlus.MatOfPoint2f (points);
            using (Mat pt = (new MatOfPoint2f (matpoints)).Reshape (1, 2 * n))

我在Unity上尝试了这个代码,它说在以下位置有一个Cs0119错误:

Mat matpoints = OpenCvSharp.CPlusPlus.MatOfPoint2f (points) 

它让我抓狂!我试图删除错误行;但是它说:

  

错误CS1503:参数#1'无法将OpenCvSharp.CPlusPlus.Point[]表达式转换为System.IntPtr类型

1 个答案:

答案 0 :(得分:2)

非常确定问题是MatOfPoint2f()想要一个Point,但是你给它一个Points数组