Homebrew 3D Scanner

10/12/2007

I’ve always had a passing interest in things like computer vision, 3d scanning and wot-not… but I don’t really know much about it. so one sunday a few weeks ago I spent a nice day sitting on the sofa, reading papers on 3d scanning. (I’m sad like that). I was looking for a ‘free-time project’ which I could play with in half-hour chunks – as a coder with lots to do, I don’t have the luxury of the immediacy of a sketchbook, nor do I have vast tracts of time to sit down and get stuck into a coding session on anything other than LBP. And, I have never got into processing for some reason…

Anyway, I stumbled upon a rather cool free laser scanning program, that lets you scan objects (that is, create 3d meshes in the computer that accurately represent a real object, for example, your face) using just a laser pointer, a computer and a webcam. It’s called the ‘david laserscanner’. Not posessing a laser pointer, a nosed around a bit more and decided that I might be able to program a structured light scanner. In this technique, you shine a pattern (or patterns) onto your object using a video projector, and photograph the results. by the same sort of triangulation that stereo-image-pair type techniques work (you know, red-green glasses and wot-not), you get a mesh out. only it’s more robust because one of the cameras is replaced by a projector and the pattern you project allows you to more clearly see the shape of the object. like this:

j-ho gets striped

A week later I had a plan – see the david forum for the details!

my first stab at a structured light scanner setup

Another week passed before I managed to snaffle rex’s HD video camera, and took those pictures of our very own Jonny Hopper (’J-Ho’). You can see that all is needed is a program that can measure the ‘bendyness’ of the stripes on his face.

This weekend I spent saturday afternoon trying out different ideas for this. I managed to compensate for the gamma curve of the projector/camera, which was step 1; then I was able to extract the ‘phase’ of the stripes, which was step 2. but then I hit a snag – my ‘phase unwrapping’ – which gives you your output depths, doesn’t work too well. never mind, I was trying a pretty dumb algorithm, but I’ve run out of time and it’ll have to be next week or so before I get a chance to try agian. still, massive noise aside, all of which comes from bugs in my unwrapper, the initial results are promising! the huge errors visible on the left are just due to errors in the phase-unwrap, and hopefully they can be completely got rid of. you can see quite a nice profile, where it works! yay!

world’s worst 3d scan

Tags: