CS129 / Project 2 / Image
Blending
This
project implements the
seamless image composition
algorithm from Pérez,
et al. "Poisson Image Editing".
The
algorithm is written for Matlab. It uses sparse matrices as suggested in the handout.
Prior calling the blending function, the image is cropped to the
minimum rectangular region containing the mask to speed up the
algorithm. Merging a patch of 400x300 pixels takes about 2
seconds in my laptop. The resulting function can perform several of the
applications mentioned in "Poisson
Image Editing":
seamless cloning, mixing gradients, inserting objects with holes,
texture flattening, and local color changes.
Failure case
The method fails when the gradients close to the seam are too
different. For example, when a constant region is merged with a
non-constant one as in the images below. Even though both original
images have
similar colors, the result does not look as a true picture.
Original |
Mask |
Source |
Result |
 |
 |
 |
 |