private Image <Bgr, byte> DrawinCounter() { for (int i = 0; i < contours.Size; i++) { var points = contours[i].ToArray(); GetResImage.Draw(points, new Bgr(Color.GreenYellow), 2); } return(GetResImage); }
private Image <Bgr, byte> DrawingCircle(Image <Gray, byte> FAI) { kernelSize = 9; List <CircleF> circles = FindingContourCircle(FAI); numberOfPrimitives = circles.Count; foreach (CircleF circle in circles) { GetResImage.Draw(circle, new Bgr(Color.Blue), 2); } return(GetResImage); }
private Image <Bgr, byte> DrawingRectangle() { kernelSize = 5; numberOfPrimitives = 0; for (int i = 0; i < contours.Size; i++) { VectorOfPoint approxContour = new VectorOfPoint(); CvInvoke.ApproxPolyDP( contours[i], approxContour, CvInvoke.ArcLength(contours[i], true) * 0.05, true); var points = approxContour.ToArray(); if (CvInvoke.ContourArea(approxContour, false) > MinArea && isRectangle(points)) { numberOfPrimitives++; GetResImage.Draw(CvInvoke.MinAreaRect(approxContour), new Bgr(Color.GreenYellow), 2); } } return(GetResImage); }