在 emgu c# 中使用 Seq

Using Seq in emgu c#

我有一个自定义的点结构(相对于System.Drawing.Point):

struct PointD
{
    public double X,Y;
}

我想得到一个 Seq 个点,并从那里提取最小面积矩形:

using (MemStorage stor = new MemStorage())
{
    Seq<PointD> seq = new Seq<PointD>(CvInvoke.CV_MAKETYPE(6, 2), stor);
    seq.Push(new PointD(0.5, 0));
    seq.Push(new PointD(1.0, 0));
    seq.Push(new PointD(0, 1.0));
    seq.Push(new PointD(1.0, 1.0));
    var output = seq.GetMinAreaRect();
}

但是这段代码在GetMinAreaRect()处抛出异常,说输入序列必须是2d点。我的问题是有没有办法让我的数据格式正确通过?我在想我只是缺少一些东西,因为这段代码可以用于 System.Drawing.Point.

我假设以下会起作用:

int[] pts = {
  new PointF(0.5, 0),
  new PointF(1.0, 0),
  new PointF(0, 1.0),
  new PointF(1.0, 1.0)
};
MCvBox2D box = PointCollection.MinAreaRect(pts);

附加示例:http://www.emgu.com/wiki/index.php/Minimum_Area_Rectangle_in_CSharp