zl程序教程

您现在的位置是:首页 >  云平台

当前栏目

一则手写汉字识别应用介绍

识别应用 介绍 手写 汉字 一则
2023-09-27 14:28:37 时间

项目

https://github.com/fanqingsong/cnn_handwritten_chinese_recognition

    使用python+flask搭建的一个网站,然后从网页的写字板上获取鼠标手写的汉字经过转码后传回后台,并经过图片裁剪处理之后传入CNN手写中文识别的模型中进行识别,最后通过PIL将识别结果生成图片,最后异步回传给web端进行识别结果展示。中文总共50,000多汉字,常用的有3,755个。这里主要对常见的3755个汉字进行识别。

 

使用技术

前台:

1、 drawingboard.js 在canvas上手写汉字

      并可以获取canvas手写汉字的图片编码 base64

2、 手写过程监控事件,实时收集canvas图片数据,通过ajax发往后台进行识别。

 

后台:

1、 flask -- web服务器框架

2、 tensorflow --- 加载汉字识别模型, 并根据输入的图片数据给出预测结果, 取最可能的前三个发往前台。

 

drawingboard

http://leimi.github.io/drawingboard.js/

This is a canvas based drawing app that you can integrate easily on your website.

drawingboard.js consists of a blank canvas surrounded by a few UI elements that control it: a color picker, a pencil, a paint can, an eraser, a pencil size chooser, navigations and reset buttons.

You can draw with mouse or touch on pretty much every browser that supports <canvas>. Didn't test that much on IE but hey, WIP.

local and session storage are supported: your last drawing is restored when you come back on the website.

You can set a background image at initialization, or let the user drop one on the canvas.

The drawingboard is really lightweight, but also really simple: if you want something more complete, go look at similar projects at the bottom of this doc.