Nothing Special   »   [go: up one dir, main page]

CN102289838A - Method for generating dynamic writing animation from calligraphy Chinese character image - Google Patents

Method for generating dynamic writing animation from calligraphy Chinese character image Download PDF

Info

Publication number
CN102289838A
CN102289838A CN201110247328XA CN201110247328A CN102289838A CN 102289838 A CN102289838 A CN 102289838A CN 201110247328X A CN201110247328X A CN 201110247328XA CN 201110247328 A CN201110247328 A CN 201110247328A CN 102289838 A CN102289838 A CN 102289838A
Authority
CN
China
Prior art keywords
chinese character
stroke
character image
calligraphy
standard
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.)
Granted
Application number
CN201110247328XA
Other languages
Chinese (zh)
Other versions
CN102289838B (en
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.)
Xiamen University
Original Assignee
Xiamen University
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 Xiamen University filed Critical Xiamen University
Priority to CN201110247328.XA priority Critical patent/CN102289838B/en
Publication of CN102289838A publication Critical patent/CN102289838A/en
Application granted granted Critical
Publication of CN102289838B publication Critical patent/CN102289838B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

本发明涉及一种由书法汉字图像生成其动态书写动画的方法,包括以下步骤,A),建立至少一个基于统计的标准笔触模型;B),输入书法汉字图像并提取该汉字图像的笔画轮廓;C),用户利用数位板在上述汉字图像的笔画轮廓内交互输入该书法汉字的笔锋运动轨迹;D),根据用户选择的上述标准笔触模型计算用户输入的笔锋运动轨迹上的每个轨迹点形成的笔触;E),依次填充上述每个轨迹点形成的笔触并保存为动画的每一帧,并生成视频文件。采用上述步骤,将静态的书法汉字图像以一种动态的书写动画来展现书法的书写过程,可以非常清晰地展现书法的书写过程,特别适用于书法教学及影视传媒的汉字书写动画制作。

The invention relates to a method for generating a dynamic writing animation from a calligraphic Chinese character image, comprising the following steps: A), establishing at least one statistically-based standard stroke model; B), inputting the calligraphic Chinese character image and extracting the stroke outline of the Chinese character image; C), the user utilizes the digital board to interactively input the stroke motion trajectory of the calligraphy Chinese character in the stroke outline of the above-mentioned Chinese character image; D), calculates each trajectory point on the stroke motion trajectory of the user's input according to the above-mentioned standard stroke model selected by the user to form strokes; E), fill in the strokes formed by each track point in turn and save as each frame of the animation, and generate a video file. By adopting the above steps, the static calligraphic Chinese character image can be used as a dynamic writing animation to show the writing process of calligraphy, which can show the writing process of calligraphy very clearly, and is especially suitable for calligraphy teaching and the production of Chinese character writing animation for film and television media.

Description

一种由书法汉字图像生成其动态书写动画的方法A method for generating dynamic writing animations from calligraphy Chinese character images

技术领域 technical field

本发明涉及一种数字图像处理的计算机技术,特别涉及一种由书法汉字图像生成其动态书写动画的方法。The invention relates to a computer technology for digital image processing, in particular to a method for generating a dynamic writing animation from a calligraphic Chinese character image.

背景技术 Background technique

中国书法具有很高的艺术欣赏价值,经过数千年的发展,历史上流传下来大量的书法碑帖资料,这些以静态图像呈现的书法碑帖已不能满足当前的很多实际应用需求,如在影视传媒及对外汉语教学等汉字应用领域中广泛使用的汉字书写动画。目前大多采用flash橡皮工具手工逐帧地制作汉字书写动画,其弊端是制作过程繁琐、耗时且效率低下。但是,重建书法汉字图像的书写过程动画是个很具挑战性的工作,这是因为:1)书法在长期的历史演变过程中,产生了许多书体,如常见的篆、隶、楷、草、行等,其笔画形态和书写方法存在很大差异;2)另外即便同一书体,如楷体,不同书法家在运笔方法(如提、按、顿、挫以及各种笔锋的组合运用)上也有明显差异。目前汉字识别及图像处理的方法,还不能自动提取汉字的笔画书写轨迹,这也是为什么离线手写体汉字识别仍然没有取得较大进展的原因。Chinese calligraphy has high artistic appreciation value. After thousands of years of development, a large number of calligraphy inscriptions have been handed down in history. These calligraphy inscriptions presented in static images can no longer meet many current practical application needs, such as in film and television media and Chinese character writing animations widely used in the field of Chinese character application such as teaching Chinese as a foreign language. At present, most of them use flash eraser tools to manually produce Chinese character writing animations frame by frame. The disadvantages are that the production process is cumbersome, time-consuming and inefficient. However, reconstructing the animation of the writing process of calligraphy Chinese character images is a very challenging task, because: 1) During the long-term historical evolution of calligraphy, many calligraphy styles have been produced, such as common seal script, official script, regular script, cursive script, 2) In addition, even with the same calligraphy style, such as regular script, different calligraphers have different ways of using the brush (such as lifting, pressing, pause, frustration, and the combination of various strokes) Significant differences. The current methods of Chinese character recognition and image processing cannot automatically extract the strokes and writing traces of Chinese characters, which is why offline handwritten Chinese character recognition still has not made great progress.

发明内容 Contents of the invention

本发明为解决现有技术中存在的技术问题,提供了一种可由静态的书法汉字图像生成自动书写动画过程的方法,动态地展现汉字书法的书写过程。In order to solve the technical problems in the prior art, the present invention provides a method for automatically generating an animation process of writing from static images of calligraphy Chinese characters, and dynamically displaying the writing process of Chinese calligraphy.

本发明解决上述技术方案,提供的技术方案是:提供一种由书法汉字图像生成其动态书写动画的方法,包括以下步骤,A),建立至少一个基于统计的标准笔触模型;B),输入书法汉字图像并提取该汉字图像的笔画轮廓;C),用户利用数位板在上述汉字图像的笔画轮廓内交互输入该书法汉字的笔锋运动轨迹;D),根据用户选择的上述标准笔触模型计算用户输入的笔锋运动轨迹上的每个轨迹点形成的笔触;E),依次填充上述每个轨迹点形成的笔触并保存为动画的每一帧,并生成视频文件。The present invention solves above-mentioned technical scheme, and the technical scheme provided is: provide a kind of method that generates its dynamic writing animation by calligraphy Chinese character image, comprise the following steps, A), set up at least one standard stroke model based on statistics; B), input calligraphy Chinese character image and extract the stroke outline of this Chinese character image; C), the user utilizes the digital board to interactively input the stroke movement trajectory of this calligraphy Chinese character in the stroke outline of the above-mentioned Chinese character image; D), calculate the user input according to the above-mentioned standard stroke model selected by the user The strokes formed by each track point on the stroke movement track; E), fill in the strokes formed by each track point in turn and save as each frame of the animation, and generate a video file.

作为本发明的一优选方案,所述步骤A)进一步包括以下步骤,A1),采集不同种类的毛笔在纸上书写的真实笔触样本;A2),统计上述真实笔触样本的特征值;A3),结合上述特征值,分别得出不同种类毛笔的标准笔触模型的参数方程。As a preferred solution of the present invention, said step A) further includes the following steps, A1), collecting real brushstroke samples written on paper by different types of brushes; A2), counting the eigenvalues of the above-mentioned real brushstroke samples; A3), Combining the above eigenvalues, the parameter equations of the standard stroke models of different types of brushes are obtained respectively.

作为本发明的一优选方案,所述步骤B)进一步包括以下步骤,B1),输入书法汉字图像后对图像进行黑白二值化处理;B2),利用freeman链码提取汉字图像的笔画轮廓。As a preferred solution of the present invention, said step B) further includes the following steps, B1), after inputting the calligraphic Chinese character image, black and white binary processing is carried out to the image; B2), utilizing the freeman chain code to extract the stroke outline of the Chinese character image.

作为本发明的一优选方案,所述步骤D)进一步包括以下步骤,D1),根据用户交互输入的每个轨迹点信息计算当前轨迹点的标准笔触模型的四个顶点坐标;D2),判断当前轨迹点的四个顶点坐标是否全在所述汉字图像的笔画轮廓内?若是,则进行步骤D4);若不是,则进行步骤D3);D3),调整当前轨迹点的四个顶点坐标使其位于所述汉字图像的笔画轮廓内,并将调整后的四个顶点坐标作为当前轨迹点的标准笔触模型的四个顶点坐标;D4),根据当前轨迹点的四个顶点坐标反求贝塞尔曲线控制点并生成贝塞尔曲线;D5),判断生成的贝塞尔曲线是否全部位于所述汉字图像的笔画轮廓内?若是,则结束;若不是,则进行步骤D6);D6),将位于所述汉字图像的笔画轮廓之外的部分贝塞尔曲线删除,用对应轮廓曲线代替,并结束。As a preferred solution of the present invention, said step D) further includes the following steps, D1), calculating the four vertex coordinates of the standard stroke model of the current trajectory point according to each trajectory point information input by the user; D2), judging the current Are the coordinates of the four vertices of the locus point all within the stroke outline of the Chinese character image? If so, then proceed to step D4); if not, then proceed to step D3); D3), adjust the four vertex coordinates of the current track point so that it is located in the stroke outline of the Chinese character image, and the adjusted four vertex coordinates As the four vertex coordinates of the standard stroke model of the current track point; D4), according to the four vertex coordinates of the current track point, reverse the control point of the Bezier curve and generate the Bezier curve; D5), judge the generated Bezier curve Are the curves all within the outline of the strokes of the Chinese character image? If yes, then end; if not, proceed to step D6); D6), delete the part of the Bezier curves outside the stroke outline of the Chinese character image, replace it with the corresponding outline curve, and end.

其中,in,

笔触是指毛笔书写过程中,笔毫与纸在某一时刻接触产生的墨点;Brushstroke refers to the ink dots produced by the contact between the pen and the paper at a certain moment during the writing process of the brush;

书写过程的轨迹点是指笔触内毛笔的作用点;The trajectory point of the writing process refers to the action point of the brush in the stroke;

笔锋运动轨迹是指上述轨迹点组成了笔锋在点画内的运动轨迹,书法的点画形状可以看作由笔锋运动轨迹上的笔触序列构成。The movement track of the stroke means that the above-mentioned track points constitute the movement trajectory of the stroke in the stippling, and the shape of the stipple in calligraphy can be regarded as composed of the sequence of strokes on the movement trajectory of the stroke.

本发明所述技术方案相对于现有技术,取得的有益效果是:Compared with the prior art, the technical solution of the present invention has the beneficial effects of:

(1)将静态的书法汉字图像以一种动态的书写动画来展现书法的书写过程,适用于行书、草书等各种书体,可以非常清晰地展现书法的书写过程,特别适用于书法教学及影视传媒应用领域的汉字书写动画制作。(1) The static calligraphic Chinese character image is used as a dynamic writing animation to show the writing process of calligraphy, which is suitable for various calligraphy styles such as running script and cursive script, and can clearly show the writing process of calligraphy, especially suitable for calligraphy teaching and learning Animation production of Chinese character writing in the field of film and television media applications.

(2)用户直接临摹书法汉字后,通过生成的动画帧或视频文件观看书法的书写过程,不需要人工一帧一帧地制作汉字书写动画,提高了工作效率。(2) After the user directly copies calligraphy and Chinese characters, he can watch the writing process of calligraphy through the generated animation frames or video files, and does not need to manually make animations of writing Chinese characters frame by frame, which improves work efficiency.

(3)根据统计的多种标准笔触,同一书法可以用不同的笔触来体现书法的动画过程,使动画的展现丰富多样。(3) According to the various standard strokes of the statistics, the same calligraphy can use different strokes to reflect the animation process of calligraphy, so that the animation can be displayed in a variety of ways.

附图说明 Description of drawings

此处所说明的附图用来提供对本发明的进一步理解,构成本发明的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described here are used to provide a further understanding of the present invention, and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention, and do not constitute improper limitations to the present invention. In the attached picture:

图1是本发明所述由书法汉字图像生成其动态书写动画的方法流程图;Fig. 1 is the flow chart of the method for generating its dynamic writing animation by calligraphy Chinese character images according to the present invention;

图2是本发明所述建立基于统计的标准笔触模型的流程图;Fig. 2 is the flow chart of setting up the standard stroke model based on statistics according to the present invention;

图3是本发明所述输入书法汉字图像并提取该汉字图像的轮廓的流程图;Fig. 3 is the flow chart of inputting calligraphy Chinese character image and extracting the outline of this Chinese character image according to the present invention;

图4是本发明所述计算用户输入的笔锋运动轨迹上的每个轨迹点形成的笔触的流程图;Fig. 4 is the flow chart of calculating the strokes formed by each track point on the stroke motion track input by the user according to the present invention;

图5是本发明所述的采集到的毛笔实际笔触形状;Fig. 5 is the actual stroke shape of the brush collected according to the present invention;

图6是本发明所述的贝塞尔曲线拟合的笔触形状;Fig. 6 is the stroke shape of Bezier curve fitting of the present invention;

图7是本发明所述图像进行黑白二值化处理效果图;Fig. 7 is the black-and-white binary processing effect diagram of the image according to the present invention;

图8是本发明所述的四种笔触统计的曲线图。Fig. 8 is a graph of four stroke statistics according to the present invention.

具体实施方式 Detailed ways

为了使本发明所要解决的技术问题、技术方案及有益效果更加清楚、明白,以下结合附图和实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention clearer and clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

为了使本发明所要解决的技术问题、技术方案及有益效果更加清楚、明白,以下结合附图和实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention clearer and clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

图5示出毛笔真实的笔触形状示意图。如图6所示,我们经过观察发现,毛笔笔触形状可以用上下两条对称的3次Bezier(贝塞尔)曲线来拟合,并以此建立标准笔触模型。基于此,实际笔触形状可定义为:Sf=(Lt,Lh,Ll,Lr),其中Lt,Lh,Ll,Lr为所述特征值。Lt为笔锋长度,Lh为笔根长度,Ll与Lr分别代表笔肚左右两侧长度。标准情况下Ll与Lr等长对称,但在书写过程中由于笔毫与纸面摩擦导致笔触变形,因此分开表示。图5右所示为本文定义的标准笔触模型,其坐标原点O为毛笔笔杆中心对应位置,横坐标x为毛笔运动方向,与坐标轴相交的4个点T0,T1,T2,T3为笔触顶点,它们到原点O的距离分别对应真实笔触的特征值Lt,Lh,Ll,LrFig. 5 shows a schematic diagram of the real stroke shape of the brush. As shown in Figure 6, we found through observation that the shape of brush strokes can be fitted by two symmetrical three-degree Bezier (Bezier) curves up and down, and a standard stroke model can be established based on this. Based on this, the actual stroke shape can be defined as: S f =(L t , L h , L l , L r ), where L t , L h , L l , L r are the feature values. L t is the length of the tip of the pen, L h is the length of the root of the pen, and L l and L r are the lengths of the left and right sides of the belly of the pen respectively. Under standard circumstances, L l and L r are equal in length and symmetrical, but during the writing process, the strokes are deformed due to the friction between the brush pen and the paper surface, so they are represented separately. The standard stroke model defined in this paper is shown on the right in Figure 5. The coordinate origin O is the corresponding position of the center of the brush holder, the abscissa x is the movement direction of the brush, and the four points T 0 , T 1 , T 2 , T that intersect with the coordinate axes 3 is the vertices of strokes, the distances from them to the origin O correspond to the characteristic values L t , L h , L l , L r of real strokes respectively.

基于书法知识和书写经验,对于同一支毛笔,在笔头没有变形且落笔没有超过笔毫长度

Figure BDA0000086277270000041
的情况下,压感值P和笔毫长度L是线性正相关的;由于笔根长度较短、毛量密集,对压感值较不敏感,因此本文假定与压感值P直接相关的是笔锋长度Lt。由于不同种类毛笔的笔毫长度L(cm)、材质和毛量分布都有差别,在此定义笔锋长度Lt的计算公式如下:Based on calligraphy knowledge and writing experience, for the same brush, there is no deformation at the tip of the brush and the length of the brush does not exceed the pen length
Figure BDA0000086277270000041
In the case of , the pressure sensitivity value P and the pen length L are linearly positively correlated; because the root length of the pen is short and the hair is dense, it is less sensitive to the pressure sensitivity value, so this paper assumes that the pressure sensitivity value P is directly related to The stroke length L t . Since the length L (cm), material and distribution of hair volume of different types of brushes are different, the formula for defining the length L t of the brush tip is as follows:

LL tt == PP PP maxmax ** ρLρL

其中Pmax是数位板输出压感值的上限,ρ为单位转换系数(把cm转换成屏幕像素)。Among them, P max is the upper limit of the output pressure sensitivity value of the tablet, and ρ is the unit conversion coefficient (convert cm into screen pixels).

下面结合附图,详细说明本发明所述的由书法汉字图像生成其动态书写动画的方法。如图1所示,该方法包括以下步骤:The method for generating a dynamic writing animation from a calligraphic Chinese character image according to the present invention will be described in detail below in conjunction with the accompanying drawings. As shown in Figure 1, the method includes the following steps:

步骤A,建立至少一个基于统计的标准笔触模型。Step A, establishing at least one standard stroke model based on statistics.

首先,采集不同种类的毛笔在纸上书写的真实笔触样本。采集的过程可以是人工采集,也可以借助计算机手段进行采集。通常触面笔锋长度相同的情况下,用软毫笔书写时,两侧笔肚与根部的形变较硬毫笔大;同样地,毛量较密的毛笔其也较长。因此,根据毛笔的上述特性,建立标准笔触模型。First, samples of real brush strokes written on paper with different types of brushes are collected. The collection process can be manual collection or collection with the help of computer means. Usually, when the length of the brush tip on the contact surface is the same, when writing with a soft brush, the deformation of the belly and root on both sides is larger than that of a harder brush; similarly, a brush with denser hair is also longer. Therefore, according to the above-mentioned characteristics of the brush, a standard stroke model is established.

其次,统计上述真实笔触样本的特征值。毛笔的材质和毛量分布主要体现体现在笔根与笔锋的比例系数α和两侧笔肚与笔锋的比例系数β,因此,α与β可以作为真实笔触样的特征值,即α=Lh/Lt,β=Ll/Lt。通常触面笔锋长度相同的情况下,用软毫笔书写时,两侧笔肚与根部的形变较硬毫笔大;同样地,毛量较密的毛笔其Lh,Ll,Lr也较长。Second, the feature values of the above-mentioned real stroke samples are counted. The material and hair volume distribution of the brush are mainly reflected in the ratio coefficient α between the root and the tip of the brush and the ratio coefficient β between the belly and the tip on both sides. Therefore, α and β can be used as the eigenvalues of real brush strokes, that is, α=L h /L t , β=L l /L t . Usually, when the length of the tip of the contact surface is the same, when writing with a soft brush, the deformation of the belly and root on both sides is larger than that of a harder brush; similarly, the L h , L l , L r of a brush with denser hair longer.

基于上述对毛笔的材质和毛量分布的特征分析,本专利申请选取了四种典型的毛笔类型:长锋羊毫,大狼毫,中狼毫,小狼毫等,但不限于此。如图7所示,横坐标为L_t,A曲线为L_h随L_t的变化情况,B曲线为L_l,L_r随L_t的变化情况。Based on the above analysis of the characteristics of the brush material and hair volume distribution, this patent application selects four typical types of brushes: Changfeng Yanghao, Dalanghao, Zhonglanghao, Xiaolanghao, etc., but not limited thereto. As shown in Figure 7, the abscissa is L_t, the A curve is the change of L_h with L_t, the B curve is L_l, the change of L_r with L_t.

上述数据表明Lt,Lh,Ll,Lr存在线性关系:The above data show that there is a linear relationship between L t , L h , L l , and L r :

Lh=α*Lt L h =α*L t

Ll=Lr=β*Lt L l =L r =β*L t

最后,结合上述特征值α与β,分别得出不同种类毛笔的标准笔触模型的参数方程。对表1中的四种毛笔类型数据进行线性最小二乘拟合,得到不同类型毛笔的关系参数α和β。Finally, combining the above eigenvalues α and β, the parameter equations of the standard stroke models of different types of brushes are respectively obtained. The linear least squares fitting is performed on the data of the four types of brushes in Table 1, and the relationship parameters α and β of different types of brushes are obtained.

下表1是经人工采集、计算机统计分析得到的参数样本:The following table 1 is a sample of parameters obtained through manual collection and computer statistical analysis:

  长锋羊毫(cm) Changfeng brush (cm)   大狼毫(cm) Big wolf hair (cm)   中狼毫(cm) Middle wolf hair (cm)   小狼毫(cm) Little wolf hair (cm)   L L   5.0 5.0   2.8 2.8   2.2 2.2   1.7 1.7   α α   0.25496 0.25496   0.43541 0.43541   0.17273 0.17273   0.46970 0.46970   β β   0.25954 0.25954   0.46564 0.46564   0.43455 0.43455   0.57851 0.57851

表1Table 1

据此,可以得到标准笔触模型的四个顶点的参数方程:According to this, the parameter equations of the four vertices of the standard stroke model can be obtained:

Toy=T1y=T2x=T3x=0T oy =T 1y =T 2x =T 3x =0

TT 00 xx == -- LL tt == -- PP PP maxmax ** ρLρL

TT 11 xx == LL hh == αα ** PP PP maxmax ** ρLρL

TT 22 ythe y == LL 11 == ββ ** PP PP maxmax ** ρLρL

T3y=-Lr=-T2y T 3y = -L r = -T 2y

步骤B,输入书法汉字图像并提取该汉字图像的笔画轮廓。Step B, input a calligraphic Chinese character image and extract the stroke outline of the Chinese character image.

首先,输入书法汉字图像后对图像进行黑白二值化处理。如图7所示的黑白二值化处理的效果。书法汉字图像的格式可以有多种,如JPEG、JPG、BMP、GIF等,在此不限制。并且,将该书法汉字图像进行黑白二值化处理。图像的二值化处理是指图像上的点的灰度值为0或255,也即将整个图像呈现出明显的黑白效果。First, after inputting the calligraphy Chinese character image, the black and white binary processing is performed on the image. The effect of black and white binarization as shown in Figure 7. There may be various formats of the calligraphic Chinese character image, such as JPEG, JPG, BMP, GIF, etc., which are not limited here. In addition, the calligraphic Chinese character image is subjected to black and white binarization processing. The binarization of the image means that the gray value of the point on the image is 0 or 255, that is to say, the whole image presents an obvious black and white effect.

其次,利用freeman链码提取汉字图像的笔画轮廓。freeman链码提取轮廓处理技术本身是现有技术,在此不累述。Secondly, the stroke outline of the Chinese character image is extracted by freeman chain code. The freeman chain code extraction contour processing technology itself is a prior art, and will not be repeated here.

步骤C,用户在上述汉字图像的笔画轮廓内输入该书法汉字的笔锋运动轨迹。In step C, the user inputs the stroke movement trajectory of the calligraphy Chinese character in the stroke outline of the above-mentioned Chinese character image.

用户可以借助数位板,在提取的汉字图像的笔画轮廓内输入该书法汉字的笔锋运动轨迹。数位板可以感应用户在书写过程中的每个轨迹点的坐标、压感值与时间信息。笔锋运动轨迹的中锋、逆锋、弯钩、折、提、案等各种运笔方法,可以根据以下方法确定:The user can input the stroke movement trajectory of the calligraphy Chinese character in the stroke outline of the extracted Chinese character image with the help of the digital tablet. The tablet can sense the coordinates, pressure sensitivity value and time information of each track point during the writing process of the user. Various methods of moving the pen, such as the center, the reverse, the hook, the fold, the lift, and the case, can be determined according to the following methods:

假设Pn为当前时刻的轨迹点,Po为前一时刻的轨迹点,Pt为后一时刻的轨迹点,计算每个轨迹点的切线角度θ(由斜率κ求得)和压力变化程度η:Assuming that P n is the trajectory point at the current moment, P o is the trajectory point at the previous moment, and P t is the trajectory point at the next moment, calculate the tangent angle θ (obtained from the slope κ) and the degree of pressure change at each trajectory point η:

κκ == PtPt .. ythe y -- Popo .. ythe y PtPt .. xx -- Popo .. xx

θθ == tanthe tan -- 11 κκ ++ (( 00 oror ++ ‾‾ ππ ))

ηη == PnPn .. pp -- Popo .. pp PnPn .. pp ++ Popo .. pp

通过切线角度θ(由斜率κ求得)和压力变化程度η判断当前轨迹点的运笔方法:若切线角度θ和压力变化程度η都在一个很小的范围

Figure BDA0000086277270000074
内,可以判断此时的笔锋为中锋;若切线角度θ较大而压力变化程度η处于内,表示出现“逆锋”、“弯钩”、“折”等情况;若压力变化程度η较大则表示出现“提”、“按”的情况。The method of judging the current trajectory point by the tangent angle θ (obtained from the slope κ) and the degree of pressure change η: If the tangent angle θ and the degree of pressure change η are in a small range
Figure BDA0000086277270000074
, it can be judged that the stroke at this time is the center; if the tangent angle θ is large and the pressure change degree η is at Inside, it means that there are situations such as "reverse front", "hook" and "folding"; if the pressure change degree η is large, it means that there are situations of "lifting" and "pressing".

步骤D,根据用户选择的上述标准笔触模型作为用户输入的笔锋运动轨迹上的每个轨迹点的基本笔触形状,然后结合轮廓对其进行调整。Step D, according to the above-mentioned standard stroke model selected by the user as the basic stroke shape of each trajectory point on the stroke movement trajectory input by the user, and then adjust it in combination with the outline.

首先,根据用户交互输入的每个轨迹点信息计算当前轨迹点的标准笔触模型的四个顶点坐标;First, calculate the four vertex coordinates of the standard stroke model of the current trajectory point according to the information of each trajectory point input by the user;

用户交互输入笔锋运动轨迹时,数位板在一预定的时间频率(如150ms)检测一个轨迹点,将该轨迹点的坐标、压感值和时间信息记录下来,用上述的参数方程计算顶点坐标。When the user interactively inputs the stroke trajectory, the tablet detects a trajectory point at a predetermined time frequency (such as 150ms), records the coordinates, pressure sensitivity value and time information of the trajectory point, and calculates the vertex coordinates with the above parametric equation.

其次,判断当前轨迹点的四个顶点坐标是否全在所述汉字图像的笔画轮廓内?若不是,则对四个顶点坐标进行调整,以使四个顶点坐标位于汉字图像的笔画轮廓内,并将调整后的顶点坐标作为当前轨迹点的顶点坐标;若是,则不需要调整,直接作为当前轨迹点顶点坐标。Secondly, judge whether the four vertex coordinates of the current track point are all within the stroke outline of the Chinese character image? If not, then the four vertex coordinates are adjusted so that the four vertex coordinates are located in the stroke outline of the Chinese character image, and the adjusted vertex coordinates are used as the vertex coordinates of the current track point; if so, then no adjustment is required, directly used as Vertex coordinates of the current track point.

再次,根据当前轨迹点的四个顶点坐标反求贝塞尔曲线控制点并生成贝塞尔曲线;并判断所生成的贝塞尔曲线是否全部位于汉字图像的笔画轮廓内;如果不是,则将位于汉字图像的笔画轮廓外的贝塞尔曲线删除,并用对应轮廓曲线代替,形成新的笔触形状。Again, according to the four vertex coordinates of the current trajectory point, reverse the Bezier curve control points and generate the Bezier curve; and judge whether the generated Bezier curves are all within the stroke outline of the Chinese character image; if not, then Bezier curves located outside the stroke outline of the Chinese character image are deleted and replaced with corresponding outline curves to form new stroke shapes.

贝塞尔曲线控制点的计算方式是:3次Bezier曲线的参数形式为:B(t)=P0(1-t)3+3P1t(1-t)2+3P2t2(1-t)+P3t3,t∈[0,1],它有4个控制点(如图6所示):P0,P1,P2,P3,其中P3,P0的坐标分别与T1,T0的重合。由Bezier曲线的性质可得,曲线在P0点与线段P0P1相切,在P3点与线段P2P3相切。同理,求出另一段贝塞尔曲线控制点P0,P’1,P’2,P3The calculation method of the Bezier curve control point is: the parameter form of the 3rd Bezier curve is: B(t)=P 0 (1-t) 3 +3P 1 t(1-t) 2 +3P 2 t 2 (1 -t)+P 3 t 3 , t∈[0,1], it has 4 control points (as shown in Figure 6): P 0 , P 1 , P 2 , P 3 , where P 3 , P 0 The coordinates coincide with those of T 1 and T 0 respectively. According to the properties of Bezier curve, the curve is tangent to line segment P 0 P 1 at point P 0 and tangent to line segment P 2 P 3 at point P 3 . In the same way, calculate the control points P 0 , P' 1 , P' 2 , and P 3 of another Bezier curve.

步骤E,填充上述轨迹点形成的笔触形状并保存为动画的每一帧,生成视频文件。填充的颜色可以是黑色或其他颜色,在此不限。视频文件的格式不限制,如AVI格式等。Step E, filling the stroke shape formed by the above track points and saving it as each frame of the animation to generate a video file. The color of filling can be black or other colors, it is not limited here. The format of the video file is not limited, such as AVI format, etc.

上述说明示出并描述了本发明的优选实施例,如前所述,应当理解本发明并非局限于本文所披露的形式,不应看作是对其他实施例的排除,而可用于各种其他组合、修改和环境,并能够在本文所述发明构想范围内,通过上述教导或相关领域的技术或知识进行改动。而本领域人员所进行的改动和变化不脱离本发明的精神和范围,则都应在本发明所附权利要求的保护范围内。The foregoing description shows and describes preferred embodiments of the present invention, and as previously stated, it is to be understood that the present invention is not limited to the form disclosed herein and should not be construed as excluding other embodiments but may be applied to various other embodiments. Combinations, modifications and circumstances, and can be modified within the scope of the inventive concept described herein, by the above teachings or by skill or knowledge in the relevant field. However, changes and changes made by those skilled in the art do not depart from the spirit and scope of the present invention, and should all be within the protection scope of the appended claims of the present invention.

Claims (4)

1. A method for generating dynamic writing animation from calligraphy Chinese character images is characterized by comprising the following steps,
A) establishing at least one standard stroke model based on statistics;
B) inputting a calligraphy Chinese character image and extracting a stroke contour of the Chinese character image;
C) the user interactively inputs the stroke tip motion trail of the calligraphy Chinese character in the stroke outline of the Chinese character image by using a digital board;
D) according to the standard stroke model selected by the user, the standard stroke model is used as the basic stroke shape of each track point on the stroke front motion trail input by the user, and then the standard stroke model is adjusted by combining the outline;
E) and sequentially filling the strokes formed by each track point, storing the strokes as each frame of the animation, and generating a video file.
2. The method of claim 1, wherein step A) further comprises the step of,
A1) collecting real brush touch samples written on paper by different types of writing brushes;
A2) counting the characteristic value of the real pen touch sample;
A3) and combining the characteristic values to respectively obtain the parameter equations of the standard brush stroke models of the different types of writing brushes.
3. The method of claim 1, wherein said step B) further comprises the step of,
B1) after inputting the calligraphy Chinese character image, performing black and white binarization processing on the image;
B2) and extracting stroke outlines of the Chinese character images by using a freeman chain code.
4. The method of claim 1, wherein said step D) further comprises the step of,
D1) calculating four vertex coordinates of the standard pen touch model of the current track point according to the standard pen touch model selected by the user and each track point information interactively input;
D2) judging whether the coordinates of four vertexes of the current track point are all in the stroke contour of the Chinese character image? If yes, go to step D4); if not, go to step D3);
D3) adjusting four vertex coordinates of the current track point to be positioned in the stroke contour of the Chinese character image, and taking the adjusted four vertex coordinates as the four vertex coordinates of the standard stroke model of the current track point;
D4) reversely solving Bezier curve control points according to the four vertex coordinates of the current track point and generating a Bezier curve;
D5) is it determined whether all of the generated bezier curves are located within the stroke contour of the chinese character image? If yes, ending; if not, go to step D6);
D6) and deleting the part of the Bezier curve outside the stroke contour of the Chinese character image, replacing the part of the Bezier curve with the corresponding contour curve, and ending.
CN201110247328.XA 2011-08-26 2011-08-26 Method for generating dynamic writing animation from calligraphy Chinese character image Expired - Fee Related CN102289838B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110247328.XA CN102289838B (en) 2011-08-26 2011-08-26 Method for generating dynamic writing animation from calligraphy Chinese character image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110247328.XA CN102289838B (en) 2011-08-26 2011-08-26 Method for generating dynamic writing animation from calligraphy Chinese character image

Publications (2)

Publication Number Publication Date
CN102289838A true CN102289838A (en) 2011-12-21
CN102289838B CN102289838B (en) 2014-07-02

Family

ID=45336224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110247328.XA Expired - Fee Related CN102289838B (en) 2011-08-26 2011-08-26 Method for generating dynamic writing animation from calligraphy Chinese character image

Country Status (1)

Country Link
CN (1) CN102289838B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103632387A (en) * 2013-12-03 2014-03-12 北京理工大学 Method and system for generation of brush writing copybook
CN104821005A (en) * 2015-05-12 2015-08-05 南京师范大学 Method of writing process dynamic reproduction of Chinese character calligraphy works, capable of simulating gesture style
CN105425979A (en) * 2015-10-30 2016-03-23 河南理工大学 Method for realizing robot anthropomorphic writing
CN105468574A (en) * 2015-11-19 2016-04-06 厦门大学 Decorative font synthesizing method
CN106503756A (en) * 2016-10-18 2017-03-15 上海子墨国际文化传播有限公司 Based on the method that image outline sets up Chinese character handwriting model
CN106649539A (en) * 2016-11-02 2017-05-10 深圳市幻实科技有限公司 Method and device for playing augmented reality videos
CN108038890A (en) * 2017-12-06 2018-05-15 广州视源电子科技股份有限公司 Vector diagram demonstration method, device, equipment and computer storage medium
CN108244205A (en) * 2018-01-15 2018-07-06 王晓茗 A kind of calligraphy biscuit and preparation method thereof
CN109299649A (en) * 2018-07-25 2019-02-01 高金山 A kind of processing method and processing device of dynamic writing brush word
CN109746916A (en) * 2019-01-28 2019-05-14 武汉科技大学 A method and system for robot writing calligraphy
CN110531875A (en) * 2019-08-21 2019-12-03 深圳市威屏科技有限公司 Write generation method, terminal device and the storage medium of the vigour of style in writing
CN111063009A (en) * 2019-12-18 2020-04-24 山东山科智能科技有限公司 Chinese character writing animation demonstration method and device
CN113436298A (en) * 2021-07-05 2021-09-24 深圳软牛科技有限公司 Method, device and related components for automatically generating Chinese character stroke order animation

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0398023A (en) * 1989-09-12 1991-04-23 Sharp Corp Matrix type display device
JPH09198023A (en) * 1996-01-11 1997-07-31 Hidenori Ito Software for preparing scratchy and blurry hair-pencil font
CN1996347A (en) * 2006-09-14 2007-07-11 浙江大学 Visualized reproduction method based on handwriting image
CN101699516A (en) * 2009-10-30 2010-04-28 华南理工大学 Stroke rendering method for beautifying hand-written Chinese characters
CN101916451A (en) * 2010-07-30 2010-12-15 浙江大学 Method for calligraphic-specific style rendering

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0398023A (en) * 1989-09-12 1991-04-23 Sharp Corp Matrix type display device
JPH09198023A (en) * 1996-01-11 1997-07-31 Hidenori Ito Software for preparing scratchy and blurry hair-pencil font
CN1996347A (en) * 2006-09-14 2007-07-11 浙江大学 Visualized reproduction method based on handwriting image
CN101699516A (en) * 2009-10-30 2010-04-28 华南理工大学 Stroke rendering method for beautifying hand-written Chinese characters
CN101916451A (en) * 2010-07-30 2010-12-15 浙江大学 Method for calligraphic-specific style rendering

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《系统仿真学报》 20060331 毛国红、张俊松、何兴恒 "虚拟毛笔模型研究综述" 第669-674页 1-4 第18卷, 第3期 *
毛国红、张俊松、何兴恒: ""虚拟毛笔模型研究综述"", 《系统仿真学报》 *

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103632387A (en) * 2013-12-03 2014-03-12 北京理工大学 Method and system for generation of brush writing copybook
CN104821005A (en) * 2015-05-12 2015-08-05 南京师范大学 Method of writing process dynamic reproduction of Chinese character calligraphy works, capable of simulating gesture style
CN104821005B (en) * 2015-05-12 2017-10-10 南京师范大学 The method that the Chinese character calligraphy works writing process of style of brushwork style dynamically reappears can be simulated
CN105425979A (en) * 2015-10-30 2016-03-23 河南理工大学 Method for realizing robot anthropomorphic writing
CN105468574B (en) * 2015-11-19 2018-11-16 厦门大学 The synthetic method of dingbat
CN105468574A (en) * 2015-11-19 2016-04-06 厦门大学 Decorative font synthesizing method
CN106503756A (en) * 2016-10-18 2017-03-15 上海子墨国际文化传播有限公司 Based on the method that image outline sets up Chinese character handwriting model
CN106649539A (en) * 2016-11-02 2017-05-10 深圳市幻实科技有限公司 Method and device for playing augmented reality videos
CN108038890A (en) * 2017-12-06 2018-05-15 广州视源电子科技股份有限公司 Vector diagram demonstration method, device, equipment and computer storage medium
CN108244205A (en) * 2018-01-15 2018-07-06 王晓茗 A kind of calligraphy biscuit and preparation method thereof
CN109299649A (en) * 2018-07-25 2019-02-01 高金山 A kind of processing method and processing device of dynamic writing brush word
CN109299649B (en) * 2018-07-25 2023-04-18 高金山 Method and device for processing dynamic calligraphy characters
CN109746916A (en) * 2019-01-28 2019-05-14 武汉科技大学 A method and system for robot writing calligraphy
CN109746916B (en) * 2019-01-28 2021-01-05 武汉科技大学 Method and system for robot to write calligraphy
CN110531875A (en) * 2019-08-21 2019-12-03 深圳市威屏科技有限公司 Write generation method, terminal device and the storage medium of the vigour of style in writing
CN110531875B (en) * 2019-08-21 2023-12-12 华诺科技武汉有限公司 Writing stroke generation method, terminal equipment and storage medium
CN111063009A (en) * 2019-12-18 2020-04-24 山东山科智能科技有限公司 Chinese character writing animation demonstration method and device
CN113436298A (en) * 2021-07-05 2021-09-24 深圳软牛科技有限公司 Method, device and related components for automatically generating Chinese character stroke order animation
CN113436298B (en) * 2021-07-05 2023-09-19 深圳软牛科技有限公司 Method and device for automatically generating Chinese character stroke order animation and related components thereof

Also Published As

Publication number Publication date
CN102289838B (en) 2014-07-02

Similar Documents

Publication Publication Date Title
CN102289838A (en) Method for generating dynamic writing animation from calligraphy Chinese character image
CN106384094B (en) An automatic generation method of Chinese character library based on writing style modeling
Simo-Serra et al. Real-time data-driven interactive rough sketch inking
CN103488711B (en) A method and system for quickly making vector fonts
CN102509357B (en) Stroke-based Pencil Sketch Simulation and Drawing System
CN111462023B (en) A system and method for vectorizing image texture lines
CN104821005B (en) The method that the Chinese character calligraphy works writing process of style of brushwork style dynamically reappears can be simulated
CN101853517A (en) An automatic generation method of realistic image oil painting based on stroke limitation and texture
CN104166499A (en) Handwriting practice system and practice handwriting automatic detecting and evaluating method
CN104834890B (en) A kind of extracting method to word expression information in calligraphy work
CN111142770A (en) Method for generating pen point and processing device
CN114419632A (en) A method, device and system for generating OCR training samples
CN106155540B (en) Electronic brush pen shape processing method and device
Tong et al. Sketch generation with drawing process guided by vector flow and grayscale
Wong et al. Model-based analysis of Chinese calligraphy images
CN111462084B (en) Bleeding Point Prediction System and Method for Image Vectorization Printing Based on Random Forest
Yu et al. Realistic synthesis of cao shu of Chinese calligraphy
CN101697234A (en) Stroke segmentation modeling-based handwritten Chinese character Lishu beautifying method
CN105574814A (en) Portrait paper-cut special effect generation method
CN1971615A (en) Method for generating cartoon portrait based on photo of human face
Warren et al. Grain and grain boundary segmentation using machine learning with real and generated datasets
CN113392780A (en) Character image distortion deformation method for AI recognition of Chinese characters
Wang et al. Automatic image-based pencil sketch rendering
CN107301425A (en) Children doodling scoring method based on deep learning
CN108154467A (en) Method and system are intended in a kind of linear wall die sinking

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140702

Termination date: 20170826

CF01 Termination of patent right due to non-payment of annual fee