Building a 3D Scanning Dome — Part 1

Making a 3D scanner is a tricky project. I learned a lot about the algorithms involved when I built a similar scanner for the University of Leeds sometime ago. Since that time, there have been many advances in the technology and now, one can buy a cheap, laser line scanner for not a lot of money. They all have their problems though. Some are low resolution, others don’t capture the surface textures properly. One thing that is key though — you want to control the light. A good friend of mine Dr Hannah Dee over at Aberystwyth University, showed me a project she was working on involving a dome with controllable lights. The theory is, if you want to capture the texture of an object, you need to sample how it responds to different lighting conditions in order to recreate all these bump maps, normal maps, albedo maps etc. I figured this was a good place to start. My initial design didn’t include a dome, but who doesn’t love a Dome right?

The basic design

Thanks to another friend, Dr Julie Freeman I managed to get the hubs 3D printed (using a proper 3D printer and not a glue-gun on rails!) and laser cut the struts. I added holes along the struts so that I could bolt on any things I’d forgotten down the line. The prints and cuts came out beautifully I think!

Putting it together

Despite how good the printed parts were, issues with the design did begin to creep in. The support material in the 3D printer is a waxy-like substance that you need to clean off with a special pressure washer. This is loads of fun I have to say, but the process is not perfect. There are lots of annoying left-over residues inside the slots for the struts. This means the fit was not always perfect and in some cases, the thin 5x5mm strut end would snap. I think a better locking mechanism will be needed next time, as oppose to a push/snap fit one. Top tip people — always make spares!

Cameras

This latter point is quite useful! It’s very important to be able to programmatically control the white-balance, resolution and more critically, the focus. You can do all that with a variety of programs, my favourite being GUVCView. This program can be called from the command line with a list of settings, held in an XML file. So once you’ve played with the settings you want, you can save them out and use them again really easily.

This page has a good review of the field of view from both cameras. I can summarise the basic stats as follows:

Max res 2592 x 1944Focus distances in cm with the non-continuous steps:
255 / 3.5
238 / 3.8
221 / 4
204 / 4.3
187 / 5.3
170 / 6.4
153 / 8
136 / 10.5
119 / 15
102 / 25
85 / 40
68 / 51
Roughly a 3mm aperture. Focal length is 4.3mm. This would give an f value of 1.43 (1.4 seems about right I guess).Connection Type Corded USB
USB Type High Speed USB 2.0
USB VID_PID VID_046D&PID_0821
UVC Support Yes
Microphone Yes
Microphone Type Stereo
Lens and Sensor Type Glass
Focus Type Auto
Optical Resolution 5MP True
Diagonal Field of View (FOV) 83°
Focal Length 4.3 mm
Image Capture (4:3 SD) 640x480, 1.2 MP, 5.0 MP, 10 MP
Image Capture (16:9 W) 360p, 480p, 720p, 1080p
Video Capture (4:3 SD) 320x240, 640x480, 1600x1200 2MP
Video Capture (16:9 W) 360p, 480p, 720p, 1080p
Frame Rate (max) 30fps @ 640x480
Right Light Right Light 2
Video Effects (VFX) N/A
Buttons N/A
Indicator Lights (LED) Activity/Power
Privacy Shade Yes (Software)
Tripod Mounting Option No
Universal Clip Adjustability (range) 0° to 180° (Adjustable)
Cable Length 5 Feet or 1.5 Meters

The biggest problem with the C910 is it’s mounting. It’s a real pain to do anything with unless you are putting it at the top of a monitor. In my initial tests, I just cable-tied a few of them to the support struts.

You need quite a few USB controllers to take care of 8 of these cameras (I had managed to buy 8 — the same number I used in my previous scanner). In the end, rather than buy a couple of controller cards, I decided to get some cheap USB powered hubs and drive the cameras individually, taking a single snap-shot each.

Rather than post the code here, you can view it on github in the scanner directory. I’ve included a lot of older code in there, which I will need to filter out but the majority of it works fine. One thing I noticed is that when taking a screenshot, one needs to access the camera a few times because the focus, and indeed the white-balance, isn’t immediately set correctly. If you look further down int the main function you’ll see what I mean. This program outputs raw bitmaps, as it’s advisable to avoid compression artefacts when creating 3D scans from images.

The LEDs

Each strip of 3 LEDs fits quite nicely on a single strut of the dome. This means cutting, soldering and attaching around 50 such strips! Only thing to do is to brew up several cups of tea and get cracking!

Controlling the lights requires some sort of micro-controller. I’ve used the Arduino in the past, with the FastLed library so I figured I’d just use that again

The next steps

Freelance Research Software Engineer and Bioinformatics Student.