c# OpenCvSharp 边缘检测 Canny 算子

c# OpenCvSharp 边缘检测 Canny 算子

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>
        /// Canny算子
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCanny_Click(object sender, EventArgs e)
        {
            // 加载图像
            Mat src = Cv2.ImRead(@"img\jiang.png");
            Cv2.ImShow("原图", src);

            Mat pic = new Mat();
            Cv2.Canny(src, pic, 50, 120);

            Cv2.ImShow("Canny算子", pic);
        }
    }
}

 

发表回复

您的电子邮箱地址不会被公开。