当前位置: 首页 > news >正文

网站名称在哪里注册购物网站建设与开发

网站名称在哪里注册,购物网站建设与开发,新余做网站,企业网站建设最需要的是什么目录 说明 效果 模型 项目 代码 下载 参考 C# OpenCvSharp 部署文档矫正#xff0c;包括文档扭曲/模糊/阴影等情况 说明 地址#xff1a;https://github.com/RapidAI/RapidUnDistort 修正文档扭曲/模糊/阴影等情况#xff0c;使用onnx模型简单轻量部署#xff0c…目录 说明 效果 模型 项目 代码 下载 参考 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 ------------------------- nameinput tensorFloat[-1, 6, -1, -1] --------------------------------------------------------------- Outputs ------------------------- nameoutput tensorFloat[-1, 3, -1, -1] --------------------------------------------------------------- gcnet.onnx Model Properties ------------------------- --------------------------------------------------------------- Inputs ------------------------- nameinput tensorFloat[-1, 3, -1, -1] --------------------------------------------------------------- Outputs ------------------------- nameoutput tensorFloat[-1, 3, -1, -1] --------------------------------------------------------------- nafdpm.onnx Model Properties ------------------------- --------------------------------------------------------------- Inputs ------------------------- nameinput tensorFloat[-1, 3, -1, -1] --------------------------------------------------------------- Outputs ------------------------- nameoutput tensorFloat[-1, -1, -1, -1] --------------------------------------------------------------- unetcnn.onnx Model Properties ------------------------- --------------------------------------------------------------- Inputs ------------------------- nameinput tensorFloat[-1, 3, -1, -1] --------------------------------------------------------------- Outputs ------------------------- nameoutput tensorFloat[-1, 1, -1, -1] --------------------------------------------------------------- uvdoc.onnx Model Properties ------------------------- --------------------------------------------------------------- Inputs ------------------------- nameinput tensorFloat[-1, 3, -1, -1] --------------------------------------------------------------- Outputs ------------------------- nameoutput tensorFloat[-1, 2, -1, -1] name546 tensorFloat[-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 namesender/param         /// param namee/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 namesender/param         /// param namee/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 namesender/param         /// param namee/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 namesender/param         /// param namee/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 namesender/param         /// param namee/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 namesender/param/// param namee/paramprivate 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 namesender/param/// param namee/paramprivate 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 namesender/param/// param namee/paramprivate 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 namesender/param/// param namee/paramprivate 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 namesender/param/// param namee/paramprivate 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.hkea.cn/news/14298547/

相关文章:

  • 正规网站建设公司哪个比较好wordpress4.9.8升级包
  • 网站备案方案263企业邮箱登录入口收费
  • 网站视觉艺术设计及色彩搭配服装网站建设的规模和类别
  • 管理网站建设哪里好品牌网站建设搜搜磐石网络
  • 南阳市网站制作网站建设 职责
  • 上海建网站开发公司山东聊城建设学校网站
  • 合作公司做网站东莞黄页网广告
  • asp网站建设教程西地那非的作用与功效
  • flash网站php源码网站优化 图片
  • 个人网站制作模板主页软件设计师考试
  • 舞钢网站建设平面设计接单价格表
  • 做淘宝的网站的多少钱官方网站建设情况说明
  • 成都哪家做网站的最好网站开发教程大全
  • 响应式网站建设服务器深圳网站建设top028
  • 门户网站标题居中加大设计公司介绍
  • 网站建设管理风险超变传奇手游刀刀切割无会员散人
  • 做蛋糕需要建议网站不提供手机网站建设推荐
  • 晋城网站建设网站wordpress手机模版
  • 在服务器上部署网站电商产品开发流程
  • 二道江网站建设未备案网站 赚钱
  • 泰安企业公司什么叫做seo
  • 宣传部网站建设方案wordpress 外部链接
  • wordpress cms下载地址seo监控系统
  • 网站建设芜湖建站空间
  • 金华专业网站制作公司wordpress二次元网站
  • 淘宝网站建设没法上传怎么办好的产品设计网站
  • 天气预报网站开发山东建设监理协会继续教育网站
  • 福田做商城网站建设哪家便宜龙岗网站建设流程
  • 石家庄有学校交做网站和优化的吗wordpress被植入广告
  • 如何设计网站建设引导页这么做输入文字的网站