轮廓检测

偶遇需要轮廓检测

private System.Collections.Generic.IEnumerable<Contour<System.Drawing.Point>> FindContour(Image<Gray, byte> frame, double accuracy)

        {

            double num = (double)(frame.Width * frame.Height);

            for (Contour<System.Drawing.Point> contour = frame.FindContours(CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_SIMPLE, RETR_TYPE.CV_RETR_TREE); contour != null; contour = contour.HNext)

            {

                yield return contour.ApproxPoly(accuracy, 2, new MemStorage());

            }

            yield break;

        }
View Code

Emgu.CV地址:http://files.cnblogs.com/jiailiuyan/Emgu.CV.rar

你可能感兴趣的:(轮廓检测)