Esempio n. 1
0
        public Bitmap SetEdgesCirlceROI(int X, int Y, double radius)
        {
            Bitmap bmp = new Bitmap(1280, 1024);

            Emgu.CV.Image <Gray, byte> imgRoi = new Emgu.CV.Image <Gray, byte>(bmp);
            imgRoi.SetZero();

            Emgu.CV.Image <Gray, byte> imgCircleFilter = new Emgu.CV.Image <Gray, byte>(1280, 1024);
            imgCircleFilter.SetZero();

            PointF  centerPoint = new PointF((float)X, (float)Y);
            SizeF   size        = new SizeF((float)(radius * 2.0), (float)(radius * 2.0));
            Ellipse circle      = new Ellipse(centerPoint, size, 0.0f);

            imgCircleFilter.Draw(circle, new Gray(255), -1, LineType.EightConnected);

            imgEdgesROI = imgEdges.And(imgCircleFilter);

            imgRoi = imgEdgesROI;
            return(imgRoi.Bitmap);
        }