CHAPTER 3 Background
3.2 The Painting Procedure for Embroidered Fish
We explain the procedure of drawing Lingnan School Painting on embroidered fishes in this section. We use the compositions created by Lin Hu-Kuei(林湖奎) [1]
who is a budding young talent of Lingnan School Painting.
The painting process of Lingnan School Painting can be divided into four steps.
First, painters draw the outline of the fish body and gill, and notice the range of the fishes's tail swing. Second, painters draw fins by using pale ink and side-stroke, and paint the eye with dark ink. Third, moisten the paper, apply chocolate (赭石色) to the body of Embroidered Fish and white lead (鉛白) to the white scales. Finally, when the paper where the body of the fish was painted is still wet, washing body by vermeil (朱 紅). Figure 3.2 shows this process.
(a) sketch the contour (b) sketch the fins
(c) wash ground (d) wash body
Figure 3.2 A procedure of painting
CHAPTER 4 Stroke Generation
In this chapter, we describe how to obtain the stroke information from input image and generate stroke of fishes scale and fins automatically. After we obtain this information, brush stroke should be applied on them. Figure 4.1 shows the flowchart of sketching.
In sketching the contour of embroidered fishes, painters draw the shapes and position realistically. But they draw fish's scales and fins according to their aesthetic feeling. The Horse Hair Brush is commonly used in this process, and we will also simulate the brush model for Horse Hair Brush style. We introduce our proposed brush model which has two kinds of style: center stroke and side stroke.
This chapter is organized as follows. In section 4.1, we introduce the brush model, discuss the movement and rotation of brush, and present the ink depositing model. Then we describe the contour sketching of fish's body and scales in section 4.2 which contains the edge extraction, the stroke definition, the vectorization, and the
application of brush strokes. Section 4.3 explains the generation of fins.
Figure 4.1 The flowchart of contour sketching
4.1 The Brush Model of Horse Hair Brush
The painters of Lingnan School Painting like to use Horse Hair Brush. The painting which painted by Horse Hair Brush has the characteristics of bold and generous. In this section, we introduce two brush models for different strokes: center stroke and side stroke.
4.1.1 Center stroke
Weng's model [21] focuses on simulating center stroke effect. Center stroke means that painter place the tip of brush in the middle without any slanting. Therefore we use a single circle to simulate the contact region of brush and paper. Consider Figure 4.2. Let o and r be the center and the radius of the circle, respectively. There are many bristles inside the circle, where each bristle will generate a footprint, denoted as , on the paper.
(4.1) where i is index of the of bristles. is the distance from o to .
hi
ri hi
In our implementation, we partition the center angle into 100 parts and select 5 points on each radius to generate 500 footprints totally, as shown in Figure 4.3. Our experiments show that 500 bristles are enough. In this way the footprints can be generated efficiently. The location of a footprint with respect to center o thus can be represented as:
o
h i
Direction of circle
Figure 4.2 The contact region of brush on canvas
5 points per radius 100 / 360° θ =
Figure 4.3 The placement of bristles.
During painting process, the brush moves its contact region along the stroke trajectory. We use Cardinal Spline to simulate the stroke trajectory. Since it is an interpolating curve, we could obtain interpolated points between two neighboring control points. Figure 4.4 shows the generated trajectory by arranging control points.
(a)
Figure 4.4 (a) Control points (b) Interpolating curve
The radius of the contact circle represents the width of the stroke at each point on the paper. We refer Ho's model [12] to determine this value. Figure 4.5 shows the radius changed along the variation of tangent line of stroke trajectory. We can calculate radius by adjusting parameters of , , base, k ,start, and End. and are the thresholds of the curve two extremities. is a Bezier curve. The value of base means the minimum radius and k adjust degree for θ. θ is the included angle of tangent lines between and as shown in Figure 4.6 because could provide a suitable angle to preserve the quality in our implementation.
The value of start and end represent the initial and terminal radius respectively. m is the
ri S1 S2 S1
S2 Q(x)
) (xi
Q Q(xi+20)
) (xi+20 Q
x unit variation.
Figure 4.5 The change of radius
Figure 4.6 Theθrepresentation
We define the radius as follows:
), effect of initial drawing. The radius is linear variation from start to the radius of point . In real painting, painters usually draw heavier to generate thicker stroke when the line’s curvature becomes larger. So when
S1
S1
x lies between and , the size of radius depends on the variation of line curvature. Finally, when
S1 S2
x is greater than , the radius is also linear variation from the radius of point to end. It simulates the ending of the stroke when painting
S2
S2
When the brush moves along the stroke trajectory, the direction of the circle should be aligned to the tangent direction. We use an approximate tangent vector T at point as follows: (xi,yi)
)
The new coordinates of bristles after rotation are:
x
Figure 4.7 The rotation of circle direction
Then, by Equations (4.2) and (4.5), the location of a pixel to be painted can be obtained by the following equation:
y
Figure 4.8 shows the strokes painted in different number of bristles.
x
Circle direction (T)
'
h
i φX-axis
(4.6)
(a) Stroke trajectory
k=0.3, S1=0.35, S2=0.85
(b) Stroke by start=3.0, base=3.0, end=4.0,
k=0.6, S1=0.35, S2=0.85
(c) Stroke by start=8.0, base=13.0, end=0,
k=0.1, S1=0.2, S2=0.8
(d) Stroke by start=4.0, base=7.0, end=9.0,
Figure 4.8 Examples of brush model
4.1.2 Side stroke
Side stroke means that painter tilts brush when painting. Therefore we use two ellipses to simulate the initial and terminal contact region of brush and paper, and insert additional two ellipses to control direction of bristles as shown in Figure 4.9.
Figure 4.9 Side stroke brush model
The length of major axis of the initial ellipse (terminal ellipse) is half of the distance between S1(T1) and S2(T2), and the length of minor axis is Sa(Ta) which is given by user. The lengths of minor axis of middle ellipses are obtained by the linear interpolation of Sa and Ta. Each ellipse is divided from the center angle into 100 parts and select 10 points on each radius to generate 1000 footprints totally. We use Cardinal Spline to join points which has the same position in each ellipse. So when we want to apply side stroke, we should have eight control points and two length of major axis. Figure 4.10 shows the side strokes painted in different lengths of minor
Ta
Ta : the length of minor axis
CS : Initial ellipse m1 : Middle ellipse m2 : Middle ellipse
Sa : the length of minor axis S1
axis.
(a) Input points S1, S2, T1, and T2
(b) Stroke by
Sa=5, Ta=10 Sa=5, Ta=15
(c) Stroke by
Sa=10, Ta=20 (d) Stroke by
Figure 4.10 Examples of Side stroke
4.1.3 Ink Depositing Mechanism
As discussed in Sections 4.1.1 and 4.1.2, we can obtain the locus of bristles on the paper. Next we should determine the amount of ink that deposited onto the canvas.
In this section, we discuss the ink depositing model to simulate the amount of ink deposited and its effects on canvas. We refer to Weng’s model [21] and use two parameters to control painting styles: decreasing and discontinuity.
The decreasing parameter describes the decreasing rate of the amount of ink remaining on the brush. Given the initial and final gray values, we can control the changes of gray level linearly along the path of each bristle. Figure 4.11 shows xamples that only consider the effect of decreasing parameter.
Figure 4.11 Examples only considers the effect of decreasing parameter
(a) Center Stroke (b) Side Stroke
The discontinuity parameter describes bristles may out of ink and leave discontinuous gaps on its path during the painting process. This happens when there is not enough ink remaining on the brush. To simulate this effect, the maximum gap size is predefined in an array, discontinuity, and each bristle is mapped to discontinuity
randomly to get its max gap size. Once a bristle deposits ink, its discontinuous gap size can not be larger than its max gap size. Besides, the discontinuous gap size keeps decreasing until it equals to zero during the brush moving process. Figure 4.12 shows examples that consider both effects of decreasing and discontinuity.
Figure 4.12 Examples consider the effect of decreasing and discontinuity (a) Center Stroke
(b) Side Stroke
After setting up the brush model, we apply stroke onto the canvas. We consider the move of ink. The spread of ink on canvas is simulated by using low-pass filters to blur the stroke. For example, as shown in Figure 4.13, by using a 3 x 3 mask, the gray level of p4 will be:
Figure 4.13 A low-pass filter
Figure 4.14 show the result which use low-pass filters.
(a) Center Stroke (b) Side Stroke
Figure 4.14 Final resulting
4.2 Contour Sketching on Fish's Body and Scales
In this section, we introduce the procedure for sketching the contours of Fish's body and scales according to the input image. We classify the stroke into six kinds of type: head, cirri, gill cover, spine, body and fish scales.
4.2.1 Edge Extraction
First, users input reference and labeling images. The system finds out the outline of fish body from labeling images as shown in Figure 4.15.
Figure 4.15 Outline of fish body
(a) Labeling Image (b) Outline of fish body
We look for two extremities of anal fin (A1 and A2) and pectoral fins (P1 and P2) along the outline of fish body, these points are data points when system defines stroke (Figure 4.16). The feature of extreme anal fin points (A1 and A2) is that there are three kind of difference point which contains body, anal fin, and background in neighborhoods. And the features of pectoral fin points (P1 and P2) are that there are three kinds of difference point which contains body, pectoral fin, and background in neighborhoods. Figure 4.16 shows the position of these four points.
Figure 4.16 The position of data points and data points
(a) The relationship of labeling image
and data points
(b) The relationship of outline
4.2.2 Stroke Definition
When we find out the data points, we can determine head stroke according to the size of fish head. Spine stroke is drawn by user; our system only record curve user drew. Figure 4.17 shows the position of head and spine stroke.
Figure 4.17 The position of head and spine stroke Spine Stroke
Head Stroke
The information of cirri is not always acquired from the reference image, so our system generates it automatically. Its shape is controlled by three control points, and size is scaled according the size of fish. After the relative place of the control points is determinate, we transform them to fish head and join them by using Cardinal Spline. Figure 4.18 shows the process of generating cirri stroke. There are four cirri for each fish.
Magnify
Coordinate transformations
Figure 4.18 The process of generating cirri stroke
The method of generating gill cover stroke is similar to cirri. The differentiation between them is that the number of control points of gill cover stroke is four. Figure 4.19 shows the process of generating cirri stroke.
Figure 4.19 The process of generating gill cover stroke
There are two strokes of body stroke: one is from pectoral fin point which one of data points to the intersectional point of spine along body outline; the other is to the intersectional point of dorsal fin along body outline. The generation of dorsal fin is illustrated in next section. Figure 4.20 shows the location of body stroke.
θ Dorsal Fin
Body Stroke Body Stroke
Figure 4.20 The location of body stroke
Painters draw fish scale from spine stroke to body stroke regularly and repeatedly, and our system simulate scale according to the same method.
Fish eye is drew in advance, our system transform it to appropriate location and scale it based on the size of fish. as shown in Figure 4.21.
Figure 4.21 The process of generating fish eye
Coordinate transformations
4.2.3 Vectorization
The goal of vectorization is to generate a smooth stroke. After finding out all strokes, we extract a few sample points for each stroke, then use Cardinal Spline to join them.
4.2.4 Apply Brush Mode
After vectorization, we apply the center stroke of brush model to each stroke, as shown in Figure 4.22.
Figure 4.22 Stroke applied by brush model
4.2 Contour Sketching on Fins
The fins of real fish and of painter drew is different, so our system generate fins according to the style of painter drew.
4.3.1 Sketching Positions Generation
There are three kinds of Fish's scales: dorsal fin, pectoral fin and anal fin. In order to apply side stroke, each stroke needs eight control points. These control points of every fin are generated using different methods as follows:
Dorsal Fin
Painters usually use two side strokes to paint dorsal fins. First stroke forms an included angle θ with the spine, and second stroke is painted along spine stroke. The angle θ is defined by our system, but users can modify it. The control points of two side stroke are determined based on the size of fish. Figure 4.23 shows the position of
control points of dorsal fin.
T2 T1
S2 S1
(a) T1
S1 T2
S2
(b)
Figure 4.23 (a) First stroke. (b) Second stroke.
The red points are initial and terminal points.
The orange points are inserted points.
Pectoral fin
There are two features for Pectoral fin. One is that it is close to Pectoral fin which one of data points, and the others is that it forms an included angle with the fish body. Figure 4.24 shows the position of control points of pectoral fin.
S1
S2 T1 T2
Figure 4.24 Control point of pectoral fin
The red points are initial and terminal points.
The orange points are inserted points.
Anal Fin
There are two strokes for anal fin, and they are drawn between Al and A2 which are the data points. Anal fin swings the same way as the body. To simulate this
effect, we find two points (B1 and B2) in the outline of body, and calculate symmetrical points (B and 21′ B ′) based on the line which joint A1 and A2 (data points). Figure 4.25 is a diagrammatic explanation. The orange points are obtained by the same method. Since anal fin is drew using two strokes, we compute the middle points of the above found points. These points forms control points of anal fin stroke.
B2
A1 B1 A2
B1′ B2′
Figure 4.25 Control points of anal fin
4.3.2 Apply Brush Model
After control points of all fins are generated, we apply the side stroke brush model.
The system draws lines inside fins randomly, as shown in Figure 4.26.
Figure 4.26 The result of sketching
CHAPTER 5 Washing
In this chapter, we discuss the dyeing effect in our system. First, we get the information about color from input image. Then we simulate pigments which move above and inside the paper. Finally, we blend the washing image and sketching image.
Figure 5.1 shows the flowchart of washing.
In Lingnan School Painting, washing is an important skill to show stereo and gradational feeling. Painters put a cushion under the paper when washing. Then they moisten the paper, and use “a row of brushes” to wash layer by layer gradually.
Because there is oil that does not absorb water on the surface of cushion, water flows above the paper. The water diffusion happens above and inside the paper.
In section 5.1, we talk about the generation of washing region. Then we explain our proposed washing model in section 5.2. It consists of the paper model, Layer model, the moving of water flow, and pigment diffusion process. Then we use
“Subtractive Color Mixture” to model the overlapping of mixture in section 5.3.
Figure 5.1 Flowchart of washing
5.1 Washing Region
We scan image in raster-scan order, and find out the range of color which we want to wash. The range of color is defined in advance, but users can modify it. After finding out regions which we want to wash, user can determine to use gradational color or the same color in washing region.
5.2 Washing Model
This section introduces how we simulate the washing of Lingnan School Painting. Our model simulates the water flowing above and inside paper. Because painters put a cushion under the paper when washing, there is oil that does not absorb water on the surface of cushion. Water flows above the paper. After a while, water is absorbed into the paper, and diffused by capillary phenomenon. Curtis [17] proposed
“Shallow-water layer” to simulate water and pigment flow above the surface of the paper. Yu [24] proposed a layer model which represents the movement of water and pigment between neighboring cells into the paper. In paper modeling, we reference Curtis’s and Yu’s model. In water flowing, we reference Navier-Stoke Equation and Local Equilibrium Model (LEM) to simulate but make some modifications.
Paper Model
In paper model, paper is composed of paper cells. Each paper cell is called a papel[14]. Each papel has eight neighboring papels which are connected by fiber. The number of fibers which connect two neighboring papels is determined randomly [13].
Figure 5.2 shows an example for the relationship among neighboring papels inside the paper.
1 , 1 −
− j
pi pi,j−1 pi+ j1, −1
j
pi−1, pi,j pi+1,j
1 , 1 +
− j
pi pi,j+1 pi+ j1, +1 Papel
fiber
Figure 5.2 The relationship among neighboring papels inside the paper
To represent the diffusion phenomenon, the layer model is proposed. In the layer model, each papel inside the paper is divided into three layers: surface layer, absorption layer, and deposition layer. Besides there is a “shallow-water layer” above the paper. Figure 5.3 shows the layer model.
Shallow-Water Layer
Figure 5.3 The layer structure of papel.
Simulate Diffusion Phenomena
First, the initial water (pigment) quantity is W (P). When water particles flow, pigment particles move with it simultaneously. In hydrodynamics, Navier-Stoke Equation describes fluid motion which considers viscous fluid. Eq.(5.1) is 2D Navier-Stokes Equation.
: the velocity in y direction where
p v u μ
: the velocity in x direction
: viscosity (In all of our example, we set 0.3)
The water (pigment) quantity move to neighboring papel of x direction is : water pressure
)
We use Navier-Stokes Equation to simulate water flowing above the paper. At the same time, water and pigment also are absorbed by surface layer, and quantity absorbed in the surface layer is determined by the constant ratio (We set 0.4).
where ( ) denotes the quantity of water (pigment) absorbed by surface layer, and ( ) denotes the quantity of water (pigment) in Shallow-water layer.
s
In surface layer, water flows to neighboring papels if . denotes the water quantity of k’th neighboring papel. The quanity of and are determined by the following equations.
k
where denotes the total number of neighboring fibers which is connected to the papel and the water quantity is smaller than . denotes the number of fibers which connects and .
∑
=adjusting parameter(In our system, we setα1 =0.2,α2 =0.8,ε =0.4). is the unit
The water and pigment absorbed by absorption layer is determined by the following equation. denote the maximum and minimum absorption ratio, respectively. denotes the
maximum quantity of water which could be deposited in the deposition layer and denotes the remaining water quantity in the deposition layer. (In our system, we set
The absorbed water and pigment is desorbed to the surface layer or deposition layer in the next time. The desorbed quantity to the surface layer is determined as following.
The quantity deposited in the deposition layer is determined by the constant deposited ratiod.
where ( ) denotes the quantity of water (pigment) deposited, and is maximum capacious quantity of water in the deposition layer.
,
In Huang’s [11] ink diffusion process, the whole process includes skeleton finding, initial area pipelining and propagation process. Since diffusion which we simulate is regions, there is no need to find the skeleton and initial area pipelining. Water
In Huang’s [11] ink diffusion process, the whole process includes skeleton finding, initial area pipelining and propagation process. Since diffusion which we simulate is regions, there is no need to find the skeleton and initial area pipelining. Water