-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
182 lines (164 loc) · 7.52 KB
/
index.html
File metadata and controls
182 lines (164 loc) · 7.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!DOCTYPE html>
<head>
<title>CS194-26 Proj4</title>
<!-- <link rel="StyleSheet" href="../style.css" type="text/css" media="all" /> -->
<style type="text/css">
<!--
body {
background: #00000;
margin: 0;
padding: 0;
color: #000;
font-family: Helvetica, Verdana, Arial, sans-serif;
font-size: 11pt;
font-style: normal;
line-height: 1.4;
}
/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p {
margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
padding-right: 15px;
padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
}
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
border: none;
}
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
a:link {
color: #42413C;
text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
}
a:visited {
color: #6E6C64;
text-decoration: underline;
}
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
text-decoration: none;
}
/* ~~ this fixed width container surrounds all other elements ~~ */
.container {
width: 960px;
background: #FFF;
margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout */
}
/* ~~ This is the layout information. ~~
1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.
*/
.content {
padding: 10px 0;
}
/* ~~ miscellaneous float/clear classes ~~ */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the overflow:hidden on the .container is removed */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
-->
</style>
</head>
<body>
<h1>
William Choe
</h1>
<h2>
Face Morphing <br>
</h2>
<h3>Overview</h3>
<p>
Here we created a visual morph between two faces. We achieve this
by warping the shape of the imagaes and by cross dissolving the images for color.
To do this, you first need to define "corrispondence points" on both faces that represents
key features of each person such as eyes, mouth, nose, forehead shape, etc. <br>
</p>
<h3>Defining Correspondences</h3>
<p>
First, we need to identify key points of each picture. It's important to choose
a lot of points around facial features we (humans) tend to use to identify
faces such as the eyes, mouth, chin, etc. For this warp, I chose myself, and
my friend. I used approximately 40 points. <br />
<br />
</p>
Here is the image of myself. <br />
<img src="images/will.jpg" alt="will" width=500 />
<br />
Here is the image of my friend <br />
<img src="images/emilie.jpg" alt="emilie" width=500 />
<br />
These are our faces with the corrispondence points I selected <br>
<img src="images/will_marked.jpg" alt="will_marked" width=500>
<br />
<br />
Delauny Triangulations <br />
<img src="images/dt0.png" alt="will tri" width=500>
<img src="images/dt1.png" alt="emilie tri" width=500>
<h3>Computing the "Mid-way Face"</h3>
<p>
After defining correspondence points, we can compute the "mid-way" of the two
faces. This is done in 3 steps. <br />
<br />
1) Compute the average shape <br />
The average shape of 2 images is their x,y coordinates divided by 2 and added
together i.e. avergae_shape[y,x] = imA[y,x] * (1/2) + imB[y,x] * (1/2) <br />
<br />
2) Warping both faces into that shape i.e. create warp from imA --> mid and imB --> mid <br />
<br />
First, I used the average shape point set to create a Delaunay triangulation over the entire image.
To make sure every point in the image is located a triangle, I added the
corners of the image to my average point set. Now I can start to compute the warp
from imA --> mid and imB to mid. For a given warp (let's say imA --> mid)
for each triangle, I computed an Affine transformation matrix that maps
point transformation from imA --> mid. Ax = x' where A is the Affine matrix,
x is a vector of points in im1, and x' is a vector of points in im2. Then,
I used inverse warping using inverse of A for every x,y coordinate of my image
to determine where to map all points of imA to this warp. I repeated the
above to calculate my 2nd warp of imB --> mid. <br />
<br />
3) Averaging the colors together <br />
<br />
For both of my warps, warpA and warpB, I cross-disolved the images using a
weight of 1/2. midway = warpA * (1/2) + warpB * (1/2) <br />
</p>
<br />
Me <br />
<img src="images/will.jpg" alt="will" width=500 />
<br />
Midway Face <br />
<img src="images/midway_will_emilie.png" alt="will and emilie mid" width=500>
<br />
My friend <br />
<img src="images/emilie.jpg" alt="emilie" width=500 />
<br />
<br />
Note: Looking back I sholdn't have worn my glasses because it creates a
ghosting effect where the midway image looks like they're transparent (like a ghost)
<br />
<br />
<h3>The Morph Sequence</h3>
<p>
The process of creating a morph between imA and imB is essentially using the
same process as creating the mid-way face, just doing it multiple times while
changing certain weights and values. First, we generalize computing the
average shape. Instead of half of each image, we want (1 - i/45) of one
image and i/45 of the other image. Second, we generalize the crossdisolving.
Instead of just 1/2 of the color of each image, we again want (1-i/45) of
one image and 1/45 of the other image where i is in range from 0 to the number
of frames we want, which is 45. <br />
</p>
<br />
Here is the morph sequence between me and my friend. <br />
<img src="images/will_emilie_gif.gif" alt="my gif" width=500 />
</body>
</html>