A Method for Creating Region-Based and Stroke-Based Artistic Images Henry JOHAN, Hajime MATSUI, Toshiyuki HAGA, Yoshinori DOBASHI, and Tomoyuki NISHITA ( ) 1 1.,,.,,. Photoshop [17],,, Graduate School of Frontier Sciences, The University of Tokyo, 5 1 5 Kashiwanoha, Kashiwa, Chiba, 277-8561 Japan Graduate School of Information Science and Technology, The University of Tokyo, 7 3 1 Hongo, Bunkyo-ku, Tokyo, 113 0033 Japan ( )NTT NTT DATA Corporation, 3 3 3 Toyosu, Koto-ku, Tokyo, 135 6033 Japan Graduate School of Engineering, Hokkaido University, Kita-ku, Kita 13, Nishi 8, Sapporo, 060 8628 Japan. 1,. 1.,,, 2,., ( ). 2., 3,., Hoff [7] Seo [14]. X Vol. Jxx X No. xx pp. 1 11 xxxx xx 1
xx/xx Vol. Jxx X No. xx,,. Hausner [4],. Kim Pellacini [8], Hausner,. DeCarlo [2],,.. Salisbury [13]. Curtis [1]. Litwinowicz [9] Hertzmann [5] Hertzmann [5]. Haeberli [3],,.,. [15], Haeberli,.,,. Haeberli Haeberli 3.,,,.,,.,..,. (4. )., (5. ). (6. ), (7. ). 4.,, ( ). 4. 1. 2 (, ). 4. 2,,., p 3 Occupancy, Occ(p) : p.,.. Importance, Imp(p) : p p.. Ruzon Tomasi [12] Distance, Dist(p) : p., [11]. 3. (d sites :, d min :, t imp : ) 2
論文 領域ベース ストロークベースのアート風画像生成法 (a) (b) (c) (d) 図 1 アダプティブな母点の配置 (a) ボロノイエッジに よる入力画像のエッジの近似 (b) 他のエッジを考 慮した母点の配置 (c) 近くの画素の状態を配置不 可に変更 (d) 近くの画素の重要度を低減 Fig. 1 Adaptive sites placement. (a) Approximate an edge in the input image using a Voronoi edge. (b) Consider other nearby edges when placing sites. (c) Forbid placing sites in nearby pixels. (d) Reduce the importance values of nearby pixels. (a) 入力画像 (a) input (b) 等間隔 (母点間距離:大) (b) equally spaced (distance: large) (c) 等間隔 (母点間距離:小) (c) equally spaced (distance: small) (d) アダプティブ (d) adaptive まず Imp(p) が一番大きな画素 p0 を選ぶ. このとき p0 が入力画像のエッジ上に存在すると考え, 勾配方向 に等距離に母点 s1, s2 を配置すれば, ボロノイ辺で入 力画像のエッジを近似することができる (図 1(a)). 図 2 母点の初期配置 Fig. 2 Initial sites positions. 基本的に s1 と s2 の距離が dsites となるようにする が, 図 1(b) のように別のエッジがある場合は, 母点を より p0 の近くに配置する必要がある. ダプティブな配置を選択しパラメータを調整すること p0 の勾配方向にあって p0 からの距離が dsites /2 以 下の画素の中で, Dist(p) が極大になる 2 点を選び, Dist(p) が小さいほうの点を s1, p0 から s1 までの距 で自動的に行われる. しかし, よりユーザの望む結果 離を r とする. p0 に関して s1 と点対称な点を s2 とす 4. 4 母点配置手法の比較 図 2 に母点の初期配置の例を示す. (b), (c) は等間 隔の配置によって生成されている. (b) においてはレモ る. s1, s2 に母点を配置することが可能ならば配置し, そうでなければ r の値を小さくして配置を試みる. 母点が密になりすぎるのを防ぐため, 母点 s1, s2 を に近づけるため, ユーザが範囲を指定してその範囲ご とにパラメータを設定することも可能にした. ンを認識するのが難しく, (c) においては背景の色の一 配置した後, C(s, h) を点 s を中心とする半径 h の円と 様な領域まで多くの領域によって表現されている. (d) して, C(s1, r) と C(s2, r) が包含する領域に属する画 はアダプティブな配置によって生成されており, エッ 素に母点を配置することを禁止し (図 1(c)), C(s1, 2r) ジ付近は小さな領域で表現され, 色の一様な部分は大 と C(s2, 2r) との共通な領域に属する画素の Imp(p) きな領域で表現されている. これは, 色変化の大きな を次式にしたがって減少させる (図 1(d)). 部分は細かい筆で描き, 色の一様な部分は大きな筆で Imp(p) = Imp(p) p p0. p1 p0 塗りつぶすという画風に対応させることができる. (1) 5. ボロノイ図の最適化 以上を Imp(p) の値が timp よりも大きい画素がなく ボロノイ図の最適化では 母点を動かすことで入力 なるまで繰り返すことでアダプティブな母点配置が行 画像をよりよく近似するようなボロノイ図を生成する われる. ただし, この配置では色変化の少ない部分に ものである. 母点を置くことができないので, そのような部分には 等間隔の母点配置を行う. 4. 3 局所的なパラメータ設定 母点の初期配置は, ユーザが等間隔の配置またはア 5. 1 最適化手法 母点は一度に 1 画素しか動かさないことにして, 母 点を動かさない場合および隣接する 8 つの画素に動か した場合の 9 つの場合についてそれぞれボロノイ図を 3
xx/xx Vol. Jxx X No. xx, E color ( 2). E color = x y color diff (P V x,y,p I x,y). (2) P V, P I, x, y, color diff (p, q) La b p, q., 2. 1(5. 2 ),,. E color 1 2(5. 3 ),,. E color 1 E color Hoff [7] 5. 2 ( S 1 P S 2 S 3 3 E color Fig. 3 The calculation for the change of E color. ) 1 8 E color 3 3 P S 1,S 2,S 3 P S i D j E color de (i,j) P S 2 P S 2 S 2 P S 2 S 2 P S 2 S 2 de P S 3 S 3 P S 3 S 3 de 8 (i, j) S i D j de (i,j) de E color 5. 3 8 (E color ) 4
,,,,. ID,, ID. 1, s, RGB 24 15 s., OR,, 9 s.. E color E color E color 5. 4 2 1, E color.,.,., ( 4(a)). s 4(b) s ABCD A B s s (a) D C A B s (b) D D t C C 4 (a) s s ABCD (b) s, t ABCD ABC D Fig. 4 (a) Rectangular area ABCD is the necessary region for computation when site s is moved to s. (b) Taking into account the perpendicular bisector between sites s and t, the computation region of site s can be restricted from ABCD to ABC D. t s s t 4(b) s, s =(s x,s y ). ( (x 1,y 1 ), (x 2,y 2 ).), (x 1 =1,y 1 =1,x 2 =, y 2 = )., s t =(t x,t y ). t x >s x +1, s, t, y = y 1 y = y 2 x x 2, x 2 min(x 2,x 2). t x = s x t x = s x +1 s 1 t y = y 1 y = y 2 x 2 t x <s x 1, x 1. y 1,y 2. 6.,. 6. 1 1 ( ) 2 5
xx/xx Vol. Jxx X No. xx gradient vector (a) stroke width (b) 5 (a), (b) Fig. 5 (a) Stroke direction and (b) stroke width. (a) (b) (c) (d) 6 (a) (b) (c), (d) Fig. 6 (a) Mask and (b) texture for drawing strokes for oil painting. (c), (d) are textures for charcoal drawing. 6. 2 1, Seo [14],. 2,,.,., Perlin [10]. 7.,, 3 B., v (v), u i. (v) = u i L(u i ) L(v) ui v ui v ui v. (3), L(w) w w La b..,.,, 2 ( 5(a)).,,,..,. ( 5(b)).,. 7. 1,. Hertzmann [6],, ( 6(a)) ( 6(b)).,, 2 3 6
1 Table 1 Computation times for approximating images using Voronoi diagrams. (pixel) (sec) 7 512 512 1366 5.6 9 512 512 1015 3.2 9 640 480 679 4.5 7. 2,.. 6(c) (d) 255. 8. 7 9, ( d sites = 32, d min = 8). 1. 1. CPU Pentium4 3.0GHz, nvidia GeForce FX 5900 Ultra. 8. 1 (5. 4 ), 7 7, 5.6. 36 36.. 2 5. 2 5. 3 7 12.4 2 2.0 2.5 8. 2, 1100. Hertzmann [5] [15] 1,.,. Painter [16],, 1. Photoshop [17] GIMP [18]. 8 Photoshop GIMP. 7., Photoshop,, GIMP. Photoshop, GIMP,.,,,., Photoshop GIMP,,.,. 7
電子情報通信学会論文誌 xx/xx Vol. Jxx X No. xx 入力画像 input 中間画像 ボロノイ図 intermediate image (Voronoi diagrams) ステンドグラス風 stained glass 貼り絵風 colored paper mosaics 油絵風 oil painting 木炭画風 charcoal drawing 図 7 結果画像 (ひまわり) Fig. 7 Results (sun flower). ステンドグラス風 (Photoshop) stained glass Fig. 8 8 油絵風 (Photoshop) oil painting モザイク風 (GIMP) mosaic 図 8 Photoshop, GIMP によるアート風画像 Artistic images of sun flower created using Photoshop and GIMP. 油絵風 GIMP oil painting
論文 領域ベース ストロークベースのアート風画像生成法 入力画像 input 貼り絵風 colored paper mosaics 油絵風 oil painting 入力画像 input ステンドグラス風 stained glass 木炭画風 charcoal drawing Fig. 9 図 9 結果画像 (上:犬, 下:野菜) Results (top: dog, bottom: vegetables). 9. ま と め 画像を生成できた. アート風画像は短時間で生成でき 中間画像としてボロノイ図を用いることにより, 1 枚 可能である. るため, ユーザは気軽に様々な画風を生成することが の入力画像から領域ベースおよびストロークベースの アート風画像を生成可能な方法を提案した. 最初に入 文 [1] D. H. Salesin. Computer-generated watercolor. Proc. 力画像に母点を配置してボロノイ図を生成し, 母点を 動かすことでボロノイ図が入力画像をよりよく近似す 献 C. Curtis, S. Anderson, J. Seims, K. Fleischer, and of SIGGRAPH 97, 421 430, 1997. [2] D. DeCarlo and A. Santella. Stylization and ab- るように最適化する. 提案法は入力画像の大局的な特 straction of photographs. 徴をとらえ そして局所的な特徴をとらえるように 2 Graphics (Proc. of SIGGRAPH 2002), 21(3):769 776, 2002. 段階の最適化を行うことで 効率よく入力画像を近似 できた 次に, ボロノイ領域をそのまま利用すること [3] を生成できる. 入力画像の色変化の大きな部分により多くの母点を GRAPH 90), 24(4):207 214, 1990. [4] A. Hausner. Simulating decorative mosaics. Proc. of [5] A. Hertzmann. Painterly rendering with curved brush SIGGRAPH 2001, 573 580, 2001. strokes of multiple sizes. Proc. of SIGGRAPH 98, 配置するというアダプティブな母点の初期配置を導入 することで, 入力画像の特徴をよりよく表現すること 453 460, 1998. [6] 実験の結果, 入力画像の特徴をよく表現したアート風 A. Hertzmann. Fast paint texture. Proc. of NonPhotorealistic Animation and Rendering 2002, 91 を可能にした. ボロノイ図を最適化する際, 計算対象 領域を制限することで, 計算時間の高速化を達成した. P. E. Haeberli. Paint by numbers: Abstract image representations. Computer Graphics (Proc. of SIG- で領域ベース, 色の近い領域をたどるようにストロー クを描画することでストロークベースのアート風画像 ACM Transactions on 96, 2002. [7] K. E. Hoff III, T. Culver, J. Keyser, M. Lin, and D. Manocha. Fast computation of generalized voronoi 9
xx/xx Vol. Jxx X No. xx diagrams using graphics hardware. Proc. of SIG- GRAPH 99, 277 286, 1999. [8] J. Kim and F. Pellacini. Jigsaw image mosaics. ACM Transactions on Graphics (Proc. of SIGGRAPH 2002), 21(3):657 664, 2002. [9] P. Litwinowicz, Processing images and video for an impressionist effect. Proc. of SIGGRAPH 97, 407 414, 1997. [10] K. Perlin. Improving noise. ACM Transactions on Graphics (Proc. of SIGGRAPH 2002), 21(3):681 682, 2002. [11] J. Russ. The Image Processing Handbook. CRC Press, 1992. [12] M. A. Ruzon and C. Tomasi. Color edge detection with the compass operator. Proc. of IEEE Conference on Computer Vision and Pattern Recognition 99, 160 166, 1999. [13] M. P. Salisbury, S. E. Anderson, R. Barzel, and D. H. Salesin. Interactive pen-and-ink illustration. Proc. of SIGGRAPH 94, 101 108, 1994. [14] S. Seo, Y. Park, and S. Kim. Colored-paper mosaic rendering. SIGGRAPH 2001 Technical Sketches, 157, 2001. [15] M. Shiraishi and Y. Yamaguchi. An algorithm for automatic painterly rendering based on local source image approximation. Proc. of Non-Photorealistic Animation and Rendering 2000, 53 58, 2000. [16] Corel Corporation. Painter. [17] Adobe Systems. Adobe Photoshop. [18] GIMP. http://www.gimp.org/ x xx xx 11 13 16 16 15 15 12 14 NTT 4 9 12 46 48 54 59 2 10 11 ACM IEEE 10
Abstract This paper proposes a non-photorealistic rendering method for creating various artistic images from an input image. There are two kinds of artistic images, region-based images, such as mosaic and stained glass, and stroke-based images, such as oil painting. The proposed method can create both kinds of images. In artistic images, it is common that edges (boundaries between regions with different colors) are emphasized and nearby regions having similar colors are drawn with one color. Therefore, the proposed method first approximates the input image using several regions such that the boundaries of the regions match the edges of the input image and fills each region with one color. Voronoi diagrams are used to approximate the input image. Next, region-based images can be created by rendering the Voronoi regions, while stroke-based images can be created by drawing strokes along the Voronoi regions whose colors are similar. Keywords: Non-photorealistic rendering, region-based images, stroke-based images, Voronoi diagrams. 11