# Evaluation of Chinese Calligraphy by Using DBSC Vectorization and ICP Algorithm

Authors: Mengdi Wang; Qian Fu; Xingce Wang; Zhongke Wu; Mingquan Zhou
Journal: Mathematical Problems in Engineering
 (2016)

---

## Abstract

Chinese calligraphy is a charismatic ancient art form with high artistic value in Chinese culture. Virtual calligraphy learning system is a research hotspot in recent years. In such system, a judging mechanism for user’s practice result is quite important. Sometimes, user’s handwritten character is not that standard, the size and position are not fixed, and the whole character may be even askew, which brings difficulty for its evaluation. In this paper, we propose an approach by using DBSCs (disk B-spline curves) vectorization and ICP (iterative closest point) algorithm, which cannot only evaluate a calligraphic character without knowing what it is, but also deal with the above problems commendably. Firstly we find the promising candidate characters from the database according to the angular difference relations as quickly as possible. Then we check these vectorized candidates by using ICP algorithm based upon the skeleton, hence finding out the best matching character. Finally a comprehensive evaluation involving global (the whole character) and local (strokes) similarities is implemented, and a final composited evaluation score can be worked out.


---

## Body

## 1. Introduction

Chinese character is one of the fundamental elements of Chinese culture. Chinese calligraphy is produced and developed based on Chinese characters, and it belongs to the domain of visual art. Calligraphy has brought the writing of characters into an aesthetic stage. It fuses the creator’s idea, thought, and spirit and can arouse aesthetic emotions of the appreciator. Calligraphy can even reflect one’s personality, temperament, knowledge, and self-cultivation. Practicing calligraphy is conductive to training learning abilities, developing minds, and cultivating physical and mental qualities.After thousand years of development, a lot of calligraphy styles are established. Many famous calligraphers have formed their own unique writing characteristics and Mr. Qi Gong is one of them. Qi Gong is a great master of traditional Chinese painting and calligraphy. His calligraphy is slender, comely, and elegant and is known as “Qi font.” Mr. Qi Gong left behind a large amount of art treasure to the world and has gained worldwide reputation. He is a role model for later generations in terms of both artistic achievements and moral quality. In this paper, we choose Qi font as basic data to support our research.With the rapid development of computer graphics and image processing technologies, calligraphy research and creation have been brought into a new field. Many researchers are devoting themselves to the study of computer-aided virtual calligraphy. Existing researches mainly involve the following aspects: modeling of calligraphy elements such as brush, stroke, dip, and paper; calligraphy retrieval; character recognition; calligraphy generation; calligraphy analysis and evaluation; and feature extraction and style synthesis. In addition, designing an interactive and user-friendly calligraphy learning system based on the above techniques is a hot issue now and very helpful for calligraphy learners. In such system, a judging mechanism is quite important and essential. With an evaluation result, users could know how well they write, and this helps to improve writing skills.In this paper, we propose an evaluation approach based on DBSCs (disk B-spline curves) vectorized Qi Gong calligraphy database. Firstly, via angular difference relations, we can find the promising candidate characters from the database, thus reducing the search space. Then these vectorized candidates are registrated with user’s handwriting by using ICP (iterative closest point) algorithm based upon the skeleton; hence the best matching character is found. Finally the character and strokes similarities are calculated according to their shape features. A great advantage of this evaluation approach is that it provides a mechanism to deal with the different situation of position, size, and tilt of user’s handwritten character without knowing what this character is. Experiments prove this approach is feasible, effective, and objective.The rest of this paper is organized as follows. In Section2, related works on virtual calligraphy are presented. In Section 3, the database establishment of vectorized Qi Gong calligraphy is given. In Section 4, the preprocessing method of how to reduce the search space is described. In Section 5, character registration based on ICP algorithm is described. In Section 6, the comprehensive evaluation method is investigated. In Section 7, the experiment results are analyzed. Conclusions and our future work are summarized in the final section.


## 2. Related Work

Computer-aided virtual calligraphy research is a frontier and many research achievements on this subject have been published. Here we will introduce some research results which are closely related to our work in this paper.In 1986, Strassmann [1] proposed a 2D virtual brush model to generate paintings at the SIGGRAPH conference for the first time. This model consists of four parts, that is, brush, stroke, dip, and paper. Although the simulation result of this model is simple, it is still a great reference for the future study. There are a lot of researches on the modeling of Chinese ink calligraphy and paintings afterwards. Chu’s [2] rendering of realistic brushwork is realized by responding input data captured from a device with six degrees of freedom; Seah’s [3] modeling and representation approach for brushstroke and animation is based on disk B-spline curves. The modeling method in this paper is like Strassmann, Chu, and Seah’s models.Calligraphy analysis and evaluation are quite important and widely used in calligraphy style synthesis, calligraphy generation and calligraphy learning system, and so forth. Han et al. [4] proposed an interactive grading and learning system of Chinese calligraphy which uses the image processing and fuzzy inference techniques to evaluate characters based on the position, size, and projection features. Gao et al. [5] proposed a Chinese handwriting quality evaluation method based on the analysis of online handwriting recognition confidence. Shichinohe et al. [6] designed an augmented calligraphy system; by monitoring the calligraphy learner’s posture, it can give feedback to the learner and support the learner’s self-training process. Murata et al. [7] built a real-time measurement system of eye-hand coordination to extract the skilled elements in calligraphy. Xu et al. [8] introduced a numerical machine-learning approach to evaluate the visual quality of calligraphic writings from human aesthetic views. Han et al. [9] put forward a similarity assessment method which is based on the context of the skeleton to evaluate the similarity between two brush inks.Calligraphy system is a synthesis of the calligraphy researches such as calligraphy modeling, feature extraction and style synthesis, calligraphy generation, and calligraphy analysis and evaluation, aiming at offering an integrated and systematic application for calligraphy learners and researchers. Henmi and Yoshikawa [10] developed a virtual calligraphy system that can display teacher’s skillful motion to students by recording the position and force trajectories of the teacher’s writing brush. Shin et al. [11] presented a calligraphy learning system by using Yongzi-Bafa which can also give an evaluation result of every stroke of user’s input.The key issue of this paper is the evaluation of user’s handwritten calligraphy in a calligraphy learning system. So far, most of the evaluation researches are raster image processing based, but our work is carried out based on the vectorized calligraphy.


## 3. Database Establishment of Qi Gong Calligraphy

A good and complete calligraphy database is the basis of evaluation research, especially when evaluating a calligraphy character without knowing what it is. Our Qi Gong calligraphy database contains 3755 frequently used Qi font Chinese characters according to GB 2312 (Chinese Ideogram Coded Character Set), including both vector representation and binary image data.


### 3.1. Stroke Segmentation

Stroke is the minimum component of a Chinese character. There are mainly five kinds of strokes:(1)
“heng (一),” which is a horizontal line.(2)
“shu (丨),” which is a top-down vertical line.(3)
“pie (㇒),” which is a left-downward slope line.(4)
“dian (丶),” or called “na,” which is a right-downward short pausing stroke.(5)
“zhe (㇖),” which is a turning stroke having large angular variations.Stroke segmentation means decomposing a character into a number of strokes according to their correct stroke sequence, and each stroke is saved as a separate part. Corner detection method is used to mark crossover points, where curvature is large enough or gradient changes dramatically. When these corners are obtained, joinable corner point pairs are picked out by alternately human interaction. Hence complete and independent strokes can be separated from a character. For an optimized result, interpolation is applied to make the strokes smooth. Stroke segmentation work for Qi Gong calligraphy has been finished [12]. Figure 2 shows a segmentation example of character “她”.


### 3.2. Representing Characters by DBSCs

Raster character image, usually bitmap, requires large storage space and always causes anamorphosis and aliasing when they are zoomed or rotated, while, on the contrary, vector representation cannot only reduce the storage space, but also realize fast transformation and arbitrary scaling without anamorphosis. Disk B-spline curves are always used to represent Chinese characters in recent years.


#### 3.2.1. Disk B-Spline Curve (DBSC) Definition

LetNi,p(t) be the ith B-spline basis of degree p with knot vector t0,…,tm={a,…,a︸p,tp+1,…,tm-p-1,b,…,b︸p}. Here m=n+p+1. Then the disk B-spline curve (DBSC) is defined as follows:(1)Dt=∑i=0nNi,ptPi;ri,where Pi is control point and ri is control radii.DBSC can be viewed as 2 parts: the center curve∑i=0nNi,p(t)Pi, which is a B-spline curve, and the radius function ∑i=0nNi,p(t)ri, which is a B-spline scalar function.Owing to the perfect symmetry property of disks, the curve constructed from the centers of disks is exactly the skeleton of the 2D region represented by DBSC. Most of the properties and algorithms can be obtained by applying B-spline curve and function to the 2 parts of the disk B-spline curve, respectively. More details can be found in [3].


#### 3.2.2. DBSC Based Stroke Representation

The DBSC is derived from B-spline curves. The difference between B-spline curves and DBSC is that instead of being defined by points, DBSC is defined by a set of disks. It derives nature of flexibility for transformation, deformation, and morphing.A disk B-spline curve is a skeleton based parametric 2D representation, which represents the 2D region as well as the center curve (skeleton) of the 2D region explicitly. DBSC is a proper tool to describe a brushstroke. Therefore, we use DBSCs to represent the geometric data of each stroke in characters. The first stroke of a Qi font “她” is represented by a disk B-spline curve as shown in Figure3.Vectorized 3755 Qi font characters are included in our Qi Gong calligraphy database so that they can be used for the evaluation approach in the rest of our paper. Figure4 is an example of some vectorized characters in our Qi Gong calligraphy database.


## 3.1. Stroke Segmentation

Stroke is the minimum component of a Chinese character. There are mainly five kinds of strokes:(1)
“heng (一),” which is a horizontal line.(2)
“shu (丨),” which is a top-down vertical line.(3)
“pie (㇒),” which is a left-downward slope line.(4)
“dian (丶),” or called “na,” which is a right-downward short pausing stroke.(5)
“zhe (㇖),” which is a turning stroke having large angular variations.Stroke segmentation means decomposing a character into a number of strokes according to their correct stroke sequence, and each stroke is saved as a separate part. Corner detection method is used to mark crossover points, where curvature is large enough or gradient changes dramatically. When these corners are obtained, joinable corner point pairs are picked out by alternately human interaction. Hence complete and independent strokes can be separated from a character. For an optimized result, interpolation is applied to make the strokes smooth. Stroke segmentation work for Qi Gong calligraphy has been finished [12]. Figure 2 shows a segmentation example of character “她”.


## 3.2. Representing Characters by DBSCs

Raster character image, usually bitmap, requires large storage space and always causes anamorphosis and aliasing when they are zoomed or rotated, while, on the contrary, vector representation cannot only reduce the storage space, but also realize fast transformation and arbitrary scaling without anamorphosis. Disk B-spline curves are always used to represent Chinese characters in recent years.


### 3.2.1. Disk B-Spline Curve (DBSC) Definition

LetNi,p(t) be the ith B-spline basis of degree p with knot vector t0,…,tm={a,…,a︸p,tp+1,…,tm-p-1,b,…,b︸p}. Here m=n+p+1. Then the disk B-spline curve (DBSC) is defined as follows:(1)Dt=∑i=0nNi,ptPi;ri,where Pi is control point and ri is control radii.DBSC can be viewed as 2 parts: the center curve∑i=0nNi,p(t)Pi, which is a B-spline curve, and the radius function ∑i=0nNi,p(t)ri, which is a B-spline scalar function.Owing to the perfect symmetry property of disks, the curve constructed from the centers of disks is exactly the skeleton of the 2D region represented by DBSC. Most of the properties and algorithms can be obtained by applying B-spline curve and function to the 2 parts of the disk B-spline curve, respectively. More details can be found in [3].


### 3.2.2. DBSC Based Stroke Representation

The DBSC is derived from B-spline curves. The difference between B-spline curves and DBSC is that instead of being defined by points, DBSC is defined by a set of disks. It derives nature of flexibility for transformation, deformation, and morphing.A disk B-spline curve is a skeleton based parametric 2D representation, which represents the 2D region as well as the center curve (skeleton) of the 2D region explicitly. DBSC is a proper tool to describe a brushstroke. Therefore, we use DBSCs to represent the geometric data of each stroke in characters. The first stroke of a Qi font “她” is represented by a disk B-spline curve as shown in Figure3.Vectorized 3755 Qi font characters are included in our Qi Gong calligraphy database so that they can be used for the evaluation approach in the rest of our paper. Figure4 is an example of some vectorized characters in our Qi Gong calligraphy database.


## 3.2.1. Disk B-Spline Curve (DBSC) Definition

LetNi,p(t) be the ith B-spline basis of degree p with knot vector t0,…,tm={a,…,a︸p,tp+1,…,tm-p-1,b,…,b︸p}. Here m=n+p+1. Then the disk B-spline curve (DBSC) is defined as follows:(1)Dt=∑i=0nNi,ptPi;ri,where Pi is control point and ri is control radii.DBSC can be viewed as 2 parts: the center curve∑i=0nNi,p(t)Pi, which is a B-spline curve, and the radius function ∑i=0nNi,p(t)ri, which is a B-spline scalar function.Owing to the perfect symmetry property of disks, the curve constructed from the centers of disks is exactly the skeleton of the 2D region represented by DBSC. Most of the properties and algorithms can be obtained by applying B-spline curve and function to the 2 parts of the disk B-spline curve, respectively. More details can be found in [3].


## 3.2.2. DBSC Based Stroke Representation

The DBSC is derived from B-spline curves. The difference between B-spline curves and DBSC is that instead of being defined by points, DBSC is defined by a set of disks. It derives nature of flexibility for transformation, deformation, and morphing.A disk B-spline curve is a skeleton based parametric 2D representation, which represents the 2D region as well as the center curve (skeleton) of the 2D region explicitly. DBSC is a proper tool to describe a brushstroke. Therefore, we use DBSCs to represent the geometric data of each stroke in characters. The first stroke of a Qi font “她” is represented by a disk B-spline curve as shown in Figure3.Vectorized 3755 Qi font characters are included in our Qi Gong calligraphy database so that they can be used for the evaluation approach in the rest of our paper. Figure4 is an example of some vectorized characters in our Qi Gong calligraphy database.


## 4. Preprocessing of the Search Space

In order to improve the whole efficiency of our method, some steps will be taken to reduce the search space at first. This reducing algorithm mainly involves two aspects: one is total stroke number, and the other is angular difference between adjacent strokes.


### 4.1. Reducing the Search Space according to Total Stroke Number

The input device of our system is digital tablet which is based on electromagnetic induction. It can perceive very subtle pressure changes, convert touch pressures and positions into pixels, and eventually form the handwriting. When the pressure between “brush” and “paper” changes from zero to a nonzero number, the system considers a stroke begins. When the pressure turns back to zero, system considers the stroke finishes. Positions of virtual pen form the stroke skeleton; pressures represent stroke radii. Hence, track and shape information of every stroke, namely, the skeleton and radii, as well as the total stroke number of user’s handwriting can be recorded.Since our calligraphy database contains the total stroke number information of all characters, when user finishes input, the search space can then be reduced into a subspace in which the characters have the same total stroke number with user’s handwriting. And the next reducing step will be taken based on this subspace.


### 4.2. Reducing the Search Space according to Angular Difference between Adjacent Strokes

Every stroke in a character has a direction, namely, the correct writing direction. So there exists an angle relation between two strokes which are adjacent in writing order; we name this relation “angular difference.” No matter what kind of size or position the character has, or even if the character is written askew, the angular differences between adjacent strokes will still be almost invariable. So according to the similarities between user’s handwriting and standard Qi Gong calligraphy in terms of angular difference, we can exclude a large number of characters, or even recognize what user writes, thus reducing the search space.But the actual situation of strokes is much more complicated. The direction of a stroke is not constant; it may change slightly or greatly. A most typical example is “zhe.” It can be horizontal in the beginning and then become vertical from the middle; and it can also be vertical in the beginning and then become horizontal from the middle. In the former situation, we call it “heng zhe (㇇),” and in the latter, we call it “shu zhe (㇗).” So in order to avoid the direction deviation caused by large and small angular variation, we will distinguish the stroke’s classification in our approach.The reducing process of the search space in this phase mainly includes four steps. Firstly, a curve fitting algorithm is used to obtain the line segment that can approximate the stroke in maximum. Secondly strokes are classified into straight or curving according to the approximating distance. Thirdly the fitting lines are used to represent strokes and calculate angular differences. Finally, a weighted algorithm is used to calculate similarities between user’s handwriting and standard Qi Gong characters according to stroke classifications and angular differences; hence we can find out the top several most similar characters.


#### 4.2.1. Optimal Approximating Line Segment of Strokes

We use a least square method based curve fitting algorithm [13] to obtain the optimal approximating line segment of each stroke.Figure5 shows a fitting line example. The red points in the picture stand for the equidistant sampling data points of the stroke skeleton, and the green line stands for the calculated optimal approximating line segment of the stroke.


#### 4.2.2. Classification of Strokes

The fitting line of a stroke whose direction changes greatly such as “zhe” may be quite similar to the fitting line of a stroke whose direction is almost unchanged. This situation may bring errors to our approach. So in order to be more accurate, it is necessary to classify the stroke into straight and curving according to the approximating distance. We use Euclidean distance to distinguish strokes.Letli be the Euclidean distance from sampling point {xi,yi} to the optimal approximating line segment, i=1,2,…,n. Let L be the length of the approximating segment.Then if(1/L)∑i=1nli<ε, we judge the stroke to be straight, otherwise, curving. Here ε is a threshold value.We denoteSc as the stroke classification similarity between a standard Qi Gong character and user’s handwriting. Let m be total stroke number of a character. If there are k strokes whose classifications are different, then(2)Sc=m-km.Now we give an example. As shown in Table1, there are two characters whose total stroke numbers are both 3. We can see that the strokes of character “工” are all straight, but in character “口”, the first and third stoke are straight and the second stroke is curving. So there is one stroke whose classification is different. According to (2), Sc=(3-1)/3=2/3.Table 1
Stroke classification of characters “工” and “口”.
Stroke 1
Stroke 2
Stroke 3
Character “工”
Character “口”
Classification comparison
Same
Different
Same


#### 4.2.3. Calculation of Angular Differences

After figuring out the approximating line segments, we can use them to calculate angular differences. If the total stroke number of a character ism, then there will be m-1 angular differences. For convenience, the value of angular difference ranges from 0 to π.Here we use characters “二” and “十” in Figure5 to show how to calculate the angular differences. Assume AB→, CD→ are the approximating line segments of the two strokes in character “二”, and A′B′→, C′D′→ are the approximating line segments of the two strokes in character “十”. Segment directions are the correct writing directions of their corresponding strokes. Then the angular differences of “二” and “十” are(3)arccos⁡AB→·CD→AB→CD→,arccos⁡A′B′→·C′D′→A′B′→C′D′→.Clearly we can see that the angular differences of  “二” and “十” in Figure6 are quite unlike; they differ by almost 90°, so they can be judged to be two different characters qualitatively. In the next part we will give the quantitive evaluation criteria.LetP={p1,p2,…,pi,…,pm-1} be the angular difference sequence of a standard Qi Gong character, and let Q={q1,q2,…,qi,…,qm-1} be the sequence of user’s handwriting. P here is equivalent to a character template. pi and qi are the angular difference between stroke i and stroke i+1. m is the total stroke number and m≥2. Then the mean deviation of the two characters’ angular differences Dev can be calculated as follows:(4)Dev=∑i=1m-1pi-qim-1.The smaller the Dev is, the more similar the characters are.


#### 4.2.4. Weighted Similarity Calculation Algorithm

Here we set two threshold values,ξ and δ, to control the size of search space. ξ is used to limit k, namely, the number of strokes with different classifications, which has been introduced in Section 4.2.2. δ is used to limit Dev, namely, the mean deviation of the two characters’ angular differences, which has been introduced in Section 4.2.3.We denoteSd as the angular difference similarity between a standard Qi Gong character and user’s handwriting. Then it can be figured out according to the following equation:(5)Sd=δ-Devδ.Ifk>ξ, or Dev>δ, we consider that the current two characters being compared are not the same, thus excluding a number of characters from the search space.Ifk≤ξ and Dev≤δ, we will calculate a compositive weighted similarity S:(6)S=w1Sc+w2Sd.Herew1 and w2 are weight parameters, w1+w2=1. Combining (2), (4), (5), and (6), we could get a final detailed similarity calculation equation(7)S=w1·1-km+w2·1-∑i=1m-1pi-qiδm-1.After scanning all the characters in the search space, we can find out the top several characters which have the highestS according to the sorting result.


## 4.1. Reducing the Search Space according to Total Stroke Number

The input device of our system is digital tablet which is based on electromagnetic induction. It can perceive very subtle pressure changes, convert touch pressures and positions into pixels, and eventually form the handwriting. When the pressure between “brush” and “paper” changes from zero to a nonzero number, the system considers a stroke begins. When the pressure turns back to zero, system considers the stroke finishes. Positions of virtual pen form the stroke skeleton; pressures represent stroke radii. Hence, track and shape information of every stroke, namely, the skeleton and radii, as well as the total stroke number of user’s handwriting can be recorded.Since our calligraphy database contains the total stroke number information of all characters, when user finishes input, the search space can then be reduced into a subspace in which the characters have the same total stroke number with user’s handwriting. And the next reducing step will be taken based on this subspace.


## 4.2. Reducing the Search Space according to Angular Difference between Adjacent Strokes

Every stroke in a character has a direction, namely, the correct writing direction. So there exists an angle relation between two strokes which are adjacent in writing order; we name this relation “angular difference.” No matter what kind of size or position the character has, or even if the character is written askew, the angular differences between adjacent strokes will still be almost invariable. So according to the similarities between user’s handwriting and standard Qi Gong calligraphy in terms of angular difference, we can exclude a large number of characters, or even recognize what user writes, thus reducing the search space.But the actual situation of strokes is much more complicated. The direction of a stroke is not constant; it may change slightly or greatly. A most typical example is “zhe.” It can be horizontal in the beginning and then become vertical from the middle; and it can also be vertical in the beginning and then become horizontal from the middle. In the former situation, we call it “heng zhe (㇇),” and in the latter, we call it “shu zhe (㇗).” So in order to avoid the direction deviation caused by large and small angular variation, we will distinguish the stroke’s classification in our approach.The reducing process of the search space in this phase mainly includes four steps. Firstly, a curve fitting algorithm is used to obtain the line segment that can approximate the stroke in maximum. Secondly strokes are classified into straight or curving according to the approximating distance. Thirdly the fitting lines are used to represent strokes and calculate angular differences. Finally, a weighted algorithm is used to calculate similarities between user’s handwriting and standard Qi Gong characters according to stroke classifications and angular differences; hence we can find out the top several most similar characters.


### 4.2.1. Optimal Approximating Line Segment of Strokes

We use a least square method based curve fitting algorithm [13] to obtain the optimal approximating line segment of each stroke.Figure5 shows a fitting line example. The red points in the picture stand for the equidistant sampling data points of the stroke skeleton, and the green line stands for the calculated optimal approximating line segment of the stroke.


### 4.2.2. Classification of Strokes

The fitting line of a stroke whose direction changes greatly such as “zhe” may be quite similar to the fitting line of a stroke whose direction is almost unchanged. This situation may bring errors to our approach. So in order to be more accurate, it is necessary to classify the stroke into straight and curving according to the approximating distance. We use Euclidean distance to distinguish strokes.Letli be the Euclidean distance from sampling point {xi,yi} to the optimal approximating line segment, i=1,2,…,n. Let L be the length of the approximating segment.Then if(1/L)∑i=1nli<ε, we judge the stroke to be straight, otherwise, curving. Here ε is a threshold value.We denoteSc as the stroke classification similarity between a standard Qi Gong character and user’s handwriting. Let m be total stroke number of a character. If there are k strokes whose classifications are different, then(2)Sc=m-km.Now we give an example. As shown in Table1, there are two characters whose total stroke numbers are both 3. We can see that the strokes of character “工” are all straight, but in character “口”, the first and third stoke are straight and the second stroke is curving. So there is one stroke whose classification is different. According to (2), Sc=(3-1)/3=2/3.Table 1
Stroke classification of characters “工” and “口”.
Stroke 1
Stroke 2
Stroke 3
Character “工”
Character “口”
Classification comparison
Same
Different
Same


### 4.2.3. Calculation of Angular Differences

After figuring out the approximating line segments, we can use them to calculate angular differences. If the total stroke number of a character ism, then there will be m-1 angular differences. For convenience, the value of angular difference ranges from 0 to π.Here we use characters “二” and “十” in Figure5 to show how to calculate the angular differences. Assume AB→, CD→ are the approximating line segments of the two strokes in character “二”, and A′B′→, C′D′→ are the approximating line segments of the two strokes in character “十”. Segment directions are the correct writing directions of their corresponding strokes. Then the angular differences of “二” and “十” are(3)arccos⁡AB→·CD→AB→CD→,arccos⁡A′B′→·C′D′→A′B′→C′D′→.Clearly we can see that the angular differences of  “二” and “十” in Figure6 are quite unlike; they differ by almost 90°, so they can be judged to be two different characters qualitatively. In the next part we will give the quantitive evaluation criteria.LetP={p1,p2,…,pi,…,pm-1} be the angular difference sequence of a standard Qi Gong character, and let Q={q1,q2,…,qi,…,qm-1} be the sequence of user’s handwriting. P here is equivalent to a character template. pi and qi are the angular difference between stroke i and stroke i+1. m is the total stroke number and m≥2. Then the mean deviation of the two characters’ angular differences Dev can be calculated as follows:(4)Dev=∑i=1m-1pi-qim-1.The smaller the Dev is, the more similar the characters are.


### 4.2.4. Weighted Similarity Calculation Algorithm

Here we set two threshold values,ξ and δ, to control the size of search space. ξ is used to limit k, namely, the number of strokes with different classifications, which has been introduced in Section 4.2.2. δ is used to limit Dev, namely, the mean deviation of the two characters’ angular differences, which has been introduced in Section 4.2.3.We denoteSd as the angular difference similarity between a standard Qi Gong character and user’s handwriting. Then it can be figured out according to the following equation:(5)Sd=δ-Devδ.Ifk>ξ, or Dev>δ, we consider that the current two characters being compared are not the same, thus excluding a number of characters from the search space.Ifk≤ξ and Dev≤δ, we will calculate a compositive weighted similarity S:(6)S=w1Sc+w2Sd.Herew1 and w2 are weight parameters, w1+w2=1. Combining (2), (4), (5), and (6), we could get a final detailed similarity calculation equation(7)S=w1·1-km+w2·1-∑i=1m-1pi-qiδm-1.After scanning all the characters in the search space, we can find out the top several characters which have the highestS according to the sorting result.


## 4.2.1. Optimal Approximating Line Segment of Strokes

We use a least square method based curve fitting algorithm [13] to obtain the optimal approximating line segment of each stroke.Figure5 shows a fitting line example. The red points in the picture stand for the equidistant sampling data points of the stroke skeleton, and the green line stands for the calculated optimal approximating line segment of the stroke.


## 4.2.2. Classification of Strokes

The fitting line of a stroke whose direction changes greatly such as “zhe” may be quite similar to the fitting line of a stroke whose direction is almost unchanged. This situation may bring errors to our approach. So in order to be more accurate, it is necessary to classify the stroke into straight and curving according to the approximating distance. We use Euclidean distance to distinguish strokes.Letli be the Euclidean distance from sampling point {xi,yi} to the optimal approximating line segment, i=1,2,…,n. Let L be the length of the approximating segment.Then if(1/L)∑i=1nli<ε, we judge the stroke to be straight, otherwise, curving. Here ε is a threshold value.We denoteSc as the stroke classification similarity between a standard Qi Gong character and user’s handwriting. Let m be total stroke number of a character. If there are k strokes whose classifications are different, then(2)Sc=m-km.Now we give an example. As shown in Table1, there are two characters whose total stroke numbers are both 3. We can see that the strokes of character “工” are all straight, but in character “口”, the first and third stoke are straight and the second stroke is curving. So there is one stroke whose classification is different. According to (2), Sc=(3-1)/3=2/3.Table 1
Stroke classification of characters “工” and “口”.
Stroke 1
Stroke 2
Stroke 3
Character “工”
Character “口”
Classification comparison
Same
Different
Same


## 4.2.3. Calculation of Angular Differences

After figuring out the approximating line segments, we can use them to calculate angular differences. If the total stroke number of a character ism, then there will be m-1 angular differences. For convenience, the value of angular difference ranges from 0 to π.Here we use characters “二” and “十” in Figure5 to show how to calculate the angular differences. Assume AB→, CD→ are the approximating line segments of the two strokes in character “二”, and A′B′→, C′D′→ are the approximating line segments of the two strokes in character “十”. Segment directions are the correct writing directions of their corresponding strokes. Then the angular differences of “二” and “十” are(3)arccos⁡AB→·CD→AB→CD→,arccos⁡A′B′→·C′D′→A′B′→C′D′→.Clearly we can see that the angular differences of  “二” and “十” in Figure6 are quite unlike; they differ by almost 90°, so they can be judged to be two different characters qualitatively. In the next part we will give the quantitive evaluation criteria.LetP={p1,p2,…,pi,…,pm-1} be the angular difference sequence of a standard Qi Gong character, and let Q={q1,q2,…,qi,…,qm-1} be the sequence of user’s handwriting. P here is equivalent to a character template. pi and qi are the angular difference between stroke i and stroke i+1. m is the total stroke number and m≥2. Then the mean deviation of the two characters’ angular differences Dev can be calculated as follows:(4)Dev=∑i=1m-1pi-qim-1.The smaller the Dev is, the more similar the characters are.


## 4.2.4. Weighted Similarity Calculation Algorithm

Here we set two threshold values,ξ and δ, to control the size of search space. ξ is used to limit k, namely, the number of strokes with different classifications, which has been introduced in Section 4.2.2. δ is used to limit Dev, namely, the mean deviation of the two characters’ angular differences, which has been introduced in Section 4.2.3.We denoteSd as the angular difference similarity between a standard Qi Gong character and user’s handwriting. Then it can be figured out according to the following equation:(5)Sd=δ-Devδ.Ifk>ξ, or Dev>δ, we consider that the current two characters being compared are not the same, thus excluding a number of characters from the search space.Ifk≤ξ and Dev≤δ, we will calculate a compositive weighted similarity S:(6)S=w1Sc+w2Sd.Herew1 and w2 are weight parameters, w1+w2=1. Combining (2), (4), (5), and (6), we could get a final detailed similarity calculation equation(7)S=w1·1-km+w2·1-∑i=1m-1pi-qiδm-1.After scanning all the characters in the search space, we can find out the top several characters which have the highestS according to the sorting result.


## 5. Character Registration by Using ICP Algorithm

Iterative closest point (ICP) algorithm [14] is one of the most commonly used registration algorithms based on point set to point set. The basic steps of this algorithm are [15] to find out the closest matching point pairs in the two point sets being processed; compute the transformation matrix that minimizes the sum of the squares between the paired points and then apply the transformation; iterate the above two steps until the distance satisfies a given convergence precision. When the iteration is stopped, we can get the final translation and rotation parameters. Therefore, we can consider the user’s handwritten character and the standard Qi font character candidates selected from the previous preprocessing step as point sets and match them via ICP algorithm.Skeleton is an important descriptor for shape matching, and sometimes it performs better than contour or the whole pixel point set of an object. What is more, computation of skeleton-based ICP algorithm will be much faster than the computation based on whole points of the object. Since the Qi Gong calligraphy characters in our database are vectorized by DBSCs, the skeletons and shapes are easy to get. And as we said in Section4.1, the skeleton and radii of user’s handwritten character are also recorded, so in this paper we will use the skeleton point set to realize ICP registration and find out the best matching character.


### 5.1. Scaling of the Standard Qi Gong Character

Our ICP registration is rigid, so before applying this algorithm, we must scale the standard character at first and make the two characters to be processed have the same size so that we can get a more accurate registration result in the following step.LetXs be the skeleton point set of standard Qi Gong character, and let Xu be the skeleton point set of user’s handwritten character. Here we take Xu as the referenced point set. First the geometric centers Os and Ou of Xs and Xu are calculated. Then the smallest disks which can cover the whole character are found, and the corresponding radii are denoted by rs and ru. With rs and ru, we can scale the vectorized standard Qi Gong character, thus making it have the same covering disk size with user’s handwritten character.


### 5.2. ICP Registration of Characters

#### 5.2.1. ICP Algorithm

Registration operation of ICP algorithm actually means finding an optimal rigid transformation from one coordinate system to another which can minimize the sum of the squares between two point sets. This transformation can be represented by a3×3 rotation matrix R and a three-dimensional translation vector T.LetP={pi∣pi∈R3,i=1,2,…,N} and Q={qi∣qi∈R3,i=1,2,…,M} be two point sets to be registrated. Suppose p is an arbitrary point in P, and its coordinate value is (xp1,yp1,zp1). After transforming, the coordinate value of p is (xp2,yp2,zp2). Then,(8)xp2yp2zp2=Rxp1yp1zp1+T.So the registration goal is to figure out the transformation ofR and T which can minimize the value of the following function:(9)fR,T=min⁡∑i=1Npik-Rpi+T2,where k is iteration times, pik is the closest matching point of pi, pik∈Q, and N is the total point number of P. In this iteration process, P and pik are not fixed, they are always changing. After each iteration, P and the closest matching point pairs will be updated. Rpi+Ti=1,2,…,N will be the new P in next iteration.


#### 5.2.2. Character Registration Steps

In our approach, we use ICP registration algorithm to make standard Qi Gong character and user’s handwritten character match best, and the algorithm is carried out in two-dimensional space.X
s and Xu are the two skeleton point sets of standard Qi Gong character and user’s handwritten character, and they have been scaled to the same size after the process in Section 5.1. Then the registration steps can be described as follows.(1)
Search all the closest corresponding points ofXs in Xu.(2)
Figure out the rigid transformation which can minimize the sum of the squares between the paired points above mentioned and then acquire rotation parameterR and translation parameter T.(3)
ApplyR and T to Xs and get the transformed point set.(4)
If the transformed point set ofXs and the referenced point set Xu can satisfy a given convergence precision of function f(R,T) in (9), namely, the sum of the squares of the two point sets being less than a given threshold value, then stop iterating. Otherwise set the transformed point set as the new Xs, and iterate the above four steps until the function value is acceptable.There are several commonly used methods of searching the closest corresponding point pairs in step (1), such as point to point [14], point to plane [16], and point to projection [17], as shown in Figure 7. Since our registration is based on skeleton point set, we use the point to point searching method. Figure 8 is a registration example of our experiment character “永”.


## 5.1. Scaling of the Standard Qi Gong Character

Our ICP registration is rigid, so before applying this algorithm, we must scale the standard character at first and make the two characters to be processed have the same size so that we can get a more accurate registration result in the following step.LetXs be the skeleton point set of standard Qi Gong character, and let Xu be the skeleton point set of user’s handwritten character. Here we take Xu as the referenced point set. First the geometric centers Os and Ou of Xs and Xu are calculated. Then the smallest disks which can cover the whole character are found, and the corresponding radii are denoted by rs and ru. With rs and ru, we can scale the vectorized standard Qi Gong character, thus making it have the same covering disk size with user’s handwritten character.


## 5.2. ICP Registration of Characters

### 5.2.1. ICP Algorithm

Registration operation of ICP algorithm actually means finding an optimal rigid transformation from one coordinate system to another which can minimize the sum of the squares between two point sets. This transformation can be represented by a3×3 rotation matrix R and a three-dimensional translation vector T.LetP={pi∣pi∈R3,i=1,2,…,N} and Q={qi∣qi∈R3,i=1,2,…,M} be two point sets to be registrated. Suppose p is an arbitrary point in P, and its coordinate value is (xp1,yp1,zp1). After transforming, the coordinate value of p is (xp2,yp2,zp2). Then,(8)xp2yp2zp2=Rxp1yp1zp1+T.So the registration goal is to figure out the transformation ofR and T which can minimize the value of the following function:(9)fR,T=min⁡∑i=1Npik-Rpi+T2,where k is iteration times, pik is the closest matching point of pi, pik∈Q, and N is the total point number of P. In this iteration process, P and pik are not fixed, they are always changing. After each iteration, P and the closest matching point pairs will be updated. Rpi+Ti=1,2,…,N will be the new P in next iteration.


### 5.2.2. Character Registration Steps

In our approach, we use ICP registration algorithm to make standard Qi Gong character and user’s handwritten character match best, and the algorithm is carried out in two-dimensional space.X
s and Xu are the two skeleton point sets of standard Qi Gong character and user’s handwritten character, and they have been scaled to the same size after the process in Section 5.1. Then the registration steps can be described as follows.(1)
Search all the closest corresponding points ofXs in Xu.(2)
Figure out the rigid transformation which can minimize the sum of the squares between the paired points above mentioned and then acquire rotation parameterR and translation parameter T.(3)
ApplyR and T to Xs and get the transformed point set.(4)
If the transformed point set ofXs and the referenced point set Xu can satisfy a given convergence precision of function f(R,T) in (9), namely, the sum of the squares of the two point sets being less than a given threshold value, then stop iterating. Otherwise set the transformed point set as the new Xs, and iterate the above four steps until the function value is acceptable.There are several commonly used methods of searching the closest corresponding point pairs in step (1), such as point to point [14], point to plane [16], and point to projection [17], as shown in Figure 7. Since our registration is based on skeleton point set, we use the point to point searching method. Figure 8 is a registration example of our experiment character “永”.


## 5.2.1. ICP Algorithm

Registration operation of ICP algorithm actually means finding an optimal rigid transformation from one coordinate system to another which can minimize the sum of the squares between two point sets. This transformation can be represented by a3×3 rotation matrix R and a three-dimensional translation vector T.LetP={pi∣pi∈R3,i=1,2,…,N} and Q={qi∣qi∈R3,i=1,2,…,M} be two point sets to be registrated. Suppose p is an arbitrary point in P, and its coordinate value is (xp1,yp1,zp1). After transforming, the coordinate value of p is (xp2,yp2,zp2). Then,(8)xp2yp2zp2=Rxp1yp1zp1+T.So the registration goal is to figure out the transformation ofR and T which can minimize the value of the following function:(9)fR,T=min⁡∑i=1Npik-Rpi+T2,where k is iteration times, pik is the closest matching point of pi, pik∈Q, and N is the total point number of P. In this iteration process, P and pik are not fixed, they are always changing. After each iteration, P and the closest matching point pairs will be updated. Rpi+Ti=1,2,…,N will be the new P in next iteration.


## 5.2.2. Character Registration Steps

In our approach, we use ICP registration algorithm to make standard Qi Gong character and user’s handwritten character match best, and the algorithm is carried out in two-dimensional space.X
s and Xu are the two skeleton point sets of standard Qi Gong character and user’s handwritten character, and they have been scaled to the same size after the process in Section 5.1. Then the registration steps can be described as follows.(1)
Search all the closest corresponding points ofXs in Xu.(2)
Figure out the rigid transformation which can minimize the sum of the squares between the paired points above mentioned and then acquire rotation parameterR and translation parameter T.(3)
ApplyR and T to Xs and get the transformed point set.(4)
If the transformed point set ofXs and the referenced point set Xu can satisfy a given convergence precision of function f(R,T) in (9), namely, the sum of the squares of the two point sets being less than a given threshold value, then stop iterating. Otherwise set the transformed point set as the new Xs, and iterate the above four steps until the function value is acceptable.There are several commonly used methods of searching the closest corresponding point pairs in step (1), such as point to point [14], point to plane [16], and point to projection [17], as shown in Figure 7. Since our registration is based on skeleton point set, we use the point to point searching method. Figure 8 is a registration example of our experiment character “永”.


## 6. Comprehensive Evaluation

Skeleton represents the global topological information of a character, which can reflect the balance and arrangement of all the strokes. Local similarity of each stroke is also an important metric in calligraphy evaluation mechanism. With stroke evaluation score, learners could find out about which stroke they wrote well and which stroke they need to practice further more. So we compare both the global similarity and the local similarity in our approach.However, skeleton distance is not easy to convert into a certain score based on the percentage grading system. What is more, it has lost the width information. So in this paper we use the whole character shape instead of skeleton to represent the topological feature. Similarly, we use stroke shape to calculate stroke similarity. Here the shape data is defined as the pixel distribution information of a character or stroke; that is the most direct and easy way to measure the distance between two characters or two strokes. With the skeleton and radii of a character, and the stroke segmentation data in our database, we can easily get the shape information of each stroke and the whole character.


### 6.1. Character Shape Similarity

When the registration step is finished, the best matching character will be found; then character shape similarity, denoted byS1, can be calculated according to the overlapping situation of user’s handwriting and transformed standard Qi Gong character as follows:(10)S1=∑i=1K∑j=1KXi,j·Yi,j∑i=1K∑j=1KXi,j·Yi,j+Xi,j-Yi,j,where K is the length of the smallest square which can cover the two registrated characters, Xi,j is the pixel value of user’s character, Yi,j is the pixel value of Qi Gong character, and we define(11)Xi,jorYi,j=1,if  pixeli,jis  black0,if  pixeli,jis  white.In (10), numerator represents the total number of pixels that both are black, namely, the overlapping black area; denominator represents the total number of pixels that are different or both black, namely, the remaining part after removing the overlapping white area.


### 6.2. Stroke Shape Similarity

In order to avoid the error brought by position and size of the strokes to be compared, we first normalize their “effective area” to80×80 in pixels. Here the “effective area” of a stroke is calculated as follows.First, we find four boundaries of a stroke, that is, the top, the bottom, the left, and the right. Then this rectangle is turned into a square region according to its longer side, and we make sure that the rectangle is right in the middle of the square. This square region is called the effective area of a stroke. Figure9 shows an example of finding the effective area of a stroke.When the effective areas of user’s handwritten strokes and standard Qi Gong strokes are normalized to80×80 in pixels, the shape similarity of nth stroke, denoted by S(n), can be calculated according to the following equation, which is quite similar to (10):(12)Sn=∑i=1K∑j=1KXi,jn·Yi,jn∑i=1K∑j=1KXi,jn·Yi,jn+Xi,jn-Yi,jn,where, 1≤n≤N, N is the total stroke number of the current character and K=80. Xi,j(n) is the pixel value of user’s nth stroke; Yi,j(n) is the pixel value of nth standard stroke.


### 6.3. Composited Score

With character shape similarityS1 and stroke shape similarities S(n), we can also compute a composited single evaluation score Eva.The mean similarity of all strokes is taken as the final stroke shape similarity, denoted byS2:(13)S2=1N∑n=1NSn.The maximal values ofS1 and S2 are both 1. Hence,(14)Eva=φ·S1+ω·S2·100%,where φ and ω are weight parameters, φ+ω=1.So far, the introduction of the detailed steps of our evaluation approach has been finished. Figure10 shows the whole architecture of the approach in this paper.


## 6.1. Character Shape Similarity

When the registration step is finished, the best matching character will be found; then character shape similarity, denoted byS1, can be calculated according to the overlapping situation of user’s handwriting and transformed standard Qi Gong character as follows:(10)S1=∑i=1K∑j=1KXi,j·Yi,j∑i=1K∑j=1KXi,j·Yi,j+Xi,j-Yi,j,where K is the length of the smallest square which can cover the two registrated characters, Xi,j is the pixel value of user’s character, Yi,j is the pixel value of Qi Gong character, and we define(11)Xi,jorYi,j=1,if  pixeli,jis  black0,if  pixeli,jis  white.In (10), numerator represents the total number of pixels that both are black, namely, the overlapping black area; denominator represents the total number of pixels that are different or both black, namely, the remaining part after removing the overlapping white area.


## 6.2. Stroke Shape Similarity

In order to avoid the error brought by position and size of the strokes to be compared, we first normalize their “effective area” to80×80 in pixels. Here the “effective area” of a stroke is calculated as follows.First, we find four boundaries of a stroke, that is, the top, the bottom, the left, and the right. Then this rectangle is turned into a square region according to its longer side, and we make sure that the rectangle is right in the middle of the square. This square region is called the effective area of a stroke. Figure9 shows an example of finding the effective area of a stroke.When the effective areas of user’s handwritten strokes and standard Qi Gong strokes are normalized to80×80 in pixels, the shape similarity of nth stroke, denoted by S(n), can be calculated according to the following equation, which is quite similar to (10):(12)Sn=∑i=1K∑j=1KXi,jn·Yi,jn∑i=1K∑j=1KXi,jn·Yi,jn+Xi,jn-Yi,jn,where, 1≤n≤N, N is the total stroke number of the current character and K=80. Xi,j(n) is the pixel value of user’s nth stroke; Yi,j(n) is the pixel value of nth standard stroke.


## 6.3. Composited Score

With character shape similarityS1 and stroke shape similarities S(n), we can also compute a composited single evaluation score Eva.The mean similarity of all strokes is taken as the final stroke shape similarity, denoted byS2:(13)S2=1N∑n=1NSn.The maximal values ofS1 and S2 are both 1. Hence,(14)Eva=φ·S1+ω·S2·100%,where φ and ω are weight parameters, φ+ω=1.So far, the introduction of the detailed steps of our evaluation approach has been finished. Figure10 shows the whole architecture of the approach in this paper.


## 7. Experiment Results and Analysis

### 7.1. Validity of the Recognition Algorithm

Aiming at finding out the best matching character, our character recognition algorithm mainly consists of two parts: reducing the search space and ICP registration, namely, steps (1) to (5) in Figure10. We have given one example as shown in Figure 8. In order to avoid the Type-I or Type-II error, we did several experiments by using a sample database containing 30 characters of 5 writers to validate the validity and make our algorithm more convincing. Table 2 shows the experiment result. We can see that, in this sample database, only one character is recognized as a wrong Qi Gong character. User wrote a character “己” (ji), but our algorithm recognized it as “已” (yi); their shape is quite similar. The proportion of two characters like “己” and “已” which not only are very similar in shape but also have the same total stroke number is quite small. So this error can be accepted. The experiment proves our algorithm is effective. In these 30 test characters, 21 of them are recognized at the stage of reducing the search space before ICP registration, which proves our method is efficient as well.Table 2
Experiment of finding the best matching character.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
User’s handwritten character
十
才
己
云
艺
车
月
去
石
白
永
西
自
问
麦
The best matching Qi Gong character
十
才
已
云
艺
车
月
去
石
白
永
西
自
问
麦
True/false
T
T
F
T
T
T
T
T
T
T
T
T
T
T
T
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
User’s handwritten character
巫
我
言
画
贤
知
京
城
星
斋
家
都
梦
彩
森
The best matching Qi Gong character
巫
我
言
画
贤
知
京
城
星
斋
家
都
梦
彩
森
True/false
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T


### 7.2. Composited Shape Evaluation

We take “永” as our experiment character. “永” is the first character of calligraphy “Preface to Orchid Pavilion” (蘭亭序) shown in Figure1 and Table 3. The ICP registration of its skeleton has been shown in Figure 8, and we analyze its shape similarity. Likewise, other characters in calligraphy “Preface to Orchid Pavilion” or our vector Qi Gong calligraphy database can also be evaluated by our method.Table 3
Experiment of character “永”.
(a)
Character shape similarity
User’s handwriting
Original Qi Gong character
Overlapping comparison
Similarity
0.823234
(b)
Stroke shape similarities
Stroke 1
Stroke 2
Stroke 3
Stroke 4
Stroke 5
User’s stroke
Transformed Qi Gong Stroke
Similarity
0.906372
0.878092
0.690590
0.710224
0.857143
(c)
Composited evaluation score
S
1
S
2
Eva (%)
0.823234
0.808484
81.59Figure 1
Evaluation result of Chinese calligraphy. Left is the famous calligraphy “Preface to Orchid Pavilion” (蘭亭序) written by Mr. Qi Gong; top right is the original standard Qi Gong character “永” from calligraphy (left); bottom right is the same character handwritten by user. With our evaluation method, we can achieve the following result. The character shape similarity is 0.823234, and strokes’ shape similarities are 0.906372, 0.878092, 0.690590, 0.710224, and 0.857143. Obviously, the evaluation result, including not only a shape similarity but also each stroke shape similarity, can help users improve their calligraphy study well.Figure 2
Stroke segmentation of character “她”.Figure 3
The first stroke of “她” represented by DBSC.Figure 4
Vectorized Qi Gong calligraphy database.Figure 5
Optimal approximating line of a stroke.Figure 6
Characters “二” and “十”.Figure 7
Methods of searching the closest point in ICP.
(a)
Point to point
(b)
Point to plane
(c)
Point to projectionFigure 8
ICP registration of character “永”. (a) Skeleton of user’s handwritten character, (b) skeleton of original standard Qi Gong character, (c) transformed skeleton of standard Qi Gong character after ICP registration, and (d) overlapping comparison.
(a)
(b)
(c)
(d)Figure 9
Finding the effective area of a stroke.Figure 10
Architecture of the evaluation approach in this paper.In Table3(a), we can see the user’s askew handwritten character (left), the original standard Qi Gong character (middle), and the overlapping comparison after registration (right). Global similarity is calculated. According to this similarity, users could know how well they wrote in terms of structure and shape of this character. Table 3(b) shows the comparison of each stroke; with these stroke similarities, users can get to know which stroke they wrote well and which stroke they need to practice more. For example, the best stroke of user’s handwriting is the first stroke, with a similarity of 0.906372, and the worst stroke is the third stroke, with a similarity of 0.690590. Table 3(c) gives the composited evaluation score, which can show the overall quality of user’s practice. Here the φ and ω in (14) are both set as 0.5 in our experiment.We consulted several calligraphy teachers and asked them to evaluate experiment result. They concluded the result is relatively objective, which proves our approach is effective and satisfactory.


## 7.1. Validity of the Recognition Algorithm

Aiming at finding out the best matching character, our character recognition algorithm mainly consists of two parts: reducing the search space and ICP registration, namely, steps (1) to (5) in Figure10. We have given one example as shown in Figure 8. In order to avoid the Type-I or Type-II error, we did several experiments by using a sample database containing 30 characters of 5 writers to validate the validity and make our algorithm more convincing. Table 2 shows the experiment result. We can see that, in this sample database, only one character is recognized as a wrong Qi Gong character. User wrote a character “己” (ji), but our algorithm recognized it as “已” (yi); their shape is quite similar. The proportion of two characters like “己” and “已” which not only are very similar in shape but also have the same total stroke number is quite small. So this error can be accepted. The experiment proves our algorithm is effective. In these 30 test characters, 21 of them are recognized at the stage of reducing the search space before ICP registration, which proves our method is efficient as well.Table 2
Experiment of finding the best matching character.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
User’s handwritten character
十
才
己
云
艺
车
月
去
石
白
永
西
自
问
麦
The best matching Qi Gong character
十
才
已
云
艺
车
月
去
石
白
永
西
自
问
麦
True/false
T
T
F
T
T
T
T
T
T
T
T
T
T
T
T
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
User’s handwritten character
巫
我
言
画
贤
知
京
城
星
斋
家
都
梦
彩
森
The best matching Qi Gong character
巫
我
言
画
贤
知
京
城
星
斋
家
都
梦
彩
森
True/false
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T


## 7.2. Composited Shape Evaluation

We take “永” as our experiment character. “永” is the first character of calligraphy “Preface to Orchid Pavilion” (蘭亭序) shown in Figure1 and Table 3. The ICP registration of its skeleton has been shown in Figure 8, and we analyze its shape similarity. Likewise, other characters in calligraphy “Preface to Orchid Pavilion” or our vector Qi Gong calligraphy database can also be evaluated by our method.Table 3
Experiment of character “永”.
(a)
Character shape similarity
User’s handwriting
Original Qi Gong character
Overlapping comparison
Similarity
0.823234
(b)
Stroke shape similarities
Stroke 1
Stroke 2
Stroke 3
Stroke 4
Stroke 5
User’s stroke
Transformed Qi Gong Stroke
Similarity
0.906372
0.878092
0.690590
0.710224
0.857143
(c)
Composited evaluation score
S
1
S
2
Eva (%)
0.823234
0.808484
81.59Figure 1
Evaluation result of Chinese calligraphy. Left is the famous calligraphy “Preface to Orchid Pavilion” (蘭亭序) written by Mr. Qi Gong; top right is the original standard Qi Gong character “永” from calligraphy (left); bottom right is the same character handwritten by user. With our evaluation method, we can achieve the following result. The character shape similarity is 0.823234, and strokes’ shape similarities are 0.906372, 0.878092, 0.690590, 0.710224, and 0.857143. Obviously, the evaluation result, including not only a shape similarity but also each stroke shape similarity, can help users improve their calligraphy study well.Figure 2
Stroke segmentation of character “她”.Figure 3
The first stroke of “她” represented by DBSC.Figure 4
Vectorized Qi Gong calligraphy database.Figure 5
Optimal approximating line of a stroke.Figure 6
Characters “二” and “十”.Figure 7
Methods of searching the closest point in ICP.
(a)
Point to point
(b)
Point to plane
(c)
Point to projectionFigure 8
ICP registration of character “永”. (a) Skeleton of user’s handwritten character, (b) skeleton of original standard Qi Gong character, (c) transformed skeleton of standard Qi Gong character after ICP registration, and (d) overlapping comparison.
(a)
(b)
(c)
(d)Figure 9
Finding the effective area of a stroke.Figure 10
Architecture of the evaluation approach in this paper.In Table3(a), we can see the user’s askew handwritten character (left), the original standard Qi Gong character (middle), and the overlapping comparison after registration (right). Global similarity is calculated. According to this similarity, users could know how well they wrote in terms of structure and shape of this character. Table 3(b) shows the comparison of each stroke; with these stroke similarities, users can get to know which stroke they wrote well and which stroke they need to practice more. For example, the best stroke of user’s handwriting is the first stroke, with a similarity of 0.906372, and the worst stroke is the third stroke, with a similarity of 0.690590. Table 3(c) gives the composited evaluation score, which can show the overall quality of user’s practice. Here the φ and ω in (14) are both set as 0.5 in our experiment.We consulted several calligraphy teachers and asked them to evaluate experiment result. They concluded the result is relatively objective, which proves our approach is effective and satisfactory.


## 8. Conclusions

This paper presents the establishment of our vectorized Qi Gong calligraphy database, and we propose an effective evaluation approach by using angular difference relations, ICP algorithm, and shape features. In the proposed approach, character shape similarity can reflect the global whole structure and stroke arrangement of the character; and stroke shape similarity can reflect the local detail features. The proposed approach is comprehensive, and it is able to deal with the different situation of position, size, and tilt of user’s handwritten character without knowing what this character is. Experiment results show that this approach is feasible and effective. Furthermore, it can be extended to other calligraphy databases.



---

*Source: 4845092-2016-02-24.xml*