C# OpenCvSharp 部署文档矫正,包括文档扭曲/模糊/阴影等情况

目录

说明

效果

模型

项目

代码

下载

参考


C# OpenCvSharp 部署文档矫正,包括文档扭曲/模糊/阴影等情况

说明

地址:https://github.com/RapidAI/RapidUnDistort

修正文档扭曲/模糊/阴影等情况,使用onnx模型简单轻量部署,未来持续跟进最新最好的文档矫正方案和模型,Correct document distortion using a lightweight ONNX model for easy deployment. We will continue to follow and integrate the latest and best document correction solutions and models in the future. 

效果

模型

drnet.onnx

Model Properties
-------------------------
---------------------------------------------------------------

Inputs
-------------------------
name:input
tensor:Float[-1, 6, -1, -1]
---------------------------------------------------------------

Outputs
-------------------------
name:output
tensor:Float[-1, 3, -1, -1]
---------------------------------------------------------------

gcnet.onnx

Model Properties
-------------------------
---------------------------------------------------------------

Inputs
-------------------------
name:input
tensor:Float[-1, 3, -1, -1]
---------------------------------------------------------------

Outputs
-------------------------
name:output
tensor:Float[-1, 3, -1, -1]
---------------------------------------------------------------

nafdpm.onnx

Model Properties
-------------------------
---------------------------------------------------------------

Inputs
-------------------------
name:input
tensor:Float[-1, 3, -1, -1]
---------------------------------------------------------------

Outputs
-------------------------
name:output
tensor:Float[-1, -1, -1, -1]
---------------------------------------------------------------

unetcnn.onnx

Model Properties
-------------------------
---------------------------------------------------------------

Inputs
-------------------------
name:input
tensor:Float[-1, 3, -1, -1]
---------------------------------------------------------------

Outputs
-------------------------
name:output
tensor:Float[-1, 1, -1, -1]
---------------------------------------------------------------

uvdoc.onnx

Model Properties
-------------------------
---------------------------------------------------------------

Inputs
-------------------------
name:input
tensor:Float[-1, 3, -1, -1]
---------------------------------------------------------------

Outputs
-------------------------
name:output
tensor:Float[-1, 2, -1, -1]
name:546
tensor:Float[-1, 3, -1, -1]
---------------------------------------------------------------

项目

代码

using OpenCvSharp;
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;

namespace DocumentUndistort
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        Stopwatch stopwatch = new Stopwatch();
        Mat image;
        Mat out_img;
        string image_path;
        string startupPath;
        string fileFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";
        const string DllName = "DocumentUndistortSharp.dll";
        IntPtr engine;

        /*
         //初始化
        extern "C" _declspec(dllexport) int __cdecl  init(void** engine, char* binary_model_path, char* unblur_model_path, char* unshadow_model_gcnet_path, char* unshadow_model_drnet_path, char* unwrap_model_path, char* msg);

        //binary
        extern "C" _declspec(dllexport) int __cdecl  binary(void* engine, Mat* srcimg, char* msg, Mat* out_img);

        //unblur
        extern "C" _declspec(dllexport) int __cdecl  unblur(void* engine, Mat* srcimg, char* msg, Mat* out_img);

        //unshadow
        extern "C" _declspec(dllexport) int __cdecl  unshadow(void* engine, Mat* srcimg, char* msg, Mat* out_img);

        //unwrap
        extern "C" _declspec(dllexport) int __cdecl  unwrap(void* engine, Mat* srcimg, char* msg, Mat* out_img);

        //openCvBilateral
        extern "C" _declspec(dllexport) int __cdecl  openCvBilateral(Mat* srcimg, char* msg, Mat* out_img);

        //释放
        extern "C" _declspec(dllexport) void __cdecl destroy(void* engine);
         */


        [DllImport(DllName, EntryPoint = "init", CallingConvention = CallingConvention.Cdecl)]
        internal extern static int init(ref IntPtr engine, string binary_model_path, string unblur_model_path, string unshadow_model_gcnet_path, string unshadow_model_drnet_path, string unwrap_model_path, StringBuilder msg);

        [DllImport(DllName, EntryPoint = "binary", CallingConvention = CallingConvention.Cdecl)]
        internal extern static int binary(IntPtr engine, IntPtr srcimg, StringBuilder msg, IntPtr out_img);

        [DllImport(DllName, EntryPoint = "unblur", CallingConvention = CallingConvention.Cdecl)]
        internal extern static int unblur(IntPtr engine, IntPtr srcimg, StringBuilder msg, IntPtr out_img);

        [DllImport(DllName, EntryPoint = "unshadow", CallingConvention = CallingConvention.Cdecl)]
        internal extern static int unshadow(IntPtr engine, IntPtr srcimg, StringBuilder msg, IntPtr out_img);

        [DllImport(DllName, EntryPoint = "unwrap", CallingConvention = CallingConvention.Cdecl)]
        internal extern static int unwrap(IntPtr engine, IntPtr srcimg, StringBuilder msg, IntPtr out_img);

        [DllImport(DllName, EntryPoint = "openCvBilateral", CallingConvention = CallingConvention.Cdecl)]
        internal extern static int openCvBilateral(IntPtr srcimg, StringBuilder msg, IntPtr out_img);

        [DllImport(DllName, EntryPoint = "destroy", CallingConvention = CallingConvention.Cdecl)]
        internal extern static int destroy(IntPtr engine);

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = fileFilter;
            if (ofd.ShowDialog() != DialogResult.OK) return;

            pictureBox1.Image = null;
            pictureBox2.Image = null;
            textBox1.Text = "";

            image_path = ofd.FileName;
            pictureBox1.Image = new Bitmap(image_path);
            image = new Mat(image_path);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            startupPath = Application.StartupPath;

            string binary_model_path = startupPath + "\\model\\unetcnn.onnx";
            string unblur_model_path = startupPath + "\\model\\nafdpm.onnx";
            string unshadow_model_gcnet_path = startupPath + "\\model\\gcnet.onnx";
            string unshadow_model_drnet_path = startupPath + "\\model\\drnet.onnx";
            string unwrap_model_path = startupPath + "\\model\\uvdoc.onnx";

            StringBuilder msg = new StringBuilder(512);

            int res = init(ref engine, binary_model_path, unblur_model_path, unshadow_model_gcnet_path, unshadow_model_drnet_path, unwrap_model_path, msg);
            if (res == -1)
            {
                MessageBox.Show(msg.ToString());
                return;
            }
            else
            {
                Console.WriteLine(msg.ToString());
            }
            image_path = startupPath + "\\test_img\\2.jpg";
            pictureBox1.Image = new Bitmap(image_path);
            image = new Mat(image_path);
        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            destroy(engine);
        }

        /// <summary>
        /// unwrap
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            if (image_path == "")
            {
                return;
            }

            textBox1.Text = "执行中……";
            Application.DoEvents();

            if (image != null) image.Dispose();
            if (out_img != null) out_img.Dispose();
            if (pictureBox1.Image != null) pictureBox1.Image.Dispose();

            StringBuilder msg = new StringBuilder(512);
            image = new Mat(image_path);
            out_img = new Mat();

            stopwatch.Restart();

            int res = unwrap(engine, image.CvPtr, msg, out_img.CvPtr);
            if (res == 0)
            {
                stopwatch.Stop();
                double costTime = stopwatch.Elapsed.TotalMilliseconds;
                pictureBox2.Image = new Bitmap(out_img.ToMemoryStream());
                textBox1.Text = $"耗时:{costTime:F2}ms";
            }
            else
            {
                textBox1.Text = "失败," + msg.ToString();
            }
        }

        /// <summary>
        /// openCvBilateral
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button7_Click(object sender, EventArgs e)
        {
            if (image_path == "")
            {
                return;
            }

            textBox1.Text = "执行中……";
            Application.DoEvents();

            if (image != null) image.Dispose();
            if (out_img != null) out_img.Dispose();
            if (pictureBox1.Image != null) pictureBox1.Image.Dispose();

            StringBuilder msg = new StringBuilder(512);
            image = new Mat(image_path);
            out_img = new Mat();

            stopwatch.Restart();

            int res = openCvBilateral(image.CvPtr, msg, out_img.CvPtr);
            if (res == 0)
            {
                stopwatch.Stop();
                double costTime = stopwatch.Elapsed.TotalMilliseconds;
                pictureBox2.Image = new Bitmap(out_img.ToMemoryStream());
                textBox1.Text = $"耗时:{costTime:F2}ms";
            }
            else
            {
                textBox1.Text = "失败," + msg.ToString();
            }
        }

        /// <summary>
        /// unshadow
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button6_Click(object sender, EventArgs e)
        {
            if (image_path == "")
            {
                return;
            }

            textBox1.Text = "执行中……";
            Application.DoEvents();

            if (image != null) image.Dispose();
            if (out_img != null) out_img.Dispose();
            if (pictureBox1.Image != null) pictureBox1.Image.Dispose();

            StringBuilder msg = new StringBuilder(512);
            image = new Mat(image_path);
            out_img = new Mat();

            stopwatch.Restart();

            int res = unshadow(engine, image.CvPtr, msg, out_img.CvPtr);
            if (res == 0)
            {
                stopwatch.Stop();
                double costTime = stopwatch.Elapsed.TotalMilliseconds;
                pictureBox2.Image = new Bitmap(out_img.ToMemoryStream());
                textBox1.Text = $"耗时:{costTime:F2}ms";
            }
            else
            {
                textBox1.Text = "失败," + msg.ToString();
            }
        }

        /// <summary>
        /// unblur
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button5_Click(object sender, EventArgs e)
        {
            if (image_path == "")
            {
                return;
            }

            textBox1.Text = "执行中……";
            Application.DoEvents();

            if (image != null) image.Dispose();
            if (out_img != null) out_img.Dispose();
            if (pictureBox1.Image != null) pictureBox1.Image.Dispose();

            StringBuilder msg = new StringBuilder(512);
            image = new Mat(image_path);
            out_img = new Mat();

            stopwatch.Restart();

            int res = unblur(engine, image.CvPtr, msg, out_img.CvPtr);
            if (res == 0)
            {
                stopwatch.Stop();
                double costTime = stopwatch.Elapsed.TotalMilliseconds;
                pictureBox2.Image = new Bitmap(out_img.ToMemoryStream());
                textBox1.Text = $"耗时:{costTime:F2}ms";
            }
            else
            {
                textBox1.Text = "失败," + msg.ToString();
            }
        }

        /// <summary>
        /// binary
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button4_Click(object sender, EventArgs e)
        {
            if (image_path == "")
            {
                return;
            }

            textBox1.Text = "执行中……";
            Application.DoEvents();

            if (image != null) image.Dispose();
            if (out_img != null) out_img.Dispose();
            if (pictureBox1.Image != null) pictureBox1.Image.Dispose();

            StringBuilder msg = new StringBuilder(512);
            image = new Mat(image_path);
            out_img = new Mat();

            stopwatch.Restart();

            int res = binary(engine, image.CvPtr, msg, out_img.CvPtr);
            if (res == 0)
            {
                stopwatch.Stop();
                double costTime = stopwatch.Elapsed.TotalMilliseconds;
                pictureBox2.Image = new Bitmap(out_img.ToMemoryStream());
                textBox1.Text = $"耗时:{costTime:F2}ms";
            }
            else
            {
                textBox1.Text = "失败," + msg.ToString();
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (pictureBox2.Image == null)
            {
                return;
            }
            Bitmap output = new Bitmap(pictureBox2.Image);
            var sdf = new SaveFileDialog();
            sdf.Title = "保存";
            sdf.Filter = "Images (*.jpg)|*.jpg|Images (*.png)|*.png|Images (*.bmp)|*.bmp";
            if (sdf.ShowDialog() == DialogResult.OK)
            {
                switch (sdf.FilterIndex)
                {
                    case 1:
                        {
                            output.Save(sdf.FileName, ImageFormat.Jpeg);
                            break;
                        }
                    case 2:
                        {
                            output.Save(sdf.FileName, ImageFormat.Png);
                            break;
                        }
                    case 3:
                        {
                            output.Save(sdf.FileName, ImageFormat.Bmp);
                            break;
                        }
                }
                MessageBox.Show("保存成功,位置:" + sdf.FileName);
            }
        }
    }
}
 

using OpenCvSharp;
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;namespace DocumentUndistort
{public partial class Form1 : Form{public Form1(){InitializeComponent();}Stopwatch stopwatch = new Stopwatch();Mat image;Mat out_img;string image_path;string startupPath;string fileFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";const string DllName = "DocumentUndistortSharp.dll";IntPtr engine;/*//初始化extern "C" _declspec(dllexport) int __cdecl  init(void** engine, char* binary_model_path, char* unblur_model_path, char* unshadow_model_gcnet_path, char* unshadow_model_drnet_path, char* unwrap_model_path, char* msg);//binaryextern "C" _declspec(dllexport) int __cdecl  binary(void* engine, Mat* srcimg, char* msg, Mat* out_img);//unblurextern "C" _declspec(dllexport) int __cdecl  unblur(void* engine, Mat* srcimg, char* msg, Mat* out_img);//unshadowextern "C" _declspec(dllexport) int __cdecl  unshadow(void* engine, Mat* srcimg, char* msg, Mat* out_img);//unwrapextern "C" _declspec(dllexport) int __cdecl  unwrap(void* engine, Mat* srcimg, char* msg, Mat* out_img);//openCvBilateralextern "C" _declspec(dllexport) int __cdecl  openCvBilateral(Mat* srcimg, char* msg, Mat* out_img);//释放extern "C" _declspec(dllexport) void __cdecl destroy(void* engine);*/[DllImport(DllName, EntryPoint = "init", CallingConvention = CallingConvention.Cdecl)]internal extern static int init(ref IntPtr engine, string binary_model_path, string unblur_model_path, string unshadow_model_gcnet_path, string unshadow_model_drnet_path, string unwrap_model_path, StringBuilder msg);[DllImport(DllName, EntryPoint = "binary", CallingConvention = CallingConvention.Cdecl)]internal extern static int binary(IntPtr engine, IntPtr srcimg, StringBuilder msg, IntPtr out_img);[DllImport(DllName, EntryPoint = "unblur", CallingConvention = CallingConvention.Cdecl)]internal extern static int unblur(IntPtr engine, IntPtr srcimg, StringBuilder msg, IntPtr out_img);[DllImport(DllName, EntryPoint = "unshadow", CallingConvention = CallingConvention.Cdecl)]internal extern static int unshadow(IntPtr engine, IntPtr srcimg, StringBuilder msg, IntPtr out_img);[DllImport(DllName, EntryPoint = "unwrap", CallingConvention = CallingConvention.Cdecl)]internal extern static int unwrap(IntPtr engine, IntPtr srcimg, StringBuilder msg, IntPtr out_img);[DllImport(DllName, EntryPoint = "openCvBilateral", CallingConvention = CallingConvention.Cdecl)]internal extern static int openCvBilateral(IntPtr srcimg, StringBuilder msg, IntPtr out_img);[DllImport(DllName, EntryPoint = "destroy", CallingConvention = CallingConvention.Cdecl)]internal extern static int destroy(IntPtr engine);private void button1_Click(object sender, EventArgs e){OpenFileDialog ofd = new OpenFileDialog();ofd.Filter = fileFilter;if (ofd.ShowDialog() != DialogResult.OK) return;pictureBox1.Image = null;pictureBox2.Image = null;textBox1.Text = "";image_path = ofd.FileName;pictureBox1.Image = new Bitmap(image_path);image = new Mat(image_path);}private void Form1_Load(object sender, EventArgs e){startupPath = Application.StartupPath;string binary_model_path = startupPath + "\\model\\unetcnn.onnx";string unblur_model_path = startupPath + "\\model\\nafdpm.onnx";string unshadow_model_gcnet_path = startupPath + "\\model\\gcnet.onnx";string unshadow_model_drnet_path = startupPath + "\\model\\drnet.onnx";string unwrap_model_path = startupPath + "\\model\\uvdoc.onnx";StringBuilder msg = new StringBuilder(512);int res = init(ref engine, binary_model_path, unblur_model_path, unshadow_model_gcnet_path, unshadow_model_drnet_path, unwrap_model_path, msg);if (res == -1){MessageBox.Show(msg.ToString());return;}else{Console.WriteLine(msg.ToString());}image_path = startupPath + "\\test_img\\2.jpg";pictureBox1.Image = new Bitmap(image_path);image = new Mat(image_path);}private void Form1_FormClosed(object sender, FormClosedEventArgs e){destroy(engine);}/// <summary>/// unwrap/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button2_Click(object sender, EventArgs e){if (image_path == ""){return;}textBox1.Text = "执行中……";Application.DoEvents();if (image != null) image.Dispose();if (out_img != null) out_img.Dispose();if (pictureBox1.Image != null) pictureBox1.Image.Dispose();StringBuilder msg = new StringBuilder(512);image = new Mat(image_path);out_img = new Mat();stopwatch.Restart();int res = unwrap(engine, image.CvPtr, msg, out_img.CvPtr);if (res == 0){stopwatch.Stop();double costTime = stopwatch.Elapsed.TotalMilliseconds;pictureBox2.Image = new Bitmap(out_img.ToMemoryStream());textBox1.Text = $"耗时:{costTime:F2}ms";}else{textBox1.Text = "失败," + msg.ToString();}}/// <summary>/// openCvBilateral/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button7_Click(object sender, EventArgs e){if (image_path == ""){return;}textBox1.Text = "执行中……";Application.DoEvents();if (image != null) image.Dispose();if (out_img != null) out_img.Dispose();if (pictureBox1.Image != null) pictureBox1.Image.Dispose();StringBuilder msg = new StringBuilder(512);image = new Mat(image_path);out_img = new Mat();stopwatch.Restart();int res = openCvBilateral(image.CvPtr, msg, out_img.CvPtr);if (res == 0){stopwatch.Stop();double costTime = stopwatch.Elapsed.TotalMilliseconds;pictureBox2.Image = new Bitmap(out_img.ToMemoryStream());textBox1.Text = $"耗时:{costTime:F2}ms";}else{textBox1.Text = "失败," + msg.ToString();}}/// <summary>/// unshadow/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button6_Click(object sender, EventArgs e){if (image_path == ""){return;}textBox1.Text = "执行中……";Application.DoEvents();if (image != null) image.Dispose();if (out_img != null) out_img.Dispose();if (pictureBox1.Image != null) pictureBox1.Image.Dispose();StringBuilder msg = new StringBuilder(512);image = new Mat(image_path);out_img = new Mat();stopwatch.Restart();int res = unshadow(engine, image.CvPtr, msg, out_img.CvPtr);if (res == 0){stopwatch.Stop();double costTime = stopwatch.Elapsed.TotalMilliseconds;pictureBox2.Image = new Bitmap(out_img.ToMemoryStream());textBox1.Text = $"耗时:{costTime:F2}ms";}else{textBox1.Text = "失败," + msg.ToString();}}/// <summary>/// unblur/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button5_Click(object sender, EventArgs e){if (image_path == ""){return;}textBox1.Text = "执行中……";Application.DoEvents();if (image != null) image.Dispose();if (out_img != null) out_img.Dispose();if (pictureBox1.Image != null) pictureBox1.Image.Dispose();StringBuilder msg = new StringBuilder(512);image = new Mat(image_path);out_img = new Mat();stopwatch.Restart();int res = unblur(engine, image.CvPtr, msg, out_img.CvPtr);if (res == 0){stopwatch.Stop();double costTime = stopwatch.Elapsed.TotalMilliseconds;pictureBox2.Image = new Bitmap(out_img.ToMemoryStream());textBox1.Text = $"耗时:{costTime:F2}ms";}else{textBox1.Text = "失败," + msg.ToString();}}/// <summary>/// binary/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void button4_Click(object sender, EventArgs e){if (image_path == ""){return;}textBox1.Text = "执行中……";Application.DoEvents();if (image != null) image.Dispose();if (out_img != null) out_img.Dispose();if (pictureBox1.Image != null) pictureBox1.Image.Dispose();StringBuilder msg = new StringBuilder(512);image = new Mat(image_path);out_img = new Mat();stopwatch.Restart();int res = binary(engine, image.CvPtr, msg, out_img.CvPtr);if (res == 0){stopwatch.Stop();double costTime = stopwatch.Elapsed.TotalMilliseconds;pictureBox2.Image = new Bitmap(out_img.ToMemoryStream());textBox1.Text = $"耗时:{costTime:F2}ms";}else{textBox1.Text = "失败," + msg.ToString();}}private void button3_Click(object sender, EventArgs e){if (pictureBox2.Image == null){return;}Bitmap output = new Bitmap(pictureBox2.Image);var sdf = new SaveFileDialog();sdf.Title = "保存";sdf.Filter = "Images (*.jpg)|*.jpg|Images (*.png)|*.png|Images (*.bmp)|*.bmp";if (sdf.ShowDialog() == DialogResult.OK){switch (sdf.FilterIndex){case 1:{output.Save(sdf.FileName, ImageFormat.Jpeg);break;}case 2:{output.Save(sdf.FileName, ImageFormat.Png);break;}case 3:{output.Save(sdf.FileName, ImageFormat.Bmp);break;}}MessageBox.Show("保存成功,位置:" + sdf.FileName);}}}
}

下载

源码下载

参考

https://github.com/hpc203/document-undistort-onnxrun

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

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

相关文章

CSS 溢出问题及解决方案:实用案例与技巧

在网页开发中&#xff0c;CSS 的布局和样式起着至关重要的作用&#xff0c;但经常会遇到一个棘手的问题——溢出问题。溢出是指元素内的内容超出了其设定的容器大小&#xff0c;这不仅会影响页面的美观&#xff0c;还可能干扰用户体验。本文将详细探讨 CSS 溢出问题的案例&…

生成树机制实验

1 实验内容 1、基于已有代码,实现生成树运行机制,对于给定拓扑(four_node_ring.py),计算输出相应状态下的生成树拓扑 2、构造一个不少于7个节点,冗余链路不少于2条的拓扑,节点和端口的命名规则可参考four_node_ring.py,使用stp程序计算输出生成树拓扑 2 实验原理 一、…

数据结构详解——堆与二叉树

​ 目录 树的概念树的表示方法二叉树的概念特殊的二叉树二叉树的性质二叉树的存储结构顺序存储链式存储 堆的概念与结构堆的性质堆的实现堆的初始化入堆堆的扩容向上调整算法出堆&#xff08;最顶端元素&#xff09;向下调整算法 二叉树的实现二叉树的创建二叉树的销毁二叉树的…

【蓝桥杯】43694.正则问题

题目描述 考虑一种简单的正则表达式&#xff1a; 只由 x ( ) | 组成的正则表达式。 小明想求出这个正则表达式能接受的最长字符串的长度。 例如 ((xx|xxx)x|(x|xx))xx 能接受的最长字符串是&#xff1a; xxxxxx&#xff0c;长度是 6。 输入描述 一个由 x()| 组成的正则表达式。…

mac m1下载maven安装并配置环境变量

下载地址&#xff1a;Download Apache Maven – Maven 解压到一个没有中文和空格的文件夹 输入pwd查看安装路径 输入cd返回根目录再输入 code .zshrc 若显示 command not found: code你可以通过以下步骤来安装和配置 code 命令&#xff1a; 1. 确保你已经安装了 Visual Studio…

【自己动手开发Webpack插件:开启前端构建工具的个性化定制之旅】

在前端开发的世界里&#xff0c;Webpack无疑是构建工具中的“明星”。它强大的功能可以帮助我们高效地打包和管理前端资源。然而&#xff0c;有时候默认的Webpack功能可能无法完全满足我们的特定需求&#xff0c;这时候就需要自定义Webpack插件来大展身手啦&#xff01;今天&am…

移远通信多模卫星通信模组BG95-S5获得Skylo网络认证,进一步拓展全球卫星物联网市场

近日&#xff0c;全球领先的物联网整体解决方案供应商移远通信正式宣布&#xff0c;其支持“卫星蜂窝”多模式的高集成度NTN卫星通信模组BG95-S5已成功获得NTN网络运营商Skylo的网络认证。BG95-S5也成为了获得该认证的最新款移远卫星通信模组。 BG95-S5模组顺利获得Skylo认证&a…

1.3.浅层神经网络

目录 1.3.浅层神经网络 1.3.1 浅层神经网络表示 1.3.2 单个样本的向量化表示 1.3.4 激活函数的选择 1.3.5 修改激活函数 1.3.5 练习​​​​​​​ 1.3.浅层神经网络 1.3.1 浅层神经网络表示 之前已经说过神经网络的结构了&#xff0c;在这不重复叙述。假设我们有如下…

StarRocks强大的实时数据分析

代码仓库&#xff1a;https://github.com/StarRocks/starrocks?tabreadme-ov-file StarRocks | A High-Performance Analytical Database 快速开始&#xff1a;StarRocks | StarRocks StarRocks 是一款高性能分析型数据仓库&#xff0c;使用向量化、MPP 架构、CBO、智能物化…

2024年博客之星主题创作|猫头虎分享AI技术洞察:2025年AI发展趋势前瞻与展望

2025年AI发展趋势前瞻&#xff1a;猫头虎深度解析未来科技与商业机遇 摘要 2024年&#xff0c;AI技术迎来爆发式增长&#xff0c;AIGC、智能体、AIRPA、AI搜索、推理模型等技术不断突破&#xff0c;AI应用场景持续扩展。2025年&#xff0c;AI将进入全新发展阶段&#xff0c;W…

PG vs MySQL mvcc机制实现的异同

MVCC实现方法比较 MySQL 写新数据时&#xff0c;把旧数据写入回滚段中&#xff0c;其他人读数据时&#xff0c;从回滚段中把旧的数据读出来 PostgreSQL 写新数据时&#xff0c;旧数据不删除&#xff0c;直接插入新数据。 MVCC实现的原理 PG的MVCC实现原理 定义多版本的数据…

Android SystemUI——CarSystemBar视图解析(十一)

前面文章我们已经把 CarSystemBar 从启动到构建视图,再到将视图添加到 Window 的流程分析完毕,我们知道默认情况下在车载系统中只显示顶部栏和底部栏视图的。这里我们在前面文章的基础上以顶部栏为例具体解析其视图的结构。 一、顶部栏解析 通过《CarSystemBar车载状态栏》这…

51c~ONNX~合集1

我自己的原文哦~ https://blog.51cto.com/whaosoft/11608027 一、使用Pytorch进行简单的自定义图像分类 ~ONNX 推理 图像分类是计算机视觉中的一项基本任务&#xff0c;涉及训练模型将图像分类为预定义类别。本文中&#xff0c;我们将探讨如何使用 PyTorch 构建一个简单的自定…

每打开一个chrome页面都会【自动打开F12开发者模式】,原因是 使用HBuilderX会影响谷歌浏览器的浏览模式

打开 HBuilderX&#xff0c;点击 运行 -> 运行到浏览器 -> 设置web服务器 -> 添加chrome浏览器安装路径 chrome谷歌浏览器插件 B站视频下载助手插件&#xff1a; 参考地址&#xff1a;Chrome插件 - B站下载助手&#xff08;轻松下载bilibili哔哩哔哩视频&#xff09…

go语言之OOP特性和演示

一、OOP特性 Go语言中的OOP特性 结构体&#xff1a;在Go中&#xff0c;结构体用于定义复合类型&#xff0c;类似于其他语言中的类。它可以包含字段&#xff08;属性&#xff09;和方法&#xff08;行为&#xff09;。方法&#xff1a;Go允许为任何自定义类型&#xff08;包括…

USB3020任意波形发生器4路16位同步模拟量输出卡1MS/s频率 阿尔泰科技

信息社会的发展&#xff0c;在很大程度上取决于信息与信号处理技术的先进性。数字信号处理技术的出现改变了信息 与信号处理技术的整个面貌&#xff0c;而数据采集作为数字信号处理的必不可少的前期工作在整个数字系统中起到关键 性、乃至决定性的作用&#xff0c;其应用已经深…

ChatGPT大模型极简应用开发-目录

引言 要理解 ChatGPT&#xff0c;了解其背后的 Transformer 架构和 GPT 技术一路的演进则变得非常必要。 ChatGPT 背后的 LLM 技术使普通人能够通过自然语言完成过去只能由程序员通过编程语言实现的任务&#xff0c;这是一场巨大的变革。然而&#xff0c;人类通常容易高估技术…

C++入门基础篇:域、C++的输入输出、缺省参数、函数重载、引用、inline、nullptr

本篇文章是对C学习前期的一些基础部分的学习分享&#xff0c;希望也能够对你有所帮助。 那咱们废话不多说&#xff0c;直接开始吧&#xff01; 目录 1.第一个C程序 2. 域 3. namespace 3.1 namespace的作用 3.2 namespace的定义 3.3 namespace使用说明 4.C的输入和输出…

RabbitMQ---TTL与死信

&#xff08;一&#xff09;TTL 1.TTL概念 TTL又叫过期时间 RabbitMQ可以对队列和消息设置TTL&#xff0c;当消息到达过期时间还没有被消费时就会自动删除 注&#xff1a;这里我们说的对队列设置TTL,是对队列上的消息设置TTL并不是对队列本身&#xff0c;不是说队列过期时间…

先进制造aps专题二十七 西门子opcenter aps架构分析

欧美的商业aps&#xff0c;主要就是sap apo,西门子opcenter aps,达索quintiq 从技术的层面&#xff0c;西门子aps是不如sap apo的&#xff0c;但是西门子aps是西门子数字化工厂产品的核心&#xff0c;有很多特色&#xff0c;所以分析 西门子aps主要分计划器和排产器两个部分 计…