The Batik Trick - PowerPoint PPT Presentation

1 / 104
About This Presentation
Title:

The Batik Trick

Description:

Title: PowerPoint Presentation Author: Claudio Costi Last modified by: ISG Created Date: 4/10/2002 7:13:55 PM Document presentation format: Bildschirmpr sentation – PowerPoint PPT presentation

Number of Views:600
Avg rating:3.0/5.0
Slides: 105
Provided by: Claudio160
Category:
Tags: batik | lost | process | trick

less

Transcript and Presenter's Notes

Title: The Batik Trick


1
The Batik Trick a Physically Plausible
Simulation of Traditional Batik Painting using
Distance Transforms, Distance Transforms, and
Distance Transforms by Brian Wyvill and Kees van
Overveld
2
  • contents
  • The Art of Batik Painting
  • The Visual Effects and their Causes
  • Distance Transforms
  • A Batik Simulator
  • Results, Conclusions and Summary

3
1.The Art of Batik Painting
  • Batik (American ba-teek Correct bah-tik)
  • origins unknown 2000 years old Middle-east,
    India or Central Asia?
  • most prevalent Indonesian island of Java since
    14th or 15th century
  • http//www.story-of-batik.com/html/history_of_bat
    ik.html

4
1.The Art of Batik Painting
5
1.The Art of Batik Painting
the wax-gorithm
while (not ready) dye entire cloth with color
C for(p in uncovered region) p.color C wash
off color on wax-covered areas (if any) cover
part of exposed region with wax if(expensive
just for fun) remove wax from some
regions correct mistakes or add painted
details sell // you should be rich now !!!
6
1.The Art of Batik Painting
example
7
2.The Visual Effects and their Cause
(the phenomenology of dye absorption and wax
cracking)
8
2.The Visual Effects and their Cause
(the phenomenology of dye absorption and wax
cracking)
non-homogenous cloth absorption rates
9
2.The Visual Effects and their Cause
(the phenomenology of dye absorption and wax
cracking)
non-homogenous cloth absorption rates cracks
occur in time-order
instead of all-at-once
so there are few crack crossings but most
T-junctions
... because crack-propagation is a causal
process cracks run until they encounter another
(earlier) crack or the bound of the wax
10
2.The Visual Effects and their Cause
(the phenomenology of dye absorption and wax
cracking)
non-homogenous cloth absorption rates cracks
occur in time-order cracks often end in maximally
concave regions of wax borders
..instead of...
...because it is energetically cheap to have
shorter cracks
11
2.The Visual Effects and their Cause
(the phenomenology of dye absorption and wax
cracking)
non-homogenous cloth absorption rates cracks
occur in time-order cracks often end in maximally
concave regions of wax borders cracks erode, so
older cracks result in wider dye traces than
younger cracks
12
2.The Visual Effects and their Cause
(the phenomenology of dye absorption and wax
cracking)
non-homogenous cloth absorption rates cracks
occur in time-order cracks often end in maximally
concave regions of wax borders cracks erode, so
older cracks result in wider dye traces than
younger cracks junction regions are fragile, so
wax breaks off, leaving widened younger crack
ends
13
2.The Visual Effects and their Cause
(the phenomenology of dye absorption and wax
cracking)
non-homogenous cloth absorption rates cracks
occur in time-order cracks often end in maximally
concave regions of wax borders cracks erode, so
older cracks result in wider dye traces than
younger cracks junction regions are fragile, so
wax breaks off, leaving widened younger crack
ends
...this will be achieved by an appropriate noise
function
14
2.The Visual Effects and their Cause
(the phenomenology of dye absorption and wax
cracking)
non-homogenous cloth absorption rates cracks
occur in time-order cracks often end in maximally
concave regions of wax borders cracks erode, so
older cracks result in wider dye traces than
younger cracks junction regions are fragile, so
wax breaks off, leaving widened younger crack
ends
...whereas various Distance Transforms will be
used for these
15
3.Distance Transforms
(Jack-of-all-trades in image processing)
16
3.Distance Transforms
(Jack-of-all-trades in image processing)
formal definition for a set S, and a metric ,
S ? S ? ? and a subset V?S, we define ?s,
s?S D(s)MIN(vv ?Vs-v)
17
3.Distance Transforms
(examples)
in geometry
for small distance D
for large distance D
L1 -metric
L2 -metric
L? -metric
18
3.Distance Transforms
(observations)
  • distance transform models decreasing influence at
    larger D shape details are lost (Huygens
    principle)
  • shape of (Dconst)-contour dominates for large D
  • distance transform is related to
  • Minkowsky sum
  • Voronoi diagram
  • low-pass filtering multi-scale
  • implicit surfaces
  • Dijsktras shortest path (discrete S)
  • most preferred metric L2 (independent of
    coordinate system)
  • brute force calculation requires O(SV)
    calculations
  • approximations require O(n S) calculations

19
3.Distance Transforms
(fast approximation)
a two-pass algorithm for the Distance
Transform for(pixel p in V) D(p)0 for(pixel p
in S\V) D(p)infinity for(pixel p scan from top
left to bottom right) for(pixel n in upper
left half Neighborhood(p)) if(D(n)n-pgtD(p))
D(p)D(n)n-p for(pixel p scan from bottom
right to top left) for(pixel n in lower right
half Neighborhood(p)) if(D(n)n-pgtD(p))D(p)
D(n)n-p (optionally, smooth D(p) with a
suitable relaxation)
20
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
21
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
22
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
23
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
?
?
?
?
?
0
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
24
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
?
?
?
?
?
0
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
25
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
?
?
?
?
0
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
26
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
?
?
?
0
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
27
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
?
?
?
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
28
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
?
?
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
29
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
?
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
30
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
31
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
this is wrong it should be 2.82. Dont panic,
just wait and see
?
?
0
0
1
1.41
2.41
?
?
?
0
0
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
32
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
33
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
?
?
?
?
?
?
?
?
?
?
?
?
34
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
?
?
?
?
?
?
?
?
?
?
?
35
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
?
?
?
?
?
?
?
?
?
?
36
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
1
?
?
?
?
?
?
?
?
?
37
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
1
1.41
?
?
?
?
?
?
?
?
38
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
1
1.41
2.41
?
?
?
?
?
?
?
39
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
1
1.41
2.41
?
2.82
?
?
?
?
?
40
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
1
1.41
2.41
?
2.82
2.41
?
?
?
?
41
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
1
1.41
2.41
?
2.82
2.41
2
?
?
?
42
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
1
1.41
2.41
?
2.82
2.41
2
2
?
?
43
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
1
1.41
2.41
?
2.82
2.41
2
2
2.41
?
44
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
1
1.41
2.41
?
2.82
2.41
2
2
2.41
2.82
45
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
?
1.41
1
1
1.41
2.41
?
2.82
2.41
2
2
2.41
2.82
next we revert the scanning direction
46
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.42
?
?
?
0
0
1
2
?
?
1.41
1
1
1.41
2.41
3.82
2.82
2.41
2
2
2.41
2.82
47
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
?
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
48
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
?
0
0
1
2
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
49
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
?
0
0
1
2
1
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
50
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
?
0
0
1
2
1
2
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
51
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
?
0
0
1
1.41
2.41
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
52
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
?
0
0
1
1.41
2.41
1
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
53
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
54
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
3.41
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
55
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
2.82
0
0
1
1.41
2.41
1
2
See? Told you everything was going to be OK
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
56
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
2.82
1
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
57
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
58
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
?
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
59
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
?
2.82
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
60
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
?
2.82
2.41
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
61
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
?
2.82
2.41
2
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
62
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
?
2.82
2.41
2
1
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
63
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
?
2.82
2.41
2
1
1.41
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
64
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
?
2.82
2.41
2
1
1.41
2.41
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
65
3.Distance Transforms
(fast approximation)
?
?
?
?
?
?
4.23
2.82
2.41
2
1
1.41
2.41
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
66
3.Distance Transforms
(fast approximation)
?
?
?
?
?
3.82
4.23
2.82
2.41
2
1
1.41
2.41
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
67
3.Distance Transforms
(fast approximation)
?
?
?
?
3.82
3.41
4.23
2.82
2.41
2
1
1.41
2.41
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
68
3.Distance Transforms
(fast approximation)
?
?
?
3.82
3.41
3
4.23
2.82
2.41
2
1
1.41
2.41
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
69
3.Distance Transforms
(fast approximation)
?
?
3.82
3.41
3
2
4.23
2.82
2.41
2
1
1.41
2.41
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
70
3.Distance Transforms
(fast approximation)
?
3.82
3.41
3
2
2.41
4.23
2.82
2.41
2
1
1.41
2.41
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
71
3.Distance Transforms
(fast approximation)
3.82
3.41
3
2
2.41
2.82
4.23
2.82
2.41
2
1
1.41
2.41
3.82
0
1
1.41
2.41
2.82
1
2
0
0
1
1.41
2.41
1
2
0
0
1
2
1
2
3
3.41
2.41
1.41
1
1
1.41
2.41
2.82
2.41
2
2
2.41
2.82
3.82
72
3.Distance Transforms
(related algorithms)
  • the distance transform can be turned into an
    identitydistance transform (IDT) by also keeping
    track of the identity of the closest object Vi
    this is a discrete approximation to the Voronoi
    diagram with arbitrary initial objects.

remember for(pixel p in V ) D(p)0 for(pixel
p in S\ V ) D(p)infinity for(pixel p scan
from top left to bottom right) for(pixel n in
upper left half Neighborhood(p))
if(D(n)n-pgtD(p)) D(p)D(n)n-p (and
similar for other half)
73
3.Distance Transforms
(related algorithms)
  • the distance transform can be turned into an
    identitydistance transform (IDT) by also keeping
    track of the identity of the closest object Vi
    this is a discrete approximation to the Voronoi
    diagram with arbitrary initial objects.

remember for(pixel p in Vi) D(p)0Id(p)Vi
for(pixel p in S\Vi) D(p)infinity Id(p)
none for(pixel p scan from top left to
bottom right) for(pixel n in upper left half
Neighborhood(p)) if(D(n)n-pgtD(p))
D(p)D(n)n-p Id(p)
Id(n) (and similar
for other half)
74
3.Distance Transforms
(related algorithms)
  • the distance transform can be turned into an
    identitydistance transform (IDT) by also keeping
    track of the identity of the closest object Vi
    this is a discrete approximation to the Voronoi
    diagram with arbitrary initial objects.
  • after D(s) is computed, it tells the shortest
    distance to the border of V. D(s) allows local
    updating in case of local modifications of V.
  • larger neighborhoods give better approximation to
    circular (D(s)const)-contours
  • 3 x 3, 4-connected square
  • 3 x 3, 8-connected 8-gon,
  • 5 x 5, 24-connected ?16-gon,
  • 7 x 7, 48-connected ? 32-gon, etc.

75
4.A Batik Simulator
(architecture)
76
4.A Batik Simulator
(architecture)
  • the Batik process simulation consists of two
    phases
  • generating cracks
  • applying a next dye bath, taking the recent
    cracks into account

77
4.A Batik Simulator
(crack generation)
  • crack initialization
  • crack propagation
  • crack tuning

78
4.A Batik Simulator
(crack generation crack initialization)
V current wax distribution generate
D(s) while(not enough cracks) pick random
point p ? V // The chance to pick a cell is
proportional to the area // of the cell. This
results in uniform average cell areas. while (n
? Neighbors(p), D(n)gtD(p))pn // D(p) is local
maximum of the Distance Transform (DT) find
direction d of steepest descent
propagateCrack(p,d,-d) // Every crack ends at
the border of the cell it started in. //
Rationale cracks start far from border where
stress // is high update DT (only in the
environment of recent crack)
79
4.A Batik Simulator
(crack generation crack propagation)
propagateCrack(p,d0,d1) // have two halves
of the crack run simultaneously p0p1p
while(not ready) for(j0jlt2j)if(pj in
wax (not on a crack or off wax)) step
pj in direction dj estimate dj based
on local distance gradient // rationale this
ensures shortest way to the border of the
cell, // therefore to maximally curved local
concavities (if any) perturb dj with
IIR-filtered noise
80
4.A Batik Simulator
(crack generation crack propagation cont.-d)
the pixels labeled with black squares are labeled
as on a crack their distance values D(s) are
sub-pixel accurate the formed crack is the red
polyline with sub-pixel coordinates the blue
squares indicate pixels used for computing ?D(s)
and the next positions of pj
p0
81
4.A Batik Simulator
(crack generation crack propagation cont.-d)
the pixels labeled with black squares are labeled
as on a crack their distance values D(s) are
sub-pixel accurate the formed crack is the red
polyline with sub-pixel coordinates the blue
squares indicate pixels used for computing ?D(s)
and the next positions of pj
82
4.A Batik Simulator
(crack generation crack propagation cont.-d)
the pixels labeled with black squares are labeled
as on a crack their distance values D(s) are
sub-pixel accurate the formed crack is the red
polyline with sub-pixel coordinates the blue
squares indicate pixels used for computing ?D(s)
and the next positions of pj
83
4.A Batik Simulator
(crack generation crack propagation cont.-d)
the pixels labeled with black squares are labeled
as on a crack their distance values D(s) are
sub-pixel accurate the formed crack is the red
polyline with sub-pixel coordinates the blue
squares indicate pixels used for computing ?D(s)
and the next positions of pj
84
4.A Batik Simulator
(crack generation crack propagation cont.-d)
the pixels labeled with black squares are labeled
as on a crack their distance values D(s) are
sub-pixel accurate the formed crack is the red
polyline with sub-pixel coordinates the blue
squares indicate pixels used for computing ?D(s)
and the next positions of pj
85
4.A Batik Simulator
(crack generation crack propagation cont.-d)
the pixels labeled with black squares are labeled
as on a crack their distance values D(s) are
sub-pixel accurate the formed crack is the red
polyline with sub-pixel coordinates the blue
squares indicate pixels used for computing ?D(s)
and the next positions of pj
86
4.A Batik Simulator
(crack generation crack propagation cont.-d)
the pixels labeled with black squares are labeled
as on a crack their distance values D(s) are
sub-pixel accurate the formed crack is the red
polyline with sub-pixel coordinates the blue
squares indicate pixels used for computing ?D(s)
and the next positions of pj
87
4.A Batik Simulator
(crack generation crack propagation cont.-d)
...etcetera until we reach a pixel that is
already on a crack or off the wax
88
4.A Batik Simulator
(crack generation crack tuning)
  • we account for two additional effects
  • the age of a crack for age-dependent width of the
    dye track
  • widening the junction between a crack and an
    older crack

89
4.A Batik Simulator
(crack generation crack tuning age
administration)
During crack propagation, store age of the
crack(inverse of crack counter) as an
identification tag in all crack pixels. After
all cracks are generated, use identitydistance
transform to attribute, to each pixel p, the age
of the crack C to which p is closest, together
with the distance to C.
prior to IDT pixels are labeled as wax or
crack only crack-pixels know their age
after IDT all pixels have an age label set.
wax-pixels know both the distance to the
closest crack and the age of that crack.
90
4.A Batik Simulator
(crack generation crack tuning age
administration)
And now its time for some serendipity the
wedge-shaped generalized Voronoi shapes look just
like typical batik-type irregularities in
dye-absorption near the wax cracks!
prior to IDT pixels are labeled as wax or
crack only crack-pixels know their age
after IDT all pixels have an age label set.
wax-pixels know both the distance to the
closest crack and the age of that crack.
91
4.A Batik Simulator
(crack generation crack tuning junction
administration)
D(s) tells how far s lies from the nearest
junction with the border or the nearest older
crack there, D( )0. During crack propagation,
label crack pixels p with info about their
distance to the nearest junction (d2j) iff
D(p)ltTHRESHOLD. Similar as with age, distribute
the values of d2j also to non-crack-pixels,
using a (modified) distance transform. However,
this time decrease rather than increase the
distance attribute.
92
4.A Batik Simulator
(crack generation crack tuning junction
administration)
D(s) tells how far s lies from the nearest
junction with the border or the nearest older
crack there, D( )0. During crack propagation,
label crack pixels p with info about their
distance to the nearest junction (d2j) iff
D(p)ltTHRESHOLD. Similar as with age, distribute
the values of d2j also to non-crack-pixels,
using a (modified) distance transform. However,
this time decrease rather than increase the
distance attribute.
prior to modified distance transform only
crack-pixels have a valid d2j-attribute
after modified distance transform all pixels
have a valid d2j-attribute which is propagated
outwards and decreased with distance to the crack.
93
4.A Batik Simulator
(summary of crack generation)
  • as we saw, the Batik process simulation consists
    of two phases
  • generating cracks
  • crack initiate
  • crack propagate
  • crack tuning
  • age administration
  • junction administration
  • applying a next dye bath, taking the recent
    cracks into account

94
4.A Batik Simulator
(dye application color model)
r0.72 g0.72 b0.008
r100 g100 b100
Dyes may be modeled as color filters
transmit r 0.9 g0.9 b0.4
dye 2 yellow
r0.81 g0.81 b0.02
r90 g90 b40
transmit r 1.0 g1.0 b0.25
dye 1 dark orange
r0.81 g0.81 b0.09
r90 g90 b10
reflect r 0.9 g0.9 b0.9
substrate
So we model color filtering by means of
component-wise multiplication of dye colors
95
4.A Batik Simulator
(dye application algorithm)
if(p off wax) col dyeColor else d2c
distanceToNearestCrack // using D(p) aof
ageOfNearestCreack // using age(p)
d2j distanceToNearestJunction // using d2j(p)
amp computeIntensityOfColorToBeApplied
(d2c,aof,d2j) // decreases with d2c increases
with aof // increases with d2j col dyeColor
clamp(amp, 0, 100) modulate col with a
bandwith filtered noise function apply to pixel
p using multiplicative color model
96
4.A Batik Simulator
(external controls)
  • The R,G,B channels in the input images constitute
    process control parameters
  • red R(x,y)0 no wax R(x,y)gt0 thickness of the
    wax (crack width is multiplied with R(x,y))
  • green in the crack initialization, random
    candidates are taken iff
  • rand(0...1) gt G(x,y). So expected cell size is
    proportional to G(x,y)
  • blue during crack propagation, the path
    direction is randomly perturbed with an
    IIR-filtered random sequence. The random
    amplitude is B(x,y)

97
5.Summary and Conclusions
  1. The batik simulator gives convincing batik-type
    modification of flat-colored, segmented images
  2. The various mechanisms in the batik process can
    be modeled in terms of geometric operations and
    re-entrant image processing operations
  3. All required algorithms can be straightforwardly
    derived from the distance transform
  4. An open question remains as to the methodological
    soundness of distance transform-based crack
    formation compared to finite elements-based
    techniques enter the issue of incommensurable
    sets of assumptions!

98
5.Results and Conclusions
the effect of widening cracks with age
99
5.Results and Conclusions (cont)
modulating crack width the red channel
100
5.Results and Conclusions (cont)
modulating crack density the green channel
101
5.Results and Conclusions (cont)
modulating randomness the blue channel
102
5.Results and Conclusions (cont)
the process of building a piece of batik
103
5.Results and Conclusions (cont)
104
Questions?
Write a Comment
User Comments (0)
About PowerShow.com