Skip to content

An implementation of 'Image stylization using anisotropic reaction diffusion', The Visual Computer (SCIE)

Notifications You must be signed in to change notification settings

cglabnccu/stylizationRD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image stylization using anisotropic reaction diffusion

An implementation of paper's system


Abstract

Image stylization refers to the process of converting input images to a specific representation that enhances image content using several designed patterns. The critical steps to a successful image stylization are the design of patterns and arrangements. However, only skilled artists master such tasks because these tasks are challenging for most users. In this paper, a novel image stylization system based on anisotropic reaction diffusion is proposed to facilitate pattern generation and stylized image design. The system begins with self-organized patterns generated by reaction diffusion. To extend the style of reaction diffusion, the proposed method involves using a set of modifications of anisotropic diffusion to deform shape and introducing a flow field to guide pattern arrangement. A pattern picker is proposed to facilitate the pattern selection from these modifications. In the post-process step, a new thresholding and color mapping method is introduced to refine the sizes, densities, and colors of patterns. From the experimental results and a user study, several image stylizations, including paper-cut, stylized halftone, and motion illusion, are generated using our method, demonstrating the feasibility and flexibility of the proposed system.

Keywords: Non-photorealistic, rendering, Image stylization, Reaction diffusion, Pattern generation

Demo

youtube link
youtube video

[Required]

  • CMake(3.0 or higher)
  • wxWidgets(3.0.2 or higher)
  • OpenCV(2.9.7 or higher)
  • amp(C++ Accelerated Massive Parallelism)

[WorkFlow]

  • Open src: Load image into MASK, and generate sobel edge image into MASK_s
  • Flowfield Option:
  1. Open ETF: use the ETF of load image as flowfield
  2. Open Flow: there are some vfb in /data/
  • Start: use mouse left button to draw patten into current_B, use tool->Edge2addB and slide addB large than 0, can add edge of input image to result of reaction diffusion.

[Future Work]

  1. using faster algorithm
  2. oriental cloud patterns
  3. merge flowfield maker
  4. parameter f

[Papers' Examples]

Fig. Workflow Remark/Notes     
4(a) Load Flow source.vfb, Parameters F k l can reference to Table 1, Press Start and click Fill Ink, after its being stable, select adathresholding (beta=0.8) --
4(b) as above --
4(c) as above --
5(a) Load Flow vortex.vfb, Parameters F k l can reference to Table 1, check the Customize Anisotropic Function to YES, and select 0~180 degree. Then press Start and click Fill Ink, after its being stable, select adathresholding (beta=0.8, alpha=0.1) --
5(b) as above, Customize Anisotropic Function select degree 0~180. --
5(c) as above, Customize Anisotropic Function select degree 45~135. --
8(c) Load SrcImg controlshape-a.png, Load Flow vortex.vfb, Load Control Img controlshape_controlImg.png. Press Start, Pattern Size = 0.1, then check the Activate Segmentation to YES, and assign each region with its own parameters(recommanded pattern provide at Note). After its stable , select Thresholding (alpha=0.4 beta=0.5). Region
1:SPOT(theta0=90)
2:HOLE(theta0=90)
3:SPOT(theta0=90)
4:LINE(theta0=90)
5:inverse LINE(theta0=90)
12(c) Load SrcImg cat-source.png, Load ETF cat-source.png, The Parameters can use Pattern Picker (Tool>Open Pattern Picker) to select SQUARE pattern, then Press Start and click Fill Ink and click Edge2AddB (Tool>Edge2AddB), after its being stable, select adathresholding (alpha=0.4 beta=0.0)
12(d) as above, use gradient size (size type: LINEAR) brush to modify the sizes
14(c) Load SrcImg flower.png, Load Flow vortex.vfb, The Parameters can use Pattern Picker (Tool>Open Pattern Picker) to select SQUARE pattern, then Press Start and click Fill Ink, use gradient size (size type: inverse Circular) brush to modify the sizes, after its being stable, select colormapping (Mode: 3)
14(d) as above, use gradient k (size type: inverse Circular) brush to modify the pattern parameters
15(c) Load SrcImg Marilyn.png, Load Flow vortex.vfb, The Parameters can use Pattern Picker (Tool>Open Pattern Picker) to select SPINDLE pattern, then Press Start and click Fill Ink, after its being stable, select adathresholding (alpha=0.4 beta=0.0)
15(e) as above, replace Flow by using ETF of Marilyn.png, and choose the SQUARE pattern
17(c) Load SrcImg Kremlin-source.png, Load ETF Kremlin-source.png, Load Control Img Kremlin-controlImg.png. Press Start and click Edge2AddB (addB=0.03), then check the Activate Segmentation to YES, and assign each region with its own parameters(recommanded pattern provide at Note). After its stable , select Thresholding (alpha=0.05 beta=0.4). Region
1:SPOT
23: BLACK
4
8: LINE
17(d) as above.Pattern Size = 0.2 After its stable , select adaThresholding (alpha=0.36 beta=0.4). Regions
13: HOLE
4
8: QUADE(theta0=45)

[Table 1]

Style a(theta) F k l Figure
semicircle Eq. 6 .0375 .0655 1 Fig. 5(a)
spot: spidle Eq. 6 .0375 .0655 2 Fig. 5(b)
hole: spidle Eq. 6 .0300 .0546 2 Fig. 8 blue
stripe Eq. 6 .0300 .0620 2 Fig. 8 green
triangle Eq. 6 .0375 .0655 3 Fig. 5(c)
spot: quad Eq. 6 .0375 .0655 4 Fig. 5(d)
water drop Eq. 7 .0375 .0655 2 Fig. 6(a)
sector Eq. 7 .0375 .0655 4 Fig. 6(b)

Common Q&A

Q: Error LNK2019(Build Error)
Open VS2013 Project settings -> Linker > General > System : change Subsystem to "Windows".
Q: Unable to startup program (The system cannot find the file specified)(Build Error)
Solution Explorer -> Select "FlowBase" -> Right Click and "Set as StartUp Project"
---

Citation

@article{chi2016image,
  title={Image stylization using anisotropic reaction diffusion},
  author={Chi, Ming-Te and Liu, Wei-Ching and Hsu, Shu-Hsuan},
  journal={The Visual Computer},
  volume={32},
  number={12},
  pages={1549--1561},
  year={2016},
  publisher={Springer}
}

About

An implementation of 'Image stylization using anisotropic reaction diffusion', The Visual Computer (SCIE)

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages