Image Analogy

Generate Photographs from Low Budget Drawings

Fall 2014

What Is It?

This computer program takes in a real photograph, a simple low budget drawing of it, and a new simple drawing, and then generates a fourth image that shapes like the third image but has the texture of the photograph. This allows me to generate new photographs by using very simple drawings. This is an implementation of the algorithm described here.

I made it as my final project for CMU's Computational Photography course (15-463).

In all of the pictures, top left is actual photograph, top right is low budget drawing of it. Bottom left is a new low budget drawing, and bottom right is what my program generates.

Landscape generation works very well

What Is It Written In?

It is written in Matlab.

Another example. The water is a bit mangled

What Is the Algorithm?

I loop through patches in the third image, and look for patches in the second image that are similar to it. I then get the corresponding patch in the first image, and copy it over patch by patch to the output. In order to get all patches to blend together nicely, I ran Dijkstra's Algorithm to find a minimum error cut, and use that between each pair of adjacent patches.

Now anyone can make their own low budget Van Gogh paintings

What Did I Learn?

Instead of just following some homework spec, I had to implement something that does not necessarily have a correct solution. I learned to dig through research papers and experiment with the code to find what produces the best results for each different input.

The algorithm is weak on generating Rihanna from Obama

Github Repository