To interpolate f of f* over Ω, the solution is:
To avoid the blurred interpolation, we can modify the problem by introducing further constrains in the form of a guidance field,
We choose the gradient field directly from the source image g,
So now, the solution to the problem is
We can discretize the laplacian operator as
So, the solution can be discretized as follows,
Results
Given a source and a destination image, we want to copy the eyes and the mouth of the girl (source) into the lena image (destination).
Gauss-Seidel scheme
The discretized model can be resolved by the Gauss-Seidel iterative method. The result is showed.
Conjugate gradient method
The model problem described above can be expressed as a linear system of equations:
where f are those pixels in the clone region. A is a matrix of size N x N, where N is the number of pixels in the clone region, and is defined as follows:
The vector b is a finite approximation of the source laplacian for all the pixels in the clone region. Moreover, the border pixels have the fixed value of their neighbors outside the clone region added on the laplacian value.
Once the matrix A and vector b are defined, the conjugate gradient method will attempt to solve the linear system of equations.
Conclusions
The results present a bit of blurring where the destination image have edges. This is happening because the seamless cloning blends the source and destination regions. The effect of this blending is more significant when the insertion of one object is close to another. However, the use of mixed gradients prevents this undesirable effect.
No hay comentarios:
Publicar un comentario