Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You should use EmguCv classes and C# features. Here is a small toy example that replicate what you want to do :

         using (MemStorage storage = new MemStorage()) //allocate storage for contour approximation         
     {
         Contour<Point> contour = new Contour<Point>(storage);


             contour.Push(new Point(0, 0));
             contour.Push(new Point(0, 10));
             contour.Push(new Point(10, 10));
             contour.Push(new Point(10, 0));

         double area0 = contour.Area;
         Contour<Point> approxContour = contour.ApproxPoly(contour.Perimeter * 0.05, storage);
     }

Hope this helps, Luca