Textures in Photogrammetry: How They Can Deceive Us

One of the advantages I find in Photogrammetry is that unlike other methods such as laser scanning and regular 3D recording, the results are photorealistic. The models seem natural and precise due to the textures that are associated with the points, and aesthetically it is much more pleasing. In addition to this it is amazing for archaeological recording, as all colours and shades are preserved as they were originally.

However the more I experimented with this great technology, the more I realised that as useful as this tool is, the textures sometime give us a wrong idea of what is going on. Generally this causes no problems at all, but in some situations I have found myself trying to get things to work and failing due to a false perception I had of the model.

A good example of this are these graffiti from Cardiff castle.

Image

The model itself is not great. It was made with my Iphone camera, and I didn’t even use the maximum quality on 123D Catch, however it does help me prove the point.

I spent quite a lot of time trying to test a theory of mine, which I’ve written about before. Theoretically, using a filter or renderer on a photogrammetric model, it should be possible to emphasise inscriptions in order to make them clearer. I was originally trying the APSS filter, but I recently read articles suggesting the use of Radiance Scaling in Meshlab (I’m still experimenting with this, but results seem positive for now). Therefore I decided to test out a number of filters on the graffiti model, as the ridges of the letters appeared to have been handled very well by the program. Even when rotating the textures caused me the illusion that quite a few points had been found around each letter, points that I could manipulate to my advantage.

Having played around for some time with no real results, I decided to try removing the textures to manipulate the shadow, but having done that I noticed that the beautiful ridges that had appeared previously, disappeared when the textures were removed, like so:

ImageImage

Looking at it even better I noticed that the points that had been found were basically evenly distributed, rather than surrounding the letters as I first thought. As a result the reason the filters were not working was because there was nothing to work on.

ImageImage

So even if the textures were providing a much needed aesthetic relief, and helping with the recording, for more specific actions they only got in the way, creating illusions.

This however does not in any way limit the technology. The case shown was that of an extreme case, in which the circumstances caused a lack of points. Most models have a much larger number of points and a greater accuracy, which makes it suited for most situations. However when pushing the limits of the technology it is important to remember that in the end the model is just a collection of points, and that these are where the potential is.

Advertisements

First Photogrammetry Article Published

New Photogrammetry Article

article

I’m very glad to present you with my first (but not last) published article on the topic of Photogrammetry in Archaeology! The December edition of The Post Hole, that has recently been released, features a paper on “The use of Photogrammetric models for the recording of archaeological features”, which I wrote during the summer, and which I’m sure you will find of some interest.

It deals specifically with archaeoloogical features on site, and it looks at accuracy, methodology and uses, especially when it comes to recording. The aim of it is to show that far from being technology for technology’s sake, Photogrammetry can contribute greatly to our understanding of an archaeological site, as well as reinforce and improve traditional methods of recording such as section drawing and plans.

The article is based on a few sites I worked on, and that have featured on this website before, such as Ham Hill and Caerau.

This is however just scratching the surface of a technology that is now appearing more and more frequently in publications, and that will eventually become a fundamental part of archaeological recording.

Ham Hill Iron Age Skeletons Turn Digital

Image

Three of the skeletons found at the site of Ham Hill, Somerset during the 2013 excavation are now available to view online at the following links:

https://sketchfab.com/show/70d864c4736435710bc65b6f21d81c03

https://sketchfab.com/show/821565c7ce0b98e1b7764c73a9f07492

https://sketchfab.com/show/fa694aff0fb5949e2f396a5fb2da37b0

The skeletons were discovered during this year’s excavation carried out by the Cambridge Archaeological Unit and Cardiff University, at the site of an important Iron Age hill fort. They are only some of the many human remains found, some of which were carefully placed within a number of pits, while others were located symbolically within an enclosure ditch, often with body parts missing.

Image

The models themselves were made using Photogrammetry and specifically 123D Catch, which required very little time for quite good quality. The aim of this was to preserve a record of the skeletons in situ for further interpretation once they had been removed from the location they were discovered in.

Given the complexity of the subject, the results seem to be very promising. Time was a big factor when making the models, as they had to be removed before damage occurred. Some of them were also in tight spots, which made it hard to access some of the standard angles, but overall this was counterbalanced by taking a larger number of photographs than normally (around 30 per skeleton). The lighting conditions also proved to be ideal, as there was an overcast sky, but also sufficient sunlight coming through to really emphasise the surfaces.

Image

For further information on the skeletons I suggest reading the article at http://www.bbc.co.uk/news/uk-england-somerset-23928612

Using Iphone Camera for Photogrammetry

I mentioned before I recently received an Iphone 4s, and having been a strong supporter of Windows against Apple, I am slowly being converted over. Apart from the great thing of being able to carry my models around and show fellow archaeologists without risking the life of my laptop, I have started exploring the advantages of having a pretty good camera on me at all times.

By using the 123D Catch app, it is possible to instantly create amazing models wherever you are, but how accurate are 3D models made using the Iphone camera? I don’t have the app itself due to a lack of 3G, but I have been going around site the last week or so and have taken a number of photographs and then processed them once got home.

Once again I experimented with larger and smaller objects and features, comparing the results I got with those done with regular SLR cameras. I can’t actually upload the images due to site restrictions, but I created a model of a toy car as an example. I followed the usual methods of recording, so to not alter the results in any way.

Image

These are some of the points I have found:

Image stitching: Comparing the number of images that stitched in normal models and those done with the Iphone’s camera there is a bit of a difference between the two. Especially with similarly coloured images only some of the images are stitched together. This however happened only on a few occasions and as such doesn’t constitute a major flaw.

Point cloud: The number of points within the models done with the Iphone seem to be equal, if not more than those in the normal photographs. I believe this is because the Iphone seems to adjust the colours and lighting automatically and digitally, which makes the photographs seem more consistent. On the other hand this also seems to have the negative effect of artificially changing the images, thus playing with the contrast and colour balance, which affects the accuracy of the model.

Image

Textures: The textures in the Iphone models seem to be extremely good, probably due to the digital adjustment mentioned above. In this case I wouldn’t say this is a problem, and the results are quite bright and distinct, which is a good thing when analysing the models.

General look: This is the point I have the greatest issues with. The number of keypoints the program finds made me expect extremely crisp models, but they look to me much more murky than they should. The digital altering of the images, and the fact that the size of the images is below the 2 MBs makes the model much less accurate, and the results suffer greatly.

Image

Overall though I am happy with this method. If the models were of extreme importance, I wouldn’t even consider using the Iphone camera, but for simple and less important models it is perfect. The practical nature of being able to capture images in a matter of minutes and have them upload directly to my Dropbox is great, and on more than one occasion I’ve been caught without my camera, so it is a great alternative.

Some Issues with Photogrammetry

This is based on some of the work I did for my dissertation. I realised that as it stands it isn’t likely to be published, so I thought I should at least share some of the concepts and ideas that I used for it.

Creating Photogrammetric models for archaeology can be a simple process, but there are some cases in which problems may rise, due to the shape of the objects or the type of surface. We’ve already seen how large features can require certain considerations when photographing, to simplify the work of 123D Catch.

But there are other issues as well:

  • Curved surfaces: If for example we are looking at a pot fragment and we are photographing it from the inside and the outside, the fact the surfaces are concave and convex rather than flat means we may have some difficulties. In general, convex surfaces are easier to manage than concave surfaces, as, provided that the angle of the two spirals of photos is big enough, the pattern of points is such that it provides sufficient information to the program to deal with the surface. If, however, the surface is concave then the same does not apply, and the outcome of the rendering depends on the size of the object. A large surface will generally provide sufficient detail for the program to recognise it and deal accordingly, but a smaller sample often does not have the same results, and the only course of action is to adjust the illumination to create as much contrast on the surface as possible, although this also does not always work. Similarly, if the object has elements which overlap in the photos, these can present some problems, as the program often assumes that they are on the same level. In this case, it may be necessary to increase the number of photos input to help clarify, as well as manually unstitching and stitching all photos that have not been properly placed.

Image

  • Translucent surfaces: These can cause problems with the camera, as they alter the contrast depending on the angle and lighting. In this case, it is important to make sure that the lighting is uniform and the object fixed, hence making it necessary to circle the object rather than rotate it.
  • Uniform texture: If the colour of the object is too similar throughout, thus not providing enough difference and contrast to allow the selection of keypoints, adjusting the light to bring out as much contrast as possible may assist in the creation of the model. One particular case of this is objects that have similar sides, like the image below that looked very similar from different angles. On the other hand, 123D Catch seems to cope quite well with this case, allowing the smallest of details to be picked out from the texture.

Image

There are of course many other cases in which we have problems using 123D Catch, but these described are some of the most common. The fact that these issue exist though doesn’t mean that the software is extremely faulty or useless, as we are dealing with some rare exceptions, while generally models should be produced easily and with none of these issues.

Viewing Photogrammetric Models on iPhone/iPad

Image

Since very recent I used to look at the iPhone and the iPad with a pinch of scepticism, as I believed it to be simply a less powerful laptop, mainly used for games and the occasional note taking. I’ve always been a Windows user, but last month I was given an old iPhone and I’m becoming more and more convinced of the effectiveness of the Apple products, especially with regards to 3D modelling and Photogrammetry.

The first thing I tried out was the 123D Catch app, which I am very pleased with. Unfortunately I don’t have 3G, so the great advantage of being able to create models wherever I am is lost on me. Still, regardless of personal use, it is truly a plus. Also, the camera itself is good enough to get the level of detail necessary.

The one thing though that got me thinking was the possibility of carrying with me my collection of models, so I have something to show when talking to people about Photogrammetry. In the last two months many times I’ve had to bring my laptop on site to show some results, and every time I risked it getting broken. As my phone is much easier to protect I realised that if I could get my models on my phone, it could save me a lot of money for a new laptop.

Therefore I started looking through all the different types of apps available, both free and commercial. Out of all the ones I found, the one I’m most pleased with is Meshlab for iOS, which is derived from the Meshlab I use on PC.

Image

Yesterday I went through the main flaws of the PC version, but the app is actually the best there is. It allows you to open Obj files with textures using mail or Dropbox, by placing them in a .zip archive, and then it views them in a typical Meshlab environment. The texture support is a deal breaker, as it’s what is giving me a lot of problems in other apps. Also, the navigation tools are easy and intuitive, and you can change the lighting with a single tap, highlighting certain areas. Finally, it doesn’t require an internet connection, which is ideal for my iPhone.

The only disadvantages I can see is that is does crash when opening large files, which is rarely a problem, but annoying in some cases, and the fact that the contrast is too high. The shadows it creates makes the models seem less natural than they should be, and there is no way to remove them. Although not really a major issue, it does make the models lose a bit. I’m guessing following updates will make this function better. Finally there is no way to sort files in folders, which could be difficult if you have many different models.

I shall continue investigating apps and see what I can find. By the looks of it there is a lot of potential for 3D modelling and archaeology awaiting me.

Program Overview: Meshlab

Image

When writing my third year dissertation a few months ago I analysed a basic method of creating photogrammetric models using 123D Catch, and when it came to discussing the later editing of the models the program I turned to was Meshlab.

I’d originally come across this program when looking at the Ducke, Scores and Reeves 2011 article, as part of a more complex method to actually create the models, but had concluded that it would have a much better use as a separate process. This is due to the vast variety of tools and filters that the program employs, which surpassed those of any other freeware 3D program I knew. I talk in the past as I’ve since changed my mind, at least in part.

Image

But before talking about the problems, I’ll go through the advantages:

  • Easy interface: Simple operations are easy to do in Meshlab, and the navigation is efficient (the zoom is counterintuitive, still easy to adapt to it). Loading models is simple and it does allow a lot of file types to be used, plus changing between points and surfaces requires a simple button click.
  • Nice lighting: Far from complex or complete, the lighting tool is somewhat primitive, but possible for the best. Programs like Blender or Sketchup make me go insane when you just want to emphasise a certain area, while Meshalb has a light you can rotate to show certain elements. It also makes the model’s edges come to life, increasing the contrast and bringing out things hard to see otherwise. When I made a photogrammetric model of a Zeus head statue, some of the other archaeologists with me suggested by looking at the Meshlab light effect, that it may well be a Neptune head instead.
  • Alignment tool: I think this may be due to my ignorance of Blender, but I still prefer the way Meshlab glues together two models, by selecting 4 identical points between them. It adapts the size and orientation automatically, with good results.
  • Great filters: I wrote an article about using the APSS filter to bring out inscriptions, and there are many more available, with references to documentation about them. Some are a bit useless for what I’m trying to achieve, but still not bad at all.

Image

  • Free: Meshlab is entirely open source, which is great for making Photogrammetric models. Compared to program’s that are commercially available, it still does what you need it to do, without having to pay the money.

There are however some problems:

  • No undo button: Probably not the major issue, but by far the most annoying. The number of times I’ve had to start a project from the start due to a minor issue makes this a big flaw. Unless you save every time you do anything, you’ll find yourself in trouble.
  • Saving glitches: Quite a few times I’ve saved the final product, closed the program and opened it again to find it had not saved textures. This is a difficult thing to get around when we are dealing with Photogrammetric models, where the texture is essential.
  • No image files: Meshlab seems to hate all image files, which makes it difficult in some scenarios. For example it is not possible to open a models and an image in the same context. I found this frustrating when gluing together some features from then same trench, where I wanted to use the plan of the trench as a guide to the positions.
  • No real rendering: Blender is great to create good images of the objects you’ve created, while with Meshlab all you can do is use the windows Snipping Tool. Presentation wise it is deficient.
  • Inefficient tools: In some tool Meshlab excels, in other it is lacking. The measuring tool exists, but in order to set a reference distance you have to go through a series of calculations that you personally have to do. The rotate tool is odd, and the transpose tool only seems to apply to a single layer.

Overall Meshlab can get the job done, and in some things it can work better than with other programs such as Blender. However the issues that derive from the fact it is freeware makes it hard to use. I would still recommend it, but when it can be avoided it’s probably for he best.

Image

References:

Ducke, B., Score, D. and Reeves, J. (2010) Multiview 3D Reconstruction of the Archaeological Site at Weymouth from Image Series. Computers & Graphics, 35 . pp. 375-382.

Virtual Museums: Combining 3D Modelling, Photogrammetry and Gaming Software

I wrote the post below yesterday night, but since it was written I’ve managed to create at least a part of what is described in the text, which is shown in the video above. Hence keep in mind that the rest of the post may be slightly different from what is in the video.

One of the more popular posts I’ve published seems to be the one about public engagement at Caerau, South Wales, in which I created an online gallery with the clay “Celtic” heads school children made. The main concept that I was analysing in the text was the idea that we could create digital galleries in which to display artefacts,

When I wrote the word gallery I imagined the computer definition of gallery, as in a collection of images (or in this case models) within a single folder. However I have since found this: http://3dstellwerk.com/frontend/index.php?uid=8&gid=18&owner=Galerie+Queen+Anne&title=1965%2C85%C2%B0C

This is an example of what the website http://3dstellwerk.com offers, an opportunity for artists the create a virtual space in which to display their work. It allows users to go “walk” through the gallery and view the 2d artwork as if it were an actual exhibition. Although the navigation may require a little improvement, it is a brilliant idea to make art more accessible to people.

Virtual Museum

This idea however could easily be adapted for archaeology, using Photogrammetry, Making models of a selection of artefacts using 123D Catch, we can then place them within a virtual space created with our 3D software of choice, in order to then animate it using gaming software such as Unity 3D which would allow user interaction. A large scale project could even allow the objects to be clicked in order to display additional information, or create audio to go with each artefact. Video clips could also be incorporated within the virtual space.

Virtual Museum 2

On an even larger scale this could mean we can create online museums available to all and with specific goals in mind. As we are talking of digital copies of objects, it would be possible to group in a single virtual space a number of significant objects without having to physically remove them from their original location.

The only problem that we may encounter with this idea is file size, as each photogrammetric model is relatively small and manageable, yet if we want a decent sized virtual museum we are going to need a large portion of data. Still, even if the technology at present is not quite capable of dealing with the bulk, the rate at which it is improving will allow such ideas to be doable in the near future.

Virtual Museum 3

The Winged Victory of Samothrace: Analysis of the Images

This is a continuation of my blog from yesterday, so I suggest you read that first. One of the things I’ve been working on the past month is creating a photogrammetric model of monuments using nothing but tourists’ photographs. After many attempts my last test, using the Winged Victory of Samothrace as a model, seemed to have sufficiently good results, so much that I decided to analyse the image data to pinpoint what kind of photographs actually stitch together in 123D Catch, and which ones give problems. This way we can actually choose a limited amount of good photographs, rather than a vast number of mixed ones.

Image

In order to understand the patterns behind the stitching mechanism, I created an Excel file in which I included all images with certain details: width and height, if the background is consistent with the majority of the photographs, if the colour is consistent, if the lighting is the same, the file size, and the position of the object. The last one is based on the idea that to make 3d models we need series of shots from 8 positions, each at 45 degrees angle from one another. If we are thinking of it like a compass, with North corresponding to the back of the object, position 1 is South, 2 is SW, 3 is W, and so on up to 8 is SE.

The first thing I noticed, which ties in with what said yesterday, is the lack of photographs in positions 4 and 6 (NW and NE), which of course meant that all the images from the back (position 5) also had trouble stitching. Therefore the first problem for the model is the need of enough images from all angles, without which it is inevitable to have missing parts. This is made harder by the fact that these are typically positions that are not photographed.

Having concluded that images from position 4-5-6 had this reason for not stitching, I removed them from the list so the data would be more accurate for the others.

I then averaged the height, width and file size of the stitched images and those of the unstitched images and then compared them. The former had an average height of 1205.31, a width of 906.57 and a file size of 526.26, while the latter had a height of 929.07, a width of 668.57 and a file size of 452.57. The differences here are enough to suggest that large good quality images have a higher chance of being stitched. This may seem obvious, but actually some images that have not stitched are larger and higher quality than some which have, so this can’t be the only factor. Also, the difference isn’t large enough to suggest it is even a key factor.

Image

Image

The next step was analysing the percentage of stitched images that had abnormal background, colour and lighting to the unstitched ones, which had even more limited results. In the former, the background was not constant in 15% of the images, the colour in 63% and the lighting in 47%, while in the latter background was 0%, colour was 50% and lighting 50%. Somehow these results show that the photographs have a higher chance of being included if they are different from the rest, which goes against all the knowledge we have up to now of 123D Catch. I therefore suspect that the program allows a good tolerance when it comes to these elements, and that I may have been to harsh in defining the differences in these elements.

Having concluded little with this methodology I decided to look at each individual unstitched image to see what elements could be responsible. This proved to be much more successful. I managed to outline three categories of unstitched images which explain every single one of the photographs, without any overlap with the stitched ones:

  • Distant shots: Some photographs were taken at a further distance from the statue than others, and while a certain degree of variation is acceptable, in these it was too extreme.

Image

  • Excessive shadows: Although as we’ve seen before the lighting didn’t appear to be a factor, some of the images had an extreme contrast, with very unnatural light. They were practically at the edge of the scale, and while some variation is acceptable, these were well beyond that.

Image

  • Background: this is an interesting case in which the background is not different  rom the rest, but has a very similar colour to the rest of the object. Because of the similarities it is difficult for the program to recognise any edges, which makes it impossible to be stitched correctly.Image

Therefore creating 3d models from tourists’ photographs is entirely possible, as long as we have sufficient angles, photographs from a similar distance, without harsh lighting and with a contrasting background.