Apr
3
Head First into 3D Scanning
By Ben Brown
So, not long after Kwartzlab was introduced to the uphill battle that is our RepRap Mendel 3D Printer, a few of us starting throwing around the idea of building a 3D scanner. If you’ve never heard about one, we’re using a line laser to scan a 3D object through a webcam, into a file we can manipulate, mangle and then possibly send to a 3D printer – essentially creating the first half of a 3D photocopier.
All we need is a decent laser, webcam and software to do all the heavy lifting for us. I decided to start off with a fairly popular combination in the realm of 3D scanning:
- Webcam: Logitech Quickcam Pro 9000 USB
- Laser: 532nm 10mW 3.0VDC Green Laser Module with 89 degree line lens from AixiZ
- Software: D.A.V.I.D Laserscanner Trial
D.A.V.I.D appears to be the most mature software for 3D scanning, although it also comes with a hefty pricetag ($270-310cdn). I had hoped the trial could give me a little more than a feeling for the scanning capability, but I eventually learned that the trial is actually more crippled than it really needed to be.
Anyhow, to construct our 3D scanner:
The D.A.V.I.D. software requires a special background to calibrate it’s scanning capabilities, which is included as a PDF with the software package. Using our trusty plotter (thanks Don!) and a derelict piece of corrugated plastic I scrounged from our illustrious tool room, I got to work. I needed to split the calibration image fairly precisely down the middle so it ends up sitting at a 90 degree angle for the software to recognize it properly:
Assembling and securing the calibration panel is honestly the most difficult (not) step in setting up for 3D scanning. Once I had my mediocre facsimile of the grid, I fired up the software and went through calibration. You need to adjust the camera so it only sees your calibration grid. It doesn’t have to the the entire thing though, just make sure it can see the six guidepoints in the middle. With a little luck, you should see this in no time:
Once your all calibrated you’re ready to rock. I decided to try scanning at 800×600 (although a convenient post-scan dialog tells us the trial version of D.A.V.I.D only saves at a resolution of 320×200). Once we flicked the switch on the power supply, we got to work:
Now to scan an object, you run the line laser (very slowly) up and down the front of your target object. As the webcam records the laser moving over your object, the software detects the depth of the laser line in front of the calibration grid, giving you enough data to create a 3D surface of what you’re scanning:
The idea here is to make four passes of your object, while rotating it 90 degrees between them. The amount of rotation is very important for the next step:
The Shape Fusion step takes our four individual 3D scans and attempts to assemble a single 3D representation. First of all, you can edit each scan individually to remove any parts or artifacts you don’t want to have in your completed 3D model (in this case, the wood block the glue gun was sitting on). Once we’ve got that edited out, we need to merge the four sides into a single model, and we have a few ways of doing this. Since our object was rotated on it’s Y-axis during the scan, we try to merge our four parts along that option, using 90 degrees as our reference point:
Depending on how uniform your 3D scans were (mine were essentially a trainwreck), you should be presented with a rough model of what you were trying to scan. Last step is to ‘Fuse’ the four sides together, which will attempt to fill in any missing spots and hopefully end up with something closely resembling your target object:
As you can see, I missed a lot of the edges of my scans, so I got a fantastic-looking glue gun that’s been run through the microwave. At this point I could save this abomination as a OBJ (for further mangling) or a STL file (for 3D printing) so I could waste expensive plastic filament reproducing my horrific, melty representation of a glue gun, however the trial doesn’t allow you to save any completed object. Which means you’re essentially stuck with making basic scans with D.A.V.I.D until you register it, while simultaneously weeping at all the aligning and fusing you just did that you can’t save.
Final Thoughts
Now that we’ve broken into the weird world of 3D scanning, I’ll be exploring some of the other (open source) software available, as well as working with the esteemed Karl Williams in automating much of the manual process (moving the laser, rotating the object). This should significantly increase the accuracy of 3D scans, as well as prevent my shaky hands from dropping the laser and blinding everyone within eyesight.
Things I learned from my first foray into 3D scanning:
- You may lose the will to live setting up the perfect distance, lighting and webcam settings, but it’s totally worth it. Nothing is more awesome than scanning a bananaphone and actually seeing a 3D bananaphone… other than a 3D baconphone, that is.
- An 89 degree line laser is LUDICROUSLY WIDE, even from only 2 feet away. I could scan in my object and still critically harm a Kwartzlabber on the other side of the room. I’ll need to build an enclosure for the scanning area, or come up with the coin to outfit everybody with green laser protective glasses.
- Read the instructions on your crippleware. Especially the part where it says you CAN’T SAVE ANYTHING.
Cheers!
Ben


















Crippleware is one of the main reasons I stick with Free Software wherever I can… but I guess around Kwartzlab, I’m preaching to the choir.
The DRM on a lot of commercial stuff aggravates me to no end.
Ben, Nice work on the first experiment! It’s going to be fun automating the process.
Are there any good 3D scanning freeware/open source apps out there?
If not I’ll pitch in to pay for the licence for the david scan software.
There’s one called grape3D that uses a spinning turntable to take a vertical laser-scan movie of the object (one rotation), then run it through a post-processor that generates a 3D shape. I haven’t had a chance to try it because we need the turntable.
After some more experimentation with DAVID today, we’ll need an enclosed scan area, not just to shield the laser but to control ambient light. Shadows and daylight changes were affecting the scans as I was doing them today. We just need to fudge with the camera/laser settings.
Ben, that just *rocks*, dude! Well done.
DW
I’m thinking we should build an enclosed box to eliminate any ambient light. Inside the box we can have a stepper controlled turntable and a stepper controlled device to scan the laser over the object. I’ve got the PIC microcontroller code and VB.net code figured out for using USB so I’ll write an app to control the whole thing. What do you think?
Sounds like a plan! I’m going to get materials together for a proper enclosure tomorrow. Once we have finite measurements of camera distance, turntable and laser scan angles, we can try automating the bulk of the Shape Fusion process as well.
I’ve got a turntable, the platen spins freely, no motor attached. I was originally going to use it for magnet fun, but have lost interest. Look at the top of my bin to see it.
It also has a hinged cover, which I think might work for a enclosure. Maybe replace the cover with something larger, or modify it (make a hole in the top and and sides and ceiling).
Very interesting project.
Nice job, great writeup!