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 点击链接获源码
}
}
}