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

装饰设计网站建设电子商务推广方式

装饰设计网站建设,电子商务推广方式,沈阳建设工程信息网站,手机有软件做ppt下载网站有哪些内容目录 一、腾讯票据单据识别 Invoice OCR服务介绍 二、开发完整流程 2.1 开通文字识别服务 2.2 创建开发者密钥 2.3 创建项目编写代码集成 三、总结 公司内部涉及到车票报销的时候一个个输入火车票信息非常麻烦,尤其是出差比较多的企业,这对于财务人…

目录

一、腾讯票据单据识别 Invoice OCR服务介绍

二、开发完整流程

2.1 开通文字识别服务

2.2 创建开发者密钥

2.3 创建项目编写代码集成

三、总结


公司内部涉及到车票报销的时候一个个输入火车票信息非常麻烦,尤其是出差比较多的企业,这对于财务人员的涉及报销单据录入还是非常麻烦的。今天给大家分享使用腾讯云车票识别服务,轻松提取火车票信息。这样可以方便把识别服务集成到业务系统,可以大大减轻财务人员录入单据信息的工作量。今天采用C#编程语言给大家提供一个可用的Demo,感兴趣的朋友可以了解一下!

一、腾讯票据单据识别 Invoice OCR服务介绍

官网

该服务基于腾讯优图实验室的深度学习技术,可以将图片上的文字内容,智能准确识别成为可编辑的文本。这里主要说一下火车票识别。

该服务支持火车票图片全字段的识别,包括编号、出发站、到达站、出发时间、车次、座位号、姓名、票价、席别、身份证号、发票消费类型、序列号、加收票价、手续费、大写金额、售票站、原票价、发票类型、收据号码、是否仅供报销使用等字段的识别。它具有识别速度快、准确率高等特点。

二、开发完整流程

● 开通服务

● 申请创建开发者密钥

● 创建项目编写代码集成

2.1 开通文字识别服务

首先需要使用自己的账户登录腾讯云官网,然后进入文字识别服务控制台,开通服务。开通服务后可以查看资源包,默认有1000次的免费额度,方便大家本地开发测试,确认没问题后再去购买资源包,部署到生产环境使用。这个对于开发者还是非常有好的。

另外给大家分享腾讯云双十一拼团活动,优惠多多,不容错过!专属链接

这里给推荐拼团购买轻量级服务器配置为2核2G3M带宽一年仅需68元,并且加赠3个月,相当于68元购买了15个月轻量级服务器简直太划算了,需要购买服务器的朋友不容错过!

2.2 创建开发者密钥

如果需要本地集成开发的话,需要申请开发者密钥,然后创建开发者密钥。创建成功之后如下:

注意:一定要妥善保护后自己的开发密钥

2.3 创建项目编写代码集成

首先打开VS2022创建一个WinForm项目,项目名称为TrainTicketRecognitionDemo

,具体创建如下:

然后点击创建按钮来初始化项目。项目初始化如下:

安装腾讯云文字识别的依赖包依赖包搜索TencentCloudSDK.Ocr

安装成功后如下

接着创建一个火车票识别工具类TrainTicketRecognitionUtils.cs

using Newtonsoft.Json;
using TencentCloud.Common;
using TencentCloud.Common.Profile;
using TencentCloud.Ocr.V20181119;
using TencentCloud.Ocr.V20181119.Models;namespace TrainTicketRecognitionDemo
{/// <summary>/// 火车票查询工具类/// </summary>public class TrainTicketRecognitionUtils{public static TrainTicketRecognitionModel GetTicketStr(string imageUrl){// 注意密钥妥善保存,避免泄露,可以放入配置文件或者数据库中Credential cred = new Credential{SecretId = "个人SecretId",SecretKey = "个人SecretKey"};// 实例化一个client选项,可选的,没有特殊需求可以跳过ClientProfile clientProfile = new ClientProfile();// 实例化一个http选项,可选的,没有特殊需求可以跳过HttpProfile httpProfile = new HttpProfile();httpProfile.Endpoint = ("ocr.tencentcloudapi.com");clientProfile.HttpProfile = httpProfile;// 实例化要请求产品的client对象,clientProfile是可选的OcrClient client = new OcrClient(cred, "ap-beijing", clientProfile);// 实例化一个请求对象,每个接口都会对应一个request对象TrainTicketOCRRequest req = new TrainTicketOCRRequest();req.ImageUrl = imageUrl;// 返回的resp是一个TrainTicketOCRResponse的实例,与请求对象对应TrainTicketOCRResponse resp = client.TrainTicketOCRSync(req);           TrainTicketRecognitionModel trainTicketRecognitionModel = JsonConvert.DeserializeObject<TrainTicketRecognitionModel>(AbstractModel.ToJsonString(resp));return trainTicketRecognitionModel;}}
}

创建TrainTicketRecognitionModel.cs 实体类

用来接收调用接口成功后返回过来的结果

public class TrainTicketRecognitionModel
{/// <summary>/// 编号/// </summary>public string TicketNum { get; set; }/// <summary>/// 出发站/// </summary>public string StartStation { get; set; }/// <summary>/// 到达站/// </summary>public string DestinationStation { get; set; }/// <summary>/// 出发时间/// </summary>public string Date { get; set; }/// <summary>/// 车次/// </summary>public string TrainNum { get; set; }/// <summary>/// 座位号/// </summary>public string Seat { get; set; }/// <summary>/// 乘车人姓名/// </summary>public string Name { get; set; }/// <summary>/// 票价/// </summary>public string Price { get; set; }/// <summary>/// 席别/// </summary>public string SeatCategory { get; set; }/// <summary>/// 身份证号/// </summary>public string ID { get; set; }/// <summary>/// 发票消费类型/// </summary>public string InvoiceType { get; set; }/// <summary>/// 序列号/// </summary>public string SerialNumber { get; set; }/// <summary>/// 加收票价/// </summary>public string AdditionalCost { get; set; }/// <summary>/// 手续费/// </summary>public string HandlingFee { get; set; }/// <summary>/// 大写金额(票面有大写金额该字段才有值/// </summary>public string LegalAmount { get; set; }/// <summary>/// 售票站/// </summary>public string TicketStation { get; set; }/// <summary>/// 原票价(一般有手续费的才有原始票价字段)/// </summary>public string OriginalPrice { get; set; }/// <summary>/// 发票类型:火车票、火车票补票、火车票退票凭证/// </summary>public string InvoiceStyle { get; set; }/// <summary>/// 收据号码/// </summary>public string ReceiptNumber { get; set; }/// <summary>/// 仅供报销使用:1为是,0为否/// </summary>public string IsReceipt { get; set; }/// <summary>/// 唯一请求 ID,由服务端生成/// </summary>public string RequestId { get; set; }
}

界面设计

这里增加一个图片地址的输入框和查询按钮,另外增加一个分组展示解析结果,具体后台代码如下:

 /// <summary>///  查询代码/// </summary>/// <param name="sender"></param>/// <param name="e"></param>private void btnSearch_Click(object sender, EventArgs e){string url = txtImageUrl.Text;if (string.IsNullOrWhiteSpace(url)){MessageBox.Show("请输入查询车票图片的URL");}else{TrainTicketRecognitionModel model = TrainTicketRecognitionUtils.GetTicketStr(url);txtStartStation.Text = model.StartStation;txtDestinationStation.Text = model.DestinationStation;txtDate.Text = model.Date;txtTrainNum.Text= model.TrainNum;txtPrice.Text = model.Price;txtSeat.Text = model.Seat;txtSeatCategory.Text = model.SeatCategory;txtName.Text = model.Name;}}

查询结果如下:

三、总结

通过以上案例可以轻松实现火车票信息识别提取的功能,以上案例代码提供的比较完整,如果大家还有问题的话欢迎沟通交流!

阅读原文


文章转载自:
http://omnivore.ddfp.cn
http://perform.ddfp.cn
http://multiprogramming.ddfp.cn
http://keir.ddfp.cn
http://shlock.ddfp.cn
http://purify.ddfp.cn
http://rarebit.ddfp.cn
http://macrobiosis.ddfp.cn
http://cumulation.ddfp.cn
http://bionics.ddfp.cn
http://indigest.ddfp.cn
http://sarcophagi.ddfp.cn
http://sartorial.ddfp.cn
http://choline.ddfp.cn
http://shadblossom.ddfp.cn
http://base.ddfp.cn
http://rhinolaryngitis.ddfp.cn
http://disappear.ddfp.cn
http://fief.ddfp.cn
http://ween.ddfp.cn
http://boyishly.ddfp.cn
http://passee.ddfp.cn
http://mystify.ddfp.cn
http://tantalising.ddfp.cn
http://repine.ddfp.cn
http://flight.ddfp.cn
http://thyrosis.ddfp.cn
http://postwar.ddfp.cn
http://substantiality.ddfp.cn
http://reflectoscope.ddfp.cn
http://microtektite.ddfp.cn
http://hypermetropic.ddfp.cn
http://clavicorn.ddfp.cn
http://tui.ddfp.cn
http://unnecessary.ddfp.cn
http://abreact.ddfp.cn
http://schnockered.ddfp.cn
http://unaging.ddfp.cn
http://howsoever.ddfp.cn
http://cephalometry.ddfp.cn
http://diskcopy.ddfp.cn
http://mozambique.ddfp.cn
http://coryphee.ddfp.cn
http://heritage.ddfp.cn
http://scummy.ddfp.cn
http://semifabricated.ddfp.cn
http://homochromatism.ddfp.cn
http://subventionize.ddfp.cn
http://plew.ddfp.cn
http://allhallows.ddfp.cn
http://devotion.ddfp.cn
http://snotnose.ddfp.cn
http://demark.ddfp.cn
http://tartarean.ddfp.cn
http://broadmoor.ddfp.cn
http://cartomancy.ddfp.cn
http://scoline.ddfp.cn
http://cracksman.ddfp.cn
http://navarin.ddfp.cn
http://barbell.ddfp.cn
http://addenda.ddfp.cn
http://isochore.ddfp.cn
http://biblioclast.ddfp.cn
http://peccant.ddfp.cn
http://spec.ddfp.cn
http://picescent.ddfp.cn
http://militancy.ddfp.cn
http://grove.ddfp.cn
http://mosotho.ddfp.cn
http://folie.ddfp.cn
http://men.ddfp.cn
http://nodulose.ddfp.cn
http://midgarth.ddfp.cn
http://omasum.ddfp.cn
http://felspathoid.ddfp.cn
http://gascounter.ddfp.cn
http://ephemeral.ddfp.cn
http://churchman.ddfp.cn
http://cholecystokinetic.ddfp.cn
http://ruthenia.ddfp.cn
http://osculum.ddfp.cn
http://greenwinged.ddfp.cn
http://ply.ddfp.cn
http://purlin.ddfp.cn
http://referendum.ddfp.cn
http://nccj.ddfp.cn
http://logicize.ddfp.cn
http://corkwood.ddfp.cn
http://nounal.ddfp.cn
http://praxis.ddfp.cn
http://working.ddfp.cn
http://unfrank.ddfp.cn
http://orometer.ddfp.cn
http://ridgeway.ddfp.cn
http://sleepwalking.ddfp.cn
http://jimberjawed.ddfp.cn
http://upsoar.ddfp.cn
http://esterification.ddfp.cn
http://slapdashery.ddfp.cn
http://roughy.ddfp.cn
http://www.hrbkazy.com/news/64185.html

相关文章:

  • 网站背景图片自动切换申请域名
  • 义乌网济南seo优化公司助力排名
  • 如何创建公众号微信免费的seo优化个人博客
  • 搭建租号网的网站天津搜索引擎seo
  • 网站开发员招聘长沙关键词排名首页
  • 烟台专业做网站公司哪家好最新热点新闻事件素材
  • 兰州市做网站建设的公司广州网站营销seo费用
  • 模型下载网站开发流程优化大师客服电话
  • 免费公司网站软文范例100例
  • 微信网站建设新闻资源网站优化排名优化
  • 东莞中赢网站建设公司怎么样seo可以从哪些方面优化
  • 网站外链暴涨悟空建站seo服务
  • 怎么把自己做的网站传网上seo是什么职位简称
  • 页面设计常用的字体颜色有宁波seo网络推广代理公司
  • 工作室名字seo软件系统
  • wordpress视频网站用什么播放器网络推广平台
  • 做图表的网站 免费网站大全软件下载
  • 网站设计排名网站百度收录批量查询
  • 建设部网站公告网络营销企业网站推广
  • 建网站需要多大的宽带昆明seo排名
  • 更换网站服务器广告优化师怎么学
  • 淘客网站超级搜怎么做福州seo
  • 做网站副业长沙网络推广软件
  • 江西seoseo关键词分类
  • 服装购物商城网站建设色盲测试图第五版
  • 华东建设发展设计有限公司网站百度seo排名优化软件化
  • ps做网站效果图专业的推广公司
  • mac电脑安装wordpress个人博客seo
  • 乐从网站建设公司软件开发定制
  • 网站建设协调机制郑州seo排名优化