28/04/17 – A Day in the Field, Part 3: My Photogrammetric Resume, Part 1

Screen Shot 2017-04-28 at 5.46.15 PM.png
Maijishan Grottoes, Hall of the Immortals (c. 7th century). That, believe it or not, is a 3D model.

About two weeks ago I was awarded the Robert H. N. Ho Dissertation Grant in Buddhist Studies (via the American Council of Learned Societies or ACLS) for $30,000 to be spent on my research in Cambodia next year. It was an incredible surprise, and one that helped breathe a bit life back into my research following my sluggishness after fully embracing the chilled-out vibe of Laos. That. It also gave me a bit of a motivational push to continue to work through the hottest part of the year; last Thursday it reached 44 degrees Celsius at noon, and over the last week the temperature really hasn’t changed that much.

But I have no motivation to bellyache about the heat – that’s like whining that it’s cold on a ski trip in January. Instead, I figured I’d share something I think is pretty cool.

One of the more interesting aspects of my research in Cambodia (and also in China) involving spatial analysis of ancient sites is attempting to replicate that space and analyze it away from the field site. I do this through photogrammetry, a technology I’ve touched upon in earlier posts that essentially allows me to recreate the facades of three-dimensional structures using two-dimensional photographs. I primarily use Agisoft Photoscan, one of the easier photogrammetry programs to operate because it relies on the quality of the input rather than your ability to manipulate the output. Considering that I’m not a tech genius and have only recently started learning to code in Python for ArcGIS, being able to rely on my skills as a photographer vs. my inexistent skills as a programmer makes Photoscan relatively easy to use once the photos are taken.

Screen Shot 2017-04-28 at 5.43.05 PM.png
This may not look like much, but it’s actually the light point cloud of the niche beside the one above at Maijishan. I’m currently stitching them together to make 2 of the 7 Buddha images along that hallway (please don’t tell China).

Photogrammetry is increasingly being used in archaeology in order to capture the landscape aspects of things we excavate before we have to backfill, which in all but law iw officially the rule: you dig it up, you bury it again. Scaled photogrammetric images can be used alongside Total Station data and hand-drawn diagrams to both analyze the stratigraphy of the earth and the stratigraphic context of excavated architectural features, which adds yet another dimension of data from which to analyze the results of an archaeological excavation. Most foreign teams in Cambodia (and I can assume the rest of the world that aren’t confined to Luddite-esque traditions…Classics…) have at least one member using Photoscan or similar software, and it’s allowed us to both visualize and present the visualizations of our data like never before. It’s truly the ultimate win-win.

Screen Shot 2017-04-28 at 5.24.25 PM.png
I can’t say where this one came from at Angkor because the site report hasn’t been published, but you can see the way the archaeologists have stencilled out the stratigraphy.

Plus, working with multiple 3D images in the same landscape is kind of like putting together a level in Uncharted, Far Cry, Tomb Raider, or even Zelda. Almost like digital Legos.

Screen Shot 2017-04-28 at 8.08.48 PM.png
West Prasat Top Buddhist Terrace (14th century) and Stupa (16th century): Each set sold separately.

Photogrammetry is also used in museum and heritage contexts as well. After the destruction of priceless museum collections and archaeological sites by ISIS in Nineveh, Hatra, Nimrud, and Palmyra between 2014-2016 (not to mention Baghdad in 2003 and all that’s been lost in the Syrian Civil War), museums have begun to back up their collections using photogrammetry. This can also be done alongside the 3D printing and painting of resin models, which can allow for them to keep decoys in display cases while keeping the original pieces safe.

Drones can also be used to complete imaging on larger complexes – for example Dr. Dougald O’Reilly’s work creating site-plans of the various Plain of Jars in northern Laos – and flyovers often incorporate both filming and barrages of photos in order to reconstruct landscapes combining images from above and on the ground.

Plain of Jars: Simple from the air, tedious from the ground.

I first started building 3D images around February last year, kicking around with little desk decorations in my office that were unique enough to catch my attention. Agisoft Photoscan is relatively cheap, so I bought myself the standard version and then upgraded to Professional when my advisor’s lab bought a copy. I’d usually model a statuette, or a cereal box, or even a vase, and the one time I tried to model my office was hilariously bad. And with smaller models you also have to cut the backgrounds out, so that took another 2-3 hours every time.

Screen Shot 2017-04-28 at 5.15.01 PM.png
The first model I ever created – a souvenir replica (that I bought at an auction house) of a small 12th century Khmer head.

Above: a model of a small Hevajra statue I bought from the Siem Reap Night Market last year.

But what is typically tedious comes with ample rewards, and for me that was my ability to model 1500-year-old Chinese grottoes this year in Yungang, Mogao, Maijishan, Guangyuan, and Rongxian.

Screen Shot 2017-04-28 at 5.53.42 PM.png
The Erfosi model from Rongxian is still in Dense Point Cloud purgatory from January because I need to use a better computer. But ah man, it’ll be good.

This is the central grotto at Wu Zetian’s (the Empress Regent of the Tang Dynasty’s) personal Buddhist monastery in Sichuan Province.

I did way more 3D imaging in China than I’ve done in Cambodia thus far, mainly because small, enclosed spaces with intense detail create better finished products (that I can work with) than large expanses of earth rising from dismantled sandstone and laterite walls with no referenceable points – that’s what next year’s clearance season is for. The reason for this, and this is one of the reasons I’m really glad I don’t need to know how to code to use Photoscan, is that photogrammetric software relies on being able to align similar focal points in photographs. The software then uses those points to create “point clouds” and 3D mesh. If there’s nowhere to align the points in the photograph, then the software will abandon it. As I learned while taking photos for a model of the Preah Pithu Buddhist Terrace at Angkor Thom, a wide-angle lens goes a long way for aligning photos, even if it makes the grass on top of the your Buddhist Terrace look really weird.

Screen Shot 2017-04-28 at 5.26.08 PM.png
It looks good horizontally, right? (Preah Pithu Buddhist Terrace, 14th-16th century)
Screen Shot 2017-04-28 at 5.26.36 PM.png
Buuuuut not so much from the top. See what I mean about having way too much monotonous space?

Oh yeah, I forgot to mention, Photoscan has a tracking ball and I found out how to get rid of it (after a year) half an hour before I published this blog entry. So there’s a bit of that.

The other thing I learned, which seems more like a reality with this big grant, is that a good computer goes a long way in creating a presentable 3D image. When I first began to use batches of 100+ photos to create images, I had problems with my field laptop, because in order to generate the mesh you need a disk that runs like a wild thing. So I bought a 1TB solid state drive (SSD) in the fall…however, that’s not entirely the solution. You also need at least 16GB of RAM; otherwise, your model crashes when you’re trying to generate the solid mesh layer. I have 8GB, so the images you see here are made with medium-quality mesh (and when I get a new desktop or laptop with 32GB of RAM I’ll be making them super high quality). It’s why, in the video of the Buddhist Terrace from West Prasat Top Temple below, the completed image looks somewhat pixillated.

West Prasat Top Buddhist Terrace, Chunks 1+2. Excuse the shaky camera-work – I was only able to record a screen video capture with Quicktime.

Medium-quality images go a long way with smaller areas and museum artifacts, though – the Preah Pithu Terrace is nearly 40m long and the West Prasat Top Terrace is 20m. I experimented one day after I finished surveying with a few ancient Buddhist stupas that were out in front of a modern ordination hall, and in an area less than 10x10m, they came out really well.

Two stupas (or…one and a half stupas) just west of the Bayon Temple, Angkor Thom.

The original – I partook in some digital illegal logging while making the model pretty (Stupa, Angkor Thom, 14th-16th century)

Of course, because of the branches near the top of the tree, the top of the stupa was never going to come out as pristine as the base.

But there are solutions, because while photogrammetry is not a perfect science you can attempt to augment the output with multiple inputs. For example, creating multiple chunks, but you have to take the photos in the exact same light and the exact same conditions or else the model looks like Frankenstein’s monster: all sewed up and awkward.

Anyways, the models I’ve posted above are what I’ve been tinkering with in the field alongside cataloguing and surveying, and are a sizeable minority of the models that I’ve built for practice and during my fieldwork. Overall, honestly, the end results have been a mixed bag: some models end up coming together extremely well (see the Wu Zetian video above), the light is perfect, the size of the file doesn’t overwhelm my laptop, all the photos align, and while taking the photos you have access to the best vantage points. Others…well…end up like this:

Screen Shot 2017-04-28 at 5.59.40 PM.png
A stupa at Jiaohe (6th century)…it currently looks like a mud-brick tumour.
Screen Shot 2017-04-28 at 6.11.29 PM.png
Hey, I made a light point cloud of the Milky Way!
Which was actually supposed to be this…

And my personal favourite:

This is what happens when you try to take a photo of a box…apparently attached to Astro Turf? (There was no green anywhere around that box when I took the photos btw).

But every single model is fun to put together, whether I end up using them for research or not (or even if they end up like that box) and no matter how they turn out. Photogrammetry become something of an art form in other mediums as well, and people who actually know something about digital design are able to make models way more complex than I do (or ever will). Next year, though, I’m aiming to build models of every Buddhist Terrace I clear – maybe they end up looking like the Preah Pithu mess, but they might also look as polished as the two stupas.

Who knows? Like I said, it all depends on the quality of the input.

Screen Shot 2017-04-28 at 7.19.48 PM.png
Seven-Buddha Niche, Yungang Grottoes (7th century).
Screen Shot 2017-04-28 at 5.11.13 PM.png
Stupa, Bezeklik Grottoes, Turfan (9th century). I took this model entirely with zoom lens 50m up a cliff 200m away. For essentially creating a model with a sniper scope, it didn’t turn out half-bad.

Next Entry: The end of PhD Fieldwork Season 1 – Reflections and Greatest Hits.

Andrew Harris

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s