Project 4B: (Auto)stitching and photo mosaics

Part B: Feature Matching for Autostitching

Step 1: Harris Interest Point Detector

Using the provided get_harris_corners() function, we fist find all the Harris corners of each images at single scale.

Step 2. Adaptive Non-Maximal Suppression

With Adaptive non-maximal suppression, we rank the Harris corners by their suppression radius and filter for only the top 500 points with largest radii.

Photos after applying ANMS:

Step 3. Feature Descriptor extraction

Using the points filtered with ANMS, we create features by taking a region of 40 x 40 pixels around each point. Each region is then down-sampled to 8 x 8 pixels and normalized by subtracting the mean and divide by the standard deviation.

Sample visualization of features:

Step 4. Feature Matching

After extracting features, we match the corresponding features using Lowe’s method. We first find the l2-norm between all pairs features and record the first and second nearest neighbors of each point. If the ration between the first and second nearest neighbor distance is lower the threshold (0.1), we match the point to its fist nearest neigbors.

Photos of corresponding features:

Step 5. RANSAC

Once we have corresponding features, we use them to compute the homography H with RANSAC. We repeatedly randomly select four pairs of corresponding features, computer H, and collect all the inliers with epsilon = 0.5. After 1000 iteration we keep the largest set of inliers to compute the final homography H.

Photos of corresponding features after RANSAC:

After we optained H, we use it to wrap the image and apply 2-band blending in part A. Observe that the result is much better than picking the corresponding points by hand.

Mosaic 1:

Mosaic 2:

Mosaic 3:

Part 6. Bells and Whistles

1. Put fake graffiti on buildings or chalk drawings on the ground

2. Image in Image

3. Video projection: Project a movie onto a building wall

Note the white spots occurred in the final video is a result of decomposing the input video into images. The white spots occur after the input video is read as individual images. I think this is due to video compression.

4. Replace a road sign with your own poster

What have you learned?

I will never manually point and click 10+ individual corresponding feature points between two images in the same order again.