Photo Mosaics

For Computational Photography, 15-463 (Project 2)

Carnegie Mellon University                                  jmm59@pitt.edu

Image Rectification

First thing to do for this project was to compute homographies between pairs of images.  A homography is a transformation matrix which tells one image how to align itself with another image, based on correspondence points found in the image overlaps.  To test the homographies, I used them to ‘rectify’ images.  In my examples, I took pictures that contained square objects at an angle to the camera.  Then I transformed them so that the squares were once again ‘square.’

Here you can see that while the first image was taken at an angle from the floor, the second image looks like it was taken pointing straight down.

For the next three image pairs, see if you can figure out which shape I made into a perfect square:

That last one kinda freaks me out, because it looks like the camera’s in the same place, but the iguana cage rotated somehow.  Weird.

Mosaic Panoramas

Onto the main event.  Our assignment was to take a bunch of pictures with the camera rotated about a single point.  Then we had to stitch these images together to create one wide (or tall) photograph.  All three mosaics I built were of my in-law’s house, where I live.

Here’s the house from the front yard (composed from three images):

House from the back yard (four images):

A comment on exposure: my Canon camera has the PhotoStitch feature, so I was able to take advantage of the panorama capture feature.  This automatically uses the same shutter speed, aperture size, etc. for each picture in the sequence.  Unfortunately you have to start on one side of your panorama, so by starting with the relatively dark image on the left, I ended up with the bleached-out house in the center just from the contrast in lighting.  I didn’t realize my folly until the bad weather started, so, well, alas.

Finally, here’s the living room (note several of the pictures from the image rectification section, 5 images total):

I actually capture six images for this mosaic, but it ended up being more than 180 degrees, and I crashed my computer.  Many times.

The method used here projects all images onto a single plane, so the effect is basically the same as what humans see with their eyes (single camera shots have much narrower field of view than the human eye, so we’re making up for that).  Another important feature of this transformation is that all straight lines are preserved.  An alternate option is possible, in which the images are projected onto a cylinder surrounding the camera.  While this preserves the consistency in image size for all images involved, it bends lines.  I did not do this for my project, but my camera has that option as well, so I decided to see what they’d look like:

Again, I did NOT compute these cylindrical projections myself.  These were all done by my camera.

Note that the living room cylindrical panorama is able to include the notorious sixth shot (on the far right).

The single-plane projections calculated by my camera were all very similar to what I computed, so I didn’t post them.  But that’s good, cuz it means I did it right!

Bells & Whistles

I had a lot of problems with figuring out what to translate when, since you need to keep shifting things around to add images in the right place, as well as to make room for everything you’re adding.  Because of this, I didn’t have as much time as I’d hoped for extras.  But I leave you with this fun (or boringly easy) little puzzle:

Leapin’ Lizards!

While posing for a picture, Yoda the iguana escaped from my wife’s terrified grasp!  Try to see how many sneaky lizards you can find around the room.  I’ll give you a hint: she’s not in her cage!

This was meant to be a sixth image in the mosaic, but Matlab ran out of memory when it tried to resize the mosaic to 2097x5424 (each image is 1024x768).

I suppose it’s for the best, however, since Yoda was busy scratching herself like a dog instead of smiling pretty for the camera.