Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Find bounding box of contour

 using (MemStorage store = new MemStorage())
     for (Contour<Point> contours = canny.FindContours(Emgu.CV.CvEnum.CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_SIMPLE, Emgu.CV.CvEnum.RETR_TYPE.CV_RETR_EXTERNAL, store); contours != null; contours = contours.HNext)
     {
         Contour<Point> currentContour = contours.ApproxPoly(contours.Perimeter * 0.05, store);
         if (currentContour.Area > threshold) 
         {
             Rectangle(currentContour.BoundingRectangle.X,currentContour.BoundingRectangle.Y,currentContour.BoundingRectangle.Height,currentContour.BoundingRectangle.Width);

         }

here rectangle function call require some modification to get the boundoingbox! thank you

Find bounding box of contour

 using (MemStorage store = new MemStorage())
     for (Contour<Point> contours = canny.FindContours(Emgu.CV.CvEnum.CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_SIMPLE, Emgu.CV.CvEnum.RETR_TYPE.CV_RETR_EXTERNAL, store); contours != null; contours = contours.HNext)
     {
         Contour<Point> currentContour = contours.ApproxPoly(contours.Perimeter * 0.05, store);
         if (currentContour.Area > threshold) 
         {
             Rectangle(currentContour.BoundingRectangle.X,currentContour.BoundingRectangle.Y,currentContour.BoundingRectangle.Height,currentContour.BoundingRectangle.Width);

         }

here rectangle function call require some modification to get the boundoingbox! boundoingbox! or any other way to get find bounding box for all contours in image? thank you

Find bounding box of contour

 using (MemStorage store = new MemStorage())
     for (Contour<Point> contours = canny.FindContours(Emgu.CV.CvEnum.CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_SIMPLE, Emgu.CV.CvEnum.RETR_TYPE.CV_RETR_EXTERNAL, store); contours != null; contours = contours.HNext)
     {
         Contour<Point> currentContour = contours.ApproxPoly(contours.Perimeter * 0.05, store);
         if (currentContour.Area > threshold) 
         {
             Rectangle(currentContour.BoundingRectangle.X,currentContour.BoundingRectangle.Y,currentContour.BoundingRectangle.Height,currentContour.BoundingRectangle.Width);

         }

Error 1 'System.Drawing.Rectangle' is a 'type' but is used like a 'variable'

here rectangle function call require some modification to get the boundoingbox! or any other way to get find bounding box for all contours in image? thank you