DIY 3D Laser Scanner - Video

Updated: 25th August 2010

August 2010 Update:

Hi all, I have recently added native webcam image capture to my 3D scanner software. I can now capture full colour 3d scans completely within the application. Supported resolutions 160x120, 320x240 and 640x480.

The textured 3D point clouds above are all digitised in one-pass only (except the piggybank which is made from 6 manually aligned scans).

Colin

DIY 3D Laser Scanner in action!

I have created a video showing my 3D laser scanner in action.

3D Scanner source code

The source code for my DIY 3D Laser Scanner is available here!

This is my latest attempt at creating a simple 3D scanner using just a webcam, laser pointer and simple programming code.

Project Highlights

    • Superfast setup. Preview scans can be created in seconds. Quality scans can take a few minutes.
    • Free scanning, Data captured with a manual movement of the laser sweeping over the object.
    • Webcam capture: Uses VFWGrab for capturing images.
    • Simple Calibration: No need for difficult calibration setups.
    • Live preview: I can watch the scanning process directly in the application.
    • Textures: Colour photo mapping implemented.
    • File Formats: ASCII and OBJ file formats. XYZ, XYZRGB, OBJ file format with coloured vertices.

Latest Setup: With XYZRGB capture.

Just implemented photo colour mapping to each point captured. Here is the result!

12th October 2009

Banana on decorative pot

RAW RGB scan: freescanRGB_banana_02.zip

(laser reflection off lacquered surface produced an error on the right portion of the banana in scan)

Scanning Interface (needs work!)

Top: Photo reference used to map and apply texture.

Left: Realtime webcam preview, Right: Realtime scanline viewer

Bottom: Threshold slider

Basic setup.

Laser offset and angled at 30 degrees to centre of camera.view.

Laser positioned on a 'rotary paper cutter' (It has a smooth horizontal runner).

Basic Workings

The colour reference photo (see interface above) is used to

gather colour values for all points captured.

NEW - DIY 3D Scanner - source code

The source code for my DIY 3D Laser Scanner above is available here!

Real Life

6th October 2009

Face - Point Cloud

Foot scan using a low resolution webcam setting and semi-dark room.

Toy Bear

24th September 2009

3D scanning a toy - Simple setup using a printed protractor

to gauge the 30deg scan angle.

Cleaned and smoothed point cloud with meshed result.

PROJECT OVERVIEW

The purpose of this project was to create a 3D scanning process that was quick, easy to setup and creates good 3d point clouds by using just a freehand sweeping movement of the laser line across any object (realtime 3D spraycan). I didn't want to include difficult camera calibration but the project did require a 'live view' to preview threshold and captured data values as an aditional aid.

Setup

Place the object to be scanned next to a solid vertical background or wall. This is used to obtain the (X) position of the laser. Set the web camera directly in front and directly facing the object to be scanned. Next offset the laser to the side (left) of the object to be scanned. Angle the line of the laser to 30 degrees (a printed protractor is used in the image below to gauge this angle).

Start VFWGrab (my favourite tool used to grab a single video frame every few 10ths of a second)

then run the VB processing code, (remember to keep the VFWGrab window on screen at all times throughtout the scan!)

Slowly and freely I move the laser line across the object (left to right) to gather all data points of the object required. An ascii point cloud is produced ready for meshing in a third party application.

Points2Polys - Free ascii point cloud viewer and mesh utility. pts2plys.zip (3.598kb)

If an initial colour photo was taken it can easily be used to obtain textured vertex values using the same xy coordinates as the captured points.

Process

VFWGrab was used to grab single frames of video (a simple and quick way of grabbing images).

A single JPG image (320 x 260) was captured every 10th of a second image as the laser line sweeps across the object and placed into a folder ready for processing. This image is read and the laser line's position (X) is recorded as the current point of interest (origin of the line). The laser lines drape (contour) over the object is processed and the xyz values are calculated for every bright point down the image using the simple math below

Naughter Webcam VFWGrab 1.07 http://www.naughter.com/vfwgrab.htm

Example:

In the photo above the laser line is currently at (X) position 253 and the bears nose is at (X) 202.

Subtracting the (X) value of any other point down the image results in an offset. This offset is used as the depth (Z) value. e.g. 253 - 202 = 51.

The 3D pixel value (vertex) of the bears bears nose would be: (x) 253, (y) 121, (z) 51

Ascii file output:

x y z

x y z

x y z

etc

Bottle - Scanned using free sweeping movement of laser

September 2009

Sweeping the laser line across the bottle to capture 3D data

Bottle - Raw point cloud

My Hand

September 2009

my_hand_02.zip (ascii point cloud)

Live view - Hand scan, the yellow points are data values

Real-Life Test Scans

September 2009

my_3d_toes_02.zip (ascii point cloud)

Footside_01.zip (raw point cloud)

hand_03.zip (ascii point cloud)

Left hand on surface

Naughter Webcam VFWGrab 1.07

http://www.naughter.com/vfwgrab.htm

Points2Polys - Free ascii point cloud viewer and mesh utility.

pts2plys.zip (3.598kb)