Working on High Quality Low Cost DIY 3D Scanning using Structured Light

Hello all, Karl here. I just wanted to send a note about what I have been working on. As the title says shows it is about 3d scanning. I have found it pretty fascinating so far. These are mainly based on structured light 3d scanning.

From Wikipedia:

Structured light is the process of projecting a known pattern (often grids or horizontal bars) on to a scene. The way that these deform when striking surfaces allows vision systems to calculate the depth and surface information of the objects in the scene, as used in structured light 3D scanners.

There are a few commercial offerings that I have run across or have found while searching around but they are very expensive. The first one I ran across was made by Einscan. They are over 1k and have been reviewed a lot. It seems like they put out a good product and keep evolving the software and hardware.

A few other offerings are David 3D by HP. Thunk3d, and oooooo.

All of these solutions are over 1k but HP (Formerly David 3D) offers a software only license for about $600 and you can bring your own hardware. I really wish they would have a version for hobbyists.

I am hoping with these articles to show you don’t have to spend tons of money on home 3D scanning and get good results. I am also hoping to find some people who can take the software and modify to either fix the minor issues and add some enhancements.

The first article will be on software calibration. I plan on sharing my experience with it and what I have found to work for me.  Below is first scan and I’m really happy with it. The software is already working but needs just a few tweaks. For example the Logitech C920 camera is scanning at 2304×1536 and is like a slideshow, and I have to scan slowly. A pattern is projected onto the part you are scanning and it takes nearly a second to update the image I wish resolutions could be picked and a more modest 1920×1080 be used. A turntable feature would be excellent as well. The great thing is the the source is available but just need someone to come in and tweak. Visual Studio, QT, and OpenCV are used. I am trying to talk my brother into modding and will see how that goes.

Click to Enlarge

John Deere Witt has this excellent project (SLTK OpenCV-based structured light processing toolkit). I found this project a while ago and it seemed within grasp and I have been working with John to bring it to Armbian and run on an Amlogic S905X box. If it works like I hope I think it could be made into a octoprint plugin which would be fantastic. From the looks of it, it seems like he uses the best calibration method for finding camera lens distortion. All the methods I have seen use a checkerboard pattern printed off. He uses a pattern and scans the monitor directly with the webcam. Everything is compiling now and working on the calibration process. One tool I think could also be used with Browns software is his plyalign. It attempts to automatically align point clouds when used with automatic turntable.

SLTK scan Example

Finally I received an HE3D Ciclops scanner. It is not a very exciting scanner and this laser based scanner has been reviewed quite a bit. I am trying to upgrade the webcam to use C920 and it has been challenging.

I also purchased a Kinect v1 on letgo a while back and it is user friendly. I used Skanect but resolution is not very good.

So why write about future articles you ask… Well I am hoping maybe I have overlooked a project and hoping to get someone to help on the software side. There is a gap that needs to be filled in the hobbyist area of 3D scanning. With just a little tlc with the Brown software I think a home scanner with good results can be achieved with little money. I just don’t have the skills to code. All I can do is provide feedback and test. If you know of any other Structured Light software please leave a comment below.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

Radxa ROCK 5C (Lite) SBC with Rockchip RK3588 / RK3582 SoC

12 Replies to “Working on High Quality Low Cost DIY 3D Scanning using Structured Light”

  1. Interesting write up, thank you. That small ceramic owl test in John’s GitHub sample is very interesting for how the inside of the owl is scanned. I assumed that the structured light would only be useful for scanning the outside surfaces. Would be great to see the rig that was used to scan it.

  2. I’m looking forward to your next article!

    The SLTK project looks fantastic. I actually have an sony mp-cl1and was thinking about doing structured light with it (the advantage being its infinite focal depth) – but I guess someone beat me to it 🙂 I’ll be definitely playing around with his library once I have a bit of time

    He really broke down the problem the way I had planned to do it. The one trick I never could figure out is how to go from a point cloud to a good mesh. I found a few papers that claimed to do it.. but it’s always hard to go from a paper to a working algorithm (plus, who knows if it’s any good). Have you looked into this aspect? I’d be very curious to hear if you have any solutions

  3. Which software did you use for your first scan above? The Brown Software or the SLTK? I ask because I installed the Brown software and downloaded the sample calibration and image files, however, it does not recognize those images.

    1. For the pig i used Brown. Ill be doing a livestream soon on this topic. To import the example from brown use the change directory….and you also need to calibrate with his calibration if i remember correctly.

      1. Thank you Karl. I tried to the change directory but no luck. The problem appeared to be the file type possibly. The sample images are .PNG. I didn’t see and indication of the expected format though. I didn’t have time to connect a projector and webcam and was just trying to get a quick indication of the how well the software worked.

      2. Karl,
        Did you build the Brown software from the source or install the binaries? Which OS?

        Should I subscribe to get notifications about upcoming livestreams?

        Thanks!

  4. Unfortunately, the software license from HP (formerly David) comes on a USB dongle and it can sometimes break. So I prefer open source.

  5. Mr. Karl Johnson :

    Now I want to use the slcrunch.cpp for generate 3D point-cloud .

    And I use Raspberry pi 4B , opencv4.4 , and 2021-03-04-raspios-buster-armhf-full .

    But when I do “make” command , some errors appear , as the following :

    pi@raspberrypi:~/opencv/opencv/samples/cpp/example_cmake $ make

    Scanning dependencies of target opencv_example

    [ 50%] Building CXX object CMakeFiles/opencv_example.dir/example.cpp.o

    In file included from /usr/include/c++/8/vector:69,

             from /home/pi/opencv/opencv/samples/cpp/example_cmake/example.cpp:66:

    /usr/include/c++/8/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {cv::Vec<double, 3>}; _Tp = cv::Vec<double, 3>; _Alloc = std::allocator<cv::Vec<double, 3> >]':

    /usr/include/c++/8/bits/vector.tcc:109:4: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator<cv::Vec<double, 3>*, std::vector<cv::Vec<double, 3> > >' changed in GCC 7.1

      _M_realloc_insert(end(), std::forward<_Args>(__args)...);

      ^~~~~~~~~~~~~~~~~

    /usr/include/c++/8/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {cv::Vec<double, 3>}; _Tp = cv::Vec<double, 3>; _Alloc = std::allocator<cv::Vec<double, 3> >]':

    /usr/include/c++/8/bits/vector.tcc:413:7: note: parameter passing for argument of type 'std::vector<cv::Vec<double, 3> >::iterator' {aka '__gnu_cxx::__normal_iterator<cv::Vec<double, 3>*, std::vector<cv::Vec<double, 3> > >'} changed in GCC 7.1

        vector<_Tp, _Alloc>::

        ^~~~~~~~~~~~~~~~~~~

    [100%] Linking CXX executable opencv_example

    [100%] Built target opencv_example

    pi@raspberrypi:~/opencv/opencv/samples/cpp/example_cmake $

    When I run the program , the message is as following :

    pi@raspberrypi:~/opencv/opencv/samples/cpp/sltk-master/sampledata $ ./slcrunch -c -vis -ply -procam procam_2016_12_09.yaml -o blah scan_0020/list.yaml

    enable_coalesce

    enable_coalesce

    PREFIX FOR OUTPUT : [scan_0020]

    outMapPath    blahscan_0020.yaml

    outVisCPath    blahscan_0020_rgb.png

    outVisXPath    blahscan_0020_x.png

    outVisYPath    blahscan_0020_y.png

    outVisDirPath   blahscan_0020_direct.png

    outVisAmbPath  blahscan_0020_indirect.png

    outVisChessCamPath  blahscan_0020_chesscam.png

    outVisChessProPath   blahscan_0020_chesspro.png

    outPlyPath blahscan_0020_cloud.ply

     

     Come to here 1 !!!

    checking image list: scan_0020/list.yaml

         prefix : [scan_0020]

         fname : [list.yaml]

    parsing [scan_0020/list.yaml]

    [scan_0020/1481302049.551275_[00-10-00_00]_img.jpg]

    [scan_0020/1481302051.228189_[00-10-01_01]_img.jpg]

    [scan_0020/1481302053.097507_[00-09-00_02]_img.jpg]

    [scan_0020/1481302054.693405_[00-09-01_03]_img.jpg]

    [scan_0020/1481302056.432740_[00-08-00_04]_img.jpg]

    [scan_0020/1481302058.218591_[00-08-01_05]_img.jpg]

    [scan_0020/1481302059.821438_[00-07-00_06]_img.jpg]

    [scan_0020/1481302061.644733_[00-07-01_07]_img.jpg]

    [scan_0020/1481302063.349134_[00-06-00_08]_img.jpg]

    [scan_0020/1481302065.111192_[00-06-01_09]_img.jpg]

    [scan_0020/1481302066.921491_[00-05-00_10]_img.jpg]

    [scan_0020/1481302068.727864_[00-05-01_11]_img.jpg]

    [scan_0020/1481302070.440745_[00-04-00_12]_img.jpg]

    [scan_0020/1481302072.160886_[00-04-01_13]_img.jpg]

    [scan_0020/1481302073.928258_[00-03-00_14]_img.jpg]

    [scan_0020/1481302075.812690_[00-03-01_15]_img.jpg]

    [scan_0020/1481302077.992064_[00-02-00_16]_img.jpg]

    [scan_0020/1481302080.107783_[00-02-01_17]_img.jpg]

    [scan_0020/1481302082.201916_[00-01-00_18]_img.jpg]

    [scan_0020/1481302084.359588_[00-01-01_19]_img.jpg]

    [scan_0020/1481302086.477428_[00-00-00_20]_img.jpg]

    [scan_0020/1481302088.519775_[00-00-01_21]_img.jpg]

    [scan_0020/1481302090.241762_[01-10-00_22]_img.jpg]

    [scan_0020/1481302091.783343_[01-10-01_23]_img.jpg]

    [scan_0020/1481302093.856558_[01-09-00_24]_img.jpg]

    [scan_0020/1481302095.419883_[01-09-01_25]_img.jpg]

    [scan_0020/1481302097.134070_[01-08-00_26]_img.jpg]

    [scan_0020/1481302098.811209_[01-08-01_27]_img.jpg]

    [scan_0020/1481302100.474787_[01-07-00_28]_img.jpg]

    [scan_0020/1481302101.993313_[01-07-01_29]_img.jpg]

    [scan_0020/1481302103.591916_[01-06-00_30]_img.jpg]

    [scan_0020/1481302105.259782_[01-06-01_31]_img.jpg]

    [scan_0020/1481302106.943372_[01-05-00_32]_img.jpg]

    [scan_0020/1481302108.550672_[01-05-01_33]_img.jpg]

    [scan_0020/1481302110.310776_[01-04-00_34]_img.jpg]

    [scan_0020/1481302112.068761_[01-04-01_35]_img.jpg]

    [scan_0020/1481302114.069967_[01-03-00_36]_img.jpg]

    [scan_0020/1481302115.951540_[01-03-01_37]_img.jpg]

    [scan_0020/1481302118.111106_[01-02-00_38]_img.jpg]

    [scan_0020/1481302120.067323_[01-02-01_39]_img.jpg]

    [scan_0020/1481302122.272422_[01-01-00_40]_img.jpg]

    [scan_0020/1481302124.524852_[01-01-01_41]_img.jpg]

    [scan_0020/1481302126.814440_[01-00-00_42]_img.jpg]

    [scan_0020/1481302128.658200_[01-00-01_43]_img.jpg]

    gcb images : 44, rgb images: 0

    Using image list: scan_0020/list.yaml

     

     Come to here 21 !!!

    loading exif data..

     

     come to here 31

     

     come to here 32

    (2199 chars) list: [scan_0020/1481302049.551275_[00-10-00_00]_img.jpg scan_0020/1481302051.228189_[00-10-01_01]_img.jpg scan_0020/1481302053.097507_[00-09-00_02]_img.jpg scan_0020/1481302054.693405_[00-09-01_03]_img.jpg scan_0020/1481302056.432740_[00-08-00_04]_img.jpg scan_0020/1481302058.218591_[00-08-01_05]_img.jpg scan_0020/1481302059.821438_[00-07-00_06]_img.jpg scan_0020/1481302061.644733_[00-07-01_07]_img.jpg scan_0020/1481302063.349134_[00-06-00_08]_img.jpg scan_0020/1481302065.111192_[00-06-01_09]_img.jpg scan_0020/1481302066.921491_[00-05-00_10]_img.jpg scan_0020/1481302068.727864_[00-05-01_11]_img.jpg scan_0020/1481302070.440745_[00-04-00_12]_img.jpg scan_0020/1481302072.160886_[00-04-01_13]_img.jpg scan_0020/1481302073.928258_[00-03-00_14]_img.jpg scan_0020/1481302075.812690_[00-03-01_15]_img.jpg scan_0020/1481302077.992064_[00-02-00_16]_img.jpg scan_0020/1481302080.107783_[00-02-01_17]_img.jpg scan_0020/1481302082.201916_[00-01-00_18]_img.jpg scan_0020/1481302084.359588_[00-01-01_19]_img.jpg scan_0020/1481302086.477428_[00-00-00_20]_img.jpg scan_0020/1481302088.519775_[00-00-01_21]_img.jpg scan_0020/1481302090.241762_[01-10-00_22]_img.jpg scan_0020/1481302091.783343_[01-10-01_23]_img.jpg scan_0020/1481302093.856558_[01-09-00_24]_img.jpg scan_0020/1481302095.419883_[01-09-01_25]_img.jpg scan_0020/1481302097.134070_[01-08-00_26]_img.jpg scan_0020/1481302098.811209_[01-08-01_27]_img.jpg scan_0020/1481302100.474787_[01-07-00_28]_img.jpg scan_0020/1481302101.993313_[01-07-01_29]_img.jpg scan_0020/1481302103.591916_[01-06-00_30]_img.jpg scan_0020/1481302105.259782_[01-06-01_31]_img.jpg scan_0020/1481302106.943372_[01-05-00_32]_img.jpg scan_0020/1481302108.550672_[01-05-01_33]_img.jpg scan_0020/1481302110.310776_[01-04-00_34]_img.jpg scan_0020/1481302112.068761_[01-04-01_35]_img.jpg scan_0020/1481302114.069967_[01-03-00_36]_img.jpg scan_0020/1481302115.951540_[01-03-01_37]_img.jpg scan_0020/1481302118.111106_[01-02-00_38]_img.jpg scan_0020/1481302120.067323_[01-02-01_39]_img.jpg scan_0020/1481302122.272422_[01-01-00_40]_img.jpg scan_0020/1481302124.524852_[01-01-01_41]_img.jpg scan_0020/1481302126.814440_[01-00-00_42]_img.jpg scan_0020/1481302128.658200_[01-00-01_43]_img.jpg]

    $/usr/local/bin/exiftool -s scan_0020/1481302049.551275_[00-10-00_00]_img.jpg scan_0020/1481302051.228189_[00-10-01_01]_img.jpg scan_0020/1481302053.097507_[00-09-00_02]_img.jpg scan_0020/1481302054.693405_[00-09-01_03]_img.jpg scan_0020/1481302056.432740_[00-08-00_04]_img.jpg scan_0020/1481302058.218591_[00-08-01_05]_img.jpg scan_0020/1481302059.821438_[00-07-00_06]_img.jpg scan_0020/1481302061.644733_[00-07-01_07]_img.jpg scan_0020/1481302063.349134_[00-06-00_08]_img.jpg scan_0020/1481302065.111192_[00-06-01_09]_img.jpg scan_0020/1481302066.921491_[00-05-00_10]_img.jpg scan_0020/1481302068.727864_[00-05-01_11]_img.jpg scan_0020/1481302070.440745_[00-04-00_12]_img.jpg scan_0020/1481302072.160886_[00-04-01_13]_img.jpg scan_0020/1481302073.928258_[00-03-00_14]_img.jpg scan_0020/1481302075.812690_[00-03-01_15]_img.jpg scan_0020/1481302077.992064_[00-02-00_16]_img.jpg scan_0020/1481302080.107783_[00-02-01_17]_img.jpg scan_0020/1481302082.201916_[00-01-00_18]_img.jpg scan_0020/1481302084.359588_[00-01-01_19]_img.jpg scan_0020/1481302086.477428_[00-00-00_20]_img.jpg scan_0020/1481302088.519775_[00-00-01_21]_img.jpg scan_0020/1481302090.241762_[01-10-00_22]_img.jpg scan_0020/1481302091.783343_[01-10-01_23]_img.jpg scan_0020/1481302093.856558_[01-09-00_24]_img.jpg scan_0020/1481302095.419883_[01-09-01_25]_img.jpg scan_0020/1481302097.134070_[01-08-00_26]_img.jpg scan_0020/1481302098.811209_[01-08-01_27]_img.jpg scan_0020/1481302100.474787_[01-07-00_28]_img.jpg scan_0020/1481302101.993313_[01-07-01_29]_img.jpg scan_0020/1481302103.591916_[01-06-00_30]_img.jpg scan_0020/1481302105.259782_[01-06-01_31]_img.jpg scan_0020/1481302106.943372_[01-05-00_32]_img.jpg scan_0020/1481302108.550672_[01-05-01_33]_img.jpg scan_0020/1481302110.310776_[01-04-00_34]_img.jpg scan_0020/1481302112.068761_[01-04-01_35]_img.jpg scan_0020/1481302114.069967_[01-03-00_36]_img.jpg scan_0020/1481302115.951540_[01-03-01_37]_img.jpg scan_0020/1481302118.111106_[01-02-00_38]_img.jpg scan_0020/1481302120.067323_[01-02-01_39]_img.jpg scan_0020/1481302122.272422_[01-01-00_40]_img.jpg scan_0020/1481302124.524852_[01-01-01_41]_img.jpg scan_0020/1481302126.814440_[01-00-00_42]_img.jpg scan_0020/1481302128.658200_[01-00-01_43]_img.jpg 2>&1

     

     come to here 33

     

     come to here 51

     

     come to here 36

     

     come to here 55

     

     come to here 58

    Segmentation fault

    pi@raspberrypi:~/opencv/opencv/samples/cpp/sltk-master/sampledata $

    Can you tell me , when you do the sltk ,

    What version of opencv do you use ?
    What version of linux-of-raspberrypi do you use ?

    Do you have some other configuration files , and some other application notes , such as command line demo , about the sltk ?

    Hope to get your response !

    Happy & Health !

    Zhangbin , Alex

Leave a Reply

Your email address will not be published. Required fields are marked *

Boardcon Rockchip and Allwinner SoM and SBC products
Boardcon Rockchip and Allwinner SoM and SBC products