Flickr Image Dumper

The main thing I got out of this project was the following script. It uses Flickr's publicly available API to search for images whose tag, description, or filename matches a given set of keywords. To use it, simply enter your keywords into the text box and hit "enter".


Example image mosaic generated by a search for the keyword "lemons".

If the "Preview Mode" button is checked, the search will return the first 100 results as a mosaic of 75x75 thumbnails. If the "Download Mode" button is checked, it will return a list of 4000 URLs (the maximum allowed by Flickr), which link to large-size images. This is meant to allow a user to preview the kinds of pictures that will be found with a given set of keywords before proceeding to download the whole batch. Saving all URLs in a file and then running the command "wget -i filename" will do the trick.


Preview Mode
Download Mode

Multi-View Stereo

This script was inspired by a lecture I saw on creating multi-view stereo images from photo collections. Essentially, if you have enough photographs of the same object, a sufficiently sophisticated algorithm can calculate the shape of the object and translate it into a 3D model. The researchers that developed the algorithm demonstrated it on collections of vacation photos.

In my home state, one of the big tourist attractions is "Thunder Hole", a cleft in the rock in which air bubbles are trapped by waves, to emerge later with a loud boom. It always surprised me that tourists would travel to this site by the busload and take photos of the same things as millions of others before them. How much more authentic is the experience just because your finger was on the shutter? If a landmark is popular enough, every possible picture has already been taken by someone else. Why don't we just use stock photos? Anyway, the tourists' lack of imagination make this site perfect for multi-view stereo. I got an API key from Flickr and downloaded about 4000 pictures tagged with "thunder hole". I then ran them through the Bundler program, which actually requires a suite of programs like SIFT and ImageMagick and proceeds in several distinct stages.

  1. It searches a folder full of pictures for distinctive features, perhaps the corner of a doorway or a flower in a lawn.
  2. It matches similar features in different images to determine which ones are photos of the same object.
  3. It compares features found in multiple photos in order to measure how much their size, shape, and orientation differ between photos.
  4. Based on this information, it calculates the viewing angle and zoom level of the cameras used to photograph a single feature.
  5. It uses the camera angle data to determine the original coordinates of the feature in 3d space, and constructs a 3D point cloud of these coordinates.

One side effect of this technique is that the computer doesn't know anything about the size and shape of the object, only the number and type of features it has. A blurry photograph might be flagged as unrelated, while a realistic miniature might be accepted into the model. Another side effect is that mirrored or moving surfaces are unmappable because they are full of features whose size and orientation change from picture to picture.

I started running the program with all 4000 pictures and quickly gave up due to the huge amount of time required. The time needed for feature detection, rises in linear proportion to the number of images, while the time needed for feature matching rises in geometric proportion to the number of images. I eventually reduced the number of images to 500, removed duplicates and obviously unrelated images, and re-ran the program. It took about 2.5 days of computing time on my 2.8Ghz dual-core machine.

Unfortunately, the 3D model produced is completely unrecognizable. This might be due to the difficulty of finding matching features on a granite rock face, or the lack of pictures from a large number of angles (most people took photographs from one of two locations). I might get better results by using an alternative algorithm or choosing different pictures, but I've learned what I wanted to learn and I'm tired of messing with Bundler. Click on the image of the point cloud if you want to download the Blender 3D file, or leave a comment if you want to talk to me about it.

Leave Comment
Comment:
Spam Filter: enter the sum of twelve and four (in text or numbers)
to prove you're not a spam program.