EmguCV蛇函数

问题描述 投票:1回答:2

我正在尝试使用EmguCV中的蛇活动轮廓,但我什么也不做。这是我的代码:

     Image<Gray, Byte> img = new Image<Gray, Byte>(300, 300, new Gray());

     Point center = new Point(100, 100);
     double width = 20;
     double height = 40;
     Rectangle rect = new Rectangle(center, new Size(20, 20));
     img.Draw(rect, new Gray(255.0), -1);

     using (MemStorage stor = new MemStorage())
     {
        Seq<Point> pts = new Seq<Point>((int)SEQ_TYPE.CV_SEQ_POLYGON, stor);
        pts.Push(new Point(20, 20));
        pts.Push(new Point(20, 280));
        pts.Push(new Point(280, 280));
        pts.Push(new Point(280, 20));

        //Image<Gray, Byte> canny = img.Canny(100.0, 40.0);
        Seq<Point> snake = img.Snake(pts, 0.1f, 0.5f, 0.4f, new Size(21, 21), new MCvTermCriteria(500, 0.1), stor);

        img.Draw(pts, new Gray(120), 1);
        img.Draw(snake, new Gray(80), 2);

我在做什么错?有什么主意吗?

c# emgucv
2个回答
4
投票

您错过了绘制初始化点的过程。


0
投票

嗨,为什么我无法在上述版本3中找到此蛇函数。请指教

© www.soinside.com 2019 - 2024. All rights reserved.