Project 6: Stitching Photo Mosaics

Yan Gu

(Please wear earphone and watch the video while downloading images)

Part 1&2

Overview

In part 1, we need to implement a projective transformation and manually make photo mosaics. The idea is really simple, but we need a lot of work to manually assign the correspondence points. Since they are very sensitive, a better way is to have more points (7-8 pairs of points).

The projective transformation matrix can be solve by linear equations using some elementary school level algrebra tricks.

In part 2, some additional steps are needed:

1. Corner detection:

Here I use Harris corner detection. Harris corner detection using Harris matrix which use the first order derivitive as Taylor expansion:

A corner (or in general an interest point) is characterized by a large variation of S in all directions of the vector (x, y). By analyzing the eigenvalues of  A , this characterization can be expressed in the following way:  A should have two "large" eigenvalues for an interest point, which is determined by:

2. Adaptive Non-Maximal Suppression

We first sort all the potential corner points, and then try all corners from the corner "intensity", restricted by the minimum radius between nearest respected corner points. This process is operated iteratively, by the decreasing "distance".

3. Feature points matching

This step is implemented using the method discribed in [Lowe, 1999], calculating the error ratio between the first closest match and the second closest match.

Here I set the threshold to be 0.5.

4. Random Sample Consensus

In this step, we randomly choose some sample points as corresponding points, and check the number of points which agree this prespective transormation.

aaa

The automatic algorithm is ridiculous robust and the result is surprisingly good. This is a sample that has 500 feature points each. About 70% feature points meet the other points correctly. Thus, the automatic algorithm receives a much better result than the manual algorithm.

Result:

Sunny Campus

Direct result:

Manual:

Automatic:

Cropped:

Manual:

Automatic:

Western Side Campus

Direct result:

Manual:

Automatic:

Cropped:

Manual:

Automatic:

 

CMU from Cathedral of Learning

Direct result:

Manual:

Automatic:

Cropped:

Manual:

Automatic:

Image Rectification

Here I use a warpped photo to make the result of rectification.

Input Image Result

 

Bells & Whistles

Efros in my photo!

Input Image Result

 

Season blending:

 

Pyramid Blending:

Here I use a multi-scale Laplacian pyramid blending (5 levels). Although 2 level blending works on most situations, here is a failure case of 2 level blending that causes a failure case (ghost effect, lots of high frequency information near blending edge) but the 5 level blending handles it much better.

2 level result 5 level result

Part 3

Description

The goal of this part is to create a simple, planar 3D scene from a single photograph, following the description in Tour into the Picture by Horry et al. in modeling the scene as a 3D axis-parallel box.  First, we will let the user specify simple constraints on that box (the back wall plus the vanishing point, totally 5 points).  Then, we extract the coordinates of the box in 3D, and texture-mapping the faces of the box.

Here's some example that how those constraint points are placed.

Input Images Constraints

 

Results

Imput Image Novel Viewpoints

(borrowed from Charriso)

Bells & Whistles: fly-through movie!