using OpenCvSharp; using OpenCvSharp.Extensions; using DlibDotNet; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Threading; namespace app { public partial class FrmMain : Form { public FrmMain() { InitializeComponent(); } /// <summary> /// 绘制圆形 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnCricle1_Click(object sender, EventArgs e) { // 创建一张大小为500*500图像 Mat src = new Mat(500, 500, MatType.CV_8UC3, new Scalar(255, 255, 255)); // 红色线条 Scalar color = new Scalar(0, 0, 255); // 填充 Cv2.Circle(src, new OpenCvSharp.Point(100, 100), 50, color, -1); // 线条 Cv2.Circle(src, new OpenCvSharp.Point(250, 250), 50, color, 1, LineTypes.Link8); Cv2.ImShow("圆 填充", src); Cv2.WaitKey(); } } }