//public override (ThingType thing, Point2f position, double size)? GetThing() //{ // Cv2.FindContours(mask, // out Point[][] cnts, // out HierarchyIndex[] hierarchyIndices, // RetrievalModes.External, // ContourApproximationModes.ApproxSimple); // if (cnts.Any()) // { // Point[] firstItem = cnts.OrderByDescending((points) => Cv2.ContourArea(points)). // First(); // Mat color = mask.CvtColor(ColorConversionCodes.GRAY2BGR); // Cv2.DrawContours(color, new[] { firstItem }, -1, Scalar.Red); // Cv2.ImShow(nameof(SteelBallDetector), color); // Cv2.MinEnclosingCircle(firstItem, out Point2f center, out float radius); // return (ThingType.SteelBall, center, Cv2.ContourArea(firstItem)); // } // else // { // return null; // } ////Cv2.Circle(frame, center, (int)radius, Scalar.Black, 2); ////Cv2.ImShow("sou", frame); ////Mat edges = new Mat(); ////Cv2.Canny(grayImage, edges, 300, 200); ////Cv2.ImShow("res", grayImage); ////Cv2.ImShow("dege", edges); //} public SteelBallDetector(FrameSource source) : base(source) { }
////Cv2.Circle(frame, center, (int)radius, Scalar.Black, 2); ////Cv2.ImShow("sou", frame); ////Mat edges = new Mat(); ////Cv2.Canny(grayImage, edges, 300, 200); ////Cv2.ImShow("res", grayImage); ////Cv2.ImShow("dege", edges); public AppleDetector(FrameSource source) : base(source) { }
public YellowCubeDetector(FrameSource source) : base(source) { }
public BlueCubeDetector(FrameSource source) : base(source) { }
protected ThingsDetector(FrameSource source) { Source = source; }
////Cv2.Circle(frame, center, (int)radius, Scalar.Black, 2); ////Cv2.ImShow("sou", frame); ////Mat edges = new Mat(); ////Cv2.Canny(grayImage, edges, 300, 200); ////Cv2.ImShow("res", grayImage); ////Cv2.ImShow("dege", edges); public BeerDetector(FrameSource source) : base(source) { }
public GreenCubeDetector(FrameSource source) : base(source) { }
public SpriteDetector(FrameSource source) : base(source) { }
public RedCubeDetector(FrameSource source) : base(source) { }
//public override (ThingType thing, Point2f position, double size)? GetThing() //{ // Cv2.FindContours(Mask, // out Point[][] cnts, // out HierarchyIndex[] hierarchyIndices, // RetrievalModes.External, // ContourApproximationModes.ApproxSimple); // List<Point[]> couList = cnts.ToList(); // if (cnts.Any()) // { // Point[] firstItem = cnts.OrderByDescending((points) => Cv2.ContourArea(points)). // First(); // Mat color = Mask.CvtColor(ColorConversionCodes.GRAY2BGR); // Cv2.DrawContours(color, new[] { firstItem }, -1, Scalar.Red); // Cv2.ImShow(nameof(YakultDetector), color); // Cv2.MinEnclosingCircle(firstItem, out Point2f center, out float radius); // return (ThingType.Yakult, center, Cv2.ContourArea(firstItem)); // } // else // { // return null; // } //} public YakultDetector(FrameSource source) : base(source) { }
public PcmacgDetector(FrameSource source) : base(source) { }
public TennisDetector(FrameSource source) : base(source) { }