Image deblurring with matrix regression and gradient evolution
Gradient image blending
-
Upload
prashanth-kannan -
Category
Technology
-
view
1.399 -
download
0
Transcript of Gradient image blending
![Page 1: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/1.jpg)
Gradient Image BlendingCS 7490 | Advanced Image Synthesis | Project
Prashanth Palanthandalam
![Page 2: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/2.jpg)
Based on
Poisson Image Editing by Perez et. al.
SIGGRAPH 2003
![Page 3: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/3.jpg)
Example
![Page 4: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/4.jpg)
The Challenge
To seamlessly blend a pixel into
another image, it’s neighboring
pixel values must also be known.
![Page 5: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/5.jpg)
We need to consider
Image Gradients
which quantitatively indicate
how pixels change with respect
to their neighbors.
![Page 6: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/6.jpg)
Alter the Boundary Pixels of
IMAGE 2 to be equal to
corresponding pixels of
IMAGE 1.
But preserve the GRADIENT
for the IMAGE 2 pixels inside
the region.
![Page 7: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/7.jpg)
Mathematically, we have
A background image A
A foreground image B
A mask M
An improvised version of B Cwhich blends with A .
![Page 8: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/8.jpg)
![Page 9: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/9.jpg)
The simplified equation is…
At any boundary pixel position (X,Y)
A background image A
A foreground image B
A mask M
An improved version of B
that blends with A C
C = A
for all (X,Y) belonging to B
![Page 10: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/10.jpg)
Conditions:
C and A should match at the
boundary.
Transition must be smooth.
A background image A
A foreground image B
A mask M
Correction Factor C
![Page 11: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/11.jpg)
For the interior pixels,
The Gradient of C must be equal to
the Gradient of B.
![Page 12: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/12.jpg)
Gradient:
“The sum of the differences between
a pixel and its neighbors.”
![Page 13: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/13.jpg)
Neighbors
If one of the neighbors is a
boundary pixel, its value is fixed.
![Page 14: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/14.jpg)
If one of the neighbors is out of
bounds of the selection, it is
excluded.
![Page 15: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/15.jpg)
This is done for every pixel within C.
![Page 16: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/16.jpg)
The Equation
N Number of neighboring pixels within the region.
(x,y) Coordinate of pixel.
Omega Non-boundary selection region.
dOmega Boundary selection region.
LHS denotes gradient of C, RHS denotes gradient of B
![Page 17: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/17.jpg)
The Matrix
Assume there are n pixels in region C.
We need to solve the equation for every
pixel.
We have a System of Linear Equations in n
variables.
![Page 18: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/18.jpg)
This leads to an n by n matrix.
But n is very large !
![Page 19: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/19.jpg)
Besides, the matrix is very
sparse, the values are few and
far in between.
![Page 20: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/20.jpg)
Jacobi’s Method
Px = Q
• P is the matrix of equations defined earlier.
• Q is the result of the equations.
• x is the unknown – the pixels of the region C
![Page 21: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/21.jpg)
x is initially initialized to 0 (all
values), essentially a black image.
![Page 22: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/22.jpg)
Error between Q and Px is calculated
and added back to x.
The iterations are repeated until the
error is significantly small.
![Page 23: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/23.jpg)
GUI Processing 1.5.1
![Page 24: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/24.jpg)
![Page 25: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/25.jpg)
More Results
![Page 26: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/26.jpg)
![Page 27: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/27.jpg)
![Page 28: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/28.jpg)
Failures
![Page 29: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/29.jpg)
![Page 30: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/30.jpg)
![Page 31: Gradient image blending](https://reader034.fdocuments.us/reader034/viewer/2022052413/55a186971a28ab6c688b4796/html5/thumbnails/31.jpg)
References
Poisson Image Editing by Perez et. al. SIGGRAPH 2003
Chris Trailie – Poisson Image Editing
Stack Exchange – Signal Processing Beta.