forked from imgproc2014/shadow_removal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
144 lines (127 loc) · 4.17 KB
/
index.html
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
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="main.css">
<!-- see: http://www.codecogs.com/latex/integration/htmlequations.php -->
<script type="text/javascript" src="http://latex.codecogs.com/latexit.js"></script>
<script type="text/javascript">
LatexIT.add('p',true);
</script>
<title>Shadow removal from faces</title>
</head>
<body>
<div class="vspace"></div>
<div id="all">
<div id="header">
<h1>Shadow removal from faces</h1>
</div>
<hr/>
<div id="authors">
<p>
Noam Hirshberg<br/>
Maroun Sassine
<p>
</div>
<h2>Project abstract</h2>
<p>
The goal of this project is performing shadow removal from
images of faces. Faces are often a key feature in pictures, but
sometimes, bad lighting in the scene with possible combination
of non-optimal camera settings, can cause faces to look too
dark and covered with shadows.
</p>
<p>
To achive our goal of removing shadow, Our method uses multiple
images of the person in good lighting conditions to fix an image
with shadows. The following describes the ideas and methods
implemented.
</p>
<h2>Introduction: intrinsic images</h2>
<p>
Intrinsic images are a useful midlevel description of scenes
proposed by Barrow and Tenenbaum.
</p>
<p>
The intrinsics of an image are composed of two parts:
reflectance, and illumination. These are defined such that
multiplying the reflectance with the illumination, we get the
original image, as illustrated here:
</p>
<img src="images/intrinsic.gif" border="1" width="600px">
<p>
To remove the multiplication, we work with the log domain.
</p>
<img src="http://latex.codecogs.com/svg.latex?i(x,y,t)=r(x,y)+l(x,y,t)" border="0"/>
<h2>Finding the intrinsics of an image</h2>
<p>
Deriving intrinsic images from image sequences (<i>Yair Wiess</i>):
given a sequence of images as input, we solve this equation:
$I(x,y,t)=R(x,y)L(x,y,t)$ and find $R(x,y)$, where $R(x,y)$ is
constant in all images.
</p>
<p>How does it work?</p>
<ul>
<li>We take 2 derivative filters, horizental and vertical.</li>
<li>Convolve every derivative filter with every image in the sequence.</li>
<li>Now we take all horizental derivative images and implement an image by median of all of them.</li>
<li>We do the same for the vertical derivative images.</li>
<li>Now we have 2 images.</li>
</ul>
<img src="images/median.gif">
<p>Illustration As shown in Yair's article:</p>
<img src="images/Mlmodel.png" border="1" width="600px">
<p>Note that all images must be aligned.</p>
<p>
Now we need to transform back to the original image and find 'r'.
To do so we solve the linear equations:
</p>
<img src="images/solveequation.gif">.
<p>
Solution is given by these equations:
</p>
<img src="images/Sigma(6).gif">
<br/>
<img src="images/sigma(7).gif">
<h2>Warping faces</h2>
<p>
The above algorithm assumes that the images are aligned. To use
it we need to first warp the faces to be aligned as closly as
possible to the face which we want to fix.
</p>
<h2>Results</h2>
<p>Example source images:</p>
<img src="images/maroun_source/20140706_153321.jpg" border="1">
<img src="images/maroun_source/20140706_153323.jpg" border="1">
<img src="images/maroun_source/20140706_153324.jpg" border="1">
<img src="images/maroun_source/20140706_153405.jpg" border="1">
<p>Results:</p>
<figure>
<img src="images/maroun_reflectance.jpg" border="1">
<figcaption>Reflectance image.</figcaption>
</figure>
<br/>
<figure>
<img src="images/maroun_not_aligned.jpg" border="1">
<figcaption>Without the face warpping - we can see that we don't get any meaningful results.</figcaption>
</figure>
<h2>Source code</h2>
<p>
<a href="project_final.zip">Soure code with test images</a>
<br/>
<a href="source_only.zip">Soure code only</a>
</p>
<p>
Run <code>script.m</code>. To choose a different folder for source
images change the
<code>image_prefix</code> variable.
</p>
<h2>References</h2>
<p>
Deriving intrinsic images from image sequences,
Yair Weiss,
ICCV 2001
</p>
</div><!-- id="all" -->
<div class="vspace"></div>
</body>
</html>