CN110263636A - A kind of lossless person's handwriting restoring method and system - Google Patents

A kind of lossless person's handwriting restoring method and system Download PDF

Info

Publication number
CN110263636A
CN110263636A CN201910400777.XA CN201910400777A CN110263636A CN 110263636 A CN110263636 A CN 110263636A CN 201910400777 A CN201910400777 A CN 201910400777A CN 110263636 A CN110263636 A CN 110263636A
Authority
CN
China
Prior art keywords
point
handwriting
person
edge
derivative
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910400777.XA
Other languages
Chinese (zh)
Inventor
余雄伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agree Technology Co Ltd
Original Assignee
Agree Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agree Technology Co Ltd filed Critical Agree Technology Co Ltd
Priority to CN201910400777.XA priority Critical patent/CN110263636A/en
Publication of CN110263636A publication Critical patent/CN110263636A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/30Writer recognition; Reading and verifying signatures
    • G06V40/37Writer recognition; Reading and verifying signatures based only on signature signals such as velocity or pressure, e.g. dynamic signature recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Discrimination (AREA)
  • Collating Specific Patterns (AREA)

Abstract

Technical solution of the present invention includes kind of a lossless person's handwriting restoring method and system; it is characterized in that; this method comprises: S10, is acquired the handwriting image data write based on writing device, wherein the image data acquired is the coordinate of collection point, pressure sensitivity coefficient and apart from the upper time;The data of each stroke in handwriting image data are grouped by S20;S30, coordinate data and pressure sensitivity coefficient based on each stroke collection point calculate the derivative point of corresponding first edge and the derivative point of second edge, and the derivative point in each group of multiple edges is attached, and generate person's handwriting file;S40 is handled using Bezier algorithm by point is derived per two adjacent edges in person's handwriting file, obtains final person's handwriting.The invention has the benefit that the person's handwriting for improving accuracy rate and generation that person's handwriting identifies is more life-like.

Description

一种无损笔迹还原方法及系统A kind of non-destructive handwriting restoration method and system

技术领域technical field

本发明涉及一种无损笔迹还原方法及系统,属于计算机领域。The invention relates to a lossless handwriting restoration method and system, belonging to the field of computers.

背景技术Background technique

目前在银行、电信等服务行业,无纸化办事已经成为常态,过去需要手写签名的地方均需要变为电子手写签名。由于自然书写的时候,笔画的着力度、书写的流畅度,均影响到签名字迹的真实度。因此,无纸化办事上,需要一种算法能够准确的还原真实的笔迹,并能做到放大而不失真,以便进行细节对比。目前比较通用的做法是通过密集的采集书写过程中笔锋经过的点,记录下笔画中各个点坐标位置以及压感系数,还原时以各点的坐标为圆心,压感系数为半径/直径,形成大小不一的圆点,通过圆点聚合形成上视觉上的线条。通过如此“由点聚线”的方式形成的笔迹,在放大一定倍数后,线条的细节,尤其是线条拐弯处,会明显出现函接痕迹,导致线条局部失真。且对于签名线条密集的笔迹,圆点集中导致线条难以区分。At present, in the banking, telecommunications and other service industries, paperless services have become the norm, and all places that required handwritten signatures in the past need to be electronically handwritten signatures. When writing naturally, the strength of the strokes and the fluency of writing all affect the authenticity of the signature and handwriting. Therefore, in the paperless service, an algorithm is needed that can accurately restore the real handwriting, and can enlarge it without distortion, so as to compare the details. At present, the more common practice is to collect the points passed by the stroke during the writing process, and record the coordinate position and pressure sensitivity coefficient of each point in the stroke. When restoring, the coordinates of each point are taken as the center of the circle, and the pressure sensitivity coefficient is the radius/diameter. Dots of different sizes form visual lines through the aggregation of dots. The handwriting formed by such "points and lines" method, after magnifying a certain number of times, the details of the lines, especially the corners of the lines, will show obvious traces of connection, resulting in local distortion of the lines. And for handwriting with dense signature lines, the concentration of dots makes the lines indistinguishable.

发明内容SUMMARY OF THE INVENTION

本发明提供了一种无损笔迹还原方法及系统,用于解决现有技术的不足。The present invention provides a lossless handwriting restoration method and system, which are used to solve the deficiencies of the prior art.

本发明的技术方案包括一种无损笔迹还原方法,其特征在于,该方法包括:S10,对基于书写装置书写的笔迹图像数据进行采集,其中采集的图像数据为采集点的坐标、压感系数及距离上一点的时间;S20,将笔迹图像数据中的每个笔画的数据进行分组;S30,基于每个笔画采集点的坐标数据及压感系数计算对应的第一边缘衍生点及第二边缘衍生点,生成笔迹文件;S40,将笔迹文件中每相邻的两个边缘衍生点使用贝塞尔算法进行处理,得到最终笔迹。The technical solution of the present invention includes a non-destructive handwriting restoration method, which is characterized in that the method includes: S10, collecting handwriting image data written based on a writing device, wherein the collected image data is the coordinates of the collection point, the pressure sensitivity coefficient and the The time from the previous point; S20, group the data of each stroke in the handwriting image data; S30, calculate the corresponding first edge derivative point and the second edge derivative point based on the coordinate data of each stroke collection point and the pressure sensitivity coefficient point, to generate a handwriting file; S40, use the Bessel algorithm to process every two adjacent edge-derived points in the handwriting file to obtain the final handwriting.

根据所述的无损笔迹还原方法,其中的S10具体包括:使用具备采集功能的书写装置采集用户输入的笔迹图像数据的进行采集,采集点包括横坐标、纵坐标及压感数据;对笔迹图像数据进行描边绘制成笔画图像。According to the non-destructive handwriting restoration method, S10 specifically includes: using a writing device with a collection function to collect the handwriting image data input by the user, and the collection points include abscissa, ordinate and pressure-sensitive data; Stroke is drawn as a stroke image.

根据所述的无损笔迹还原方法,其中的笔画图像为SVG矢量图。According to the non-destructive handwriting restoration method, the stroke image is an SVG vector diagram.

根据所述的无损笔迹还原方法,其中的S20具体包括:基于距离上一点的时间将连续的采集点作为一个完整笔画,而超过预设时间的作为则作为新的笔画开始,进一步将连续的采集点作为一组数据。According to the non-destructive handwriting restoration method, S20 specifically includes: taking the continuous collection point as a complete stroke based on the time from the previous point, and starting the action beyond the preset time as a new stroke, and further using the continuous collection point as a new stroke. points as a set of data.

根据所述的无损笔迹还原方法,其中的S30包括:根据相连采集点的坐标数据及压感系数计算该采集点的第一边缘衍生点及第二边缘衍生点,具体包括:S31,根据任意相连的两个采集点(x1,y1)及(x2,y2),计算出两个采集点形成的直线与横坐标夹角a的sin值及cos值;S32,以(x1,y1)作为起点,以(x2,y2)作为终点,根据直线与横坐标夹角a的sin值、cos值以及压感系数,计算出旋转长度r,进一步分别执行逆时及顺时90°旋转,得到对应的第一边缘衍生点及第二边缘衍生点;S33,将同一组笔画的每个采集点的第一边缘衍生点进行顺序标记,再逆序标记每个采集点的第二边缘衍生点形成一笔完整笔画的边缘点标记。According to the non-destructive handwriting restoration method, S30 includes: calculating the first edge derivative point and the second edge derivative point of the collection point according to the coordinate data and the pressure sensitivity coefficient of the connected collection points, and specifically includes: S31, according to any connected collection point. The two collection points (x 1 , y 1 ) and (x 2 , y 2 ) of , calculate the sin value and cos value of the angle a between the straight line formed by the two collection points and the abscissa; S32, take (x 1 , y 1 ) as the starting point, with (x 2 , y 2 ) as the end point, according to the sin value, cos value and pressure sensitivity coefficient of the angle a between the straight line and the abscissa, calculate the rotation length r, and further perform the reverse-time and clockwise steps respectively. Rotate 90° to obtain the corresponding first edge derived point and second edge derived point; S33, sequentially mark the first edge derived point of each collection point of the same group of strokes, and then reversely mark the second edge derived point of each collection point. Edge derived points form edge point markers for a full stroke.

根据所述的无损笔迹还原方法,其中的S31具体包括:以纵坐标轴的距离除以两点的距离,得到a的sin值,其计算方式为sina=(y2-y1)/R;以横坐标轴的距离除以两点的距离,得到a的cos值,其计算方式为cosa=(x2-x1)/R。According to the lossless handwriting restoration method, S31 specifically includes: dividing the distance of the ordinate axis by the distance of two points to obtain the sin value of a, and the calculation method is sina=(y 2 -y 1 )/R; Divide the distance of the abscissa axis by the distance of the two points to obtain the cos value of a, which is calculated as cosa=(x 2 -x 1 )/R.

根据所述的无损笔迹还原方法,其中的S32包括:通过左边变换对第一边缘衍生点及第二边缘衍生点进行计算,通过坐标几何变换公式,逆时针旋转90度,计算出第一个边缘衍生点(x1A,y1A)x1A=x1-rsin(a-90)=x1+rcosa,y1A=y1-rcos(a-90)=y1-rsina;通过坐标几何变换公式,顺时针旋转90度,计算出第二个边缘衍生点(x1B,y1B),x1A=x1-rsin(a-90)=x1+rcosa,y1A=y1-rcos(a-90)=y1-rsina。According to the lossless handwriting restoration method, S32 includes: calculating the first edge derived point and the second edge derived point through the left transformation, and rotating 90 degrees counterclockwise through the coordinate geometric transformation formula to calculate the first edge Derived point (x1 A , y1 A ) x1 A =x1-rsin(a-90)=x1+rcosa, y1 A =y1-rcos(a-90)=y1-rsina; through the coordinate geometric transformation formula, rotate clockwise 90 degrees, calculate the second edge derived point (x1 B , y1 B ), x1 A = x1-rsin(a-90)=x1+rcosa, y1 A =y1-rcos(a-90)=y1-rsina .

根据所述的无损笔迹还原方法,其中的S40包括:对第一边缘衍生点及第二边缘衍生点使用贝塞尔曲线算法进行处理,包括对每个采集点相连的采集点计算贝塞尔曲线的控制点,根据控制点生成优化后的贝塞尔曲线。According to the non-destructive handwriting restoration method, S40 includes: processing the first edge derived point and the second edge derived point using a Bezier curve algorithm, including calculating a Bezier curve for the collection points connected to each collection point The control points of , and the optimized Bezier curve is generated according to the control points.

根据所述的无损笔迹还原方法,计算贝塞尔曲线控制点具体包括:计算第一控制点,具体为:PA(n)_x=x(n)+(x(n+1)-x(n-1))*0.15,PA(n)_y=y(n)+(y(n+1)-y(n-1))*0.15,其中0.15为平滑系数;计算第二控制点,具体为:pB(n)_x=x(n+1)-(x(n+2)-x(n))*0.15,pB(n)_y=y(n+1)+(y(n+2)-y(n))*0.15;根据得到的第一控制点及第二控制点生成每个采集点的赛贝尔曲线,完成对每个笔画的优化。According to the lossless handwriting restoration method, calculating the Bezier curve control point specifically includes: calculating the first control point, specifically: PA(n)_x=x(n)+(x(n+1)-x(n -1))*0.15, PA(n)_y=y(n)+(y(n+1)-y(n-1))*0.15, where 0.15 is the smoothing coefficient; calculate the second control point, specifically : pB(n)_x=x(n+1)-(x(n+2)-x(n))*0.15, pB(n)_y=y(n+1)+(y(n+2) -y(n))*0.15; According to the obtained first control point and second control point, the Sebel curve of each collection point is generated, and the optimization of each stroke is completed.

本发明的计算方案还包括一种上述任意所述方法的无损笔迹还原系统,其特征在于,该系统包括:笔画采集模块,用于通过书写装置书写的笔迹图像数据进行采集,其中采集的图像数据为采集点的坐标、压感系数及距离上一点的时间;笔画分组模块,用于将笔迹图像数据中的每个笔画的数据进行分组;衍生点计算模块,用于基于每个笔画采集点的坐标数据及压感系数计算对应的第一边缘衍生点及第二边缘衍生点,并将每个组多个边缘衍生点进行连接,生成笔迹文件;优化模块,将笔迹文件中每相邻的两个边缘衍生点使用贝塞尔算法进行处理,得到最终笔迹。The calculation scheme of the present invention also includes a non-destructive handwriting restoration system according to any of the above-mentioned methods, characterized in that the system includes: a stroke collection module for collecting handwriting image data written by a writing device, wherein the collected image data are the coordinates of the collection point, the pressure sensitivity coefficient and the time from the previous point; the stroke grouping module is used to group the data of each stroke in the handwriting image data; the derived point calculation module is used to collect the points based on each stroke. The coordinate data and the pressure sensitivity coefficient calculate the corresponding first edge derived point and the second edge derived point, and connect multiple edge derived points in each group to generate a handwriting file; The edge-derived points are processed using the Bezier algorithm to obtain the final handwriting.

本发明的有益效果为:提高了笔迹识别的准确率以及生成的笔迹更加逼真、自然并且放大无失真。The beneficial effects of the invention are as follows: the accuracy of handwriting recognition is improved, and the generated handwriting is more realistic, natural, and enlarged without distortion.

附图说明Description of drawings

图1所示为根据本发明实施方式的总体流程图;Figure 1 shows an overall flow chart according to an embodiment of the present invention;

图2所示为根据本发明实施方式的系统框图;Figure 2 shows a system block diagram according to an embodiment of the present invention;

图3a,3b,3c所示为根据本发明实施方式的笔迹还原图;Figures 3a, 3b, and 3c show handwriting restoration diagrams according to embodiments of the present invention;

图4a,4b所示分别为根据本发明实施方式的签名笔迹图及部位放大图。Figures 4a and 4b are respectively a handwriting diagram of a signature and an enlarged diagram of a part according to an embodiment of the present invention.

具体实施方式Detailed ways

以下将结合实施例和附图对本发明的构思、具体结构及产生的技术效果进行清楚、完整的描述,以充分地理解本发明的目的、方案和效果。The concept, specific structure and technical effects of the present invention will be clearly and completely described below in conjunction with the embodiments and the accompanying drawings, so as to fully understand the purpose, solutions and effects of the present invention.

需要说明的是,如无特殊说明,当某一特征被称为“固定”、“连接”在另一个特征,它可以直接固定、连接在另一个特征上,也可以间接地固定、连接在另一个特征上。此外,本公开中所使用的上、下、左、右等描述仅仅是相对于附图中本公开各组成部分的相互位置关系来说的。在本公开中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。此外,除非另有定义,本文所使用的所有的技术和科学术语与本技术领域的技术人员通常理解的含义相同。本文说明书中所使用的术语只是为了描述具体的实施例,而不是为了限制本发明。本文所使用的术语“和/或”包括一个或多个相关的所列项目的任意的组合。It should be noted that, unless otherwise specified, when a feature is called "fixed" or "connected" to another feature, it can be directly fixed or connected to another feature, or it can be indirectly fixed or connected to another feature. on a feature. In addition, descriptions such as upper, lower, left, right, etc. used in the present disclosure are only relative to the mutual positional relationship of each component of the present disclosure in the accompanying drawings. As used in this disclosure, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. Also, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terms used in the specification herein are for the purpose of describing specific embodiments only, and not for the purpose of limiting the present invention. As used herein, the term "and/or" includes any combination of one or more of the associated listed items.

应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种元件,但这些元件不应限于这些术语。这些术语仅用来将同一类型的元件彼此区分开。例如,在不脱离本公开范围的情况下,第一元件也可以被称为第二元件,类似地,第二元件也可以被称为第一元件。本文所提供的任何以及所有实例或示例性语言(“例如”、“如”等)的使用仅意图更好地说明本发明的实施例,并且除非另外要求,否则不会对本发明的范围施加限制。It will be understood that, although the terms first, second, third, etc. may be used in this disclosure to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish elements of the same type from one another. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of the present disclosure. The use of any and all examples or exemplary language ("for example," "such as," etc.) provided herein is intended only to better illustrate embodiments of the invention and does not impose limitations on the scope of the invention unless otherwise claimed .

图1所示为根据本发明实施方式的总体流程图。S10,对基于书写装置书写的笔迹图像数据进行采集,其中采集的图像数据为采集点的坐标、压感系数及距离上一点的时间;S20,将笔迹图像数据中的每个笔画的数据进行分组;S30,基于每个笔画采集点的坐标数据及压感系数计算对应的第一边缘衍生点及第二边缘衍生点,并将每个组多个边缘衍生点进行连接,生成笔迹文件;S40,将笔迹文件中每相邻的两个边缘衍生点使用贝塞尔算法进行处理,得到最终笔迹。Figure 1 shows an overall flow diagram according to an embodiment of the present invention. S10, collecting the handwriting image data written based on the writing device, wherein the collected image data is the coordinates of the collection point, the pressure sensitivity coefficient and the time from the previous point; S20, grouping the data of each stroke in the handwriting image data S30, calculate the corresponding first edge derived point and the second edge derived point based on the coordinate data of each stroke collection point and the pressure sensitivity coefficient, and connect the multiple edge derived points of each group to generate a handwriting file; S40, The Bezier algorithm is used to process every two adjacent edge-derived points in the handwriting file to obtain the final handwriting.

图2所示为根据本发明实施方式的系统框图。该系统包括:笔画采集模块,用于通过书写装置书写的笔迹图像数据进行采集,其中采集的图像数据为采集点的坐标、压感系数及距离上一点的时间;笔画分组模块,用于将笔迹图像数据中的每个笔画的数据进行分组;衍生点计算模块,用于基于每个笔画采集点的坐标数据及压感系数计算对应的第一边缘衍生点及第二边缘衍生点,并将每个组多个边缘衍生点进行连接,生成笔迹文件;优化模块,将笔迹文件中每相邻的两个边缘衍生点使用贝塞尔算法进行处理,得到最终笔迹。Figure 2 shows a system block diagram according to an embodiment of the present invention. The system includes: a stroke collection module for collecting handwriting image data written by a writing device, wherein the collected image data is the coordinates of the collection point, the pressure sensitivity coefficient and the time from the previous point; the stroke grouping module is used for handwriting The data of each stroke in the image data is grouped; the derived point calculation module is used to calculate the corresponding first edge derived point and the second edge derived point based on the coordinate data and pressure sensitivity coefficient of each stroke collection point, and calculate the corresponding first edge derived point and the second edge derived point. Groups of multiple edge-derived points are connected to generate a handwriting file; the optimization module uses the Bezier algorithm to process every two adjacent edge-derived points in the handwriting file to obtain the final handwriting.

图3a,3b,3c所示为根据本发明实施方式的笔迹还原图。3a, 3b, and 3c are diagrams illustrating restoration of handwriting according to an embodiment of the present invention.

先来看一组手写板采集的带压感的数据:Let's first look at the pressure-sensitive data collected by a set of handwriting tablets:

166.8158,71.54401,0.049804688,0;166.8158,71.54401,0.049804688,0;

166.69043,71.54401,0.14550781,5;166.69043,71.54401,0.14550781,5;

166.43958,71.54401,0.19824219,4;166.43958,71.54401,0.19824219,4;

166.06342,71.54401,0.23046875,5;166.06342,71.54401,0.23046875,5;

165.6872,71.54401,0.25,4;165.6872,71.54401,0.25,4;

............

............

上面每行数据组包含4个数据,分别为采集点的Each row of the above data group contains 4 data, which are the data of the collection point.

x,y,压感系数,距离上一点的时间x, y, pressure sensitivity coefficient, time from the previous point

现在要根据上述采集点生成手写笔迹图像。Now we need to generate an image of handwriting based on the above collection points.

svg矢量图的特点是放大不失真,为了达到效果,生成的笔迹图像需要采用“描边”绘制,即按书写的粗细,描绘笔画的轮廓,如下图的笔画图像:The characteristic of svg vector graphics is that it is enlarged without distortion. In order to achieve the effect, the generated handwriting image needs to be drawn by "stroke", that is, according to the thickness of the writing, the outline of the stroke is depicted, as shown in the stroke image below:

参考图3a,为了达到此效果,需要对采集数据进行处理。首先要对笔画进行分组,把一笔连续的点作为一个完整笔画,注意每组数据的第四个值:距离上一点的时间,我们可以把距离上一点超过90的,认为是新一笔的开始,建立起一个笔画数组。对于每一个笔画内的点,计算出该点衍生出来的两个边缘点。Referring to Figure 3a, in order to achieve this effect, the collected data needs to be processed. First of all, we need to group the strokes, take a continuous point as a complete stroke, pay attention to the fourth value of each group of data: the time from the previous point, we can consider it as a new stroke if the distance from the previous point exceeds 90 To start, build an array of strokes. For each point within the stroke, calculate the two edge points derived from that point.

黑色点为采集点,线条是根据第三个数据——压感系数计算出来的长度,灰色点即为衍生出来边缘点。The black point is the collection point, the line is the length calculated according to the third data - pressure sensitivity coefficient, and the gray point is the derived edge point.

参考图3b,根据两个采集点x1,y1,x2,y2,可计算出两点的形成的直线与x坐标轴夹角a的sin值与cos值:Referring to Figure 3b, according to the two collection points x1, y1, x2, y2, the sin and cos values of the angle a between the straight line formed by the two points and the x-coordinate axis can be calculated:

以y坐标轴的距离除以两点的距离,得到a的正弦值Divide the distance on the y-axis by the distance between the two points to get the sine of a

sin a=(y2-y1)/Rsin a=(y2-y1)/R

以x坐标轴的距离除以两点距离,得到a的余弦值Divide the distance on the x-axis by the distance between the two points to get the cosine of a

cos a=(x2-x1)/Rcos a=(x2-x1)/R

而衍生的两个蓝点可用两点直线中以x1,y1为起点长度为压感系计算出的长度r分别顺、逆时间旋转90度得出,如下图3c:The two derived blue dots can be obtained by rotating 90 degrees forward and backward in time respectively, using the length r calculated from the starting point of x1 and y1 as the pressure-sensitive system in the two-point straight line, as shown in Figure 3c below:

于是,两个衍生点为(注意,计算机中的y轴方向和图中直角坐标系的是相反的):Therefore, the two derived points are (note that the y-axis direction in the computer is opposite to that of the Cartesian coordinate system in the figure):

通过坐标几何变换公式,逆时针旋转90度,计算出第一个边缘衍生点(x1,y1)Through the coordinate geometric transformation formula, rotate 90 degrees counterclockwise, and calculate the first edge derived point (x1, y1)

x1_a=x1-rsin(a-90)=x1+rcos ax1_a=x1-rsin(a-90)=x1+rcos a

y1_a=y1-rcos(a-90)=y1-rsin ay1_a=y1-rcos(a-90)=y1-rsin a

通过坐标几何变换公式,顺时针旋转90度,计算出第二个边缘衍生点(x1,y1)Through the coordinate geometric transformation formula, rotate 90 degrees clockwise to calculate the second edge derived point (x1, y1)

x1_b=x1-rsin(a+90)=x1-rcos ax1_b=x1-rsin(a+90)=x1-rcos a

y1_b=y1-rcos(a+90)=y1+rsin ay1_b=y1-rcos(a+90)=y1+rsin a

然后把同一组笔画的顺序连起衍生点1,再逆序连起衍生点2,形成如下svgThen connect the sequence of the same group of strokes to the derivative point 1, and then connect the derivative point 2 in reverse order to form the following svg

<path d="M x1_a y1_a L x2_a y2_a...L xn_a yn_a L xn_b yn_b...L x2_by2_b Lx1_b y1_b Z"style="stroke-width:1px;"/><path d="M x1_a y1_a L x2_a y2_a...L xn_a yn_a L xn_by yn_b...L x2_by2_b Lx1_b y1_b Z" style="stroke-width:1px;"/>

以上产生的笔迹,点与点采用了直线连接,当放大后,图像显示的笔迹边缘会显得较为生硬,不够平滑。因此,我们在产生的边缘点采用贝塞尔曲线算法进行改进。对于每两个点,均需要前后端点的相邻两点计算贝塞尔曲线的控制点:For the handwriting generated above, the dots are connected by straight lines. When enlarged, the handwriting edges displayed in the image will appear stiff and not smooth enough. Therefore, we use the Bezier curve algorithm to improve the generated edge points. For each two points, the adjacent two points of the front and rear endpoints are required to calculate the control points of the Bezier curve:

控制点1pA(n)_x=x(n)+(x(n+1)-x(n-1))*0.15 0.15为测试出来贝塞尔曲线较为平滑的系数Control point 1pA(n)_x=x(n)+(x(n+1)-x(n-1))*0.15 0.15 is the smoother coefficient of the Bezier curve tested

pA(n)_y=y(n)+(y(n+1)-y(n-1))*0.15pA(n)_y=y(n)+(y(n+1)-y(n-1))*0.15

控制点2:pB(n)_x=x(n+1)-(x(n+2)-x(n))*0.15Control point 2: pB(n)_x=x(n+1)-(x(n+2)-x(n))*0.15

pB(n)_y=y(n+1)-(y(n+2)-y(n))*0.15pB(n)_y=y(n+1)-(y(n+2)-y(n))*0.15

得到控制点后,即可形成相关贝塞尔曲线:Once the control points are obtained, the relevant Bezier curve can be formed:

<path M x1_a y1_a C pA(2)_x pA(2)_y pB(2)_x pB(2)_y x2_a y2_a….style="stroke-width:1px;"/><path M x1_a y1_a C pA(2)_x pA(2)_y pB(2)_x pB(2)_y x2_a y2_a….style="stroke-width:1px;"/>

通过贝塞尔算法改进后,笔迹曲线放大后边缘平滑自然。After being improved by the Bezier algorithm, the edge of the handwriting curve is smooth and natural after being enlarged.

图4a,4b所示分别为根据本发明实施方式的签名笔迹图及部位放大图。图4a为算法生成的签名笔迹,图4b为部分放大后的笔迹,放大无模糊、锯齿等失真。Figures 4a and 4b are respectively a handwriting diagram of a signature and an enlarged diagram of a part according to an embodiment of the present invention. Fig. 4a is the signature handwriting generated by the algorithm, and Fig. 4b is the partially enlarged handwriting, and there is no distortion such as blur and sawtooth when enlarged.

应当认识到,本发明的实施例可以由计算机硬件、硬件和软件的组合、或者通过存储在非暂时性计算机可读存储器中的计算机指令来实现或实施。所述方法可以使用标准编程技术-包括配置有计算机程序的非暂时性计算机可读存储介质在计算机程序中实现,其中如此配置的存储介质使得计算机以特定和预定义的方式操作——根据在具体实施例中描述的方法和附图。每个程序可以以高级过程或面向对象的编程语言来实现以与计算机系统通信。然而,若需要,该程序可以以汇编或机器语言实现。在任何情况下,该语言可以是编译或解释的语言。此外,为此目的该程序能够在编程的专用集成电路上运行。It should be appreciated that embodiments of the present invention may be implemented or implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in non-transitory computer readable memory. The method can be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the specific Methods and figures described in the Examples. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose.

此外,可按任何合适的顺序来执行本文描述的过程的操作,除非本文另外指示或以其他方式明显地与上下文矛盾。本文描述的过程(或变型和/或其组合)可在配置有可执行指令的一个或多个计算机系统的控制下执行,并且可作为共同地在一个或多个处理器上执行的代码(例如,可执行指令、一个或多个计算机程序或一个或多个应用)、由硬件或其组合来实现。所述计算机程序包括可由一个或多个处理器执行的多个指令。Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes (or variations and/or combinations thereof) described herein can be performed under the control of one or more computer systems configured with executable instructions, and as code that executes collectively on one or more processors (eg, , executable instructions, one or more computer programs or one or more applications), implemented in hardware, or a combination thereof. The computer program includes a plurality of instructions executable by one or more processors.

进一步,所述方法可以在可操作地连接至合适的任何类型的计算平台中实现,包括但不限于个人电脑、迷你计算机、主框架、工作站、网络或分布式计算环境、单独的或集成的计算机平台、或者与带电粒子工具或其它成像装置通信等等。本发明的各方面可以以存储在非暂时性存储介质或设备上的机器可读代码来实现,无论是可移动的还是集成至计算平台,如硬盘、光学读取和/或写入存储介质、RAM、ROM等,使得其可由可编程计算机读取,当存储介质或设备由计算机读取时可用于配置和操作计算机以执行在此所描述的过程。此外,机器可读代码,或其部分可以通过有线或无线网络传输。当此类媒体包括结合微处理器或其他数据处理器实现上文所述步骤的指令或程序时,本文所述的发明包括这些和其他不同类型的非暂时性计算机可读存储介质。当根据本发明所述的方法和技术编程时,本发明还包括计算机本身。Further, the methods may be implemented in any type of computing platform operably connected to a suitable, including but not limited to personal computer, minicomputer, mainframe, workstation, network or distributed computing environment, stand-alone or integrated computer platform, or communicate with charged particle tools or other imaging devices, etc. Aspects of the invention may be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optically read and/or written storage medium, RAM, ROM, etc., such that it can be read by a programmable computer, when a storage medium or device is read by a computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, may be transmitted over wired or wireless networks. The invention described herein includes these and other various types of non-transitory computer-readable storage media when such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein.

计算机程序能够应用于输入数据以执行本文所述的功能,从而转换输入数据以生成存储至非易失性存储器的输出数据。输出信息还可以应用于一个或多个输出设备如显示器。在本发明优选的实施例中,转换的数据表示物理和有形的对象,包括显示器上产生的物理和有形对象的特定视觉描绘。A computer program can be applied to input data to perform the functions described herein, transforming the input data to generate output data for storage to non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects produced on the display.

以上所述,只是本发明的较佳实施例而已,本发明并不局限于上述实施方式,只要其以相同的手段达到本发明的技术效果,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。在本发明的保护范围内其技术方案和/或实施方式可以有各种不同的修改和变化。The above are only preferred embodiments of the present invention, and the present invention is not limited to the above-mentioned embodiments, as long as it achieves the technical effect of the present invention by the same means, all within the spirit and principle of the present invention, do Any modification, equivalent replacement, improvement, etc., should be included within the protection scope of the present invention. Various modifications and changes can be made to its technical solutions and/or implementations within the protection scope of the present invention.

Claims (10)

1. a kind of lossless person's handwriting restoring method, which is characterized in that this method comprises:
S10 is acquired the handwriting image data write based on writing device, wherein the image data acquired is collection point Coordinate, pressure sensitivity coefficient and apart from the upper time;
The data of each stroke in handwriting image data are grouped by S20;
S30, coordinate data and pressure sensitivity coefficient based on each stroke collection point calculate the derivative point of corresponding first edge and second Edge derives point, and the derivative point in each group of multiple edges is attached, and generates person's handwriting file;
S40 is handled using Bezier algorithm by point is derived per two adjacent edges in person's handwriting file, obtains final pen Mark.
2. lossless person's handwriting restoring method according to claim 1, which is characterized in that the S10 is specifically included:
The handwriting image data inputted using the writing device acquisition user for having acquisition function are acquired, and collection point includes Abscissa, ordinate and pressure sensitivity data;
Image data of identifying the handwriting, which carries out retouching side, is depicted as stroke image.
3. lossless person's handwriting restoring method according to claim 2, which is characterized in that the stroke image is SVG polar plot.
4. lossless person's handwriting restoring method according to claim 1, which is characterized in that the S20 is specifically included:
Based on apart from the upper time using continuous collection point as a complete stroke, and be more than preset time conduct then Start as new stroke, further using continuous collection point as one group of data.
5. lossless person's handwriting restoring method according to claim 1, which is characterized in that the S30 includes:
The derivative point of first edge and second edge for calculating the collection point according to the coordinate data of connected collection point and pressure sensitivity coefficient Derivative point, specifically includes:
S31, according to two arbitrarily connected collection point (x1,y1) and (x2,y2), calculate the straight line and seat of the formation of two collection points The sin value and cos value of parameter x angle a;
S32, with (x1,y1) it is used as starting point, with (x2,y2) it is used as terminal, according to sin value, the cos value of straight line and abscissa angle a, Using default thickness value multiplied by pressure sensitivity coefficient as radius of turn r, the inverse time is further executed respectively and 90 ° of up time rotate, obtain pair The derivative point of the first edge answered and the derivative point of second edge;
The derivative point of the first edge of each collection point of same group of stroke is linked in sequence by S33, and the connection of another mistake sequence is each adopted The derivative point of the second edge of collection point forms the SVG of a complete stroke.
6. lossless person's handwriting restoring method according to claim 5, which is characterized in that the S31 is specifically included:
With the distance of reference axis y divided by the distance of two o'clock, the sin value of a is obtained, calculation is sina=(y2-y1)/R;
With the distance of reference axis x divided by the distance of two o'clock, the cos value of a is obtained, calculation is cosa=(x2-x1)/R。
7. lossless person's handwriting restoring method according to claim 5, which is characterized in that the S32 includes:
It is calculated, is converted by coordinate geometry public by left side transformation point derivative to first edge and the derivative point of second edge Formula is rotated by 90 ° counterclockwise, calculates the derivative point (x1 in first edgeA,y1A)
x1A=x1-rsin (a-90)=x1+rcosa,
y1A=y1-rcos (a-90)=y1-rsina;
By coordinate geometry transformation for mula, 90 degree are rotated clockwise, calculates the derivative point (x1 in second edgeB,y1B)
x1A=x1-rsin (a-90)=x1+rcosa,
y1A=y1-rcos (a-90)=y1-rsina.
8. lossless person's handwriting restoring method according to claim 1, which is characterized in that the S40 includes:
Point derivative to first edge and the derivative point of second edge are handled using Bezier algorithm, including to each acquisition The connected collection point of point calculates the control point of Bezier, generates the Bezier after optimization according to control point.
9. lossless person's handwriting restoring method according to claim 8, which is characterized in that it is specific to calculate Bezier control point Include:
The first control point is calculated, specifically:
PA (n) _ x=x (n)+(x (n+1)-x (n-1)) * 0.15,
PA (n) _ y=y (n)+(y (n+1)-y (n-1)) * 0.15, wherein 0.15 is smoothing factor;
The second control point is calculated, specifically:
PB (n) _ x=x (n+1)-(x (n+2)-x (n)) * 0.15,
PB (n) _ y=y (n+1)+(y (n+2)-y (n)) * 0.15;
The match Bell curve of each collection point is generated according to obtained the first control point and the second control point, is completed to each stroke Optimization.
10. a kind of lossless person's handwriting also original system of -9 any the methods according to claim 1, which is characterized in that the system packet It includes:
Stroke acquisition module, the handwriting image data for being write by writing device are acquired, wherein the picture number acquired According to coordinate, the pressure sensitivity coefficient and apart from the upper time for collection point;
Stroke groupings module, for being grouped the data of each stroke in handwriting image data;
A derivative point computing module, for based on each stroke collection point coordinate data and pressure sensitivity coefficient calculate corresponding first side The derivative point of edge and the derivative point of second edge are generated comprising the derivative point person's handwriting file in all edges;
Optimization module is handled using Bezier algorithm by point is derived per two adjacent edges in person's handwriting file, and described For SVG, final lossless person's handwriting is obtained.
CN201910400777.XA 2019-05-15 2019-05-15 A kind of lossless person's handwriting restoring method and system Pending CN110263636A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910400777.XA CN110263636A (en) 2019-05-15 2019-05-15 A kind of lossless person's handwriting restoring method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910400777.XA CN110263636A (en) 2019-05-15 2019-05-15 A kind of lossless person's handwriting restoring method and system

Publications (1)

Publication Number Publication Date
CN110263636A true CN110263636A (en) 2019-09-20

Family

ID=67913142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910400777.XA Pending CN110263636A (en) 2019-05-15 2019-05-15 A kind of lossless person's handwriting restoring method and system

Country Status (1)

Country Link
CN (1) CN110263636A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111078073A (en) * 2019-12-17 2020-04-28 科大讯飞股份有限公司 Handwriting amplification method and related device
CN111223165A (en) * 2020-01-03 2020-06-02 福建升腾资讯有限公司 A method, apparatus and apparatus for generating a sawless signature picture
CN113362418A (en) * 2021-04-23 2021-09-07 江苏小牛电子科技有限公司 Curve smoothing method, system, equipment and storage medium based on Bezier curve
CN113592970A (en) * 2021-07-28 2021-11-02 网易(杭州)网络有限公司 Hair styling generation method and device, electronic device and storage medium
CN113760432A (en) * 2021-08-30 2021-12-07 浙江万朋教育科技股份有限公司 Graffiti method for restoring handwriting based on H5Canvas
CN113934395A (en) * 2021-10-19 2022-01-14 河北师达教育科技有限公司 Method and device for synchronously displaying scripts in display screen and terminal equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103761A (en) * 2011-01-31 2011-06-22 周佳 Method for realizing original handwriting
CN103310474A (en) * 2013-06-08 2013-09-18 深圳市经纬科技有限公司 Method and system for implementing original handwriting
US20130308863A1 (en) * 2011-01-31 2013-11-21 Xueping Zou Method and device for implementing original handwriting, and electronic device
US20140055428A1 (en) * 2011-01-20 2014-02-27 Xueping Zou Method and device for implemeting original calligraphy of handwriting
CN104063705A (en) * 2014-06-05 2014-09-24 北京捷通华声语音技术有限公司 Handwriting feature extracting method and device
CN107798717A (en) * 2017-09-13 2018-03-13 深圳市创易联合科技有限公司 Electronic brush writing method, device, computer equipment and storage medium
CN109284059A (en) * 2018-08-28 2019-01-29 广州视源电子科技股份有限公司 Handwriting drawing method and device, interactive intelligent panel and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140055428A1 (en) * 2011-01-20 2014-02-27 Xueping Zou Method and device for implemeting original calligraphy of handwriting
CN102103761A (en) * 2011-01-31 2011-06-22 周佳 Method for realizing original handwriting
US20130308863A1 (en) * 2011-01-31 2013-11-21 Xueping Zou Method and device for implementing original handwriting, and electronic device
CN103310474A (en) * 2013-06-08 2013-09-18 深圳市经纬科技有限公司 Method and system for implementing original handwriting
CN104063705A (en) * 2014-06-05 2014-09-24 北京捷通华声语音技术有限公司 Handwriting feature extracting method and device
CN107798717A (en) * 2017-09-13 2018-03-13 深圳市创易联合科技有限公司 Electronic brush writing method, device, computer equipment and storage medium
CN109284059A (en) * 2018-08-28 2019-01-29 广州视源电子科技股份有限公司 Handwriting drawing method and device, interactive intelligent panel and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
99问答网: "C++程序计算一条线段中垂线上距离该线段中点固定位置的点的坐标", 《HTTPS://99.WENDADAOHANG.COM/C/0487692170319539014.HTML》 *
NFCM055: "贝塞尔曲线控制点确定的方法", 《HTTPS://WWW.DOCIN.COM/P-1199141322.HTML》 *
周宏博: "联机手写汉字识别算法及其系统实现", 《沈阳工业学院学报》 *
李磊: "《嵌入式系统与云计算开发 基于Android系统的实验案例基础教程》", 30 September 2018, 北京航空航天大学出版社 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111078073A (en) * 2019-12-17 2020-04-28 科大讯飞股份有限公司 Handwriting amplification method and related device
CN111223165A (en) * 2020-01-03 2020-06-02 福建升腾资讯有限公司 A method, apparatus and apparatus for generating a sawless signature picture
CN113362418A (en) * 2021-04-23 2021-09-07 江苏小牛电子科技有限公司 Curve smoothing method, system, equipment and storage medium based on Bezier curve
CN113592970A (en) * 2021-07-28 2021-11-02 网易(杭州)网络有限公司 Hair styling generation method and device, electronic device and storage medium
CN113592970B (en) * 2021-07-28 2024-04-12 网易(杭州)网络有限公司 Method and device for generating hair styling, electronic equipment and storage medium
CN113760432A (en) * 2021-08-30 2021-12-07 浙江万朋教育科技股份有限公司 Graffiti method for restoring handwriting based on H5Canvas
CN113934395A (en) * 2021-10-19 2022-01-14 河北师达教育科技有限公司 Method and device for synchronously displaying scripts in display screen and terminal equipment
CN113934395B (en) * 2021-10-19 2024-01-26 河北师达教育科技有限公司 Method, device and terminal equipment for synchronously displaying books in display screen

Similar Documents

Publication Publication Date Title
CN110263636A (en) A kind of lossless person&#39;s handwriting restoring method and system
CN112819947B (en) Three-dimensional face reconstruction method, device, electronic device and storage medium
CN102937848B (en) Method for editing handwritings and electronic equipment
JP6766033B2 (en) How to Align an Intraoral Digital 3D Model
US9020266B2 (en) Methods and devices for processing handwriting input
CN102663820A (en) Three-dimensional head model reconstruction method
CN102542264A (en) Method and device for automatically evaluating right and wrong of Chinese character writing on basis of digital handwriting equipment
KR20240032962A (en) Three-dimensional dynamic tracking method, device, electronic device, and storage medium
CN111142770A (en) Method for generating pen point and processing device
CN107870911B (en) A data visualization display method and device
CN108984481A (en) A kind of homography matrix estimation method based on convolutional neural networks
CN108961283A (en) Based on the corresponding image distortion method of feature and device
WO2018103227A1 (en) Method and device for drawing symmetrical figure
Jia et al. Mesh resizing based on hierarchical saliency detection
CN109658474A (en) Creation method, device and the computer equipment of three-dimensional sketch
CN108876704B (en) Method and device for deforming human face image and computer storage medium
Berio et al. Computational models for the analysis and synthesis of graffiti tag strokes
CN113763505B (en) Graphics generation method, device, computer equipment and storage medium
CN115082935A (en) Method, apparatus and storage medium for correcting document images
CN111063005B (en) Handwriting processing method and device
CN114756997B (en) Method and device for detecting ship hull plate curved surface design intersection line and storable medium
CN112507596B (en) Groundwater level analysis method and device, electronic equipment and storage medium
CN111027389A (en) Training data generation method based on deformable Gaussian kernel in crowd counting system
CN108388840A (en) A kind of method for registering of facial image, device and face identification system
WO2021218448A1 (en) Handwriting forming method and apparatus, and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190920

RJ01 Rejection of invention patent application after publication