
Build Your Own 3D Scanner w/ Structured Light
November 23, 2009I was about to embark on finally fixing my homemade structured light implementation (created in a Computer Vision class), when I stumbled across this amazing site.
Recently at SIGGRAPH 2009 there was a course on 3D scanning with structured light. I wasn’t able to make SIGGRAPH this year because I was working at Walt Disney Imagineering, so I didn’t find out about this course until this week. The course will also be at SIGGRAPH Asia on Dec. 16th, so make your way over to Japan and check it out.
The course features extensive notes explaining structured light and basic Matlab and C++ implementations.
Essentially, structured light uses a projector and a camera to create a 3D scan. Normally humans perceive depth based upon triangulating the location of an object using our left and right eye. In structured light you can think of the camera as your left eye and the projector as your right eye. Through projecting a series of uniquely identifiable codes the camera sees for the projector. The hardest part of implementing this is the calibration of the projector and camera. This involves determining the parameters of the lenses and the location/orientations of the projector/camera.
I’ve spent some time modifying the above code (which was very similar to my own implementation a few months ago, only it works
). The SL code now works with the Canon EDSDK. I am using my Canon T1i DSLR as the camera and an old NEC VT540 projector(1000 lumens).
I also have modified the calibration process to use a red/blue checker board pattern. In my opinion this makes the projector calibration step easier and more robust (I have no facts to back this up). Essentially, you use a red/blue checkboard pattern which appears black/white in intensity under red light. However, the pattern is roughly gray in intensity under white light. This technique come from “A Novel Method for Structured Light System Calibration” by Zhang, S. & Huang, P.
I will be posting my modified source code soon. I would be very interested in turning this into a full fledged open source project. With a minimal amount of work we could probably support most of the common camera SDKs (aka Point Grey, Dalsa etc). It would also be nice to make a GUI and support a wider range of output options. Any takers?
Check back soon for code and goodies.


Are there any compiled binaries to do structured light scanning available? I am interested in getting my feet wet. Could be pretty exciting to have the projector position and a mesh!
Too bad that the original code is not working anymore.
Has anybody got a working version?
I am more of a designer and my programming knowledge is too limited.
In case somebody had the the same beginner problem as me:
The original binaries are compiled with the 2005 vc++ runtime libraries.
You can compile the source code with a new visual studio version or download and install the 2005 runtime libraries from Microsoft.
Prost!
Hi You got a very high accuracy and resolution result.
I`m also do same project and have problem as matlab source code.
Would you send me the source code to my email?
sbp0122@naver.com
Why are we so fascinated with 3D scan…well to capture and view our 3D object back in 3D space of-course…what are we going to do with it …not much…so i have devised a method that pleases our curiosity..its a real 3D scan process but made just for our enjoyment..no laser and as yet no special software needed…no trig math calculation but an accurate full color 3D scan.
Hi,
I am trying to use the same projector calibration method by Dr. Zhang and was hoping I could ask a question. I get to the point where I have calculated the horizontal and vertical phase maps, then I am confused on how to construct the DMD line from the CCD pixel. I was hoping you could give some insight on this final step to creating the DMD image.
Thank you in advance,
Richard Jassel
[...] Library which includes a module for the Kinect camera. The library will eventually include a structured light module as well. We are also toying around with combining the Kinect with our previous work on [...]
Hi I am a first year digital media design student at LCC in London. I am really interested in trying to implement this type of projection mapping. I have a nikon d5000 and an Acer projector 2500 lummens and a mac book pro. Could anyone give me some advice on how to get started on the whole process. I am trying to find a intergrated structured light scan which I can download to play around with. I have watched the Johnny Lee videos and I want to do something along these lines for my final year presentation. I do not have much coding skills but my cousin works for Ubisoft programming physics engines. Please email me if you fancy helping out a novice chrisdavisdesign@gmail.com. Thanks
Hy everyone
I use the source code of 3D scanner and result is not good. If anyone has started this program and got good results and wants to help me let me know by email. I think I’m wrong in the process of calibrating the projector.
Thanks
vkanjevac@gmail.com
Count on me too.I’m a 3d artist and i have some experience with other scanners.
Thanks
Chris
Hi Brett,
Its a very interesting idea. Put me down too.
I’d love to see your code and try working on it soon.
Looking forward to it.
Im also working on a project 3d Scanner.
I have web camera and projector(Sony).
Reading Zhang’s paper on calibration explained things in quite detail.
I am trying two methods for calibration, one is the OpenCV calibration, which has given me the intrinsic and the distortions. With this i plan to get to the next step.
The other method i am trying out is the procamlib by Samuel for projector and camera calibration.
Regards
Hansraj
Hello Hansraj,
Ive tried Procamlib by Samuel but as yet have been unable to utilize the calibration data for an effective triangulation using the resultant “phase-map” and projected image data.
If you could please let me know if you have had more success.
Kind Regards,
A.
I didnt go ahead with the Procamlib, due to the same problem,
I used it to compare the results which I would get through OpenCV calibration. Could not do much with it.
Will let you know if I get any further.
Best Regards,
Hansraj
I’ve been working on a similar project for almost one year. Actually my research focuses on possible improvements of structured light. I’ve developed a vision computing framework originally for SL. It supports cameras provided by OpenCV as well as EDSDK lib. For portability issue I built it on wxWidgets, making it come with a native GUI interface. I’m now considering turning it into an open project too.
wxWidgets would be a good choice if your project needs a GUI interface with cross-platform features.
Hi, great blog! Thanks.
I was trying to do calibration in matlab, but it fails when i tried to calibrate photos of projection pattern. But the idea is great. Maybe someone tried to do it in matlab or have some ideas for calibration.
Best regards,
Karper.
I’m also interested in working on something like this. I’m a bit rusty on the coding end (though I’ve been meaning to get back into it), but I have a 5dmII, a panasonic P2, and access to various projectors, so I could test on multiple equipment combos.
Wow..I love your blog…so much of what I’ve been trying to follow for a year now down to Projector based tracking and more. Some of which I saw on johnny Lee blog with Wii whiteboard hacking. site..
I think its http://www.procrastineering.com Cant wait to see how this comes along…sooo exciting when the tools get this cheap with some creative minds…Any thouhts on what can be done with The coming Micrsoft “Natal” and Sony formats? Kind of like using LiDar technologies I”m hoping..
Also, I wonder if using a DIY ScanCam with 50mm lens and a slow scanner would capture well enough to make mesh models with? or to much data? Old Flatbed Scanner + 50mm Lens = Amazing 130-Megapixel Scancam from here http://www.popsci.com/diy/article/2009-06/old-flatbed-scanner-50mm-lens-amazing-130-megapixel-scancam
So I’ve gotten in contact with Douglas Lanman (one of the original authors) and we will be converting this into an open-source project soon. We will get back to you guys soon so we can get to the hacking.
@ Jouni – My email is: brett.r.jones2 at gmail dot com
@ David – A python version is an interesting idea. When I built my original scanner it was in python, however the processing steps were quite slow. I’m not aware of python wrappers for the CanonSDK. Let me know how this goes.
Brett
Hi guys,
I’m interested in test your calibration with red/blue checkerboard http://augmentedengineering.wordpress.com/2009/11/23/build-your-own-3d-scanner-w-structured-light/
Do you have any code, and pattern to provide me ?
I’m trying to calibrate camera/projector with the cvStructuredLight but it failed all the times, the projector checkerboard is always bad estimated and so the calibration is not good.
Thanks a lot. (Note that I use a point grey camera and it failed, with a logithec webcam it works fine)…
It’s cool to see that you have used with sucess a reflex as the camera for structured light stuff !
Thanks a lot guys,
Pierre
Does anyone happen to have a wrapper for the Canon EDSDK to implement this scanner in Python?
Put me down as well.
This would be a great. I would love to see the code
hi there – i would love to test this out – i’ve got the canon t1i as well, and have been thinking of building a projector based structured light scanner – would be happy to work with you guys on this!
I’m a designer so can definitely do the GUI for it
where can I email you?
cheers
Jouni
London
UK
I am also in. Please put me in the list.
Btw, fantastic idea.
Michael
this is what set me apart from everyone else.. I don’t follow other peoples way..I study but don’t follow..3D scanning is so easy its pathetic… when other people follows, it just buy me some time on my own innovations…i even found something useful to do with my 3D scanning…it will change everything