C#调用opencvsharp及yolov3训练文件进行目标检测

using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using System.IO;
using OpenCvSharp;
using OpenCvSharp.Dnn;
using OpenCvSharp.Extensions;

namespace yolov4_detect
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private Mat imagein;
        private Mat imageout;
        private void Form1_Load(object sender, EventArgs e)
        {
            imagein = new Mat();
            imageout = new Mat();          
        }
        private void button1_Click(object sender, EventArgs e)
        {
            imagein = Cv2.ImRead(@"yolov3/1.bmp");
            imageout = yolov3_model(imagein);
            pictureBox1.Image = imageout.ToBitmap();
        }

        static string Cfg = "yolov3.cfg";
        static string Weight = "yolov3.weights";
        static string Names = "coco.names";
        static string Location1 = "../../bin/Debug/yolov3/";
        string[] Labels = File.ReadAllLines(Path.Combine(Location1, Names)).ToArray();
        Scalar[] Colors = Enumerable.Repeat(false, 80).Select(x => Scalar.RandomColor()).ToArray();
        private Mat yolov3_model(Mat imgSrc)
        {

https://download.csdn.net/download/Acsen_1/12723356  点击链接获源码

        }
        private Mat GetResult(IEnumerable<Mat> output, Mat image, float threshold, float nmsThreshold, bool nms = true)
        {

https://download.csdn.net/download/Acsen_1/12723356    点击链接获源码

}
        private void Draw(Mat image, int classes, float confidence, float probability, double centerX, double centerY, double width, double height)
        {

https://download.csdn.net/download/Acsen_1/12723356  点击链接获源码

}

    }
}

https://download.csdn.net/download/Acsen_1/12723356  点击链接获源码

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值