My goals for this project were as follows:
Make scanner which
*could accurately and correctly produce computer models in 3D
*would work for objects under 1' x 1' x 1' in size
*wouldn't cost more than $20 on the project (Materials I have lying around don't count towards the cost, but including these materials, the scanner still costs only about $100.)

The final product works pretty well, and I hope to improve it's usability in the future by further automating it's performance and tweaking the software.

Step 1: The Basic Idea...Overview

In order to locate a point in 3d space, we need to describe one of several things. The simplest would simply be to give three numbers to describe it's position relative to another point in space. This is the format used by most computer models. Another way to describe the point would be to use three planes, or a plane and a line. What you'll see is that it's easiest to describe points in the third way, then convert them to the first to save them to standard format. So the question becomes, how to find the plane and the line? As it turns out, the first question is in the hardware, and the second in the software.

Step 2: The Basic Idea...Hardware

 As I'll try to do with the rest of the instructable, I'll first explain the basic idea, and then move on to my implementation. That way, you should be able to find suitable replacments for anything that you don't have.
So, we need to make a plane, then somehow record where that plane so that it can be processed by the computer. Although others in the past have used the edges of shadows to achieve this, I've gone for something a bit more exotic. I have a (very bright) green astronomy laser (a normal laser pointer might work too, astronomy pointers are expensive). I've shot it through a cylindrical lens, which makes it into a fan. This fan of light is what I'm using as a plane. It works fine, but be warned that the size of your scanner will be severely limited by the size of your lens: my lens in about a third of an inch in diameter, and with an approximately 2' cube for the frame, I'm limited to about a 2' by 6" by 6" scanning surface. A smaller lens would be better, but it's not necessary for what I'm doing.

Step 3: The Box

 The first step is to build a box to contain the scanner. The floor and back wall of the box are made out of melamine, the sides plywood, and the rest is 1 1/2" stock cut on a table saw. After working with the finished product, I can say that the melamine is unnecessary: pick some flat (and it really does need to be flat) plywood, and paint it white. It'll save you a few bucks. My box is about 1 1/2' to 2' in all dimensions, but that aspect is up to you the only other important part of the box is the rails on top. These should be precise, and fit nicely with a set of wheels. I've used 3/8" metal rod, and knex wheels for mine, but any similar set would do.

Step 4: The Laser Gantry

Next is the laser gantry. I've used an old piece of wood I had around for this. They say a picture it worth a thousand words so I'll put the detailed instructions on the pictures. The gantry is mounted so that it rolls along the rails at the top of the box. There's a hole in it, and the laser/lens unit is mounted so that the plane of light falls perpendicular to both the back and bottom of the box, and about halfway up each. Once the gantry and laser are set up, the physical setup is done. On to the camera setup.

Step 5: Camera Position...

The camera should be set off to the side, and above. This ensures that the laser line will deflect properly.
At this point, you should get a test object.  I've used a gnome statue, but anything with a distinctive shape, and good details at all levels should work.  Look at the camera, and make sure that the laser visibly deflects over the object. Look at the pictures below to get a sense of what I mean.

Step 6: The Basic Idea...software

 The ideas behind the software are also quite simple. There are a series of points, each of which correspond to the same pixel on the camera. In a sense, the image on the camera is a projected space of the real 3 dimensional space it's imaging. The trick is to learn how to transform points between the two spaces. As it turns out, this comes down to a fairly simple equation. If you're interested, I'll add scans of my development notebook for you to look through. Otherwise, I'll provide with my matlab implementation and documentation.

Step 7: Do Some Scans!

 Give it a try! Take some scans and see how it works. What you get from this scanner won't be a final model of the object: only the side facing the camera will be mapped, and the resolution is rather coarse. The way to fix this is to do multiple scans, then piece them together. For instructions on how to do this, see this excellent instructable. Happy scanning!

Step 8: New Directions...

 There are several directions I'd like to go in from here. Unfortunately, I probably won't get to it in the near future. I'll leave my ideas here for the DIYer more ambitious than I.

1) Automate-There are a couple things that would need to happen here. One is the software. Matlab might not be the best choice for this though, and I'm not quite as ambitious as to attempt it in another language. In addition, there would need to be some wizardry with electronics, some way to activate motors and such on computer command. Finally, the images would need to be taken and loaded realtime, something I'm not sure how to do. 

2) Add a turn table. Along with automation, this would allow for multiple scans to be taken at the same time. This would reduce the amount of time needed to make a complete model.

3) Scanning software: Ideally, the software would clean out the noise and mesh the point cloud it creates automatically.
It's a very interesting thing,i want to know more about it,can you send me the source code.Thank you very much.My email:sunlight305@hotmail.com.
Hi! Unfortunately, a recent hard drive failure means I don't have the Matlab code anymore. I'm putting together python code to do the same thing, since more people will be able to use this. Until I get that up, there's a fairly detailed description of how all this works at the link below. https://sites.google.com/site/oursler3dscanner/software<br>~Will
<p>can i have the source code ?:)</p>
<p>I have to do a final project in matlab and my code is no where near as amazing as yours is!</p>
I've made my own turntable for a handmade 3d scanner, and I'm very curious about the software, could you send me the source code of Matlab or any documentation? My email is: mehran.zaryoun65@gmail.com
I've made my own turntable for a handmade 3d scanner, and I'm very curious about the software, could you send me the source code of Matlab or any documentation? My email is: mehran.zaryoun65@gmail.com
I've made my own turntable for a handmade 3d scanner, and I'm very curious about the software, could you send me the source code of Matlab or any documentation? My email is: mehran.zaryoun65@gmail.com
I've made my own turntable for a handmade 3d scanner, and I'm very curious about the software, could you send me the source code of Matlab or any documentation? My email is: mehran.zaryoun65@gmail.com
I've made my own turntable for a handmade 3d scanner, and I'm very curious about the software, could you send me the source code of Matlab or any documentation? My email is: mehran.zaryoun65@gmail.com
Hello sir, would it be possible to send me the source code? Thank you in advanced.
<p>Hello!</p><p>I would love to take a look into the work you began and see if there is a way to continue it. There are a team of entrepreneurs, myself included that would love to see this expand. My email is rich.mamsf@gmail.com<br><br>Thanks and great work! </p>
<p>I try to build one, but I don't know how to convert the 2-D Points of my line in world coordinates. How can I make this?</p><p>Thanks</p>
<p>how can i communicate with you?</p>
Hi. <br>Great job <br>May i have the code? <br>golfclub4u2win@hotmail.com <br> <br>TKS
Did you ever complete this in python and can you post the matlab code? Did you use the Hough Transform here? I'm little confused as to does the transform only return linear lines?
Hi,<br> <br> Could anybody give me the code ?<br> <br> BRGDS,<br> birlan
Is there any way you could supply me your code please ?? Im doing a research project on this topic and it would be the biggest help if you could ?? My email is pierce jonRomero35@hotmail.com
Have you been able to get the code? I am looking for the Processing source! Thanks.
Knex wheels! I love it!
I've seen this done before using a stationary mount for the laser (casting a vertical line) and rotating the object around using a turret of some sort, (in that case a satellite dish motor. Have you considered this? That way you could get a full 3d model
that is SO COOL!!!!!!!!
Your welcome Dentroman765. :)
Good, but needs equations / diagrams / algorithms. You mention it, but never show.
Hi. Great project !<br>is it possible to see your notes or to have little diagrams or pseudo code for the triangulation part ? I think there are few people/hobbyists that can buy matlab. All 3d scanners use this and I despair to see a simple implementation.
Yes! I have simple notes for all of this. My apologies for the poor documentation. I never thought anyone would actually read this. It's in need of a rewrite. Until I get around to it (I'll attach the code in python too.), here's a more detailed step by step I wrote for my Application to college: https://sites.google.com/site/oursler3dscanner/software<br><br>I'll try to do a proper write up over the weekend, or barring that after finals. Feel free to comment here or PM if you have any specific points of confusion.<br><br>~Dentroman (aka Will)
Have you considered Octave? It's a sort of open alternative to Matlab. <a href="http://www.gnu.org/software/octave/" rel="nofollow">http://www.gnu.org/software/octave/</a><br> <br> The beers you could buy with the spare Matlab license money would go a long way towards dulling the pain of learning yet another language. In fact you'd probably need to go to rehab... :)
Many thanks, but your link seems to be broken
Whoops. :p <a href="https://sites.google.com/site/oursler3dscanner/software" rel="nofollow">Try this.</a>
i created something like this several years ago... got preti good results with only matlab.. but used fastrbf for smoothening the mesh<br><br>http://www.ekaggrat.net/explorations/laser-scanner/
Thank you for the great explanation.<br>I am looking for a scanner that can scan the bottom of the foot, and use that information for carving insoles by a cnc system. Are you interested in making a prototype and develop the software for that? If you are, we can discuss how much it would cost.
the problem is that those who need inserts need support for the foot not a perfect fit
&nbsp;Nice Instructable, but I missed something. &nbsp;How do you mover the laser? &nbsp;Do you push it along the tracks by hand? &nbsp;And as it is moved so it illuminates the object in, say, the y axis, then what? &nbsp;I assume the camera sees the light from the reflection from the entire y axis. &nbsp;What about scanning the x axis? &nbsp;How do you do that? &nbsp;Sorry if I'm dense.
&nbsp;Right now, I'm just pushing it along by hand, and having the software figure out where the laser is in&nbsp;post-processing. I also don't scan the x-axis: the&nbsp;computer&nbsp;is interpolating (a) the&nbsp;position&nbsp;of plane, and (b) points on surface of that object in that plane. It uses this to make a 3-d point cloud.<br /> In a later build, I might add a turntable, and then I could scan multiple axis, but that isn't really&nbsp;necessary&nbsp;to get a scan.
&nbsp;Thanks, Dentroman765. &nbsp;I think I get part of it--you use the reference points to determine where the laser beam is on the x axis. &nbsp;But I still don't get how the computer determines the points on the surface of the object, because the reflected intensity of the light must be the sum of all the reflections from the top to the bottom of the object.
&nbsp;I'll see if I can explain that a bit then.<br /> The light from the laser beam forms a plane, at least where the&nbsp;camera&nbsp;is concerned. Try drawing a cross section of an object on a piece of paper, then turning the paper so it's at an&nbsp;angle: the cross section will be distorted, but so long as you know that it is on the plane of the paper, it's fairly easy to work out the shape. <br /> The computer analyses the curve of light it sees to make the points in this same way.<br /> Your observation about reflections is a good one: I quickly discovered that reflective objects do not work well with this method, and that the light must be just right to get good quality scans.
&nbsp;Hi Dentroman765,<br /> <br /> &nbsp;&nbsp; &nbsp; Thank you very much for going to all the trouble of explaining the system to me. &nbsp;I think I must be getting senile from not seeing it immediately; after all, you repeatedly said that the detector was a camera, but my mind converted it to &quot;photodetector.&quot; &nbsp;I can see that your camera setup would work perfectly. &nbsp;Thank you for your patience with me.<br /> &nbsp;&nbsp; &nbsp; For a couple of years, I have been working on an acoustic scanner with a single microphone that I move in the x and y directions to scan an acoustic field. &nbsp;I got so blinded by that approach that I couldn't see yours. &nbsp;Very sorry.<br /> <br /> Thank you again for your interesting instructable.<br />
&nbsp;No problem at all! Thank you for reading&nbsp;through!
&nbsp;what is your software called or is it david?
&nbsp;I've been using matlab, but all you really need is a way to work with videos. Matlab is overkill.
This project has a lot of potential.&nbsp; If you do go ahead and implement some of the ideas you mention on the last page, I'd very much look forward to seeing the results!<br />
&nbsp;Thank You! I hope to do everything I mentioned on the last page, but I'll probably have to wait until summer when my&nbsp;schedule&nbsp;clears up a bit.
I hear ya!&nbsp; There just isn't enough time in a day...<br />

About This Instructable




More by Dentroman765:Make your own 3d scanner! 
Add instructable to: