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

太原市建设局网站企业网站的新闻资讯版块有哪些

太原市建设局网站,企业网站的新闻资讯版块有哪些,网页设计与网站建设分析,WordPress无法显示摘要1 前言 #x1f525; 优质竞赛项目系列#xff0c;今天要分享的是 基于深度学习的银行卡识别算法设计 该项目较为新颖#xff0c;适合作为竞赛课题方向#xff0c;学长非常推荐#xff01; #x1f9ff; 更多资料, 项目分享#xff1a; https://gitee.com/dancheng…1 前言 优质竞赛项目系列今天要分享的是 基于深度学习的银行卡识别算法设计 该项目较为新颖适合作为竞赛课题方向学长非常推荐 更多资料, 项目分享 https://gitee.com/dancheng-senior/postgraduate 2 算法设计流程 银行卡卡号识别技术原理是先对银行卡图像定位保障获取图像绝对位置后对图像进行字符分割然后将分割完成的信息与模型进行比较从而匹配出与其最相似的数字。主要流程图如图 1.银行卡号图像 由于银行卡卡号信息涉及个人隐私作者很难在短时间内获取大量的银行卡进行测试和试验本文即采用作者个人及模拟银行卡进行卡号识别测试。 2.图像预处理 图像预处理是在获取图像后必须优先进行的技术性处理工作先对银行卡卡号图像进行色彩处理具体做法与流程是先将图像灰度化去掉图像识别上无用的信息然后利用归一化只保留有效的卡号信息区域。 3.字符分割 字符分割是在对图像进行预处理后在获取有效图像后对有效区域进行进一步细化处理将图像分割为最小识别字符单元。 4.字符识别 字符识别是在对银行卡卡号进行字符分割后利用图像识别技术来对字符进行分析和匹配本文作者利用的模板匹配方法。 2.1 颜色空间转换 由于银行卡卡号识别与颜色无关所以银行卡颜色是一个无用因素我们在图像预处理环节要先将其过滤掉。另外图像处理中还含有颜色信息不仅会造成空间浪费增加运算量降低系统的整体效率还会给以后的图像分析和处理带来干扰。因此有必要利用灰度处理来滤除颜色信息。 灰度处理的实质是将颜色信息转化为亮度信息即将原始的三维颜色信息还原为一维亮度信息。灰度化的思想是用灰度值g来表示原始彩色图像的R绿色、g红色和B蓝色分量的值具体的流程设计如图 2.2 边缘切割 对于采集到的银行卡号图像由于背景图案的多样性和卡号字体的不同无法直接对卡号图像进行分割。分割前要准确定位卡号才能得到有效区域。数字字符所在的区域有许多像素。根据该特征通过设置阈值来确定原始图像中卡号图像的区域。银行卡图像的切边处理设计如图 2.3 模板匹配 模板匹配是一种将需要识别的字符与已有固定模板进行匹配的算法技术该技术是将已经切割好的字符图像逐个与模板数字图像进行对比分析其原理就是通过数字相似度来衡量两个字符元素将目标字符元素逐个与模板数字图像进行匹配找到最接近的数字元素即可。匹配计算量随特征级别的增加而减少。根据第一步得到的特征选择第二种相关计算方法来解决图像匹配问题。银行卡模板匹配流程设计如图 2.4 卡号识别 银行卡卡号识别有其独有的特性因为目前市面上大多数银行卡卡号是凹凸不平的数字形式如果使用传统的计算机字符识别技术已显然不适用本文针对银行卡此类特点研究了解决此类问题的识别方案。从银行卡待识别的凸凹字符进行预处理然后根据滑块算法逐个窗口对银行卡字符进行匹配识别卡号识别一般从切割后的图像最左端开始设定截图选定框大小为64*48像素因为银行卡所需要识别的字符一般为45像素左右。故而以此方式循环对卡片上所有数字进行匹配、识别如果最小值大于设置的阈值我们将认为这里没有字符这是一个空白区域并且不输出字符。同时窗口位置J向下滑动输出f19j;20图像总长度并判断最后循环得到字符数f、j。 3 银行卡字符定位 - 算法实现 首先就是将整张银行卡号里面的银行卡号部分进行识别且分出来这一个环节学长用的技术就是faster-rcnn的方法 将目标识别部分的银行卡号部门且分出来进行保存 主程序的代码如下(非完整代码) ​ #!/usr/bin/env pythonfrom __future__ import absolute_importfrom __future__ import divisionfrom __future__ import print_functionimport argparseimport osimport cv2import matplotlib.pyplot as pltimport numpy as npimport tensorflow as tffrom lib.config import config as cfgfrom lib.utils.nms_wrapper import nmsfrom lib.utils.test import im_detectfrom lib.nets.vgg16 import vgg16from lib.utils.timer import Timeros.environ[CUDA_VISIBLE_DEVICES] 0 #指定第一块GPU可用config tf.ConfigProto()config.gpu_options.per_process_gpu_memory_fraction 0.8 # 程序最多只能占用指定gpu50%的显存config.gpu_options.allow_growth True #程序按需申请内存sess tf.Session(config config)CLASSES (__background__,lb)NETS {vgg16: (vgg16_faster_rcnn_iter_70000.ckpt,), res101: (res101_faster_rcnn_iter_110000.ckpt,)}DATASETS {pascal_voc: (voc_2007_trainval,), pascal_voc_0712: (voc_2007_trainvalvoc_2012_trainval,)}def vis_detections(im, class_name, dets, thresh0.5):Draw detected bounding boxes.inds np.where(dets[:, -1] thresh)[0]if len(inds) 0:returnim im[:, :, (2, 1, 0)]fig, ax plt.subplots(figsize(12, 12))ax.imshow(im, aspectequal)sco[]for i in inds:score dets[i, -1]sco.append(score)maxscoremax(sco)# print(maxscore)成绩最大值for i in inds:# print(i)score dets[i, -1]if scoremaxscore:bbox dets[i, :4]# print(bbox)#目标框的4个坐标img cv2.imread(data/demo/filename)# img cv2.imread(data/demo/000002.jpg)spimg.shapewidth sp[1]if bbox[0]20 and bbox[2]20width:cropped img[int(bbox[1]):int(bbox[3]), int(bbox[0]-20):int(bbox[2])20] # 裁剪坐标为[y0:y1, x0:x1]if bbox[0]20 and bbox[2]20width:cropped img[int(bbox[1]):int(bbox[3]), int(bbox[0]):int(bbox[2])20] # 裁剪坐标为[y0:y1, x0:x1]if bbox[0] 20 and bbox[2] 20 width:cropped img[int(bbox[1]):int(bbox[3]), int(bbox[0] - 20):int(bbox[2])] # 裁剪坐标为[y0:y1, x0:x1]path cut1/# 重定义图片的大小res cv2.resize(cropped, (1000, 100), interpolationcv2.INTER_CUBIC) # dsize2*width,2*heightcv2.imwrite(pathstr(i)filename, res)ax.add_patch(plt.Rectangle((bbox[0], bbox[1]),bbox[2] - bbox[0],bbox[3] - bbox[1], fillFalse,edgecolorred, linewidth3.5))ax.text(bbox[0], bbox[1] - 2,{:s} {:.3f}.format(class_name, score),bboxdict(facecolorblue, alpha0.5),fontsize14, colorwhite)ax.set_title(({} detections with p({} | box) {:.1f}).format(class_name, class_name,thresh),fontsize14)plt.axis(off)plt.tight_layout()plt.draw()def demo(sess, net, image_name):Detect object classes in an image using pre-computed object proposals.# Load the demo imageim_file os.path.join(cfg.FLAGS2[data_dir], demo, image_name)im cv2.imread(im_file)# Detect all object classes and regress object boundstimer Timer()timer.tic()scores, boxes im_detect(sess, net, im)timer.toc()print(Detection took {:.3f}s for {:d} object proposals.format(timer.total_time, boxes.shape[0]))# Visualize detections for each classCONF_THRESH 0.1NMS_THRESH 0.1for cls_ind, cls in enumerate(CLASSES[1:]):cls_ind 1 # because we skipped backgroundcls_boxes boxes[:, 4 * cls_ind:4 * (cls_ind 1)]cls_scores scores[:, cls_ind]# print(cls_scores)#一个300个数的数组#np.newaxis增加维度 np.hstack将数组拼接在一起dets np.hstack((cls_boxes,cls_scores[:, np.newaxis])).astype(np.float32)keep nms(dets, NMS_THRESH)dets dets[keep, :]vis_detections(im, cls, dets, threshCONF_THRESH)def parse_args():Parse input arguments.parser argparse.ArgumentParser(descriptionTensorflow Faster R-CNN demo)parser.add_argument(--net, destdemo_net, helpNetwork to use [vgg16 res101],choicesNETS.keys(), defaultvgg16)parser.add_argument(--dataset, destdataset, helpTrained dataset [pascal_voc pascal_voc_0712],choicesDATASETS.keys(), defaultpascal_voc)args parser.parse_args()return argsif __name__ __main__:args parse_args()# model pathdemonet args.demo_netdataset args.dataset#tfmodel os.path.join(output, demonet, DATASETS[dataset][0], default, NETS[demonet][0])tfmodel r./default/voc_2007_trainval/cut1/vgg16_faster_rcnn_iter_8000.ckpt# 路径异常提醒if not os.path.isfile(tfmodel .meta):print(tfmodel)raise IOError(({:s} not found.\nDid you download the proper networks from our server and place them properly?).format(tfmodel .meta))# set configtfconfig tf.ConfigProto(allow_soft_placementTrue)tfconfig.gpu_options.allow_growth True# init sessionsess tf.Session(configtfconfig)# load networkif demonet vgg16:net vgg16(batch_size1)# elif demonet res101:# net resnetv1(batch_size1, num_layers101)else:raise NotImplementedErrornet.create_architecture(sess, TEST, 2,tagdefault, anchor_scales[8, 16, 32])saver tf.train.Saver()saver.restore(sess, tfmodel)print(Loaded network {:s}.format(tfmodel))# # 文件夹下所有图片进行识别# for filename in os.listdir(rdata/demo/):# im_names [filename]# for im_name in im_names:# print(~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~)# print(Demo for data/demo/{}.format(im_name))# demo(sess, net, im_name)## plt.show()# 单一图片进行识别filename 0001.jpgim_names [filename]for im_name in im_names:print(~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~)print(Demo for data/demo/{}.format(im_name))demo(sess, net, im_name)plt.show() 效果如下 4 字符分割 将切分出来的图片进行保存然后就是将其进行切分 主程序的代码和上面第一步的步骤原理是相同的不同的就是训练集的不同设置 效果图如下 5 银行卡数字识别 仅部分代码 ​ import osimport tensorflow as tffrom PIL import Imagefrom nets2 import nets_factoryimport numpy as npimport matplotlib.pyplot as plt# 不同字符数量CHAR_SET_LEN 10# 图片高度IMAGE_HEIGHT 60# 图片宽度IMAGE_WIDTH 160# 批次BATCH_SIZE 1# tfrecord文件存放路径TFRECORD_FILE rC:\workspace\Python\Bank_Card_OCR\demo\test_result\tfrecords/1.tfrecords# placeholderx tf.placeholder(tf.float32, [None, 224, 224])os.environ[CUDA_VISIBLE_DEVICES] 0 #指定第一块GPU可用config tf.ConfigProto()config.gpu_options.per_process_gpu_memory_fraction 0.5 # 程序最多只能占用指定gpu50%的显存config.gpu_options.allow_growth True #程序按需申请内存sess tf.Session(config config)# 从tfrecord读出数据def read_and_decode(filename):# 根据文件名生成一个队列filename_queue tf.train.string_input_producer([filename])reader tf.TFRecordReader()# 返回文件名和文件_, serialized_example reader.read(filename_queue)features tf.parse_single_example(serialized_example,features{image : tf.FixedLenFeature([], tf.string),label0: tf.FixedLenFeature([], tf.int64),})# 获取图片数据image tf.decode_raw(features[image], tf.uint8)# 没有经过预处理的灰度图image_raw tf.reshape(image, [224, 224])# tf.train.shuffle_batch必须确定shapeimage tf.reshape(image, [224, 224])# 图片预处理image tf.cast(image, tf.float32) / 255.0image tf.subtract(image, 0.5)image tf.multiply(image, 2.0)# 获取labellabel0 tf.cast(features[label0], tf.int32)return image, image_raw, label0# 获取图片数据和标签image, image_raw, label0 read_and_decode(TFRECORD_FILE)# 使用shuffle_batch可以随机打乱image_batch, image_raw_batch, label_batch0 tf.train.shuffle_batch([image, image_raw, label0], batch_sizeBATCH_SIZE,capacity50000, min_after_dequeue10000, num_threads1)# 定义网络结构train_network_fn nets_factory.get_network_fn(alexnet_v2,num_classesCHAR_SET_LEN * 1,weight_decay0.0005,is_trainingFalse)with tf.Session() as sess:# inputs: a tensor of size [batch_size, height, width, channels]X tf.reshape(x, [BATCH_SIZE, 224, 224, 1])# 数据输入网络得到输出值logits, end_points train_network_fn(X)# 预测值logits0 tf.slice(logits, [0, 0], [-1, 10])predict0 tf.argmax(logits0, 1)# 初始化sess.run(tf.global_variables_initializer())# 载入训练好的模型saver tf.train.Saver()saver.restore(sess, ../Cmodels/model/crack_captcha1.model-6000)# saver.restore(sess, ../1/crack_captcha1.model-2500)# 创建一个协调器管理线程coord tf.train.Coordinator()# 启动QueueRunner, 此时文件名队列已经进队threads tf.train.start_queue_runners(sesssess, coordcoord)for i in range(6):# 获取一个批次的数据和标签b_image, b_image_raw, b_label0 sess.run([image_batch,image_raw_batch,label_batch0])# 显示图片img Image.fromarray(b_image_raw[0], L)plt.imshow(img)plt.axis(off)plt.show()# 打印标签print(label:, b_label0)# 预测label0 sess.run([predict0], feed_dict{x: b_image})# 打印预测值print(predict:, label0[0])# 通知其他线程关闭coord.request_stop()# 其他所有线程关闭之后这一函数才能返回coord.join(threads) 最终实现效果 最后 更多资料, 项目分享 https://gitee.com/dancheng-senior/postgraduate
文章转载自:
http://www.morning.tsycr.cn.gov.cn.tsycr.cn
http://www.morning.qrlsy.cn.gov.cn.qrlsy.cn
http://www.morning.prprj.cn.gov.cn.prprj.cn
http://www.morning.mtqqx.cn.gov.cn.mtqqx.cn
http://www.morning.nbhft.cn.gov.cn.nbhft.cn
http://www.morning.sqfnx.cn.gov.cn.sqfnx.cn
http://www.morning.jqkjr.cn.gov.cn.jqkjr.cn
http://www.morning.haolipu.com.gov.cn.haolipu.com
http://www.morning.cfcpb.cn.gov.cn.cfcpb.cn
http://www.morning.lqgtx.cn.gov.cn.lqgtx.cn
http://www.morning.jbpodhb.cn.gov.cn.jbpodhb.cn
http://www.morning.hqlnp.cn.gov.cn.hqlnp.cn
http://www.morning.ywzqk.cn.gov.cn.ywzqk.cn
http://www.morning.rgrz.cn.gov.cn.rgrz.cn
http://www.morning.lsfrc.cn.gov.cn.lsfrc.cn
http://www.morning.jykzy.cn.gov.cn.jykzy.cn
http://www.morning.qfplp.cn.gov.cn.qfplp.cn
http://www.morning.rqxtb.cn.gov.cn.rqxtb.cn
http://www.morning.pndw.cn.gov.cn.pndw.cn
http://www.morning.lylkh.cn.gov.cn.lylkh.cn
http://www.morning.cxryx.cn.gov.cn.cxryx.cn
http://www.morning.lqypx.cn.gov.cn.lqypx.cn
http://www.morning.rwfp.cn.gov.cn.rwfp.cn
http://www.morning.mnkhk.cn.gov.cn.mnkhk.cn
http://www.morning.zpdjh.cn.gov.cn.zpdjh.cn
http://www.morning.xyrw.cn.gov.cn.xyrw.cn
http://www.morning.mgfnt.cn.gov.cn.mgfnt.cn
http://www.morning.qczpf.cn.gov.cn.qczpf.cn
http://www.morning.cbndj.cn.gov.cn.cbndj.cn
http://www.morning.gediba.com.gov.cn.gediba.com
http://www.morning.807yy.cn.gov.cn.807yy.cn
http://www.morning.tmfhx.cn.gov.cn.tmfhx.cn
http://www.morning.bsqkt.cn.gov.cn.bsqkt.cn
http://www.morning.hslgq.cn.gov.cn.hslgq.cn
http://www.morning.kflbf.cn.gov.cn.kflbf.cn
http://www.morning.ydhck.cn.gov.cn.ydhck.cn
http://www.morning.cwgpl.cn.gov.cn.cwgpl.cn
http://www.morning.mqbdb.cn.gov.cn.mqbdb.cn
http://www.morning.cmdfh.cn.gov.cn.cmdfh.cn
http://www.morning.drnjn.cn.gov.cn.drnjn.cn
http://www.morning.grynb.cn.gov.cn.grynb.cn
http://www.morning.gmgnp.cn.gov.cn.gmgnp.cn
http://www.morning.kzpy.cn.gov.cn.kzpy.cn
http://www.morning.gstmn.cn.gov.cn.gstmn.cn
http://www.morning.pfnrj.cn.gov.cn.pfnrj.cn
http://www.morning.rjkfj.cn.gov.cn.rjkfj.cn
http://www.morning.pybqq.cn.gov.cn.pybqq.cn
http://www.morning.kfmlf.cn.gov.cn.kfmlf.cn
http://www.morning.rdzgm.cn.gov.cn.rdzgm.cn
http://www.morning.dmwbs.cn.gov.cn.dmwbs.cn
http://www.morning.bytgy.com.gov.cn.bytgy.com
http://www.morning.zwhtr.cn.gov.cn.zwhtr.cn
http://www.morning.rdpps.cn.gov.cn.rdpps.cn
http://www.morning.qxxj.cn.gov.cn.qxxj.cn
http://www.morning.qyllw.cn.gov.cn.qyllw.cn
http://www.morning.tthmg.cn.gov.cn.tthmg.cn
http://www.morning.jjrsk.cn.gov.cn.jjrsk.cn
http://www.morning.wrlcy.cn.gov.cn.wrlcy.cn
http://www.morning.rptdz.cn.gov.cn.rptdz.cn
http://www.morning.lqjlg.cn.gov.cn.lqjlg.cn
http://www.morning.ydxx123.cn.gov.cn.ydxx123.cn
http://www.morning.rgkd.cn.gov.cn.rgkd.cn
http://www.morning.wpxfk.cn.gov.cn.wpxfk.cn
http://www.morning.wbxtx.cn.gov.cn.wbxtx.cn
http://www.morning.nlkjq.cn.gov.cn.nlkjq.cn
http://www.morning.zynjt.cn.gov.cn.zynjt.cn
http://www.morning.knpmj.cn.gov.cn.knpmj.cn
http://www.morning.rlqml.cn.gov.cn.rlqml.cn
http://www.morning.kbynw.cn.gov.cn.kbynw.cn
http://www.morning.gcqkb.cn.gov.cn.gcqkb.cn
http://www.morning.xfxqj.cn.gov.cn.xfxqj.cn
http://www.morning.tnnfy.cn.gov.cn.tnnfy.cn
http://www.morning.wiitw.com.gov.cn.wiitw.com
http://www.morning.xpqdf.cn.gov.cn.xpqdf.cn
http://www.morning.hmsong.com.gov.cn.hmsong.com
http://www.morning.lxhgj.cn.gov.cn.lxhgj.cn
http://www.morning.rmdsd.cn.gov.cn.rmdsd.cn
http://www.morning.thxfn.cn.gov.cn.thxfn.cn
http://www.morning.fchkc.cn.gov.cn.fchkc.cn
http://www.morning.qnhpq.cn.gov.cn.qnhpq.cn
http://www.tj-hxxt.cn/news/259767.html

相关文章:

  • 小网站怎么赚钱郑州东区做网站电话
  • 谷歌官方网站登录入口wordpress自定义字段图文
  • 个人网站建设与维护上海传媒公司艺人
  • 建设银行企业网站失败wordpress 宣布停止
  • seo怎么做自己的网站出入东莞最新通知今天
  • 十堰网站建设哪家专业威海教育行业网站建设
  • 阿里云服务器可以做几个网站wordpress 制作首页模板
  • 兼职做效果图的网站备案掉了网站会怎样
  • 植物提取网站做的比较好的厂家中职国示范建设网站
  • 个人建网站需要多少钱深圳创新投资公司官网
  • 网站建设是否需要源代码Wordpress 阅读全部
  • 民权做网站哪家好网络营销策划案怎么写
  • 宁波网站设计皆选蓉胜网络wordpress主题字体
  • 网站运营策划书网站导航设计图片
  • 成都网站制作套餐phpcms 网站根目录
  • 网站 防攻击wordpress login_head
  • 网站建设需求分析表怎么写o2o网站建设机构
  • 白云网站(建设信科网络)网站上传图片问题
  • 先做网站先备案莱州双语网站
  • 汽车软文广告株洲市网站关键词优化公司
  • 万网企业邮箱登陆界面如何嵌入到自己的网站南昌建筑工程公司
  • 明港网站建设平台开发网站建设公司官网
  • 临海做网站公司一家专门做护肤的网站
  • 怎么申请建立一个公司网站wordpress有微信主题吗
  • wordpress更改站点ip微信小程序开发如何制作
  • 电脑网站兼职在哪里做手机上怎么自己设计房子
  • 网站安全建设目标聊城网站那家做的好
  • 最新的网站建设架构十大免费货源网站免费版权
  • 成都医疗seo整站优化wordpress搬家显示重新安装
  • 网站的设计原则有哪些郑州网站建设找哪家