求助不用服务器怎么在小程序内实现汉字笔画识别功能?
发布于 6 年前 作者 kyi 7452 次浏览 来自 问答

我做了一个小程序,针对小朋友写的字进行打分,目前大方向已经有了,目前需要更进一步研发,需要识别出每个笔画的名称。有没有朋友可以指点一下。

目前的笔画识别已经做到了这个样子:

将笔画形成点阵,0对应没有,有数字对应有笔画数字越大,表示权重越高。

拍照以后,将笔画细化为一像素的二值图,16*16。

然后对系统内的笔画数组对进对比。如果和哪个数组最接近,就表示是哪个笔画。

这样做出来能够识别一些笔画。

但是如何处理比较短的笔画这个地方遇到了问题,

拍照时,我是取出照片里的笔画来归一到16*16,

就是如果是点的话,得到的结果和捺是一样的。

a[4]=[

‘0000001461000000’,

‘0000001461000000’,

‘0000001561000000’,

‘0000001561000000’,

‘0000001461000000’,

‘0000001461000000’,

‘0000001561000000’,

‘0000001561000000’,

‘0000001561000000’,

‘0000001561000000’,

‘0000001561000000’,

‘0000001561000000’,

‘0000001561000000’,

‘0000001561000000’,

‘0000001451000000’,

‘0000001221000000’];

a[5]=[

‘0000001661000000’,

‘0000001551000000’,

‘0000001551000000’,

‘0000001551000000’,

‘0000001551000000’,

‘0000001551000000’,

‘0000001551000000’,

‘0000001551000000’,

‘0000001551000000’,

‘0000001251000000’,

‘0000001251000000’,

‘0000001521000000’,

‘0000001521000000’,

‘0000001421000000’,

‘0000001321000000’,

‘0000001211000000’];

a[6]=[

‘0000011156110000’,

‘0000011156110000’,

‘0000011156110000’,

‘0000011156110000’,

‘0000011156110000’,

‘0000011156110000’,

‘0000011156110000’,

‘0000011125111000’,

‘0000011135110000’,

‘0000011165110000’,

‘00000111461100000’,

‘0000011551100000’,

‘0001115531000000’,

‘0011155310000000’,

‘0011443110000000’,

‘1122110000000000’];

a[7]=[

‘0000000000000000’,

‘0000000000000000’,

‘0000000000112100’,

‘0000000001344321’,

‘0000000123566531’,

‘0000011346666531’,

‘0001124566543211’,

‘0113455654321000’,

‘1134554321100000’,

‘1233322100000000’,

‘1111100000000000’,

‘0000000000000000’,

‘0000000000000000’,

‘0000000000000000’,

‘0000000000000000’,

‘0000000000000000’];

a[8]=[

‘0000000000000000’,

‘0000000001232100’,

‘0000000002554210’,

‘0000000013666410’,

‘0000000125666410’,

‘0000001246665310’,

‘0000011466642100’,

‘0000114666421000’,

‘0001246653110000’,

‘0012456531000000’,

‘0124554210000000’,

‘0134321100000000’,

‘0112110000000000’,

‘0000000000000000’,

‘0000000000000000’,

‘0000000000000000’];

a[9]=[

‘0000000002566310’,

‘0000000002565200’,

‘0000000013664100’,

‘0000000014652100’,

‘0000000135641000’,

‘0000000146521000’,

‘0000001355310000’,

‘0000012454100000’,

‘0000014552100000’,

‘0000135531000000’,

‘0001355310000000’,

‘0113554110000000’,

‘1135531100000000’,

‘1244311000000000’,

‘1221100000000000’,

‘1110000000000000’];

a[10]=[

‘1332100000000000’,

‘2454200000000000’,

‘1355310000000000’,

‘0135531000000000’,

‘0014552100000000’,

‘0012454210000000’,

‘0001255421000000’,

‘0000135542100000’,

‘0000013564210000’,

‘0000011466531100’,

‘0000001246654321’,

‘0000000124666543’,

‘0000000012344432’,

‘0000000000111111’,

‘0000000000000000’,

‘0000000000000000’];

a[11]=[

‘0000000000000000’,

‘0000000000000000’,

‘0000000000000000’,

‘0000000000000000’,

‘1222110000000000’,

‘3444432211000000’,

‘3444455433322222’,

‘2222234555555543’,

‘0000011245566653’,

‘0000000112334331’,

‘0000000000111100’,

‘0000000000000000’,

‘0000000000000000’,

‘0000000000000000’,

‘0000000000000000’,

‘0000000000000000’];

a[12]=[

‘0000113431000000’,

‘0000012453100000’,

‘0000001354200000’,

‘0000000245310000’,

‘0000000145410000’,

‘0000000136410000’,

‘0000000035520000’,

‘0000000035520000’,

‘0000000035520000’,

‘0000000035420000’,

‘0000000035420000’,

‘0000011135410000’,

‘0022212456310000’,

‘0002223566310000’,

‘0000122454200000’,

‘0000001122100000’];

a[13]=[

‘0000000115510000’,

‘0000000115510000’,

‘0000000115510000’,

‘0000000115510000’,

‘0000000114410000’,

‘0000000114410000’,

‘0000000114410000’,

‘0000000114510000’,

‘0000000115510000’,

‘0000000115510000’,

‘0000000115510000’,

‘0000000116510000’,

‘0111110116510000’,

‘0001221145310000’,

‘0000212222110000’,

‘0000001222200000’];

另外我的打分部分也需要有人指点

怎么样才能指导程序做得好一点。

另外,给大家我的小程序二维码和体验二维码,可以看到最新的版本。

左边是正式上线的版本,右边是体验版

我的微信号maoxingzhao

回到顶部