# Features from a Single Vector Pressure Stroke

Authors: Qiang Li; Changhai Yang; Zhao Zhang; Xi Wang; Yongjian Gong; Cuixian Xuan
Journal: Mathematical Problems in Engineering
 (2017)

---

## Abstract

Freehand sketching in a real-time 3D styling system presents a different way to create a 3D model from the traditional CAD system. Strokes are the most common and useful objects in the expression of a stylist’s intention by using the gesture commands and in the construction of geometries. Not only are they sketched freely as drawing on a paper with a pen, but also they can be converted automatically into spline curves and then can be used to form a surface. Therefore, it is necessary to investigate the features of stroke, the extraction and identification of these features, and the applications. Here, the features from a single vector pressure stroke have been discussed in detail according to their applications in an automotive freehand styling system in the early stage of conceptual design. The features have been divided into three parts: the input features, the calculable feature, and the added features. Over a hundred features have been defined and classified with the geometry or performance attributes. The features proposed have been applied in the identification of gesture commands, the expression of art vector stroke by pseudoantialiasing method, and a novel method to generate a spatial curve directly by the pressure of stroke in AutoSketch system.


---

## Body

## 1. Introduction

Strokes are not only used in the generation of geometries but also applied in many related manipulations to assist sketching, which make the freehand sketching system more natural and suitable for creative design. The most direct application is that the strokes are converted into images in a raster graphics system, for example, in Painter or Photoshop, or transformed into curves in a vector graphic system, for example, TEDDY [1], I Love Sketch system [2], or AutoSketch [3] (Figure 1), which is quite different from the curve generations in the traditional CAD systems. A multistroke combination method has been proposed by Li et al. [4–6]. In recent years, more features have been applied into AutoSketch system for the requirement of real-time 3D sketching [7, 8], especially the pressure information of digital pen that has been used to creature the spatial curve and express the style of stroke, in which more features from the strokes are calculated [9]. Strokes can be drawn like art sketching on a paper with a pencil or marker pen.Figure 1
Sketching in AutoSketch system.For the sketched strokes, one issue is to determine the geometries, for example, the curves from the strokes such as straight lines, arcs, or parabolic curves, and the geometry shapes such as triangles, rectangles, and circles [10–13]. Most of them are regular or standardized geometries and there are many methods to identify them, in which the segmentations are quite common methods to find the primitives from the strokes using features such as geometrical or velocity features [14, 15]. Another issue is to determine the meanings of gesture command sketched. Many gesture command strokes go with the sketching system. Some gesture strokes are designed for specific manipulations in I Love Sketch system (Figure 2). A scratch-out stroke means to delete an object, a roll stroke stands for an undo manipulation, and a small lasso stroke is to select a curve or set a subcoordinate system. The gesture command strokes in AutoSketch support manipulations such as select, undo, redo, and delete (Figure 3). Similar gesture strokes have also been presented in Feng et al.’s gesture-based handwriting mathematics editing system [16] (left) and Song’s ISID [17] (right) systems (Figure 4).Figure 2
Gesture strokes in I Love Sketch system.Figure 3
Gesture strokes in AutoSketch system.Figure 4
Gesture strokes in Feng’s system and ISID.Almost all the definitions of gesture command stroke depend on the techniques of identification [18]. The methods can be summarized into three aspects: the template matching techniques, the statistical analysis techniques, and the neural network techniques. However, it is necessary to dig out the implicit features from a single vector pressure stroke, which may be applied in many applications. Here, only the vector stroke has been discussed because the raster stroke is not easily obtained in a vector CAD system and is bad in real-time performance [19].A single vector pressure stroke is obtained easily in a vector graphic system with a sequence array, which consists of a series of points. The data is smaller than that of raster stroke relatively, which has a good real-time performance [20].The features discussed here have been investigated and implemented into AutoSketch system for the identification of standardized geometries and gesture commands. There are five parts of related research works for the development of AutoSketch system: the combination of multistrokes, the identification of sketched gesture commands, the standardization of freehand sketched geometries, the transformation of curves or surfaces from 2D to 3D, and the application of pressure information. This work related four projects: a novel algorithm from 2D sketch to 3D surface model in automotive styling (Science Fund Project of State Key Laboratory of Advanced Design and Manufacturing for Vehicle Body (SKLVBDM2006001)), study on the key technology of integration of 2D hand sketching and 3D automotive styling (State “863” Project (2008AA04Z110)), research on input method of 3D freehand sketching in automotive styling (Science and Technology Plan Projects of Jinhua City (2011-1-045)), and 3D automotive freehand styling system based on the pressure of digital pen and the combination of strokes (Science and Technology Plan Projects of Zhejiang Province (2013C31085)).These features can be classified into three parts: input, calculable, and added ones.


## 2. Input Features

The input features are obtained from the output of a digital pen (Figure5). They are put into an array with the data format of (xi,yi,Pi,θAPi,θEPi), and its size is n (Table 1 and Figure 1). Each point of a stroke contains the information of coordinates, pressure, azimuth angle, and elevation angle. The values of coordinates are within the screen of computer in pixel, where the width is w and the height is h.Table 1
Input features and formulae.
Number Feature Definition Formula and value 1 i Serial number of point i ∈ [ 1 , n ] 2 n Number of points n ≥ 1 3 p i ( x i , y i ) Coordinates on the screen p i ∈ [ ( 0,0 ) , ( w , h ) ] 4 P i Pressure of pen P i ∈ [ 0,255 ] 5 θ A P i Azimuth angle of pen θ A P ∈ [ 0,360 ] 6 θ E P i Elevation angle of pen θ EP ∈ [ 0 , 90 ° ]Figure 5
Input features.There are only the first four input features that have been used in AutoSketch system until now. The azimuth and elevation angles will be applied to investigate the characteristics of the stylist’s sketching in the future researches. Therefore, the following discussions are not related to the angles.


## 3. Calculable Features

Calculable features are those that can be calculated out directly from the input ones. There may be different calculable features according to the real applications. Generally, these features are, according to our researches, classified into six parts: extreme value, coordinate, length and width, angle, performance, and auxiliary features.


### 3.1. Extreme Value Features

There are two extreme value features,amin⁡ and amax⁡ (Table 2). The functions of min. and max. are used for finding the minimum and maximum values from a set of parameters, respectively. The parameter a will be replaced by the parameter x, y, or v as needed. The extreme values are used for the determination of the container of an object.Table 2
Calculation features.
Number Feature Definition Formula and value 1 a min ⁡ Min. value of parametera a min ⁡ = min ⁡ a i  a ∈ x , y , v 2 a max ⁡ Max. value of parametera a max ⁡ = max ⁡ { a i }  a ∈ { x , y , v }


### 3.2. Coordinate Features

A series of points contains the coordinates inX-Y plane. Some special coordinates are listed in Table 3.Table 3
Coordinate features.
Number Feature Definition Formula and value 1 B { b 1 , b 2 } Horizontal container of object b 1 x min ⁡ , y min ⁡, b2(xmax⁡,ymax⁡)  2 B 0 { c 1 , c 2 , c 3 , c 4 } General box container c 1 ( x 1 , y 1 ), c2(x2,y2), c3(x3,y3), c4(x4,y4)  3 c B ( x B , y B ) Center ofB x B = ( x m i n + x m a x ) 2 = ( x 1 + x 3 ) 2 y B = ( y min ⁡ + y max ⁡ ) 2 = ( y 1 + y 3 ) 2  4 o C ( x C , y C ) Centroid of convex x C = 1 6 A ∑ i = 1 m - 1 x i + x i + 1 x i y i + 1 - x i + 1 y i y C = 1 6 A ∑ i = 1 m - 1 ( y i + y i + 1 ) ( x i y i + 1 - x i + 1 y i )  5 o i ( x c i , y c i ) Arc center of 2 segments x c i = c e - b f a e - b d a = 2 ( x i - x i - 1 ) b = 2 ( y i - y i - 1 ) y c i = a f - c d a e - b d c = x i 2 + y i 2 - x i - 1 2 - x i - 1 2 d = 2 ( x i + 1 - x i ) e = 2 ( y i + 1 - y i ) f = x i + 1 2 + y i + 1 2 - x i 2 - x i 2  6 o S ( x - , y - ) Centroid of stroke x - = 1 n ∑ i = 1 n x i, y-=1n∑i=1nyi  7 B m i n p m 1 , p m 2 Min. container ofOB p m 1 = max ⁡ x b 1 , x b 3 , max ⁡ y b 1 , y b 3 p m 2 = ( m i n { x b 2 , x b 4 } , m a x { y b 2 , y b 4 } )  8 p c ( x c , y c ) Cross point of two segments when Segment 1 is vertical and Segment 2 is not vertical x c = x 1 d x 1 = 0, dx2≠0 y c = k 2 x 1 + b 2 Cross point of two segments when Segment 2 is vertical and Segment 1 is not vertical x c = x 3 d x 1 ≠ 0, dx2=0 y c = k 1 x 3 + b 1 Cross point of two segments when they are collinear x c = ( p m 1 x + p m 2 x ) 2 y c = p m 1 y + p m 2 y 2 Cross point of two segments in any other cases x c = ( b 1 - b 3 ) ( k 3 - k 1 ) y c = ( k 3 b 1 - k 1 b 3 ) ( k 3 - k 1 )  9 p K Knee point p t ∈ [ 0 , n - 2 ]  10 p I Inflection p I = ( k i - 2 - k i - 1 ) × ( k i - k i + 1 ) < 0  11 p K x, pKy Axial knee point P K a = D a i + D a i + 1, A∈{x,y} P K a ∈ { 0 :   yes , 1 :   repeat , 2 :   no }  12 C S Convex hull of stroke { p 0 , p 2 , … , p m } 3≤m≤nA container is a minimum rectangle or box including an object.B{b1,b2} stands for a simple horizontal container (Figure 6, left), which is represented by two diagonal points; another is a more general one B0{c1,c2,c3,c4} (right), which is smaller than the horizontal one and is represented by four points and a rotation angle αB (refer to Table 5).Figure 6
Box containers.The center of box containercB(xB,yB), the centroid of convex oC(xC,yC), and the centroid of stroke oS(x-,y-) are different (Figure 6). If two segments intersect each other, their containers must be overlapped (Figure 7), and there must exist a minimum box Bmin⁡(pm1,pm2) and the cross point of two segments pc(xc,yc) must be within the minimum box as well.Figure 7
Minimum box and special points.There are four cases in the calculation of cross point: the first segment is vertical, the second segment is vertical, two segments are collinear, and both are in general position. The knee pointpK and the inflection point pI are different. The former is a sharp turning and its tangent line does not cross the stroke. The latter is a smooth turning and its tangent line crosses the stroke. The axial knee point pKx or pKy is a turning point along the x-axis or y-axis, respectively.Two continuous and unparallel segments can be used to form an arc (Figure8). The arc center oi(xci,yci) and radius ri are certain. ri can be used as the radius of curvature of the point pi.Figure 8
Arc center, radius, and included angle.The convex hull of strokeCS is a convex polygon containing all the points of stroke [21]. There are quite many methods to find the convex hull, such as Gift-Wrapping, Graham-Scan, or QuickHull method. Gift-Wrapping is simple and fast enough for the point set of a stroke; therefore, it is applied to this work. At first, the point with the minimum y is the start point; secondly, the segments from the start point to the rest of the points are set up; thirdly, the angles of these segments with the X-axis are calculated out and then sorted; fourthly, the point with the minimum angle is added to the convex hull set; fifthly, the last three points are linked to two vector segments; if the second segment turns right, the last point in the convex hull is deleted; otherwise, it is as the current start point and then the second step is repeated until all the points are checked.


### 3.3. Length and Width Features

The lengths and widths are geometric features. Their positions are shown in Figure9 and the definitions are listed in Table 4. The length of segment di,i+1 and the length of stroke LS are very useful. The average radius of arc r- stands for the curling degree of stroke and the difference of radius Δr reflects the vibration of it. The dimensions of container wB, hB, and pB stand for the size of geometry. The length LSE between both ends of stroke is a span of stroke and the difference of two values dai is also a span between two points.Table 4
Length features.
Number Feature Definition Formula and value 1 d a i Difference of two values d a i = a i + 1 - a i  a ∈ { x , y , v } 2 b i Intercept of segment b i = y i - k i x i 3 d i , i + 1 Length of segment d i , i + 1 = p ⃑ i , i + 1 4 L S Length of stroke L S = ∑ i = 1 n - 1 d i , i + 1 5 w B Width ofB w B = x max ⁡ - x min ⁡ = d c 1 c 2 6 h B Height ofB h B = y max ⁡ - y min ⁡ = d c 2 c 3 7 p B Perimeter ofB p B = 2 w B + h B 8 L SE Length between both ends L SE = d 1 n 9 r i Radius of arc r i = d i , c i 10 r - Average radius of arc r - = 1 ( n - 2 ) ∑ i = 1 n - 2 r i 11 Δ r Difference of radius Δ r = r max ⁡ - r min ⁡Table 5
Angle features.
Number Feature Definition Formula and value 1 α B Rotation angle ofB α B = arctan ⁡ y 2 - y 1 x 2 - x 1 ∈ [ 0 , 360 ° ] 2 θ A i Azimuth angle of segment θ A i = arctan ⁡ y i + 1 - y i x i + 1 - x i ∈ { N , S , E , W , NE , NW , SE , SW } 3 θ A S E Azimuth angle ofLSE θ A S E = a r c t a n y n - y 1 x n - x 1 ∈ { N , S , E , W , NE , NW , SE , SW } 4 θ A S Azimuth angle of start θ A S = a r c t a n y 2 - y 1 x 2 - x 1 ∈ { N , S , E , W , NE , NW , SE , SW } 5 θ A E Azimuth angle of end θ A E = a r c t a n y n - y n - 1 x n - x n - 1 ∈ { N , S , E , W , NE , NW , SE , SW } 6 α S Rotation angle of segment α S = p ⃑ i - 1 , i × p ⃑ i , i + 1 ∈ { < 1,0 , > 1 } 7 α i Included angle α i = 180 π arccos ⁡ ( t ) ∈ { 0,180 ) t=di-1,i2+di,i+12-di-1,i+122di-1,idi,i+1Figure 9
Minimum box and special points.


### 3.4. Angle Features

The angles are also geometric features. Their size stands for the position relationship between two segments (Figures8 and 9). The value of azimuth angle θAi, θASE, θAS, or θAE is from 0 to 360°, which can be divided into eight zones, that is, east, west, north, south, northeast, northwest, southeast, and southwest, as shown in Table 5. However, the rotation angle of segment αS is not the real value in degree; it is a direction with the values of <1, 0, and >1, standing for turning left, collineation, and turning right, respectively. The azimuth angles θASE, θAS, and θAE are useful for some special applications. θASE is used to judge the general direction of stroke from start point to the end point. For example, the shapes of undo and redo gesture commands are quite similar; however, their θASE angles are opposite. θAS is the azimuth angle of start point and is used to judge the start direction of stroke, and θAE is the azimuth angle of end point and is used to judge the end direction of stroke. For example, the select command “✓” in Figure 3 is determined by these three angles. θAS should be around SE, θAE should be around NE, and θASE should also be around SE, which will limit effectively the shape of select command to a normal one.


### 3.5. Performance Features

Some features standing for the inner characteristics of a stroke are defined as the performance features (Table6).Table 6
Performance features.
Number Feature Definition Formula and value 1 S B Area ofB S B = w B h B 2 S C Area of convex S C = 1 2 ∑ i = 1 m - 1 ( x i y i + 1 - x i + 1 y i ) 3 n T L Times of turning left n T L = n TL + 1 αS<0 4 n T R Times of turning right n T R = n TR + 1 αS>0 5 n S Self-intersection times n S ∈ [ 0 , n - 3 ] 6 n K Number of knee points n K ∈ [ 0 , n - 2 ] 7 n K X Number ofx-axis knee points n K X ∈ [ 0 , n - 2 ] 8 n K Y Number ofy-axis knee points n K Y ∈ [ 0 , n - 2 ] 9 n I Number of inflection points n I ∈ [ 0 , n - 2 ] 10 k i Slope of segment k i = d y i d x i = t g θ A i 11 k B Aspect ratio ofB k B = h B w B kB∈{<1,=1,>1} 12 k T L Ratio of turning left k T L = n T L n T L + n T R × 100 % ∈ [ 0,100 ] 13 k T R Ratio of turning right k T R = n T R n T L + n T R × 100 % ∈ [ 0,100 ] 14 δ r max ⁡ Max. ratio ofr deviation δ r max ⁡ = ( r max ⁡ - r - ) r - × 100 % δ r min ⁡ Min. ratio ofr deviation δ r min ⁡ = ( r - - r min ⁡ ) r - × 100 % 15 v i Speed of point v i = d i t ≈ d i 16 v - Average speed of point v - = L S ( n - 1 ) 17 Δ v Size of speed Δ v = v max ⁡ - v min ⁡ 18 δ v max ⁡ Max. ratio ofv deviation δ v max ⁡ = ( v max ⁡ - v - ) v - × 100 % 19 δ v min ⁡ Min. ratio ofv deviation δ v min ⁡ = ( v - - v min ⁡ ) v - × 100 % 20 a i Acceleration of point a i = v i - v i - 1 t ≈ v i - v i - 1 ≈ d i - d i - 1The areas,SB and SC (Figure 6, left), represent the size of geometries [22]. The number of times of turning left nTLor right nTR stands for a kind of sketching pattern. The number of times of self-intersection nS represents the complexity of stroke trace; for instance, nS=1 (Figure 10, middle); the cross point pc may be different from the real one pc′ [23]. The slope of segment ki, similar to the azimuth angle of segment θAi, gives the direction of segment. The aspect ratio of container represents the shape of the box. The values with kB<1, kB=1, or kB>1 stand for the notion that the shape of the container is a flat rectangle, square, or tall rectangle, respectively (Figure 10, left). The ratios, kTL and kTR, reflect the level of parameter changed; for example, the stroke of α sign (Figure 10, middle) is completely turning right; however, the stroke of m sign may have kTL≈kTR (right). The speed vi, average speed v-, size of speed Δv, and acceleration ai stand for the performance of sketching habits. In addition, the speed can be used to find the turning points, where the speed is lower than that in other sections of stroke (Figure 10, right). The ratios of deviation, δrmax⁡, δrmin⁡, δvmax⁡, and δvmin⁡, reflect the vibration of the parameters.Figure 10
Some performance features.


### 3.6. Auxiliary Features

Some features are used for the calculation of other features (Table7). The change direction of segment in Y-axis Dyi, for example, is defined as {1, 0, −1} for the stroke going up or down, respectively (Figure 11, left). If two containers are overlapped, the value OB is 1, otherwise 0 (Figure 11, middle). If two segments are intersected in a general case, the value of Ps is 2; for the special case of collineation, it is 1, otherwise 0 (Figure 11, right). These features represent the relationship of two parameters, such as the relationship of direction, overlapping, or position.Table 7
Auxiliary features.
Number Feature Definition Formula and value 1 D x i Direction of change D a i = 1 d a i > 0 0 d a i = 0 , - 1 d a i < 0 ,  a ∈ { x , y }  D y i 2 O B Overlapping ofB1 and B2 O B = 1 x b 2 ≥ x b 3  ∣ x b 4 ≥ x b 1 ∣ y b 2 ≥ y b 3 ∣ y b 4 ≥ y b 1 0 otherwise  3 P s Position of two segments P s = 2 k 1 ≠ k 2 1 k 1 = k 2 ,  b 1 = b 2 0 k 1 = k 2 ,  b 1 ≠ b 2Figure 11
Position relationship and values.


## 3.1. Extreme Value Features

There are two extreme value features,amin⁡ and amax⁡ (Table 2). The functions of min. and max. are used for finding the minimum and maximum values from a set of parameters, respectively. The parameter a will be replaced by the parameter x, y, or v as needed. The extreme values are used for the determination of the container of an object.Table 2
Calculation features.
Number Feature Definition Formula and value 1 a min ⁡ Min. value of parametera a min ⁡ = min ⁡ a i  a ∈ x , y , v 2 a max ⁡ Max. value of parametera a max ⁡ = max ⁡ { a i }  a ∈ { x , y , v }


## 3.2. Coordinate Features

A series of points contains the coordinates inX-Y plane. Some special coordinates are listed in Table 3.Table 3
Coordinate features.
Number Feature Definition Formula and value 1 B { b 1 , b 2 } Horizontal container of object b 1 x min ⁡ , y min ⁡, b2(xmax⁡,ymax⁡)  2 B 0 { c 1 , c 2 , c 3 , c 4 } General box container c 1 ( x 1 , y 1 ), c2(x2,y2), c3(x3,y3), c4(x4,y4)  3 c B ( x B , y B ) Center ofB x B = ( x m i n + x m a x ) 2 = ( x 1 + x 3 ) 2 y B = ( y min ⁡ + y max ⁡ ) 2 = ( y 1 + y 3 ) 2  4 o C ( x C , y C ) Centroid of convex x C = 1 6 A ∑ i = 1 m - 1 x i + x i + 1 x i y i + 1 - x i + 1 y i y C = 1 6 A ∑ i = 1 m - 1 ( y i + y i + 1 ) ( x i y i + 1 - x i + 1 y i )  5 o i ( x c i , y c i ) Arc center of 2 segments x c i = c e - b f a e - b d a = 2 ( x i - x i - 1 ) b = 2 ( y i - y i - 1 ) y c i = a f - c d a e - b d c = x i 2 + y i 2 - x i - 1 2 - x i - 1 2 d = 2 ( x i + 1 - x i ) e = 2 ( y i + 1 - y i ) f = x i + 1 2 + y i + 1 2 - x i 2 - x i 2  6 o S ( x - , y - ) Centroid of stroke x - = 1 n ∑ i = 1 n x i, y-=1n∑i=1nyi  7 B m i n p m 1 , p m 2 Min. container ofOB p m 1 = max ⁡ x b 1 , x b 3 , max ⁡ y b 1 , y b 3 p m 2 = ( m i n { x b 2 , x b 4 } , m a x { y b 2 , y b 4 } )  8 p c ( x c , y c ) Cross point of two segments when Segment 1 is vertical and Segment 2 is not vertical x c = x 1 d x 1 = 0, dx2≠0 y c = k 2 x 1 + b 2 Cross point of two segments when Segment 2 is vertical and Segment 1 is not vertical x c = x 3 d x 1 ≠ 0, dx2=0 y c = k 1 x 3 + b 1 Cross point of two segments when they are collinear x c = ( p m 1 x + p m 2 x ) 2 y c = p m 1 y + p m 2 y 2 Cross point of two segments in any other cases x c = ( b 1 - b 3 ) ( k 3 - k 1 ) y c = ( k 3 b 1 - k 1 b 3 ) ( k 3 - k 1 )  9 p K Knee point p t ∈ [ 0 , n - 2 ]  10 p I Inflection p I = ( k i - 2 - k i - 1 ) × ( k i - k i + 1 ) < 0  11 p K x, pKy Axial knee point P K a = D a i + D a i + 1, A∈{x,y} P K a ∈ { 0 :   yes , 1 :   repeat , 2 :   no }  12 C S Convex hull of stroke { p 0 , p 2 , … , p m } 3≤m≤nA container is a minimum rectangle or box including an object.B{b1,b2} stands for a simple horizontal container (Figure 6, left), which is represented by two diagonal points; another is a more general one B0{c1,c2,c3,c4} (right), which is smaller than the horizontal one and is represented by four points and a rotation angle αB (refer to Table 5).Figure 6
Box containers.The center of box containercB(xB,yB), the centroid of convex oC(xC,yC), and the centroid of stroke oS(x-,y-) are different (Figure 6). If two segments intersect each other, their containers must be overlapped (Figure 7), and there must exist a minimum box Bmin⁡(pm1,pm2) and the cross point of two segments pc(xc,yc) must be within the minimum box as well.Figure 7
Minimum box and special points.There are four cases in the calculation of cross point: the first segment is vertical, the second segment is vertical, two segments are collinear, and both are in general position. The knee pointpK and the inflection point pI are different. The former is a sharp turning and its tangent line does not cross the stroke. The latter is a smooth turning and its tangent line crosses the stroke. The axial knee point pKx or pKy is a turning point along the x-axis or y-axis, respectively.Two continuous and unparallel segments can be used to form an arc (Figure8). The arc center oi(xci,yci) and radius ri are certain. ri can be used as the radius of curvature of the point pi.Figure 8
Arc center, radius, and included angle.The convex hull of strokeCS is a convex polygon containing all the points of stroke [21]. There are quite many methods to find the convex hull, such as Gift-Wrapping, Graham-Scan, or QuickHull method. Gift-Wrapping is simple and fast enough for the point set of a stroke; therefore, it is applied to this work. At first, the point with the minimum y is the start point; secondly, the segments from the start point to the rest of the points are set up; thirdly, the angles of these segments with the X-axis are calculated out and then sorted; fourthly, the point with the minimum angle is added to the convex hull set; fifthly, the last three points are linked to two vector segments; if the second segment turns right, the last point in the convex hull is deleted; otherwise, it is as the current start point and then the second step is repeated until all the points are checked.


## 3.3. Length and Width Features

The lengths and widths are geometric features. Their positions are shown in Figure9 and the definitions are listed in Table 4. The length of segment di,i+1 and the length of stroke LS are very useful. The average radius of arc r- stands for the curling degree of stroke and the difference of radius Δr reflects the vibration of it. The dimensions of container wB, hB, and pB stand for the size of geometry. The length LSE between both ends of stroke is a span of stroke and the difference of two values dai is also a span between two points.Table 4
Length features.
Number Feature Definition Formula and value 1 d a i Difference of two values d a i = a i + 1 - a i  a ∈ { x , y , v } 2 b i Intercept of segment b i = y i - k i x i 3 d i , i + 1 Length of segment d i , i + 1 = p ⃑ i , i + 1 4 L S Length of stroke L S = ∑ i = 1 n - 1 d i , i + 1 5 w B Width ofB w B = x max ⁡ - x min ⁡ = d c 1 c 2 6 h B Height ofB h B = y max ⁡ - y min ⁡ = d c 2 c 3 7 p B Perimeter ofB p B = 2 w B + h B 8 L SE Length between both ends L SE = d 1 n 9 r i Radius of arc r i = d i , c i 10 r - Average radius of arc r - = 1 ( n - 2 ) ∑ i = 1 n - 2 r i 11 Δ r Difference of radius Δ r = r max ⁡ - r min ⁡Table 5
Angle features.
Number Feature Definition Formula and value 1 α B Rotation angle ofB α B = arctan ⁡ y 2 - y 1 x 2 - x 1 ∈ [ 0 , 360 ° ] 2 θ A i Azimuth angle of segment θ A i = arctan ⁡ y i + 1 - y i x i + 1 - x i ∈ { N , S , E , W , NE , NW , SE , SW } 3 θ A S E Azimuth angle ofLSE θ A S E = a r c t a n y n - y 1 x n - x 1 ∈ { N , S , E , W , NE , NW , SE , SW } 4 θ A S Azimuth angle of start θ A S = a r c t a n y 2 - y 1 x 2 - x 1 ∈ { N , S , E , W , NE , NW , SE , SW } 5 θ A E Azimuth angle of end θ A E = a r c t a n y n - y n - 1 x n - x n - 1 ∈ { N , S , E , W , NE , NW , SE , SW } 6 α S Rotation angle of segment α S = p ⃑ i - 1 , i × p ⃑ i , i + 1 ∈ { < 1,0 , > 1 } 7 α i Included angle α i = 180 π arccos ⁡ ( t ) ∈ { 0,180 ) t=di-1,i2+di,i+12-di-1,i+122di-1,idi,i+1Figure 9
Minimum box and special points.


## 3.4. Angle Features

The angles are also geometric features. Their size stands for the position relationship between two segments (Figures8 and 9). The value of azimuth angle θAi, θASE, θAS, or θAE is from 0 to 360°, which can be divided into eight zones, that is, east, west, north, south, northeast, northwest, southeast, and southwest, as shown in Table 5. However, the rotation angle of segment αS is not the real value in degree; it is a direction with the values of <1, 0, and >1, standing for turning left, collineation, and turning right, respectively. The azimuth angles θASE, θAS, and θAE are useful for some special applications. θASE is used to judge the general direction of stroke from start point to the end point. For example, the shapes of undo and redo gesture commands are quite similar; however, their θASE angles are opposite. θAS is the azimuth angle of start point and is used to judge the start direction of stroke, and θAE is the azimuth angle of end point and is used to judge the end direction of stroke. For example, the select command “✓” in Figure 3 is determined by these three angles. θAS should be around SE, θAE should be around NE, and θASE should also be around SE, which will limit effectively the shape of select command to a normal one.


## 3.5. Performance Features

Some features standing for the inner characteristics of a stroke are defined as the performance features (Table6).Table 6
Performance features.
Number Feature Definition Formula and value 1 S B Area ofB S B = w B h B 2 S C Area of convex S C = 1 2 ∑ i = 1 m - 1 ( x i y i + 1 - x i + 1 y i ) 3 n T L Times of turning left n T L = n TL + 1 αS<0 4 n T R Times of turning right n T R = n TR + 1 αS>0 5 n S Self-intersection times n S ∈ [ 0 , n - 3 ] 6 n K Number of knee points n K ∈ [ 0 , n - 2 ] 7 n K X Number ofx-axis knee points n K X ∈ [ 0 , n - 2 ] 8 n K Y Number ofy-axis knee points n K Y ∈ [ 0 , n - 2 ] 9 n I Number of inflection points n I ∈ [ 0 , n - 2 ] 10 k i Slope of segment k i = d y i d x i = t g θ A i 11 k B Aspect ratio ofB k B = h B w B kB∈{<1,=1,>1} 12 k T L Ratio of turning left k T L = n T L n T L + n T R × 100 % ∈ [ 0,100 ] 13 k T R Ratio of turning right k T R = n T R n T L + n T R × 100 % ∈ [ 0,100 ] 14 δ r max ⁡ Max. ratio ofr deviation δ r max ⁡ = ( r max ⁡ - r - ) r - × 100 % δ r min ⁡ Min. ratio ofr deviation δ r min ⁡ = ( r - - r min ⁡ ) r - × 100 % 15 v i Speed of point v i = d i t ≈ d i 16 v - Average speed of point v - = L S ( n - 1 ) 17 Δ v Size of speed Δ v = v max ⁡ - v min ⁡ 18 δ v max ⁡ Max. ratio ofv deviation δ v max ⁡ = ( v max ⁡ - v - ) v - × 100 % 19 δ v min ⁡ Min. ratio ofv deviation δ v min ⁡ = ( v - - v min ⁡ ) v - × 100 % 20 a i Acceleration of point a i = v i - v i - 1 t ≈ v i - v i - 1 ≈ d i - d i - 1The areas,SB and SC (Figure 6, left), represent the size of geometries [22]. The number of times of turning left nTLor right nTR stands for a kind of sketching pattern. The number of times of self-intersection nS represents the complexity of stroke trace; for instance, nS=1 (Figure 10, middle); the cross point pc may be different from the real one pc′ [23]. The slope of segment ki, similar to the azimuth angle of segment θAi, gives the direction of segment. The aspect ratio of container represents the shape of the box. The values with kB<1, kB=1, or kB>1 stand for the notion that the shape of the container is a flat rectangle, square, or tall rectangle, respectively (Figure 10, left). The ratios, kTL and kTR, reflect the level of parameter changed; for example, the stroke of α sign (Figure 10, middle) is completely turning right; however, the stroke of m sign may have kTL≈kTR (right). The speed vi, average speed v-, size of speed Δv, and acceleration ai stand for the performance of sketching habits. In addition, the speed can be used to find the turning points, where the speed is lower than that in other sections of stroke (Figure 10, right). The ratios of deviation, δrmax⁡, δrmin⁡, δvmax⁡, and δvmin⁡, reflect the vibration of the parameters.Figure 10
Some performance features.


## 3.6. Auxiliary Features

Some features are used for the calculation of other features (Table7). The change direction of segment in Y-axis Dyi, for example, is defined as {1, 0, −1} for the stroke going up or down, respectively (Figure 11, left). If two containers are overlapped, the value OB is 1, otherwise 0 (Figure 11, middle). If two segments are intersected in a general case, the value of Ps is 2; for the special case of collineation, it is 1, otherwise 0 (Figure 11, right). These features represent the relationship of two parameters, such as the relationship of direction, overlapping, or position.Table 7
Auxiliary features.
Number Feature Definition Formula and value 1 D x i Direction of change D a i = 1 d a i > 0 0 d a i = 0 , - 1 d a i < 0 ,  a ∈ { x , y }  D y i 2 O B Overlapping ofB1 and B2 O B = 1 x b 2 ≥ x b 3  ∣ x b 4 ≥ x b 1 ∣ y b 2 ≥ y b 3 ∣ y b 4 ≥ y b 1 0 otherwise  3 P s Position of two segments P s = 2 k 1 ≠ k 2 1 k 1 = k 2 ,  b 1 = b 2 0 k 1 = k 2 ,  b 1 ≠ b 2Figure 11
Position relationship and values.


## 4. Added Features

Added features depend on the real applications to some extent. Here, only three kinds of features are discussed. Those are control features of stroke expression, calculated features, and curve features.


### 4.1. Control Features of Stroke Expression

Unlike the data of image, the data of stroke does not contain features such as color, grayscale, pen type, and width. The stroke can be drawn as natural as possible in AutoSketch with Chinese calligraphy art effect. Therefore, the pressure information is added to control the width and color of stroke. An example of gesture command stroke is shown in Figure12, and the related parameter values are listed in Table 8. The first nine features (Table 8) are switch parameters with the value of 1 or 0, which stands for yes or no attributed to the control of the display status of stroke, respectively. There are two color modes for filling, color or grayscale. The color is in RGB with the values from 0 to 255. The transparency value is from 0 to 100. The rest of the values are in pixel.Table 8
Stroke expression features.
Number Feature Definition Formula and value Example 1 D Display stroke D ∈ { Y , N } Y 2 D P Display point D P ∈ { Y , N } Y 3 D S Display stroke D S ∈ { Y , N } Y 4 PR Pressure into radius P R ∈ { Y , N } Y 5 P C Pressure into color P C ∈ { Y , N } Y 6 F Fill withC/G F ∈ { Y , N } Y 7 S Color or radius change S ∈ { Y , N } Y 8 E Edge antialiasing E ∈ { Y , N } Y 9 Z Zone of affection Z ∈ { Y , N } Y 10 M Color or grayscale M ∈ { C , G } C 11 K Width or radius scale K ∈ [ 1,100 ] 1 12 T Transparency of stroke T ∈ [ 0,100 ] 1 13 R S Start radius of stroke R S ∈ [ 1,100 ] 6 14 R E End radius of stroke R E ∈ [ R S , 100 ] 42 15 W E Edge width of stroke W E ∈ [ 1,10 ] 5 16 W P Width of pen W p ∈ [ 1,10 ] 1 17 C S Start color of stroke C S ∈ { R S , G S , B S } 243,20,8 7 18 C E End color of stroke C E ∈ { R E , G E , B E } 103,182,228Figure 12
The effect of a select gesture command.


### 4.2. Calculated Features

In order to express a vivid stroke and use the pressure feature in further applications, some calculated features have been proposed (Table9).Table 9
Calculated expression features.
Number Feature Definition Formula and value 1 R i Pressure to radius R i = R S + ( R E - R S ) P i 255 2 R G B Pressure to color { R i , G i , B i } = { 255 - P s , P s } 3 n c Number of circles n c = max ⁡ { x i - x i - 1 , y i - y i - 1 } 4 k s Step k s = k d n ,  k d ∈ ( 0,10 ] 5 R j Transit radius R j = R i - 1 + ( R i - R i - 1 ) k s j ,  j ∈ { 0 , n } 6 G S Stroke color G S ∈ { 0,255 } 7 G B Background color G B ∈ { 0,255 } 8 G E Edge color G E = G S - 2 ( G S - G B ) 3 9 G M Middle color G M = G S - ( G S - G B ) 3 10 A Opacity A = 1.0 - T 100 ,  A ∈ [ 0,1 ] 11 Δ T Transit transparency Δ T = 100 - 100 - T 0 ⋅ 1 + i 1 - 1 W E 1 W E 2 ,  i = 1 W E 12 p i a, pib Normal points of influence zone x i a = x i + k 4 r i y i a = y i + k 5 r i x i b = x i - k 4 r i y i b = y i - k 5 r i k 4 = Δ x m Δ x m 2 + Δ y m 2 , k 1 = r i d 1 k 5 = Δ y m Δ x m 2 + Δ y m 2 , k 2 = r i d 2 Δ x m = k 1 d x 1 + k 2 d x 2 Δ y m = k 1 d y 1 + k 2 d y 2The pressure of stroke can be converted into the radiusRi or width WP of pen within the start radius RS and the end radius RE; it can also be transformed into RGB color or grayscale, using the value of 255-Ps or Ps. If distance between two points is quite large, the stroke may be intermittent (Figure 13(a)), and it should use much more circles to fill the gaps. nc is the number of circles used for filling the gap between two points. The step ks is controlled by the number nc and density ks of circles. Because the pressures of two consecutive points are different, the converted radiuses must be different, and the stroke between two points may be shrunk or expanded sharply and is not smooth at the edge of the stroke (Figure 13(b)). Therefore, the radiuses between two points should be changed gradually. The transit radius Rj is controlled by ks. The color of stroke should be changed gradually in the same way; otherwise, the stroke will look like the one shown in Figure 13(c).Figure 13
Position relationship and values.Even after doing this, the stroke still looks like a zigzag at the edge, and it cannot be smoothed like image antialiasing. Therefore, a pseudoantialiasing method is applied to smooth the edge of the stroke. The colors can be divided into four parts: the background colorGB, the stroke color GS, the edge color GE, and the middle color GM. The last two can be calculated out once the stroke and background colors are known. Sometimes, the opacity value A[0.1] is applied to call some functions so that the value of transparency T[0,100] should be converted into the opacity value, and vice versa. Because the stroke is drawn repeatedly with circles, the transparency should also be changed gradually; the transit transparency ΔT is determined by the width of edge WE.The pressure of stroke can also be used to control the influence zone of pressure (Figure14), which is an area of stroke or surface changed in the manipulation of stroke or surface modification. The coordinates pia and pib can be obtained according to the radius ri, which is converted from the pressure.Figure 14
Influence zone of pressure.


### 4.3. Curve Features

There are quite many features coming from the relationship of parameters, such asX-Y, X-P, and X-V, which are discussed above. However, from a stroke, there are still some other relationships such as X-θAP or X-θEP (Table 10). A stroke S contains a lot of points; some of them are actually the noise points which make the stroke unsmooth. Therefore, the stroke should be preprocessed and compressed with a few good points to become a smooth curve SC and is drawn out using a spline SS, which is compressed further by the application of some curve fitting algorithms. In addition, the knee point curve SK is needed for some special applications, such as the identification of gesture commands and geometries. The original pressure curve SXP corresponding to the stroke cannot be applied directly. Similarly, it should also be compressed and smoothed to the curve SXPC, which is then translated to the X-axis and becomes another curve SXPG, where the start point is set to the origin o. It is then rotated along the origin o to make both ends of the curve SXPG become locked on the X-axis and become the curve SXPE. The curve SXPE may be fit into a parabola curve SXPP for controlling the stroke changing in one direction (z direction in parametric space), which can control easily the shape of spatial curve. The pressure curve X-P can be mixed with the stroke in X-Y to form a spatial curve SXYZ consequently while the pressure is converted into Z to some extent (Figure 15).Table 10
Curve features.
Number Feature Definition Formula and value 1 S Original stroke inX-Y S = f ( x , y ) 2 S C Compressed curve inX-Y S C = f ( x ′ , y ′ ) 3 S K Knee point curve inX-Y S K = f ( x K , y K ) 4 S S Spline curve inX-Y S S = f ( x ′ , y ′ ) 5 S V Speed curve inX-V S V = f ( x , v ) 6 S a Acceleration curve inX-a S a = f ( x , a ) 7 S X P Pressure curve inX-P S X P = f ( x , P ) 8 S X P C Compressed pressure curve S X P C = f ( x C , P C ) 9 S X P G Generalized pressure curve S X P G = f ( x C , P G ) 10 S X P E End-locked pressure curve S X P E = f ( x C , P E ) 11 S X P A Arc-fitting pressure curve S X P A = f ( x C , P A ) 12 S X P P Parabola-fitting pressure curve S X P P = f ( x C , P P ) 13 S X P Z Pressure-to-Z curve S X P Z = f ( x C , z C ) 14 S X Y Z Spatial curve S X Y Z = f(xC,yC,zC) 15 S X A Original stroke inX-θAP S X A = f ( x , θ A P ) 16 S X E Original stroke inX-θEP S X E = f ( x , θ E P )Figure 15
Some strokes and pressure curves.Currently, the curvesSXA and SXE have not been used yet in AutoSketch. However, they give the new dimensions in the parametric space like the curve SXP and will be applied in further researches.


## 4.1. Control Features of Stroke Expression

Unlike the data of image, the data of stroke does not contain features such as color, grayscale, pen type, and width. The stroke can be drawn as natural as possible in AutoSketch with Chinese calligraphy art effect. Therefore, the pressure information is added to control the width and color of stroke. An example of gesture command stroke is shown in Figure12, and the related parameter values are listed in Table 8. The first nine features (Table 8) are switch parameters with the value of 1 or 0, which stands for yes or no attributed to the control of the display status of stroke, respectively. There are two color modes for filling, color or grayscale. The color is in RGB with the values from 0 to 255. The transparency value is from 0 to 100. The rest of the values are in pixel.Table 8
Stroke expression features.
Number Feature Definition Formula and value Example 1 D Display stroke D ∈ { Y , N } Y 2 D P Display point D P ∈ { Y , N } Y 3 D S Display stroke D S ∈ { Y , N } Y 4 PR Pressure into radius P R ∈ { Y , N } Y 5 P C Pressure into color P C ∈ { Y , N } Y 6 F Fill withC/G F ∈ { Y , N } Y 7 S Color or radius change S ∈ { Y , N } Y 8 E Edge antialiasing E ∈ { Y , N } Y 9 Z Zone of affection Z ∈ { Y , N } Y 10 M Color or grayscale M ∈ { C , G } C 11 K Width or radius scale K ∈ [ 1,100 ] 1 12 T Transparency of stroke T ∈ [ 0,100 ] 1 13 R S Start radius of stroke R S ∈ [ 1,100 ] 6 14 R E End radius of stroke R E ∈ [ R S , 100 ] 42 15 W E Edge width of stroke W E ∈ [ 1,10 ] 5 16 W P Width of pen W p ∈ [ 1,10 ] 1 17 C S Start color of stroke C S ∈ { R S , G S , B S } 243,20,8 7 18 C E End color of stroke C E ∈ { R E , G E , B E } 103,182,228Figure 12
The effect of a select gesture command.


## 4.2. Calculated Features

In order to express a vivid stroke and use the pressure feature in further applications, some calculated features have been proposed (Table9).Table 9
Calculated expression features.
Number Feature Definition Formula and value 1 R i Pressure to radius R i = R S + ( R E - R S ) P i 255 2 R G B Pressure to color { R i , G i , B i } = { 255 - P s , P s } 3 n c Number of circles n c = max ⁡ { x i - x i - 1 , y i - y i - 1 } 4 k s Step k s = k d n ,  k d ∈ ( 0,10 ] 5 R j Transit radius R j = R i - 1 + ( R i - R i - 1 ) k s j ,  j ∈ { 0 , n } 6 G S Stroke color G S ∈ { 0,255 } 7 G B Background color G B ∈ { 0,255 } 8 G E Edge color G E = G S - 2 ( G S - G B ) 3 9 G M Middle color G M = G S - ( G S - G B ) 3 10 A Opacity A = 1.0 - T 100 ,  A ∈ [ 0,1 ] 11 Δ T Transit transparency Δ T = 100 - 100 - T 0 ⋅ 1 + i 1 - 1 W E 1 W E 2 ,  i = 1 W E 12 p i a, pib Normal points of influence zone x i a = x i + k 4 r i y i a = y i + k 5 r i x i b = x i - k 4 r i y i b = y i - k 5 r i k 4 = Δ x m Δ x m 2 + Δ y m 2 , k 1 = r i d 1 k 5 = Δ y m Δ x m 2 + Δ y m 2 , k 2 = r i d 2 Δ x m = k 1 d x 1 + k 2 d x 2 Δ y m = k 1 d y 1 + k 2 d y 2The pressure of stroke can be converted into the radiusRi or width WP of pen within the start radius RS and the end radius RE; it can also be transformed into RGB color or grayscale, using the value of 255-Ps or Ps. If distance between two points is quite large, the stroke may be intermittent (Figure 13(a)), and it should use much more circles to fill the gaps. nc is the number of circles used for filling the gap between two points. The step ks is controlled by the number nc and density ks of circles. Because the pressures of two consecutive points are different, the converted radiuses must be different, and the stroke between two points may be shrunk or expanded sharply and is not smooth at the edge of the stroke (Figure 13(b)). Therefore, the radiuses between two points should be changed gradually. The transit radius Rj is controlled by ks. The color of stroke should be changed gradually in the same way; otherwise, the stroke will look like the one shown in Figure 13(c).Figure 13
Position relationship and values.Even after doing this, the stroke still looks like a zigzag at the edge, and it cannot be smoothed like image antialiasing. Therefore, a pseudoantialiasing method is applied to smooth the edge of the stroke. The colors can be divided into four parts: the background colorGB, the stroke color GS, the edge color GE, and the middle color GM. The last two can be calculated out once the stroke and background colors are known. Sometimes, the opacity value A[0.1] is applied to call some functions so that the value of transparency T[0,100] should be converted into the opacity value, and vice versa. Because the stroke is drawn repeatedly with circles, the transparency should also be changed gradually; the transit transparency ΔT is determined by the width of edge WE.The pressure of stroke can also be used to control the influence zone of pressure (Figure14), which is an area of stroke or surface changed in the manipulation of stroke or surface modification. The coordinates pia and pib can be obtained according to the radius ri, which is converted from the pressure.Figure 14
Influence zone of pressure.


## 4.3. Curve Features

There are quite many features coming from the relationship of parameters, such asX-Y, X-P, and X-V, which are discussed above. However, from a stroke, there are still some other relationships such as X-θAP or X-θEP (Table 10). A stroke S contains a lot of points; some of them are actually the noise points which make the stroke unsmooth. Therefore, the stroke should be preprocessed and compressed with a few good points to become a smooth curve SC and is drawn out using a spline SS, which is compressed further by the application of some curve fitting algorithms. In addition, the knee point curve SK is needed for some special applications, such as the identification of gesture commands and geometries. The original pressure curve SXP corresponding to the stroke cannot be applied directly. Similarly, it should also be compressed and smoothed to the curve SXPC, which is then translated to the X-axis and becomes another curve SXPG, where the start point is set to the origin o. It is then rotated along the origin o to make both ends of the curve SXPG become locked on the X-axis and become the curve SXPE. The curve SXPE may be fit into a parabola curve SXPP for controlling the stroke changing in one direction (z direction in parametric space), which can control easily the shape of spatial curve. The pressure curve X-P can be mixed with the stroke in X-Y to form a spatial curve SXYZ consequently while the pressure is converted into Z to some extent (Figure 15).Table 10
Curve features.
Number Feature Definition Formula and value 1 S Original stroke inX-Y S = f ( x , y ) 2 S C Compressed curve inX-Y S C = f ( x ′ , y ′ ) 3 S K Knee point curve inX-Y S K = f ( x K , y K ) 4 S S Spline curve inX-Y S S = f ( x ′ , y ′ ) 5 S V Speed curve inX-V S V = f ( x , v ) 6 S a Acceleration curve inX-a S a = f ( x , a ) 7 S X P Pressure curve inX-P S X P = f ( x , P ) 8 S X P C Compressed pressure curve S X P C = f ( x C , P C ) 9 S X P G Generalized pressure curve S X P G = f ( x C , P G ) 10 S X P E End-locked pressure curve S X P E = f ( x C , P E ) 11 S X P A Arc-fitting pressure curve S X P A = f ( x C , P A ) 12 S X P P Parabola-fitting pressure curve S X P P = f ( x C , P P ) 13 S X P Z Pressure-to-Z curve S X P Z = f ( x C , z C ) 14 S X Y Z Spatial curve S X Y Z = f(xC,yC,zC) 15 S X A Original stroke inX-θAP S X A = f ( x , θ A P ) 16 S X E Original stroke inX-θEP S X E = f ( x , θ E P )Figure 15
Some strokes and pressure curves.Currently, the curvesSXA and SXE have not been used yet in AutoSketch. However, they give the new dimensions in the parametric space like the curve SXP and will be applied in further researches.


## 5. Validation of Features

All the features have been applied in AutoSketch for the identification of gesture commands listed in Figure3, the expression of the art strokes, and the generation of spatial curve by the pressure of stroke directly.


### 5.1. Identification of Gesture Commands

The features in Tables1~7 have been used to determine the commands listed in Figure 3 according to the combinations of the special conditions, as shown in Table 11. The trials demonstrate that the identification of gesture commands is quite satisfied as shown in Table 12.Table 11
Some identifying conditions.
Number Cmds. Identifying conditions 1 Select n S = 1 ,   n K = 0 ,   θ AS = S E ∣ S, θAE=NE∣N,kSKE=LKE-LSKLKE+LSK>-0.2 2 Undo n S = 1 ,   n K ≥ 2,(θASE>157.5°∣θASE<-90°) 3 Redo n S = 1 ,   n K ≥ 2 ,   ( - 22.5 ° < θ A S E < 90 ° ) 4 Delete n S = 0 ,   n K > 3 ,   ( α 1 ≥ 15 ° ∣ α n K ≥ 15 ° ) 5 Smooth n = 2 ∣ ( n K = 2 ,   n = 4 ,   N S ≠ 1 ) 6 Break n K = 2 ,   n S = 1 ,   ( - 157.5 ° < θ A S E < - 22.5 ° )Table 12
Evaluation of gesture commands sketched.
Cmd. User score Err. T Min. Max. Aver. 1 2 3 4 5 Rate Select 94 93 98 95 94 1.85 4.43 3 8 94.8 Undo 96 95 97 94 96 1.75 3.69 4 97 95.6 Redo 94 95 98 96 95 1.75 3.80 94 98 95.6 Delete 95 98 96 95 98 1.95 4.52 95 98 96.4 Smooth 96 90 98 96 98 2.37 5.22 90 98 95.6 Break 97 97 98 96 89 1.80 5.37 89 98 95.4


### 5.2. Expression of Pressure Stroke

The features in Tables8~9 have been used to express a pressure vector stroke. For real-time application, the method using the above features is called the pseudoantialiasing method in order to differentiate it from the antialiasing method of raster image in image processing. The style of stroke can be set in the attributes settings window, as shown in Figure 16. There are five different styles shown in the same time to check which one is better. The types of attributes and the values are listed in Table 13.Table 13
Attributes and values of stroke.
Type Value Number 1 2 3 4 5 Stroke T1 T2 T3 T4 Final D Y Y Y Y Y D P Y Y N N N D S N N Y Y Y P R Y Y Y Y Y P C Y Y Y Y Y F N N Y Y Y S N N N Y Y E N N N Y Y Z N N N N Y M G C C C C K 1 1 1 1 1 T 1 1 96 1 1 R S 2 8 9 6 6 R E 2 42 63 42 42 W E 5 5 5 5 5 W P 1 1 1 1 1 C S 232,242,2 1 255,0 , 0 255,0 , 0 255,0 , 0 243,20,8 7 C E 91,98,22 5 0,255 , 0 0,0 , 25 5 0,255 , 0 103,182,22 8Figure 16
Test results of a gesture stroke.


### 5.3. Generation of Spatial Curve

The features in Table10 have been used to generate a spatial curve directly by the pressure of stroke. For instance, a pressure stroke is drawn in XZ plane, and a spatial curve SXPZ is created immediately by choosing the direction in Y+, as shown in Figure 17. The mirror stroke is shown to demonstrate that the curve is a spatial one, not a planar one.Figure 17
Draw directly a spatial curve.


## 5.1. Identification of Gesture Commands

The features in Tables1~7 have been used to determine the commands listed in Figure 3 according to the combinations of the special conditions, as shown in Table 11. The trials demonstrate that the identification of gesture commands is quite satisfied as shown in Table 12.Table 11
Some identifying conditions.
Number Cmds. Identifying conditions 1 Select n S = 1 ,   n K = 0 ,   θ AS = S E ∣ S, θAE=NE∣N,kSKE=LKE-LSKLKE+LSK>-0.2 2 Undo n S = 1 ,   n K ≥ 2,(θASE>157.5°∣θASE<-90°) 3 Redo n S = 1 ,   n K ≥ 2 ,   ( - 22.5 ° < θ A S E < 90 ° ) 4 Delete n S = 0 ,   n K > 3 ,   ( α 1 ≥ 15 ° ∣ α n K ≥ 15 ° ) 5 Smooth n = 2 ∣ ( n K = 2 ,   n = 4 ,   N S ≠ 1 ) 6 Break n K = 2 ,   n S = 1 ,   ( - 157.5 ° < θ A S E < - 22.5 ° )Table 12
Evaluation of gesture commands sketched.
Cmd. User score Err. T Min. Max. Aver. 1 2 3 4 5 Rate Select 94 93 98 95 94 1.85 4.43 3 8 94.8 Undo 96 95 97 94 96 1.75 3.69 4 97 95.6 Redo 94 95 98 96 95 1.75 3.80 94 98 95.6 Delete 95 98 96 95 98 1.95 4.52 95 98 96.4 Smooth 96 90 98 96 98 2.37 5.22 90 98 95.6 Break 97 97 98 96 89 1.80 5.37 89 98 95.4


## 5.2. Expression of Pressure Stroke

The features in Tables8~9 have been used to express a pressure vector stroke. For real-time application, the method using the above features is called the pseudoantialiasing method in order to differentiate it from the antialiasing method of raster image in image processing. The style of stroke can be set in the attributes settings window, as shown in Figure 16. There are five different styles shown in the same time to check which one is better. The types of attributes and the values are listed in Table 13.Table 13
Attributes and values of stroke.
Type Value Number 1 2 3 4 5 Stroke T1 T2 T3 T4 Final D Y Y Y Y Y D P Y Y N N N D S N N Y Y Y P R Y Y Y Y Y P C Y Y Y Y Y F N N Y Y Y S N N N Y Y E N N N Y Y Z N N N N Y M G C C C C K 1 1 1 1 1 T 1 1 96 1 1 R S 2 8 9 6 6 R E 2 42 63 42 42 W E 5 5 5 5 5 W P 1 1 1 1 1 C S 232,242,2 1 255,0 , 0 255,0 , 0 255,0 , 0 243,20,8 7 C E 91,98,22 5 0,255 , 0 0,0 , 25 5 0,255 , 0 103,182,22 8Figure 16
Test results of a gesture stroke.


## 5.3. Generation of Spatial Curve

The features in Table10 have been used to generate a spatial curve directly by the pressure of stroke. For instance, a pressure stroke is drawn in XZ plane, and a spatial curve SXPZ is created immediately by choosing the direction in Y+, as shown in Figure 17. The mirror stroke is shown to demonstrate that the curve is a spatial one, not a planar one.Figure 17
Draw directly a spatial curve.


## 6. Conclusions

The features coming from a single vector pressure stroke have been investigated and discussed in detail. Those features are classified into three parts: the input features, the calculable features, and the added features. The input features are derived from the output of a digital pen, which may be different for the different input systems. The calculable features, to be honest, are the part of features that a stroke contains. They are just the simple and easy-to-calculate ones for the real-time application in 3D freehand sketching system. For the added features, they may be different depending on the real application, and they are added here for the expression of a vivid stroke, which is a novel pseudoantialiasing method, and the generation of a spatial stroke according to the pressure of the digital pen, which is a novel method to create a spatial curve directly on the planar digital screen. For the further researches, the azimuth and elevation angles of the digital pen may be applied in order to investigate the sketching habit and the gestures of holding the pen.



---

*Source: 5636913-2017-01-03.xml*