shimat / opencvsharp

OpenCV wrapper for .NET
Apache License 2.0
5.22k stars 1.13k forks source link

Linetype 'Filled' not available #1536

Closed brianmanderson closed 1 year ago

brianmanderson commented 1 year ago

Summary of your issue

LineTypes.Filled not available

Environment

OpenCvSharp4 4.7.0.20230115

What did you do when you faced the problem?

I am trying to use the 'FillPoly' function within Mat and am having the issue that the points will not connect

Example code:

Mat i = new Mat();
i = new Mat(512, 512, MatType.CV_8UC1, s: Scalar.All(0));
points_list = new List<List<Point>>();
points_list.Add(new List<Point> { new Point(128, 128)});
points_list.Add(new List<Point> { new Point(128, 256) });
points_list.Add(new List<Point> { new Point(256, 256) });
points_list.Add(new List<Point> { new Point(256, 128) });
i.FillPoly(points_list, new Scalar(255), 0); // <- tried a variety of line types

Output:

What did you intend to be?

I would like to see the corners all connected Capture

brianmanderson commented 1 year ago

Mistaken way of implementing points, please ignore