3D Scanning - Digitizing on The Cheap (1 of 2)
December 4, 2014
I recently stumbled across a 3D scanner offered by Makerbot, which currently retails at $800 U.S. The idea of digitizing a three-dimensional object, possibly modifying it, and then reprinting it, is pretty damn fascinating! Unfortunately, I can't justify spending $800 on a toy. So, I had to improvise.
How closely can you replicate the functionality of a professional 3D scanner, with little-to-no investment?
All things considered, pretty damn close.
For my first attempt, I wrote custom software in python using openCV, numpy, and matplotlib, to grab images from my webcam. The software searches each frame for the path of the laser which subtends the object under test, and extracts a 3-dimensional point cloud representing said path. In order to reconstruct the entire object, I'll need to manually rotate the object (360 times, 1 degree per frame), and take snapshots along the way. This is a tedious, but temporary, requirement -- in future designs, I'll incorporate a stepper motor to do the dirty work for me. (See Part 2 for more information on software/code.)
Let's take a look:
After collecting all the frames, another script (again, python) was used to combine/rotate each 3-dimensional 'slice' into a point cloud representing the entire model. I made sure to save my data in a form that's consumable by a 3d-modelling software, MeshLab. Here's the first look:
Not bad! It's a little messy, but with some patience (mostly in regards to learning how to use Meshlab), a passable model can be pulled from out of the rubble. I removed some noise artifacts, and did a little poison sampling/filtering, and voilà:
So, there you have it. Attempt #1, complete.
It's been about 48 hours since I started this project, and I'm already staring at a somewhat passable model. Of course, there's much room for improvement, but for such little effort I have to say I'm pretty pleased with the results. Stay tuned for attempt #2, in which I plan to:
- actually learn how to use Meshlab
- buy a stepper motor (so I don't have to manually rotate the damn thing)
- configure the webcam to take raw 1080p images (although it's capable of doing so, I was only using 300x480)
- upgrade the Black&Decker level/laser to something of higher quality
Until next time. Happy researching,