C# yolov8 OpenVINO 同步、异步接口视频推理

C# yolov8 OpenVINO 同步、异步接口视频推理

目录

效果

项目

代码

下载


效果

同步推理效果

异步推理效果

 

项目

代码

using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;


namespace yolov8_OpenVINO_Demo
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        string imgFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";

        YoloV8 yoloV8;
        YoloV8Async yoloV8Async;

        string model_path;

        string video_path = "";
        string videoFilter = "*.mp4|*.mp4;";
        VideoCapture vcapture;

        /// <summary>
        /// 窗体加载,初始化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form1_Load(object sender, EventArgs e)
        {
            model_path = "model/yolov8n.onnx";
            yoloV8 = new YoloV8(model_path, "model/lable.txt");

            yoloV8Async = new YoloV8Async(model_path, "model/lable.txt");
        }

        /// <summary>
        /// 选择视频
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button4_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = videoFilter;
            ofd.InitialDirectory = Application.StartupPath + "\\test";
            if (ofd.ShowDialog() != DialogResult.OK) return;

            video_path = ofd.FileName;
            textBox1.Text = "";

        }

        /// <summary>
        /// 同步接口-视频推理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button3_Click(object sender, EventArgs e)
        {
            if (video_path == "")
            {
                MessageBox.Show("请先选择视频!");
                return;
            }

            textBox1.Text = "开始检测";

            Application.DoEvents();

            Thread thread = new Thread(new ThreadStart(VideoDetection));

            thread.Start();
            thread.Join();

            textBox1.Text = "检测完成!";
        }

        void VideoDetection()
        {
            vcapture = new VideoCapture(video_path);
            if (!vcapture.IsOpened())
            {
                MessageBox.Show("打开视频文件失败");
                return;
            }

            Mat frame = new Mat();
            List<DetectionResult> detResults;

            // 获取视频的fps
            double videoFps = vcapture.Get(VideoCaptureProperties.Fps);
            // 计算等待时间(毫秒)
            int delay = (int)(1000 / videoFps);
            Stopwatch _stopwatch = new Stopwatch();

            Cv2.NamedWindow("DetectionResult 按下ESC,退出", WindowFlags.Normal);
            Cv2.ResizeWindow("DetectionResult 按下ESC,退出", vcapture.FrameWidth / 2, vcapture.FrameHeight / 2);

            while (vcapture.Read(frame))
            {
                if (frame.Empty())
                {
                    MessageBox.Show("读取失败");
                    return;
                }

                _stopwatch.Restart();

                delay = (int)(1000 / videoFps);

                detResults = yoloV8.Detect(frame);

                //绘制结果
                foreach (DetectionResult r in detResults)
                {
                    Cv2.PutText(frame, $"{r.Class}:{r.Confidence:P0}", new OpenCvSharp.Point(r.Rect.TopLeft.X, r.Rect.TopLeft.Y - 10), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                    Cv2.Rectangle(frame, r.Rect, Scalar.Red, thickness: 2);
                }

                Cv2.PutText(frame, "preprocessTime:" + yoloV8.preprocessTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 30), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                Cv2.PutText(frame, "inferTime:" + yoloV8.inferTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 70), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                Cv2.PutText(frame, "postprocessTime:" + yoloV8.postprocessTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 110), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                Cv2.PutText(frame, "totalTime:" + yoloV8.totalTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 150), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                Cv2.PutText(frame, "video fps:" + videoFps.ToString("F2"), new OpenCvSharp.Point(10, 190), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                Cv2.PutText(frame, "det fps:" + yoloV8.detFps.ToString("F2"), new OpenCvSharp.Point(10, 230), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);

                Cv2.ImShow("DetectionResult 按下ESC,退出", frame);

                //for test
                delay = 1;
                //delay = (int)(delay - _stopwatch.ElapsedMilliseconds);
                //if (delay <= 0)
                //{
                //    delay = 1;
                //}
                //Console.WriteLine("delay:" + delay.ToString()) ;
                if (Cv2.WaitKey(delay) == 27 || Cv2.GetWindowProperty("DetectionResult 按下ESC,退出", WindowPropertyFlags.Visible) < 1.0)
                {
                    Cv2.DestroyAllWindows();
                    vcapture.Release();
                    break; // 如果按下ESC,退出循环
                }
            }

            Cv2.DestroyAllWindows();
            vcapture.Release();
        }


        /// <summary>
        /// 异步接口-视频推理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            if (video_path == "")
            {
                MessageBox.Show("请先选择视频!");
                return;
            }

            textBox1.Text = "开始异步推理检测";

            Application.DoEvents();

            Thread thread = new Thread(new ThreadStart(VideoDetectionAsync));

            thread.Start();
            thread.Join();

            textBox1.Text = "异步推理检测完成!";
        }

        void VideoDetectionAsync()
        {
            vcapture = new VideoCapture(video_path);
            if (!vcapture.IsOpened())
            {
                MessageBox.Show("打开视频文件失败");
                return;
            }

            Mat frame = new Mat();
            List<DetectionResult> detResults;

            // 获取视频的fps
            double videoFps = vcapture.Get(VideoCaptureProperties.Fps);
            // 计算等待时间(毫秒)
            int delay = (int)(1000 / videoFps);
            Stopwatch _stopwatch = new Stopwatch();

            Cv2.NamedWindow("DetectionResult 按下ESC,退出", WindowFlags.Normal);
            Cv2.ResizeWindow("DetectionResult 按下ESC,退出", vcapture.FrameWidth / 2, vcapture.FrameHeight / 2);

            vcapture.Read(frame);

            while (true)
            {
                if (!vcapture.Read(frame))
                {
                    break;
                }

                detResults = yoloV8Async.Detect(frame);

                //绘制结果
                foreach (DetectionResult r in detResults)
                {
                    Cv2.PutText(frame, $"{r.Class}:{r.Confidence:P0}", new OpenCvSharp.Point(r.Rect.TopLeft.X, r.Rect.TopLeft.Y - 10), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                    Cv2.Rectangle(frame, r.Rect, Scalar.Red, thickness: 2);
                }
                Cv2.PutText(frame, "preprocessTime:" + yoloV8Async.preprocessTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 30), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                Cv2.PutText(frame, "inferTime:" + yoloV8Async.inferTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 70), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                Cv2.PutText(frame, "postprocessTime:" + yoloV8Async.postprocessTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 110), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                Cv2.PutText(frame, "totalTime:" + yoloV8Async.totalTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 150), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                Cv2.PutText(frame, "video fps:" + videoFps.ToString("F2"), new OpenCvSharp.Point(10, 190), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);
                Cv2.PutText(frame, "det fps:" + yoloV8Async.detFps.ToString("F2"), new OpenCvSharp.Point(10, 230), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);

                Cv2.ImShow("DetectionResult 按下ESC,退出", frame);

                // for test
                delay = 1;
                //delay = (int)(delay - _stopwatch.ElapsedMilliseconds);
                //if (delay <= 0)
                //{
                //    delay = 1;
                //}
                //Console.WriteLine("delay:" + delay.ToString()) ;
                if (Cv2.WaitKey(delay) == 27 || Cv2.GetWindowProperty("DetectionResult 按下ESC,退出", WindowPropertyFlags.Visible) < 1.0)
                {
                    Cv2.DestroyAllWindows();
                    vcapture.Release();
                    break; // 如果按下ESC,退出循环
                }
            }

            Cv2.DestroyAllWindows();
            vcapture.Release();
        }

    }

}

using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;namespace yolov8_OpenVINO_Demo
{public partial class Form2 : Form{public Form2(){InitializeComponent();}string imgFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";YoloV8 yoloV8;YoloV8Async yoloV8Async;string model_path;string video_path = "";string videoFilter = "*.mp4|*.mp4;";VideoCapture vcapture;/// <summary>/// 窗体加载,初始化/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void Form1_Load(object sender, EventArgs e){model_path = "model/yolov8n.onnx";yoloV8 = new YoloV8(model_path, "model/lable.txt");yoloV8Async = new YoloV8Async(model_path, "model/lable.txt");}/// <summary>/// 选择视频/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button4_Click(object sender, EventArgs e){OpenFileDialog ofd = new OpenFileDialog();ofd.Filter = videoFilter;ofd.InitialDirectory = Application.StartupPath + "\\test";if (ofd.ShowDialog() != DialogResult.OK) return;video_path = ofd.FileName;textBox1.Text = "";}/// <summary>/// 同步接口-视频推理/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button3_Click(object sender, EventArgs e){if (video_path == ""){MessageBox.Show("请先选择视频!");return;}textBox1.Text = "开始检测";Application.DoEvents();Thread thread = new Thread(new ThreadStart(VideoDetection));thread.Start();thread.Join();textBox1.Text = "检测完成!";}void VideoDetection(){vcapture = new VideoCapture(video_path);if (!vcapture.IsOpened()){MessageBox.Show("打开视频文件失败");return;}Mat frame = new Mat();List<DetectionResult> detResults;// 获取视频的fpsdouble videoFps = vcapture.Get(VideoCaptureProperties.Fps);// 计算等待时间(毫秒)int delay = (int)(1000 / videoFps);Stopwatch _stopwatch = new Stopwatch();Cv2.NamedWindow("DetectionResult 按下ESC,退出", WindowFlags.Normal);Cv2.ResizeWindow("DetectionResult 按下ESC,退出", vcapture.FrameWidth / 2, vcapture.FrameHeight / 2);while (vcapture.Read(frame)){if (frame.Empty()){MessageBox.Show("读取失败");return;}_stopwatch.Restart();delay = (int)(1000 / videoFps);detResults = yoloV8.Detect(frame);//绘制结果foreach (DetectionResult r in detResults){Cv2.PutText(frame, $"{r.Class}:{r.Confidence:P0}", new OpenCvSharp.Point(r.Rect.TopLeft.X, r.Rect.TopLeft.Y - 10), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.Rectangle(frame, r.Rect, Scalar.Red, thickness: 2);}Cv2.PutText(frame, "preprocessTime:" + yoloV8.preprocessTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 30), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.PutText(frame, "inferTime:" + yoloV8.inferTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 70), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.PutText(frame, "postprocessTime:" + yoloV8.postprocessTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 110), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.PutText(frame, "totalTime:" + yoloV8.totalTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 150), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.PutText(frame, "video fps:" + videoFps.ToString("F2"), new OpenCvSharp.Point(10, 190), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.PutText(frame, "det fps:" + yoloV8.detFps.ToString("F2"), new OpenCvSharp.Point(10, 230), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.ImShow("DetectionResult 按下ESC,退出", frame);//for testdelay = 1;//delay = (int)(delay - _stopwatch.ElapsedMilliseconds);//if (delay <= 0)//{//    delay = 1;//}//Console.WriteLine("delay:" + delay.ToString()) ;if (Cv2.WaitKey(delay) == 27 || Cv2.GetWindowProperty("DetectionResult 按下ESC,退出", WindowPropertyFlags.Visible) < 1.0){Cv2.DestroyAllWindows();vcapture.Release();break; // 如果按下ESC,退出循环}}Cv2.DestroyAllWindows();vcapture.Release();}/// <summary>/// 异步接口-视频推理/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button1_Click(object sender, EventArgs e){if (video_path == ""){MessageBox.Show("请先选择视频!");return;}textBox1.Text = "开始异步推理检测";Application.DoEvents();Thread thread = new Thread(new ThreadStart(VideoDetectionAsync));thread.Start();thread.Join();textBox1.Text = "异步推理检测完成!";}void VideoDetectionAsync(){vcapture = new VideoCapture(video_path);if (!vcapture.IsOpened()){MessageBox.Show("打开视频文件失败");return;}Mat frame = new Mat();List<DetectionResult> detResults;// 获取视频的fpsdouble videoFps = vcapture.Get(VideoCaptureProperties.Fps);// 计算等待时间(毫秒)int delay = (int)(1000 / videoFps);Stopwatch _stopwatch = new Stopwatch();Cv2.NamedWindow("DetectionResult 按下ESC,退出", WindowFlags.Normal);Cv2.ResizeWindow("DetectionResult 按下ESC,退出", vcapture.FrameWidth / 2, vcapture.FrameHeight / 2);vcapture.Read(frame);while (true){if (!vcapture.Read(frame)){break;}detResults = yoloV8Async.Detect(frame);//绘制结果foreach (DetectionResult r in detResults){Cv2.PutText(frame, $"{r.Class}:{r.Confidence:P0}", new OpenCvSharp.Point(r.Rect.TopLeft.X, r.Rect.TopLeft.Y - 10), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.Rectangle(frame, r.Rect, Scalar.Red, thickness: 2);}Cv2.PutText(frame, "preprocessTime:" + yoloV8Async.preprocessTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 30), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.PutText(frame, "inferTime:" + yoloV8Async.inferTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 70), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.PutText(frame, "postprocessTime:" + yoloV8Async.postprocessTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 110), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.PutText(frame, "totalTime:" + yoloV8Async.totalTime.ToString("F2") + "ms", new OpenCvSharp.Point(10, 150), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.PutText(frame, "video fps:" + videoFps.ToString("F2"), new OpenCvSharp.Point(10, 190), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.PutText(frame, "det fps:" + yoloV8Async.detFps.ToString("F2"), new OpenCvSharp.Point(10, 230), HersheyFonts.HersheySimplex, 1, Scalar.Red, 2);Cv2.ImShow("DetectionResult 按下ESC,退出", frame);// for testdelay = 1;//delay = (int)(delay - _stopwatch.ElapsedMilliseconds);//if (delay <= 0)//{//    delay = 1;//}//Console.WriteLine("delay:" + delay.ToString()) ;if (Cv2.WaitKey(delay) == 27 || Cv2.GetWindowProperty("DetectionResult 按下ESC,退出", WindowPropertyFlags.Visible) < 1.0){Cv2.DestroyAllWindows();vcapture.Release();break; // 如果按下ESC,退出循环}}Cv2.DestroyAllWindows();vcapture.Release();}}}

下载

源码下载

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/29545.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

智源更新大模型排行榜:豆包大模型“客观评测”排名国产第一

6月中旬&#xff0c;智源研究院旗下的 FlagEval 大模型评测平台发布最新榜单&#xff1a;在有标准答案的“客观评测”中&#xff0c;GPT-4 以76.11分在闭源大模型中排名第一&#xff1b;Doubao-Pro&#xff08;豆包大模型&#xff09;以75.96分排名第二&#xff0c;同时也是得分…

隧道代理是什么?怎么运作的?

隧道代理作为网络代理的一种形式&#xff0c;已经在现代互联网世界中扮演着重要的角色。无论是保护隐私、访问受限网站还是实现网络流量的安全传输&#xff0c;隧道代理都发挥着重要作用。在本文中&#xff0c;我们将深入探讨隧道代理的概念、运作方式以及在不同场景中的应用。…

天风宏观:再论经济“去金融化”

天风宏观认为&#xff0c;经济“去地产化”之后也正在“去金融化”&#xff0c;应逐渐淡化金融数据对于经济的指示意义&#xff0c;更关注经济数据本身和进行中的结构转型。 5月金融数据延续了此前逻辑&#xff0c; 受规范手工补息、存款分流等因素影响&#xff0c;M1同比-4.2%…

【多线程】线程状态

&#x1f970;&#x1f970;&#x1f970;来都来了&#xff0c;不妨点个关注叭&#xff01; &#x1f449;博客主页&#xff1a;欢迎各位大佬!&#x1f448; 文章目录 1. 枚举线程所有状态2. 线程转移2.1 示意图2.2 观察 NEW 、 RUNNABLE 、 TERMINATED 状态的转换2.3 观察 WAI…

【K8S】通过官方 kubeadm 快速搭建 Kubernetes 集群

文章目录 1、环境准备2、搭建流程2.1、初始化配置2.2、安装 Docker2.3、部署 K8S 1、环境准备 针对本次K8S集群搭建环境&#xff0c;可以使用虚拟机&#xff0c;不过这里我直接模拟真实生产线上环境&#xff0c;忍痛购买了3台阿里云ECS服务器&#xff0c;服务器信息如下&#…

决定罗德岛州(Rhode Island)版图的关键历史事件

决定罗德岛州&#xff08;Rhode Island&#xff09;版图的关键历史事件&#xff1a; 1. 早期探索与定居&#xff1a;罗德岛州的早期历史与英国*民者有关&#xff0c;特别是宗教难民的定居。1636年&#xff0c;为了逃避马萨诸塞湾*民地的宗教迫害&#xff0c;罗杰威廉姆斯建立了…

可以聊天的ai软件有实用的吗?分享3个智能的软件!

在数字化浪潮席卷而来的今天&#xff0c;人工智能&#xff08;AI&#xff09;技术已经深入我们生活的方方面面&#xff0c;其中AI聊天软件以其独特的交互方式和智能化的对话体验&#xff0c;吸引了众多用户的关注。本文将为您盘点当前市场上热门的AI聊天软件&#xff0c;带您领…

MCK主机加固在防漏扫中的关键作用

在当今这个信息化飞速发展的时代&#xff0c;网络安全成为了企业不可忽视的重要议题。漏洞扫描&#xff0c;简称漏扫&#xff0c;是一种旨在发现计算机系统、网络或应用程序中潜在安全漏洞的技术手段。通过自动化工具&#xff0c;漏扫能够识别出系统中存在的已知漏洞&#xff0…

PyCharm QThread 设置断点不起作用

背景&#xff1a; 端午节回来上班第一天&#xff0c;不想干活&#xff0c;领导又再后面看着&#xff0c;突然想起一个有意思的问题&#xff0c;为啥我的程序在子进程QThread的子类里打的断点不好用呢&#xff1f;那就解决一下这个问题吧。 原因&#xff1a; 如果您的解释器上…

GitHub加载慢怎么解决

选了一个最简单的方法记录一下 一、GitHub为什么加载这么慢 简而言之就是&#xff0c;国内DNS默认解析到美国服务器&#xff08;慢&#xff09;&#xff0c;我们只要绕过DNS解析&#xff0c;直接访问韩国日本服务器&#xff08;快&#xff09;就可以解决访问缓慢的问题。 二、…

一个按钮更改Notes字体大小

大家好&#xff0c;才是真的好。 在说到正文以前&#xff0c;我们还是提两句&#xff0c;上周HCL发布了Notes/Domino 12.0.2FP4补丁&#xff0c;以及在亚马逊云应用市场上架了HCL Domino 14.0。 现在谈谈正文部分。 随着岁月飞逝&#xff0c;使用Notes的人也开始日渐眼花&a…

Mac M3 Pro 安装 Zookeeper-3.4.6

1、下载安装包 官方下载地址&#xff1a;https://archive.apache.org/dist/zookeeper/ 网盘下载地址&#xff1a;https://pan.baidu.com/s/1j6iy5bZkrY-GKGItenRB2w?pwdirrx 提取码: irrx 2、解压并添加环境变量 # 将安装包移动到目标目录 mv ~/Download/zookeeper-3.4.6.…

vue3根据按钮切换更新echarts对应的数据

效果图 初始化注意 setOption的函数定义&#xff0c;option是指图表的配置项和数据&#xff0c;notMerge是指是否不跟之前设置的 option 进行合并。默认为 false。即表示合并。如果为 true&#xff0c;表示所有组件都会被删除&#xff0c;然后根据新option 创建所有新组件 //…

vue引入aos.js实现滚动动画

aos.js官方网站&#xff1a;http://michalsnik.github.io/aos/ aos.js介绍 AOS (Animate on Scroll) 是一个轻量级的JavaScript库&#xff0c;用于实现当页面元素随着用户滚动进入可视区域时触发动画效果。它不需要依赖 jQuery&#xff0c;可以很容易地与各种Web开发框架&#…

MikroTik RouterOS 授权签名验证分析

MikroTik 软路由 百科https://baike.baidu.com/item/mikrotik/9776775官网https://mikrotik.com/ 授权文件分析 -----BEGIN MIKROTIK SOFTWARE KEY------------ mr3jH5qhn9irtF53ZICFTN7Tk7wIx7ZkxdAxJ19ydASY ShhFteHMntBTyaS8wuNdIJJPidJxbuNPLTvCsv7zLA …

STM32学习笔记(八)--DMA直接存储器存取详解

&#xff08;1&#xff09;配置步骤1.配置RCC外设时钟 开启DMA外设2.初始化DMA外设 调用DMA_Init 外设存储器站点的起始地址 数据宽度 地址是否自增 方向 传输计数器 是否需要自动重装 选择触发源 通道优先级3.开启DMA控制 4.开启触发信号输出&#xff08;如果需要硬件触发&…

在线报表设计器 ,FastReport Online Designer 2024.2新版本(下)

在上篇文章《在线报表设计器 &#xff0c;FastReport Online Designer 2024.2新版本&#xff08;上&#xff09; 》中&#xff0c;我们已经介绍了部分在线设计器的新功能&#xff0c;这部分将继续为大家介绍其他新功能&#xff0c;欢迎查阅~ 报告设计器中的功能进行了大规模更…

对input输入框的正则限制

一、0-100的整数 正则&#xff1a; const inputRules ref([{required: false,trigger: "blur",validator: (rule, value, callback) > {const reg /^[0-9]$/; // 只允许整数if ((0 < value && value < 100 && reg.test(value)) ||valu…

AI时代的数据治理:挑战与策略

随着人工智能&#xff08;AI&#xff09;技术的突飞猛进&#xff0c;我们已迈进智能时代的大门。在这个新时代里&#xff0c;数据无疑成为推动AI创新与进步的核心力量。然而&#xff0c;与此同时&#xff0c;数据治理的紧迫性也日益凸显&#xff0c;它成为确保AI系统有效、公正…

【STM32】GPIO简介

1.GPIO简介 GPIO是通用输入输出端口的简称&#xff0c;简单来说就是STM32可控制的引脚&#xff0c;STM32芯片的GPIO引脚与外部设备连接起来&#xff0c;从而实现与外部通讯、控制以及数据采集的功能。 STM32芯片的GPIO被分成很多组&#xff0c;每组有16个引脚。 最基本的输出…