Photogrammetry

Introduction

Photogrammetry is the process whereby multiple photographs of an object are stitched together to make a 3d model of the object; the photographs are then draped over the model to make it photorealistic. Because of the physics of photography (focal distances of lenses and so on) a computer can calculate the relative positioning of overlapping points it identifies in multiple photographs, and with a bit of trig it works out the points-in-space. Then it joins these points up by connecting to the nearest neighbouring points, creating a series of triangles or ‘mesh’.

A common digital format then for these models is a folder with a .obj file describing the geometry of the object, a .png file with all of the texture information, and a .mtl file that tells the computer how to drape the texture onto the model. Services like sketchfab.com let you upload a zip file of such a folder, and then display or annotate the object. Here’s one I did of a gravestone of one of the Moodie family burials:

Getting Started

  1. Read the small section on photogrammetry in ODATE

  2. Select one of the gravestones in the cemetery that you are working on. If that’s not possible, you can try making a model of an object in your house.

If you have an actual digital camera, use that. If you don’t, your cell phone camera can work. You will need to take photos of all sides of the stone/object such that you have sufficient overlap of each image. Around 20 photographs can do it. You might circle the object three times, once at a low level, once at the middle, and once around the top (if feasible).

  1. Transfer your photographs to a folder on your computer; if you have a google drive account, you might want to move them there.

  2. An actual digital camera embeds metadata about focal length in each image that the photogrammetry process will use. Most cellphone cameras do not. If you are using cellphone images, please follow these instructions to embed metadata into your images.

Making a 3d model

You have two options here.

  1. Use Google’s own computing resources to stitch a model together for you with a piece of software called ‘Meshroom’. To do this, right-click and open this notebook in a new window. You run each cell in that notebook starting at the top - select the cell, then hit run. When it finishes, select the next cell, and hit run. That notebook has instructions on uploading your images directly, or connecting to your google drive folder. Read carefully before hitting run! The process might take a bit of time.

  2. Download and use Regard3d, an open source collection of algorithms for making 3d models, on your own computer. Download Regard3 and then follow its tutorial; you can then re-do its steps on the folder of your own images. Remember: you need to add the metadata to your photos if the camera you used isn’t a standard camera; see Getting Started Step 4.

Then, once you’re done:

  • Upload your finished model to Sketchfab.com; the free version only allows 1 upload per month. Another option is https://p3d.in; models there can only be max 100 mb in size. There are other options too that you can find with a bit of googling. It might well be that your model is quite wonky - perhaps you didn’t have enough photos in the right places. How is the process of taking photographs similar to the kind of close reading you might do in a history class?

  • You can also drag and drop your model files (.obj, .mtl, .png) into your github repo for this week (zipped file is ok too).