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

黄冈网站建设策划公司网站建设及维护管理总结

黄冈网站建设策划,公司网站建设及维护管理总结,网站搭建设计 是什么,冶金建设网站识别主要步骤 1.图像预处理。包括确认图片有效区域#xff0c;灰度化#xff0c;二值化。 2.字符分割。即将识别信息最小化。由于密保卡图片文字宽度固定且无粘连#xff0c;只需要使用固定宽度切割。 3.对分割后的信息提取特征,建立特征库 4.提取特征和特征库样本进行匹配灰度化二值化。 2.字符分割。即将识别信息最小化。由于密保卡图片文字宽度固定且无粘连只需要使用固定宽度切割。 3.对分割后的信息提取特征,建立特征库 4.提取特征和特征库样本进行匹配输出识别结果   首先看下密保卡图片 1、减少识别区域。由于密保卡有效区域固定故将有效区域直接截取出来。 2、图片灰度化  图片灰度算法有平均值法分量法最大值法加权平均法本例用的加权平均法 public static Bitmap CorlorGray(Bitmap bmp){//位图矩形System.Drawing.Rectangle rect new System.Drawing.Rectangle(0, 0, bmp.Width, bmp.Height);//以可读写方式锁定全部位图像素System.Drawing.Imaging.BitmapData bmpData bmp.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite, bmp.PixelFormat);//得到首地址IntPtr ptr bmpData.Scan0;//定义被锁定的数组大小由位图数据与未用空间组成int bytes bmpData.Stride * bmpData.Height;byte[] rgbValues new byte[bytes];//复制被锁定的位图像素值到数组中System.Runtime.InteropServices.Marshal.Copy(ptr, rgbValues, 0, bytes);//灰度化double colorTemp 0;for (int i 0; i bmpData.Height; i){//只处理每行图像像素数据舍弃未用空间for (int j 0; j bmpData.Width * 3; j 3){colorTemp rgbValues[i * bmpData.Stride j 2] * 0.299 rgbValues[i * bmpData.Stride j 1] * 0.587 rgbValues[i * bmpData.Stride j] * 0.114;rgbValues[i * bmpData.Stride j] rgbValues[i * bmpData.Stride j 1] rgbValues[i * bmpData.Stride j 2] (byte)colorTemp;}}//把数组复位回位图System.Runtime.InteropServices.Marshal.Copy(rgbValues, 0, ptr, bytes);//解锁位图bmp.UnlockBits(bmpData);return bmp;}   3、图片二值化   最常见的二值处理方法是计算像素的平均值K扫描图像的每个像素值如像素值大于K 像素值设为255(白色)值小于等于K像素值设为0(黑色) #region 阈值法二值化 public static Bitmap Threshoding(Bitmap b, byte threshold){int width b.Width;int height b.Height;BitmapData data b.LockBits(new System.Drawing.Rectangle(0, 0, width, height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);unsafe{byte* p (byte*)data.Scan0;int offset data.Stride - width * 4;byte R, G, B, gray;for (int y 0; y height; y){for (int x 0; x width; x){R p[2];G p[1];B p[0];gray (byte)((R * 19595 G * 38469 B * 7472) 16);if (gray threshold){p[0] p[1] p[2] 255;}else{p[0] p[1] p[2] 0;}p 4;}p offset;}b.UnlockBits(data);return b;}}#endregion  4、字符分割 由于密保卡每个小方块大小固定如果识别A1那么只需截取一个37* 20的图片块来进行处理。 循环遍历图片Y轴每个像素点找到字符之间像素全为白色的X坐标集合从而将图片切割。 public static ListBitmap Cut(Bitmap bitmap){ListContentRectangle lst new ListContentRectangle();int width bitmap.Width;int height bitmap.Height;int[] xarray new int[width];for (int x 0; x width; x){for (int y 0; y height; y){int r bitmap.GetPixel(x, y).R;if (r 0)xarray[x] 1;}}int temp 0;int[] yarray new int[height];for (int i 0; i width; i){if (xarray[i] 0 i ! 0 xarray[i - 1] 0){temp i;}if (xarray[i] 0 i width - 1 xarray[i 1] 0){for (int j 0; j height; j){for (int x temp 1; x i 1; x){int r bitmap.GetPixel(x, j).R;if (r 0)yarray[j] 1;}}}int ttmp 0;for (int y 0; y height; y){if (yarray[y] ! 0){ttmp y;break;}}for (int x height - 1; x -1; x--){if (yarray[x] ! 0){ContentRectangle rectangle new ContentRectangle();rectangle.X temp;rectangle.Width i 1 - temp;rectangle.Y ttmp;rectangle.Height x 1 - ttmp;lst.Add(rectangle);yarray new int[height];break;}}}ListBitmap lstbmp new ListBitmap();foreach (ContentRectangle rect in lst){var tempbmp bitmap.Clone(new System.Drawing.Rectangle(rect.X, rect.Y, rect.Width, rect.Height), bitmap.PixelFormat);lstbmp.Add(tempbmp);}return lstbmp;}   5、建立特征库 字符切割后得到了类似以下图片。人眼可以直观的辨识出来但机器却是不认识的。所以需要建立特征库以便机器比对识别。 /// summary/// 获取数字对应的二值化代码/// /summary/// param namebitmap/param/// returns/returnspublic static string GetCodebybitmap(Bitmap bitmap){StringBuilder code new StringBuilder();for (int i 0; i bitmap.Width; i){for (int j 0; j bitmap.Height; j){int r bitmap.GetPixel(i, j).R;code.Append(r 127 ? 1 : 0);}}return code.ToString();} 将图片7像素点逐个扫描转换为0,、1表示的二值化字符串与数字7进行关联存储建立特征库。 6、识别 按上述步骤进行图片处理后取得图片的0、1表示的二值化代码并与特征库中的代码进行比对匹配对应代码完成识别。 匹配算法可以直接使用代码相等但这样使得特征库必须完善否则容易匹配失败。所以一般都会采用字符串相似度匹配设置阈值相似度大于阈值的即为同一个字符。相关算法自行百度。   转载于:https://www.cnblogs.com/guozhongxiang/p/7495338.html
http://www.zqtcl.cn/news/617937/

相关文章:

  • 清理网站数据库网站服务器租一个月
  • wordpress免费简约主题搜索引擎优化的英文
  • 瑞安门户网站建设怎么建设自己网站首页
  • 网站建设岗位周计划thinkphp微网站开发
  • 如何修改asp网站栏目帝国cms网站搬家教程
  • 网站建设与网页制作小团队兼职做网站
  • 嘉兴做网站的公司网红营销价值
  • scala做网站广州化妆品网站制作
  • 网站建设小组五类成员在线购物网站功能模块
  • 网站建设开发详细步骤流程图网站建设与管理实训报告总结
  • 网站设计的素材旅游网站建设标书
  • 做网站还得备案大企业网站建设多少钱
  • 一般做网站空间大概多少钱电商网站开发公司
  • 海报模板在线制作免费网站如何建设个人网站
  • 网站集群建设的意义如何优化推广网站
  • 怎么给公司做免费网站服装品牌网页设计图片
  • 中国通信建设协会网站新手建网站教程
  • 做网站页面的需要哪些技巧wordpress 网址导航
  • 如何做美食网站设计广州网页设计招聘
  • 中国商标网商标查询官方网站页面模板怎么添加文章
  • 建设基础化学网站的经验如何建设网站pdf下载
  • 外贸公司网站设计公司做网站能挣钱不
  • 免费网站ppt模板下载济南建设网站公司
  • 网站建设技术托管免费空间域名注册免备案
  • 威海住房建设部官方网站专科网站开发就业方向
  • 做外贸网站多少钱成都网页设计专业
  • 北京比较好的网站公司在线医生免费咨询
  • 免费的个人网站怎么做企业网站管理系统软件
  • 枣庄住房和城乡建设局网站如何注册国外域名
  • 满洲里建设局网站网页设计公司的目标客户有哪些