概述
Digital Face Makeup by Example
paper motivation
这篇论文用传统的图像处理技术进行人脸妆容的迁移。在这篇论文之前对人脸妆容迁移的方法比较少。相关的一篇论文需要提供参考美妆图像的卸妆图像,这一步在实用中比较麻烦。
主要贡献
主要是对比之前的方法不需要提供参 a pair of “before” and “after” makeup images as examples.也就是只需要提供一张参考的妆容照就可以了。
主要思想
论文方法输入两张图片,一张目标图片
I
I
I,一张参考的样例化妆图片
ε
varepsilon
ε。主要分为四步。第一步:进行人脸对齐。因为我们迁移的信息是对像素点进行迁移,所以对人脸的对齐是很有必要的。第二步:对图像的分解。对目标图像和参考化妆图像分解成三层:脸部结构层;皮肤细节层;颜色层。第三步 :将分解后的图像通过不同的处理;皮肤细节层通过相加,颜色层使用一个 alpha blending,对人脸结构中的高光和阴影部分使用梯度进行迁移。第四步:将得到的三部分组合到一起。
人脸对齐
对于人脸对齐采用了Thin Plate Spline (TPS) 薄板样条函数(TPS)是一种很常见的插值方法。因为它一般都是基于2D插值,所以经常用在在图像配准中。在两张图像中找出N个匹配点,应用TPS可以将这N个点形变到对应位置,同时给出了整个空间的形变(插值)。
TPS常用来对形状进行 non-rigid 变形,比如给定原始形状的有限点集A,变形后的对应目标点集B,设C=B-A,对(Ax,Ay, Cx)拟合出一个TPS,就可以得到x方向的内插函数;对(Ax,Ay, Cy)拟合出来的TPS则可以得到y方向的内插函数。这样一以来对于不在点集中的点,我们就可以插值得到目标点。从而完成整个面的变形。
这里可能需要用户去细化控制点的位置,因为控制点已经比较确定了,通常不需要一分钟就可以细化,在代码中需要标明额头部分,标出十个控制点。
这些控制点控制了脸部的不同部分。C1代表皮肤区域,C2代表嘴唇,C3代表眼睛和口腔。
层分解
将图片转换到CIELAB颜色空间,L层被认为是 lightness layer ,a*,b*认为是颜色层。然后将lightness layer分解成large-scale and detail layers.The large-scale layer is considered as the face structure layer and the detail layer as skin detail layer.主要思想是,先将lightness layer执行一个 edge-preserving smoothing得到large-scale layer,然后将lightness layer减去large-scale layer得到detail layer。
迁移
Skin detail transfe
Skin detail transfer is straightforward. The resultant skin detail layer
R
d
mathcal { R } _ { d }
Rd is a weighted sum of
I
d
mathcal { I } _ { d }
Id and
E
d
,
i
.
e
.
mathcal { E } _ { d } , i . e .
Ed,i.e.
R
d
=
δ
I
I
d
+
δ
E
E
d
mathcal { R } _ { d } = delta _ { mathcal { I } } mathcal { I } _ { d } + delta _ { mathcal { E } } mathcal { E } _ { d }
Rd=δIId+δEEd
where
0
≤
δ
I
,
δ
E
≤
1.
0 leq delta _ { mathcal { I } } , delta _ { mathcal { E } } leq 1 .
0≤δI,δE≤1. The values of
δ
I
delta _ { mathcal { I } }
δI and
δ
E
delta _ { mathcal { E } }
δE control the contribution of each component.
Color transfe
The resultant color layer
R
c
mathcal { R } _ { c }
Rc is an alpha-blending of color layers of
I
mathcal { I }
I and
E
,
mathcal { E } ,
E, i.e.
R
c
(
p
)
=
{
(
1
−
γ
)
I
c
(
p
)
+
γ
E
c
(
p
)
p
∈
C
3
I
c
(
p
)
otherwise
mathcal { R } _ { c } ( p ) = left{ begin{array} { l l } { ( 1 - gamma ) mathcal { I } _ { c } ( p ) + gamma mathcal { E } _ { c } ( p ) } & { p in mathcal { C } _ { 3 } } \ { mathcal { I } _ { c } ( p ) } & { text { otherwise } } end{array} right.
Rc(p)={(1−γ)Ic(p)+γEc(p)Ic(p)p∈C3 otherwise
The value of
γ
gamma
γ is to control blending effect of two color layers.
Highlight and shading transfe
we adapt a gradient-based editing method.The idea is to add only large changes of
E
s
mathcal { E } _ { s }
Es to
I
s
.
mathcal { I } _ { s . }
Is. Doing this, we assume that these changes are due to makeup.
∇
R
s
(
p
)
=
{
∇
E
s
(
p
)
if
β
(
p
)
∥
∇
E
s
(
p
)
∥
>
∥
∇
I
s
(
p
)
∥
∇
I
s
(
p
)
otherwise
nabla mathcal { R } _ { s } ( p ) = left{ begin{array} { l l } { nabla mathcal { E } _ { s } ( p ) } & { text { if } beta ( p ) left| nabla mathcal { E } _ { s } ( p ) right| > left| nabla mathcal { I } _ { s } ( p ) right| } \ { nabla mathcal { I } _ { s } ( p ) } & { text { otherwise } } end{array} right.
∇Rs(p)={∇Es(p)∇Is(p) if β(p)∥∇Es(p)∥>∥∇Is(p)∥ otherwise
Lip makeup
因为嘴唇化妆和脸部是很不一样的。在物理化妆中,嘴唇上的化妆品(如口红)通常会保留或突出嘴唇的质感,而不是像在面部皮肤上那样隐藏。因此,嘴唇区域的化妆需要用不同的方法来处理。
The main idea is to fill each pixel of
R
mathcal { R }
R with pixel value from
E
mathcal { E }
E guided by
I
.
mathcal { I } .
I. Then the makeup effect is similar to
E
mathcal { E }
Eand the texture is similar to
I
.
mathcal { I } .
I. Specifically, for each pixel
p
p
p
缺点
需要进行用户交互,不是很方便。
最后
以上就是愉快秀发为你收集整理的Digital Face Makeup by Example的全部内容,希望文章能够帮你解决Digital Face Makeup by Example所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复