Project 3 for grad students - Gradient-Domain Fusion

Yan Gu

Overview

The implementation of this project is much simpler: just to optimize an energy function. For each problem, we optimize a certain energy function and get the result.

Framework

Initiallize we have a quadratic energy function:

If we calculate the partial derivative of each variable in the function, we can get:

Obviously that the coefficient matrix is positive definate (I change every semi-positive definate matrix into positive definate matrix in practice). So if we want to minimize the energy, simply calculate:

whereas A = {a_ij}.

Toy Problem:

Energy function:

Result:

Poisson Blending:

Energy function:

Result:

Original picture
Replace picture
Result

Failure case:

It is obviously that if the backgound color does not match (like carving some letters on blackboard onto whiteboard) , the result will receive a failure. However, here I show another example:

Original picture
Replace picture
Result

The main reason is that the less the distance of texture of two pictures, the better the result will be.

Mixed Gradients:

Energy function:

whereas d_ij = abs(s_i-s_j) > abs(t_i-t_j) ? s_i-s_j : t_i-t_j .

Result:

Original picture
Replace picture
Result

Mixed Gradients blending works especially good with texture on background.

Bells & Whistles:

Color2Gray:

Energy function:

whereas S,V are saturation and value in HSV color space. alpha is a coefficient here to balance derivatives and mean values. I set alpha to be 50 in this case.

Result:

Original picture
Gradient Domain Result
Direct result

Detail Manipulation:

Energy function:

whereas alpha is also 50 and r() is a kind of nonlinear mapping function like giving in [2]:

Result:

Original picture
Smoothing result
Detail enhancement result

Non-photorealistic abstraction

The edge-aware smoothing algorithm above is well suited to the needs of image abstraction.

Here I use Difference of Gaussians (DOG) [4] to detect the edge and make a non-photorealistic abstraction effect [5].

Result:

Original picture
Non-photorealistic abstraction result

Parameters( [alpha beta] ):

[100 0.75] for villa, and

[50, 0.5] for teahouse.

Reference:

[1] P. Perez, M. Gangnet, and A. Blake, “Poisson image editing,” ACM Trans. Graphics, vol. 22, no. 3, pp. 313–318, 2003.

[2] S. Paris, S. W. Hasinoff, and J. Kautz, “Local laplacian filters: edgeaware image processing with a laplacian pyramid,” ACM Trans. Graphics, vol. 30, no. 4, pp. 68:1–12, 2011.

[3] M. Aubry, S. Paris, S. W. Hasinoff, J. Kautz, and F. Durand, “Fast and robust pyramid-based image processing,” Technical Report, pp. 1–11, 2011.

[4] Notes by Bryan S. Morse on Edge Detection and Gaussian related mathematics from the University of Edinburgh.

[5] Z. Farbman, R. Fattal, D. Lischinski, and R. Szeliski, “Edge-preserving decompositions for multi-scale tone and detail manipulation,” ACM Trans. Graphics, vol. 27, no. 3, pp. 67:1–10, 2008.