-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75bb98b
commit c3b2503
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Gradient blending | ||
|
||
实现Gradient Blending | ||
|
||
(1)用genmask去从源图像中选择一个区域; | ||
|
||
(2)用拉普拉斯算子计算源图像的拉普拉斯图像; | ||
|
||
(3)利用ginput在目标图像中点击一个点,将源图像中的区域的中心点对齐到这个点; | ||
|
||
(4) 在目标图像中标记需要进行计算的像素点,并且对这些像素点进行重新的标号; | ||
|
||
(5)构建线性方程组的矩阵A和b | ||
|
||
(6)求解方程,得到像素的像素值,将像素值返回到目标图像的相应像素得到融合后的结果 | ||
|
||
### 结果 | ||
|
||
原图像: | ||
|
||
![source1](pic/source1.jpg) | ||
|
||
背景图: | ||
|
||
![bg3](pic/bg3.jpg) | ||
|
||
![bg4](pic/bg4.jpg) | ||
|
||
融合后的结果: | ||
|
||
![tar1](pic/tar1.png) | ||
|
||
![tar2](pic/tar2.png) | ||
|
||
![tar3](pic/tar3.png) | ||
|
||
![ta4](pic/ta4.png) | ||
|