Overview:
------------------
This project focused on image morphing techniques. The goal of this project was to create a "morph" animation of my face into another person's face. A morph is a simultaneous warp of the image shape and a cross-dissolve of the image colors.
In this project, I implement two morphing methods (point triangulation and thin plate spline). The techniques utilized in this project were referenced from the following sources.
- https://alliance.seas.upenn.edu/~cis581/wiki/Projects/fall2016/project2/main.pdf
- http://cseweb.ucsd.edu/~sjb/eccv_tps.pdf
Project Walk-Through and Results:
--------------------
**Define Correspondences**
- First, pairs of corresponding points are selected by hand across the two input images. This portion of my code leverages MATLAB's built-in "cpselect" tool.
<p align="center">
<img src="https://cloud.githubusercontent.com/assets/9031637/20342033/c413059c-abb6-11e6-9ea7-4e75bf347f61.png" width="800">
</p>
**Image Morph Via Triangulation**
- The point correspondences across two images are averaged, giving an average face. Delauney triangulation is then performed on these points, sectioning the plane into triangles.
<p align="center">
<img src="https://cloud.githubusercontent.com/assets/22136934/20359373/89a8e934-abfd-11e6-854d-070eb894a3cb.jpg" width="650">
</p>
- These triangles computed in the average face can be applied to the points in each of the original faces.
<p align="center">
<img src="https://cloud.githubusercontent.com/assets/22136934/20367661/770dee70-ac1e-11e6-9368-c25225e5082c.jpg" width="650">
</p>
- For each pixel in the new image, we determine where that point lies in the two original face images. The new pixel is computed as a weighted
average of the original pixels. The key insight here is that points that lie within a triangle in the original face images remain within that tiangle after a transformation into the new image. The output from this step, which is also the final morphed image, can be viewed below.
<p align="center">
<img src="https://cloud.githubusercontent.com/assets/22136934/20368113/97a61728-ac20-11e6-86c7-1e7a798cfaad.jpg" width="650">
</p>
**Thin Plate Spline (TPS)**
- The thin plate spline technique computes an average face as before, by averaging the corresponding points between the input images. For each input image, a function is then computed that exactly maps the selected points in the input image to their corresponding location in the averaged image. This function also applies to all of the unselected pixels in the input image - note that there is no specified "exact" location for these points. Instead, for these remaining points, the function acts to minimize bending contortions to the image. You can see the morphing result from this technique below.
<p align="center">
<img src="https://cloud.githubusercontent.com/assets/22136934/20368767/6f9b45b6-ac23-11e6-82b9-5c27dc67eadb.jpg" width="650">
</p>
没有合适的资源?快使用搜索试试~ 我知道了~
薄板样条matlab代码-CIS-581_Face_Morphing:无缝地将一张脸变形为另一张脸
共14个文件
m:6个
jpg:2个
gitignore:1个
需积分: 21 8 下载量 97 浏览量
2021-05-27
00:39:58
上传
评论
收藏 29KB ZIP 举报
温馨提示
薄板样条matlab代码概述: 该项目专注于图像变形技术。 该项目的目标是将我的脸部“变形”动画制作为另一个人的脸部。 变形是图像形状的同时扭曲和图像颜色的交叉溶解。 在此项目中,我实现了两种变形方法(点三角剖分和薄板样条线)。 该项目中使用的技术从以下来源中引用。 项目进展及结果: 定义对应 首先,在两个输入图像之间手动选择成对的对应点。 我的代码的这一部分利用了MATLAB内置的“ cpselect”工具。 通过三角剖分的图像变形 将两幅图像上的点对应关系进行平均,得到一张平均脸。 然后在这些点上执行Delauney三角剖分,将平面切成三角形。 在平均面中计算出的这些三角形可以应用于每个原始面中的点。 对于新图像中的每个像素,我们确定该点在两个原始人脸图像中的位置。 计算新像素作为原始像素的加权平均值。 此处的关键见解在于,原始面部图像中位于三角形内的点在转换为新图像后仍保留在该三角形内。 该步骤的输出(也是最终的变形图像)可以在下面查看。 薄板花键(TPS) 薄板样条线技术通过对输入图像之间的对应点求平均,像以前一样计算平均人脸。 对于每个输入图像,然后计算一个函数,该函数将输入
资源详情
资源评论
资源推荐
收起资源包目录
CIS-581_Face_Morphing-master.zip (14个子文件)
CIS-581_Face_Morphing-master
.gitignore 53B
morph_tps.m 3KB
click_correspondences.m 780B
morph.m~ 7KB
est_tps.m 2KB
README.md 3KB
Output
Empty_Text.txt 193B
morph.m 7KB
Images
image2.jpg 5KB
project2_testimg.png 2KB
image1.jpg 13KB
morph_tps_wrapper.m 2KB
point_correspondences.mat 1KB
demo.m 2KB
共 14 条
- 1
weixin_38646645
- 粉丝: 4
- 资源: 1001
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0