When given pixel intensity of a source image S, we want to reconstruct an image V using the gradients from s, plus one pixel value. Denote the intensity of S at (x,y) as s(x,y), and similarly V at (x,y) as V(x,y).
For each pixel, we will have two gradient-based objectives: 1. \( argmin_v((v(x+1, y) - v(x, y)) - (s(x+1, y) - s(x,y)))^2 \) 2. \( argmin_v((v(x, y+1) - v(x, y)) - (s(x, y+1) - s(x,y)))^2 \)
And additionally, we add one pixel value constraint: 3. \( argmin_v((v(1, 1) - s(1, 1)))^2 \)
To translate this in to a least-square optimization problem, we want to reshape V into a vector x, and construct the constraints as \( (Ax - b)^2 \), where A denotes the coefficients of v(x,y) in the objectives, and b corresponds to all terms non-related to v(x,y).
where \( N_i \) denotes the 4-neighbor of pixel i, \( S \) denotes the region of the source image.
In this project, we also have a helper mask \( m \), which we will apply onto the original source image
to get the final source image we will be using for Poisson Blending.
The color of the surfer's skin changes significantly.
The color of the brown bear also changes significantly, more blended into the white background.
In this example, the color of the white polar bear almost turns into green.
Here \( d_{ij} = max(abs(s_i - s_j), abs(t_i - t_j)) \)
We can notice that the mixed-gradient result better preserve the details of the target background compared to
the original Poisson Blending result.