13
Computational Photography Final project Image blending Student 杜 杜 Student ID 601410050

Computational Photography Final project Image blending Student :杜 寧 Student ID : 601410050

Embed Size (px)

Citation preview

Computational PhotographyFinal project

Image blending

Student :杜 寧Student ID : 601410050

OutlineMotivationProgram designMethods of operationLimitationDemoReference

Motivation 市面上已經有許多完善的圖像處理工具,但我們卻

不知道這些程式背後運用了哪些理論才能實作出來。

這次在計算攝影學課程中學到許多關於處理影像的方法,加上曾經在網路上看過很多有趣的合成照片,想藉此機會實作出 Image blending 。

Program design Minimize squared difference between gradients of

foreground region and gradients of target region. Keep background pixels constant.

Given the pixel intensities of the source image "s" and of the target image "t", we want to solve for new intensity values "v" within the source region "S":

Each "i" is a pixel in the source region "S", and each "j" is a 4-neighbor of "i".

In the first summation, the gradient is over two variable pixels; in the second, one pixel is variable and one is in the fixed target region.

Program design(cont) Implemented the mixed gradient blending:

This algorithm does the same steps as Poisson blending. Here "d_ij" is the value of the gradient from the source or

the target image with larger magnitude. That means, if the target gradient is greater than the

source gradient, then we use the target gradient as the guide, and vice versa.

source gradient(i, j) = src(i) – src(j) target gradient(i, j) = tar(i) – tar(j) assume Sg is source gradient(i, j), Tg is target gradient(i,

j) d(i, j) = if Tg > Sg

then choose Tg

else choose Sg

Methods of operation1.Click “Load image” button and then

choose the source image from “test_images” browser.

Methods of operation(cont)

2.It will show the mask after you used mouse to draw a region that you want to blend with the target image.

Mouse down => draw Mouse up => finish

Methods of operation(cont)

3.Click “Load image” button again to choose the target image, and it will display a figure window.

4.Pull the masked image to a good blending place on target image by mouse down.

Methods of operation(cont)

5.Click “Start blending” button and wait the result image to display on the GUI “Result Image” block.

Methods of operation(cont)

6.Click “Close” button to exit. (It will show you a pop-up window to ask if you really want to exit.)

LimitationImages need to be very well aligned.Cannot do contrast reversal. Changes foreground color(for better or

worse).

Demo http://youtu.be/dfnX2tFjc8E

1.

2.

3.

連結

Reference 上課投影片 Chapter27 Blending and Compositing p.38~p.48

Gradient-Domain Fusion http://courses.engr.illinois.edu/cs498dwh/fa2010/projects/gradient/ComputationalPhotography_ProjectGradient.html

Poisson Image Editing.” Patrick Pérez, Michel Gangnet, and Andrew Blake. SIGGRAPH 2003

http://cs.engr.uky.edu/~jacobs/classes/2010_photo/readings/PoissonImageEditing.pdf

Image Blending by Evan Wallace http://cs.brown.edu/courses/csci1950-g/results/proj2/edwallac/