User Tools

Site Tools


scanning_without_panels_by_hal

Tutorial: Scanning Without Panels

by Mattia Mercante – mattia.mercante@gmail.com Many thanks to WalterMo and to Alessandro for their help.

Minor corrections by: Felipe La Rotta

Important points to keep in mind

The goal of this tutorial is to introduce you to one of DAVID's features: Scanning without panels. Before starting with our real-world example, we need to get all the necessary equipment besides DAVID starter.

Stepper motor: Unlike a common motor that spins continuously, a stepper motor only moves in small and very precise increments.

Controller: An electronic circuit that interfaces the stepper motor with the computer and DAVID.

Camera Rig: To keep the camera on the required position, a rig or structure should be constructed or improvised.

Laser Rig: Same as the camera rig, but for the laser itself.

On this page you can read about my experience with an Arduino based controller. You are free to use any other type of controller, as long as the initial position of the motor (called step 0) can be set and recalled later. The motor is also up to your choice, but procure a model that provide a very uniform and predictable speed. This is critical, because every movement should be replicated several times and there must be no perceptible difference between each attempt.

Ok, ready to start? Let's go!

Introduction

Hello to everyone! This is my second tutorial after a long time. On the first one I've used panels and DAVID 1.5, but this time we are going to use David 2.6.1 and and no panels. On both times ShapeFusion was (and is still) our best friend for Aligning and Fusion work

In this tutorial we'll review my experience in Italy, more specifically in the Florentine museum of Rinaldo Carnielo (sorry, there is no English page). On that place I've scanned 3 sculptures (2 plaster casts, 1 bronze), and a piece of another big plaster cast statue. The work was specially challenging due the size of the objects and the requirement of moving the camera and the laser all around the sculptures.

As you can see, the sculpture used on this tutorial not only big (110cm (43.4inches) x 60cm (23.6inches) x 70cm (27.6inches)) but it's also placked on a box. These facts make the construction of a sufficiently big calibration corner totally impractical.

Tip: The sculpture used for this tutorial is a head of Morpheus:

Requirements & Hardware

First to start, you need some hardware to be able to scan without panels.
As with the panels, you need a perfect 90° calibration corner, a good camera and a laser with enough power. Furthermore, you need a stable tripod, a rigid structure at which the camera and the laser are mounted, and a device that moves the laser.

1. The controller with an Arduino inside controls the motor with the attached laser (it is one like this);
2. The motor and the laser are powered by the same cable from the controller. The motor is a stepper motor with a 64:1 planetary gear like this);
And here in detail;
3. The USB cable for the connection with the PC;
4. The 12V wall power supply for the controller;
5. A stable and precise tripod;
6. The rigid structure at which the camera and the motor with laser are mounted. This rig must be fixed on the tripod (here you can see some elements of the structure. Don't care what its shape is… the important thing is that it's light and easy to assemble and dismantle).

The panels for the corner need to be big enough to surround correctly the object (or the portions of the object) that you aim to scan.
I've used a quite big corner: 55cm (21.7inches) x 49cm (19.3inches) x 35cm (13.8inches). In my case, I've chosen to scan this big statue, one little portion after the other, because I want to keep the detail amount high and reduce the noise on the surface. This means that I've chosen a scanning area of 33cm (13inches) x 26cm (10.2inches). Here below you can see the corner, made of thick wood:

Your goal must be to have a rigid structure that keep safe and lock all components together, the camera and motor with the laser. It's very important that the relative distances and positions stay locked during all the scanning process. My solution is this:

It's flexible, light and easy to be moved. But in same time keep safe the laser and camera positions and orientations.
When you have placed and fixed the camera and the laser (this must be placed in the right position, ready to project a good laser plane with an angle at least of 30°), you are ready to move forward.

Configuration of the Arduino Controller

In this tutorial I use a controller device based on an Arduino microprocessor board. Probably not all the infos reported will be usefull for other systems of motor control and David synchronisation. Take this infos as a general guide, an example.
First of all, you need to configure your controller and set David to be ready for panel-less scanning.
Plug in the power supply, connect the device with the motor, turn on the controller and connect it via USB to your PC.
The controller that I use is an Arduino, so I need to install the Arduino drivers. Now you are able to know the COM port on which the controller communicate with your PC. You can find this important information in the “Tools → Serial Port” menù of the Arduino software. However you can find the name of the COM port in the “Start → Control Panel → System → Devices” of your Window O.S. menù. Usually the port name is a higher one than “COM2”. Use the highest.
Go to the David, Advanced Settings, and follow WalterMo's instruction.
Here they are condensed:

1) Communication, COM, Portname = COMx (the number of x you will find on the device manager, USB Serial Port).
2) Communication, Messages, AnalyzeImage = set from one M to four M.
3) Laserscanner, LaserPlaneCalculation, LaserMotionEstimation, Enabled = True
4) Laserscanner, LaserPlaneCalculation, LaserMotionEstimation, MotionBase = 2
5) Laserscanner, LaserPlaneCalculation, LaserMotionEstimation, ScanStartDetectionMode = 0
6) Laserscanner, LaserPlaneCalculation, LaserMotionEstimation, UseRememberedPlanePoses = True

In addition, I strongly suggest to set:

7) Laserscanner, LaserPlaneCalculation, Triangulation, AllowPointsBehindPlanes = True
8) Laserscanner, LaserPlaneCalculation, Triangulation, BackgroundFilterFactor = -1
9) Laserscanner, LaserPlaneCalculation, TriangleMeshComputation, DepthThresholdFactor = a value < 0,05, just to avoid the problem of bad links (not related with the panel-less scanning, but with the final mesh result).

Now, if you press the “Start” button on your David software, the motor starts to move in the chosen direction and the laser is turned on. When we press “Stop” in David window, the acquisition stops and the laser comes back to the original position.
This is the right synchronisation, the good workflow.

Calibration of the Camera

First to do the camera calibration, please take care to block the corner on a table or to the floor. It's important because, as you can see in the image of the Reference Scan (posted below), I remove the calibration sheets from the panels after the camera calibration. If the corner isn't well blocked, there is the risk to accidentally move it when you remove the sheets. I've locked my corner with a screw clamp.

Place your calibration sheets on the panels and fix them on the corner, as you usually do when you scan with panels. Choose the camera orientation (the rotation possibilities in the “Camera Calibration” window of David) in relation with the shape of your objcet.
Adjust the focus of the lens. Insert the right scale value into the David “Scale” field and adjust the camera settings as suggested in the David manual. Do the camera calibration.
Here you can see two possibilities how to rotate the camera and do a good calibration.

In my case, for this scanning work, I think that the vertical orientation is the best choise. In the second image you can see that I've chosen this one (90° rotation) and I'd calibrated it.
As you probably know, it isn't important to see all the V3 dots. The most important thing is to spread them over the whole camera view and see, at least, the 6 rings.

Look at the green lines on the markers: if they are quite short and with uniform orientation, it's ok and you can proceed to the next step. Otherwise, if you obtain big green segments, your corner isn't precise, or your panels aren't flat enough, or the calibration sheets aren't well fixed on the panels. You need to have the best precision at this point, or the next steps and the scans will be problematical.

Calibration of the Laser

When your camera is well calibrated, pay attention to not move the structure with the camera and the laser; obviously don't move the 90° corner, too. And don't change the camera focus anymore! Now, I suggest to remove the sheets with the printed markers, because, in this way, you can avoid the interferences of the black dots on the laser light (on the white surfaces the laser is correctly reflected, but on black surfaces it's absorbed, so not well visible). For the laser calibration it's better to have a perfect laser line projection.
Remove carefully the sheets and leave the panels naked.
Turn the laser ON and place its line in the camera view. Adjust the camera settings as suggested in the David manual. Try to have a situation like this:

Try to keep the laser line thin and well contrasted. A fine help is to click on the laser line in the camera image and a second magnified window will open. It will show you each line pixel. Try to have the background completely black.

Ok, time to calibrate the laser movement. From the “Camera Calibration” window, go to the next one “3D Laser Scanning”. If you have set “True” the “LaserMotionEstimation” value, you can see the “Motor-Driven Laser” steps: “Reference” and “Repetition”.
Now DAVID need to determine the “Reference” plane. This will be the reference path and speed of the laser for all the other scans without panels. We must tell David of what colour the laser is and, after the scan, David will find its kind of movement. And we must tell to David the precise range of time needed to complete a whole scan (the speed), from initial motor step (laser position 0) to the final motor step (laser position XXX).

Place the laser line in the top, or in the bottom, of the camera view (check that it's well focused on the panels). For this tutorial we don't care about the option “UseModelOutsideReferenceRange” in the Advanced Settings, so, please, place the laser light where it's still enough visible in the camera view (not completely out of the view). Do this fundamental thing: set the counter, of your motor steps, to 0 !!

Turn off the laser light and check that your controller automatically turns it on in the same moment when the laser starts panning. Select the “Reference” option and press “Start”. When the laser goes out of the camera view and David alert you with a message, press the “Stop” button. The motor must come back automatically to position 0. This is very important, because if the original position is missed, your scans will be distorted.

Probably now you should have a “depth image” like this:

Ok, now you have calibrated your laser motion. You are now able to scan without panels!
David store these calibration data into a file called “laser_motion.xml”, automatically created when you close the David software, after each “Reference” calibration. You can find this file in the main directory of David. Its dimension is strictly related to the scale value of the calibration and with the speed of the laser (in other words: how much data David had collected).

After a “Reference” scan, you could close immediately the software and restart it. Or you can save the Reference scan into ShapeFusion, delete the depth image and do the Repetition scan. After that, open this second scan into ShapeFusion, too. It is a quick and easy way to overlap the Reference and Repetition scans and see if they're correctly overlapped: if all is ok, you must see both scans on the same planes, respectively flowed into each other.

This is an example of a good Repetition scan:

It is correct (not deformed), without big waves and noise, well fitted on the grid (the position of the real panels).
This is a good result from which to move forward for the scanning project.

Be carefully

Now you're ready to start the scanning work. First remove the calibration corner from the camera view, be sure that the structure is well blocked and rigid. The camera and the leser mustn't be moved and rotated. Any small deviation from the original positions/orientations will create deformations, noise and waves on your scans (in few words: leave the camera and laser as they are after the calibrations).
If you have small objects that you can move and rotate, simply remove the panels and place the object in front of the camera. Or, if you have big and heavy objects, you need to move the camera + laser structure all around the objects.
At this point it's very important that you remember the precise distance between camera and panels (or better, between camera and the center of the corner).
You can easily know this distance just measuring it with a simple folding rule or a ruler.
Why is it so important? Because you can't change the camera focus. So you must pay attention to place the objects (or the area of the objects) at the right distance from the camera and have the best focussing over the object's surface.
Remeber that you can avoid a lot of noise and bad waves over your scans, just doing your best with the right focus settings.
The laser, which you had focussed first to perform the Reference Scan, allows to be refocussed a little. Every object, every surface, has its peculiar shapes, not always simple as the calibration panels. So, probably, during a scan work, you need to adjust the laser focus. Do this carefully, because if you rotate or move the laser, or the motor, you compromise the quality of the scans.

Scanning Time!

As I wrote, I've chosen to scan my sculpture divided into many little areas. I've kept, at least, 1/3 of the mesh surface shared between two contiguous scans.
The process is simple, and rather automated: I place the camera+laser in front of the object's surface, press Start and wait that the scan is completed.



When the single scans are done, I move them forward to David ShapeFusion, ready for the aligning and, finally, for the fusion.
At the end of the acquisition, I have 65 single scans, taken all around the object and from different points of view.


Here above you can see all the scans, arranged and, after, aligned. As you can see, if you work with precision, all the scans fit correctly together, with a good overlapping in the shared areas.

When I've finished, I've divided the sculpture in some parts, because I have a moderate amount of RAM on my pc (only 4Gb). So If I want to fuse at a value of 1000-1200 with the ShapeFusion Poisson fusion method, and avoid PC crashes, I need to reduce the total amount of the polygons and divide the scans into groups: Hair, Beard, Face, Bust and Base. In this way I can keep the final amount of details high as I want.

As first step, I've saved all the aligned scans and reduced their triangle density of the 25-30%, with the software MeshLab. After that, I've imported again all the scans into David and divided into the groups (selected and erased the areas out one group, saved the remaining scans - process repeated for each group).
When I had the groups, I've fused them separately. Then, I've combined all the meshes into a single 3D object.


The final result

All the scanning work take me approx. 5-6 hours of work. For aligning, saving, optimization and fusion, I'd worked for some hours (maybe not more than 5, spreaded over a week, when I'd some spare time). The decimated result that you can see, count only 2.600.000 triangles, and has a size of 110 Mb. I can't say the original amount of the final mesh, not decimated (with full density single scans), but be sure, it would be too much big! And I don't need giant files. With the right decimation, we can keep all details and cut drastically the file size.





Well, this is the end. Hope that you like this quick tutorial about scanning without panels.

by Mattia Mercante – mattia.mercante@gmail.com

scanning_without_panels_by_hal.txt · Last modified: 2014/06/06 18:38 (external edit)