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
相关文章:
C# OpenCvSharp 部署文档矫正,包括文档扭曲/模糊/阴影等情况
目录 说明 效果 模型 项目 代码 下载 参考 C# OpenCvSharp 部署文档矫正,包括文档扭曲/模糊/阴影等情况 说明 地址:https://github.com/RapidAI/RapidUnDistort 修正文档扭曲/模糊/阴影等情况,使用onnx模型简单轻量部署,…...
go读取excel游戏配置
1.背景 游戏服务器,配置数据一般采用csv/excel来作为载体,这种方式,策划同学配置方便,服务器解析也方便。在jforgame框架里,我们使用以下的excel配置格式。 然后可以非常方便的进行数据检索,例如ÿ…...
特殊类设计
[本节目标] 掌握常见特殊类的设计方式 1.请设计一个类,不能被拷贝 拷贝只会放生在两个场景中:拷贝构造函数以及赋值运算符重载,因此想要让一个类禁止拷贝,只需让该类不能调用拷贝构造函数以及赋值运算符重载即可。 C98 将拷贝构…...
图像去雾数据集的下载和预处理操作
前言 目前,因为要做对比实验,收集了一下去雾数据集,并且建立了一个数据集的预处理工程。 这是以前我写的一个小仓库,我决定还是把它用起来,下面将展示下载的路径和数据处理的方法。 下面的代码均可以在此找到。Auo…...
【LeetCode】--- MySQL刷题集合
1.组合两个表(外连接) select p.firstName,p.lastName,a.city,a.state from Person p left join Address a on p.personId a.personId; 以左边表为基准,去连接右边的表。取两表的交集和左表的全集 2.第二高的薪水 (子查询、if…...
基于Python的多元医疗知识图谱构建与应用研究(上)
一、引言 1.1 研究背景与意义 在当今数智化时代,医疗数据呈爆发式增长,如何高效管理和利用这些数据,成为提升医疗服务质量的关键。传统医疗数据管理方式存在数据孤岛、信息整合困难等问题,难以满足现代医疗对精准诊断和个性化治疗的需求。知识图谱作为一种知识表示和管理…...
小哆啦解题记:如何计算除自身以外数组的乘积
小哆啦开始力扣每日一题的第十二天 https://leetcode.cn/problems/product-of-array-except-self/description/ 《小哆啦解题记:如何计算除自身以外数组的乘积》 在一个清晨的阳光下,小哆啦坐在书桌前,思索着一道困扰已久的题目:…...
渐进式图片的实现原理
渐进式图片(Progressive JPEG)的实现原理与传统的基线 JPEG(Baseline JPEG)不同。它通过改变图片的编码和加载方式,使得图片在加载时能够逐步显示从模糊到清晰的图像。 1. 传统基线 JPEG 的加载方式 在传统的基线 JP…...
SQL刷题快速入门(三)
其他章节: SQL刷题快速入门(一) SQL刷题快速入门(二) 承接前两个章节,本系列第三章节主要讲SQL中where和having的作用和区别、 GROUP BY和ORDER BY作用和区别、表与表之间的连接操作(重点&…...
mybatis(19/134)
大致了解了一下工具类,自己手敲了一边,java的封装还是真的省去了很多麻烦,封装成一个工具类就可以不用写很多重复的步骤,一个工厂对应一个数据库一个environment就好了。 mybatis中调用sql中的delete占位符里面需要有字符…...
sqlmap 自动注入 -01
1: 先看一下sqlmap 的help: 在kali-linux 系统里面,可以sqlmap -h看一下: Target: At least one of these options has to be provided to define the target(s) -u URL, --urlURL Target URL (e.g. "Salesforce Platform for Application Development | Sa…...
3.8.Trie树
Trie树 Trie 树,又称字典树或前缀树,是一种用于高效存储和检索字符串数据的数据结构,以下是关于它的详细介绍: 定义与原理 定义:Trie 树是一种树形结构,每个节点可以包含多个子节点,用于存储…...
day 21
进程、线程、协程的区别 进程:操作系统分配资源的最小单位,其中可以包含一个或者多个线程,进程之间是独立的,可以通过进程间通信机制(管道,消息队列,共享内存,信号量,信…...
基于模板方法模式-消息队列发送
基于模板方法模式-消息队列发送 消息队列广泛应用于现代分布式系统中,作为解耦、异步处理和流量控制的重要工具。在消息队列的使用中,发送消息是常见的操作。不同的消息队列可能有不同的实现方式,例如,RabbitMQ、Kafka、RocketMQ…...
俄语画外音的特点
随着全球媒体消费的增加,语音服务呈指数级增长。作为视听翻译和本地化的一个关键方面,画外音在确保来自不同语言和文化背景的观众能够以一种真实和可访问的方式参与内容方面发挥着重要作用。说到俄语,画外音有其独特的特点、挑战和复杂性&…...
PyTorch使用教程(10)-torchinfo.summary网络结构可视化详细说明
1、基本介绍 torchinfo是一个为PyTorch用户量身定做的开源工具,其核心功能之一是summary函数。这个函数旨在简化模型的开发与调试流程,让模型架构一目了然。通过torchinfo的summary函数,用户可以快速获取模型的详细结构和统计信息࿰…...
亚博microros小车-原生ubuntu支持系列:5-姿态检测
MediaPipe 介绍参见:亚博microros小车-原生ubuntu支持系列:4-手部检测-CSDN博客 本篇继续迁移姿态检测。 一 背景知识 以下来自亚博官网 MediaPipe Pose是⼀个⽤于⾼保真⾝体姿势跟踪的ML解决⽅案,利⽤BlazePose研究,从RGB视频…...
C语言之高校学生信息快速查询系统的实现
🌟 嗨,我是LucianaiB! 🌍 总有人间一两风,填我十万八千梦。 🚀 路漫漫其修远兮,吾将上下而求索。 C语言之高校学生信息快速查询系统的实现 目录 任务陈述与分析 问题陈述问题分析 数据结构设…...
WPF基础 | WPF 基础概念全解析:布局、控件与事件
WPF基础 | WPF 基础概念全解析:布局、控件与事件 一、前言二、WPF 布局系统2.1 布局的重要性与基本原理2.2 常见布局面板2.3 布局的测量与排列过程 三、WPF 控件3.1 控件概述与分类3.2 常见控件的属性、方法与事件3.3 自定义控件 四、WPF 事件4.1 路由事件概述4.2 事…...
迷宫1.2
先发一下上次的代码 #include<bits/stdc.h> #include<windows.h> #include <conio.h> using namespace std; char a[1005][1005]{ " ", "################", "# # *#", "# # # #&qu…...
4步实现AnyLogic-Pypeline集成:构建跨语言仿真系统的实战指南
4步实现AnyLogic-Pypeline集成:构建跨语言仿真系统的实战指南 【免费下载链接】AnyLogic-Pypeline A custom AnyLogic library for running Python inside an AnyLogic model (Java) 项目地址: https://gitcode.com/gh_mirrors/an/AnyLogic-Pypeline AnyLogi…...
OpenClaw飞书机器人配置:Qwen3.5-9B多轮对话实战
OpenClaw飞书机器人配置:Qwen3.5-9B多轮对话实战 1. 为什么选择OpenClaw飞书Qwen3.5-9B组合 去年我接手了一个小团队的内部效率优化项目,需要在不增加人力的情况下提升日常事务处理速度。经过几轮技术选型,最终选择了OpenClaw作为自动化核心…...
八大网盘直链解析终极指南:如何彻底告别下载限速困扰
八大网盘直链解析终极指南:如何彻底告别下载限速困扰 【免费下载链接】Online-disk-direct-link-download-assistant 一个基于 JavaScript 的网盘文件下载地址获取工具。基于【网盘直链下载助手】修改 ,支持 百度网盘 / 阿里云盘 / 中国移动云盘 / 天翼云…...
OpenWrt搭建Samba共享服务的实用指南
1. 为什么要在OpenWrt上搭建Samba共享 家里有台老路由器刷了OpenWrt系统,闲置着总觉得浪费。后来发现用它搭建个局域网文件共享特别方便,手机电脑都能直接访问,传文件再也不用数据线来回倒腾。Samba这个协议在Windows、Mac和Linux上都能用&am…...
【日常运维】Java服务在Windows平台上作为常驻服务的启动方式【winsw.exe】
文章目录[toc]一、下载winsw二、放置jar包三、配置启动信息四、启动服务五、在服务中查看服务是否启动成功六、调用服务是否成功七、指定编码格式八、启动服务一般一、下载winsw 二进制可执行文件下载地址: http://repo.jenkins-ci.org/releases/com/sun/winsw/win…...
2025年大模型技术演进深度解析:从DeepSeek到Omni全景回顾
1.大三下保研成功,当时就pytorch熟练,玩过一些小模型,大模型调api都不会。海面了好几家公司,靠以前的课题项目和pku一个研究院切合,拿了大模型算法实习生offer,实际上以rag清洗数据为主,在这边学…...
从R-CNN到YOLO:目标检测算法的前世今生与YOLO原理
从R-CNN到YOLO:目标检测算法的前世今生与YOLO原理一、从两阶段到单阶段的演变 目标检测经历了从"两阶段"到"单阶段"的革命性变革。 R-CNN系列(两阶段方法) R-CNN开创了深度学习目标检测的先河,但需要两步&…...
别再只会调PID了!手把手教你用MATLAB/Simulink搞定直流电机双闭环调速(附R2018b模型)
从零构建直流电机双闭环调速系统的MATLAB实战指南 在工业自动化领域,直流电机调速系统一直是控制工程师的必修课。很多工程师虽然掌握了基本的PID控制原理,但在面对更复杂的双闭环系统时,常常陷入调参困境——明明按照教科书设置了参数&#…...
从零开始:SDXL 1.0电影级绘图工坊Docker环境搭建与测试
从零开始:SDXL 1.0电影级绘图工坊Docker环境搭建与测试 1. 为什么选择SDXL 1.0与Docker组合 SDXL 1.0作为Stable Diffusion系列的最新升级版本,在图像生成质量上实现了质的飞跃。相比前代产品,它原生支持1024x1024高清分辨率,生…...
告别云端依赖:Qwen3-VL-8B本地图文对话工具快速上手教程
告别云端依赖:Qwen3-VL-8B本地图文对话工具快速上手教程 1. 为什么选择本地部署多模态模型? 在当今AI应用蓬勃发展的时代,越来越多的企业和开发者开始关注数据隐私和安全性。云端API虽然方便,但存在以下痛点: 数据安…...
