Scanning the Iconic Treasury Al-Khazneh of Petra

Jan. 8, 2019
protect

Disclaimer, this article is not an introduction to photogrammetry, but rather a case study of scanning the Petra Treasury and the challenges that came with. These are my personal process and tools that I wanted to share with you. If you are interested in diving in depth into the topic of photogrammetry, then I would recommend you check out one of my previous articles here.

During my trip to Jordan, I reached out to Princess Sumaya University for Technology to organize a visit and given my experience in scanning archaeological sites in Lebanon, I was asked to give a presentation on the topic. While I can easily give an old presentation that students have probably not seen before, and it would work out fine, I wanted to do better.

Jordan is an archaeological rich country, home of the city of Petra, and I thought it would be interesting if I scanned the iconic Treasury, and used that in my presentation instead of using an old project.

 

Al-Khazneh (The Treasury) of Petra featured in Indiana Jones and the Last Crusade

That sounded like a cool idea, except for a few things:

  • I was informed of the topic a week before my trip, which meant that I did not have much time to prepare the presentation

  • I was attending the Jordan 8th Gaming Summit, which meant I had even less time to prepare the presentation

  • I was traveling to Amman, and Petra was 3-4 hours away by car in the middle of nowhere, therefore it would take me all day to get to Petra and come back

  • It takes a lot of time to process a scan, and I don’t a have a pocket server on me

  • I did not have access to a drone, and the Treasury is a little bit taller than me, therefore it will be challenging to get those top view shots.

In short, preparing, scanning, and presenting in 3 days? challenge accepted!

Day 1: Preparation

The organizers of the Gaming Summit had scheduled a trip to Petra for the speakers of the event, which took care of the transportation issue for me, and since I will be visiting with other fellow speakers, I found it the be a great opportunity to both scan and network.

To process the scan I decided to use Reality Capture since it can run on a laptop with a limited amount of RAM as long as it has an Nvidia graphics card. Additionally, It can handle a lot of photos while remaining relatively fast. This tool made perfect sense for this for this specific case, however, for your particular project, you still need to do research to see which is the best solution that suits you.

The presentation consisted of a few steps, the content to explain (slides), the scan, and a demo scene inside of Unreal. Luckily I was not starting from scratch. On Friday, I took a quick look at my previous presentations, and picked the slides that are most relevant, then prepared a quick intro to photogrammetry targeted towards students.

Quickly after, I started researching the Treasury, I only had one shot at scanning it, and the first thing I did was to study the target and its environment. I looked up the treasury on Google and Youtube and searched for references from different angles. Then I saved them for offline use since they might be useful later, especially when I did not know if I will have internet access on site.

 

I selected a picture of the treasury, and I started visualizing how I would go and take photos of it.

  • The blue sections are walls that are facing me, and usually are the easiest to scan. The higher sections are further away from the camera, and therefore with the lack of closeup photos they will be generated at a lower resolution, but the quality should still be enough.

  • The green sections are the poles, and the best way to scan those is by taking a full circle around them.

  • The purple sections are the floor and the ceiling, and you just need to take inclined pictures while moving.

  • The red sections are areas that are not visible from ground level, and a top view is needed. This is where a drone can come in handy, but I did not have that privilege.

To solve the top view problem I took a look at the environment.

From these pictures we can deduce a few things:

  • There are some higher areas that I can get to, and take those high shots

  • It might be a little tricky to fit the entire treasury in one photo since it was facing a cliff, and therefore there wasn’t enough room to get further away from it

  • There will be lots of tourist blocking the view

These couple of hours of researching info were enough to confirm that there is a chance scanning the Treasury might actually work. Then I quickly hopped on a plane a headed to Jordan

Day 2: Scanning the Monument

Arriving at the site, I found out that there are guides that can take you up the cliff to take a selfie with the treasury. Though I was warned by locals that it is illegal to go up there, and plus it was very windy that day, enough for the wind to throw you off the cliff, therefore that idea flew straight out of my head (see what I did there).

The second set back was that the treasury is actually closed and guarded, and you are not allowed to enter it, meaning you can only take photos from a distance. This meant that some areas of the scan will be slightly lower in resolution, and the back of the poles will be occluded.

Great, so limited angles, limited space to take the photos, no top view, and lots of tourist moving around, that was just great!

Tight restrictions meant that I had to make each photo count, and be extra careful not to take blurry one, nor panoramic ones (multiple photos in-place), as those are the most hurtful to your resulting scan.

On the bright sight, it was an overcast day, therefore I didn’t have hard shadows in my photos. (Small win, but I will take it!)

Well now that I have the on-sight photos, I was back on the bus, which coincidentally has a power plug, so I didn’t have to worry about battery life, sweet!

After going over the captured set, and after removing any repetitive or blurry photos, I threw the photos into Reality Capture and hit align. The result was great, 150/150 photos aligned perfectly!

 

The picture above is a top view of the alignment points of the Treasury generated from the photos. The white points represent the camera position of where I took the photos. Then, I defined the scan bounds since I was mostly interested in the treasury, there was no point in wasting laptop resources on calculating the surroundings.

After building the mesh, I found that RC did a good job of removing the tourists (since they weren’t consistent between photos), and the scan looked great, except for occluded areas (top sections).

Remember those google images and youtube videos I had saved? Well some of them were drone footage (4k FTW!), and all I had to do was to convert the videos to photos, then throw everything into a new project a see what sticks, and it worked! Well kinda, each video generated a few chunks, that I had to manually attach to each other using ground control point.

Since the video footages were taken in different weather conditions, using different cameras, using different lenses, and some of them have been post-processed, I had to manually help RC by identifying 3 points in common with all the chunks (the more spaced the better).

Amazingly that worked as well. I did, however, disable those extra photos from being processed during the texture reconstruction step, and only kept the original set, to maintain color consistency, and avoid artifacts which is a setting you can set for each photo in RC.

Here’s the result

JikGuard.com, a high-tech security service provider focusing on game protection and anti-cheat, is committed to helping game companies solve the problem of cheats and hacks, and providing deeply integrated encryption protection solutions for games.

Read More>>