Close

3D scanning with a camera, part 1

A project log for Psioπ

Resurrecting a Psion Series 5 PDA with modern innards

RasmusBRasmusB 05/02/2017 at 21:061 Comment

This time I'm back with an actual update!

Since space is tight inside the Psion housing, I wanted to create 3D models of the plastic parts. This proved more difficult than I expected since I couldn't easily access all areas of the parts with my calipers. So what to do?

I had tried photogrammetry a bit before. The idea is to take a lot of pictures of the object from as many different angles as possible, and then let a computer calculate the shape of the object. It's basically magic :)

However, my previous experiments didn't produce any useful models. For example, mobile apps such as 123dCatch produce 3d models that _look_ very nice, but is seriously lacking in actual resolution of the mesh. This doesn't show much when you apply a texture, but it is not suitable for reverse engineering of detailed parts.

But today I got a new camera, which inspired me to make a new, more serious attempt :)

My victim for this experiment was a plastic part that had seen better days. The Psion it came from was in pretty poor shape when I got it - it had been dropped, battery goop had been leaking into it and the plastic was cracked.

Last time I learned that both shadows and highlights mess up the 3D algorithms. Shadows are taken care of with soft lighting, but highlights require a different approach. The quickest and easiest way for me was to paint the part with matte spray paint. This removed almost all of the highlights! Note that there is special paint for this purpose that can be applied and wiped off, but I opted for the cheap and cheerful route since I couln't care less if this broken part gets ruined.

But now I just created a different problem. The algorithm works by matching features that are visible in several pictures against each other. If a surface is entirely featureless, the algorithm won't have anything to work with! To combat this, I intentionally ruined my pristine surface by doing the worst spray can job I have ever done in my life. The goal was to cover the gray primer with lots of random black spots.

This was the final result of my intentionally crappy paint job. This picture is taken in my cheap light box, but it shows a lot of promise! There are no hard shadows, no specular highlights, and it is easy to overexpose the white background. The less crap there is in the intial pictures, the less crap I hope to get in my model as well.

There are several different open source photogrammetry programs out there. One thing they all have in common is that they are a proper pain to get up and running. Thankfully, I stumbled over a guy who had made binary packages of several different programs. Check out his video:

I started out with MVE, using the instructions and default values from the wiki just to see if my pictures were good enough to get a nice mesh this time. It does take a few minutes to run through the entire flow, but in the end this was the result:

... and since I complained about how textures hides crappy meshes before, here is the same mesh without any texture applied:

Obviously there is still some strange things going on around the edges - my part seems to have grown a beard! I assume this is from the drop shadow of the part itself. Now that I have a workflow to get from pictures to 3d mesh, I'm thinking of trying the opposite approach - underexposing the pictures against a black background. That might eliminate any problems with the drop shadow. Processing the 32 images I took was maybe 30 minutes of computer time. Taking the pictures was a breeze since I can tether my new camera to the computer and just leave it on the tripod.

I'll get back with a part 2 pretty soon, these results were honestly a lot better than I had expected from a first attempt! Most of the time was spent wrestling with misbehaving software, so I should be able to pick up the pace dramatically from now on :)

Discussions

esot.eric wrote 05/03/2017 at 07:54 point

Nice!

  Are you sure? yes | no