In this project, we sample a couple of image editing algorithms that are based on gradient domain operations. The main idea throughout is to explicitly set up constaints on the gradients (i.e. pixel differences) of an image, and then solve for the actual pixel values that best match the constraints, usually in term of the least square measure.
To see that this basic script is running correctly, both removing the small gradients and removing the large gradients are tried.
|remove small gradients||remove large gradients|
|cumsum along y|
Now the magic blending part.
|blended into elsewhere|
|and the fleet|
Mixed gradient blending is helpful in some special situations.
|dora on grass||name in water|
NPR effects can be achieved by simply getting rid of smaller gradients like in the toy problem.
|Also, we can enhance some strong edges to better depict the shapes.|
|The outlook from my bedroom's window, and the NPR'ed version.|
|However, this simple method usually doesn't work well for highly textured surfaces, such as grass and this hairy ear, mostly for the reason that there are too few low gradient pixels among these regions.|
|Yet another example with line enhancement. Totally flattened the grass this time by setting a larger threshold on gradients.|
|Converting color image to gray scale image by looking at the HSV space and blending the S and V channels together with the standard rgb2gray results using the mixed gradient method.|
|Though this gives out not longer a faithful representation of the original image.|