AN OPEN SOURCE LOW-COST AUTOMATIC SYSTEM FOR IMAGE-BASED 3D DIGITIZATION

3D digitization of heritage artefacts, reverse engineering of industrial components or rapid prototyping-driven design are key topics today. Indeed, millions of archaeological finds all over the world need to be surveyed in 3D either to allow convenient investigations by researchers or because they are inaccessible to visitors and scientists or, unfortunately, because they are seriously endangered by wars and terrorist attacks. On the other hand, in case of industrial and design components there is often the need of deformation analyses or physical replicas starting from reality-based 3D digitisations. The paper is aligned with these needs and presents the realization of the ORION (arduinO Raspberry pI rOtating table for image based 3D recostructioN) prototype system, with its hardware and software components, providing critical insights about its modular design. ORION is an image-based 3D reconstruction system based on automated photogrammetric acquisitions and processing. The system is being developed under a collaborative educational project between FBK Trento, the University of Trento and internship programs with high school in the Trentino province (Italy). Figure 1. ORION in action and some 3D results achieved with the developed system.

Figure 1.ORION in action and some 3D results achieved with the developed system.

INTRODUCTION
Image-based 3D reconstruction is receiving a lot of attention thanks to the availability of automated photogrammetric solutions which allow almost anyone with a digital cameraor even smartphones (Nocerino et al., 2017), to generate a 3D model.Indeed, an ever growing "photogrammetric culture" is widespreading throughout various application communities and faithful 3D digital replica of objects are getting more and more feasible.Various investigations (Wenzel et al., 2013;Gonizzi-Barsanti et al., 2014;Toschi et al., 2014;Macher et al., 2017) demonstrated that, with respect to other methods, automation in image-based methods has reached a very efficient level in various application projects, with great potentials.Beside some processing open issues (Nocerino et al., 2014;Menna et al., 2016;Remondino et al., 2017), image acquisition is still a very crucial step, limiting the quality of the final 3D results.Particularly, in case of mass heritage 3D digitization projects (Europeana; Google Art Project; Santos et al., 2017aSantos et al., , 2017b) ) or complex objects with non-collaborative surfaces, the whole 3D digitization pipeline based on a manual image acquisition followed by an offline processing may be not cost effective.Indeed (i) the time required by manually placing the camera in the correct positions is not effective, (ii) an offline processing done at a later stage could be not successful (e.g.due to incompleteness), thus requiring new integrative image acquisition, which may be not always feasible, especially when dealing with remote or endangered cultural heritage.With the aim to simplify and automate the image acquisition for small to medium sized cultural heritage artefacts like vases, jugs, amphorae, decorative stones, or industrial parts like a gear box or a turbine blade, several automatic systems have come out as research (Santos et al, 2017a(Santos et al, , 2017b;;Gattet et al., 2015;Hosseininaveh et al., 2014Hosseininaveh et al., , 2015)), commercial (Pixelio3D, EinScan, etc.) or even DIY solutions.The simplest and least expensive type among the automatic systems is based on a turntable.This system generally consists of a controller able to shoot the camera after turning and stopping the table in predefined angular positions.While this solution can alleviate the acquisition efforts for simple shaped objects with cooperative surface material, it seldom replaces the professional expertise of a photogrammetrist when dealing with much complex objects like those present in vast museum collections, thus providing just a limited improvement to the efficiency of the photogrammetric workflow.One of the main problems of simple turntable systems for photogrammetric acquisition is the basic assumption that the object surface is cooperative (with random texture at the required spatial resolution and without specular reflections) and that the object shape is in focus within the field of view of the used camera.
Figure 2. ORION main hardware components and a schematic representation of hardware relationships (up).3D printed models of the designed parts for the turn table (below).
Unfortunately, many objects do not always have a rotational symmetric shape, which make their surface closer or farther to the camera with obvious focusing issues (depth-of-field, DoF).Non-rigorous solutions to overcome depth-of-field related issues have been proposed using focus stacking procedures and assuming the interior orientation parameters' variations within the synthetic stacked image not significantly affecting the 3D final results (but without proof against a higher order accuracy reference).

Paper contribution
The article presents the current state of development of ORION (arduinO Raspberry pI rOtating table for image based 3D recostructioN), an image-based acquisition hardware and software system for the 3D digitization of heritage artefacts, industrial components or design pieces (Figure 1-2).The system has been designed by the authors to (i) acquire images from one or more high resolution digital cameras (DSLR, mirrorless, etc.), (ii) control a turntable (with selectable speed and acceleration/deceleration), (iii) control the motorized linear stages where cameras are placed on to allow for forward and backward camera motion with fixed focus, (iv) control the illumination (with synchronised strobes, LED, or digital projector), (v) superimpose structured light (multi-resolution and multitemporal fringe or random patterns) and (vi) send the images to a computer for an online processing.The system is being developed under a collaborative educational project between FBK Trento, the University of Trento and internship programs with high school in the Trentino province (Italy).
With respect to the system proposed in Hosseininaveh et al (2015), ORION can control different lighting devices (like flash units, LED panels, a digital projector for superimposing structured light patterns) thus being able to acquire objects with and without texture, or even objects that feature both characteristics (i.e.partially textureless).Compared with the Gattet et al (2015), besides the capability to control different types of lights, ORION can control camera shooting parameters for most commercially available cameras and automatically download e organise the images.Using dedicated scripting, the images can be either processed locally or sent to a remote server (Nocerino et al., 2017).The images can be processed using research and commercial SfM software applications, as well as photogrammetric tools for educational purposes (González-Aguilera et al., 2016).

ORION COMPONENTS
ORION is still under development and the currently tested release features a Raspberry Pi, two Arduino Uno, one turntable assembled using an Ikea SNUDDA table and 3D printed parts, a Dell M115HD digital projector, a stepper motor, one/two digital camera(s) and strobes/LED lights.A modular graphic user interface (GUI) has been developed for beginners or experienced user.Once assembled, everything fits in a cabin baggage trolley.Technical specifications, electronic circuit diagrams, 3D models of parts to be printed are all available to the research community along with the open source software (GPL3 license).

Hardware components
Two Arduino Uno rev3 (Table 1) and a Raspberry Pi3 Model B (Table 2) were used to control the system.Arduino is an opensource single-board microcontroller platform with flexible and easy-to-use hardware and software components.Raspberry Pi is a series of low cost credit-card-sized single-board computers created to promote the teaching of basic computer science in schools and in developing countries.The choice of this configuration was driven by the consideration that timing and synchronization is extremely important in two tasks: cameras shooting and flash lighting.The Raspberry Pi could control the entire system but not with a very precise input/output (I/O) timing when the operative system (OS) of the controller has to guide several tasks.For this reason, a dedicated Arduino is employed, which provides timing operations as accurate as 100µs, i.e. one order better than required by the camera shutter speed.The output signals are converted by highspeed transistors to give the shooting signal to the cameras and flash units.ORION can control most commonly available cameras on the market with the best performances in terms of synchronization obtained using cameras with external trigger capabilities (e.g.DSLR cameras using wired shutter release cords).This triggering solution has been tested on Nikon D3100, D3X, D750 cameras.A millisecond synchronization has been proved by photographing an ad hoc developed digital chronometer.

Microcontroller
Figure 3 shows a setup realised with two cameras during the European Researchers' Night 2017 in Trento, Italy.The second Arduino is used to turn the table in a very effective way by accurately controlling the position and the velocity of a NEMA 17 stepper motor.This motor can be actuated step by step and its 3200 steps for revolution (1/16 microstepping) allows for a very good positioning and an increased smoothness in the acceleration/deceleration phases.Furthermore, it can keep its position while powered, avoiding accidental rotations.Stepper motors are fed by current using special drivers; in this case a Pololu A4988 has been used and the control of this IC (integrated circuit) is entrusted to GRBL software that can easily manage several motion related parameters (position, velocity, acceleration ramps, power feeding, homing, counting).The torque of this motor is 44Ncm and it is transmitted to the top of the turn table through a couple of bevel gears that guarantee a smooth contact between parts and a constant gear-ratio.Moreover, the gears were designed and subdivided in 5 parts to be 3D printed even with small 3D printing machine (e.g. a Zortrax M200 in our case).

Software components
The software development has been conceived bearing in mind the two main requirements of being (i) cross-platform and compatible with most operating systems (Linux, Windows, and Mac-OSX) (ii) portable i.e. the application should be able to run in small low-cost single-board devices like the Raspberry Pi.
The core of the code is implemented in Python 2.7 and the gphoto open-source tools has been chosen for its potential to control most commonly available cameras on the market.The Raspberry Pi3 runs the python software that, through a visual user interface, manages the whole system and coordinates the several processes involved.
Usually, the main problem when developing applications for embedded systems like the Raspberry Pi is to find libraries that can be compiled in such peculiar CPU architectures.The side favorable effect is the flexibility of the developed code because software running on embedded architectures is typically compatible with standard PC and Workstations.The disadvantages are clearer the impossibility to use more advanced computing libraries due to the limitation of the hardware (like for example the lack of a GPU).
To this end, we used only common/standard libraries available in Python (Table 3).The GUI (Figure 4) is designed bearing in mind the ease of use and compatibility with normal PC and embedded system (i.e. with Raspberry Pi and a dedicated touchscreen).The current GUI discloses only basic functionalities to control the cameras, the turn table and the projector/lights in its main window, keeping more advanced features (e.g. the synchronization delays between the cameras) hidden in the advanced settings menu.For a better management of image files, these are renamed and downloaded in separate folders for each camera.Names are customizable.The full code is uploaded in github (https://github.com/Gekk0r/Orion-scan)and are constantly in maintenance, the license is GPL3.

General digitization procedures using a turntable
In a typical 3D digitization scenario using a turntable, the camera stands on a tripod at a defined height, the illumination is set to be diffuse, the lens is focused onto the object surface so that the depth of field volume results optimised.The object is photographed by rotating the table by predefined angle intervals, typically varying from 5-30 degrees, thus simulating a circular camera network like if the camera were moving around the object.To photographically cover the whole object, more turns placing the camera at different heights are necessary, a procedure commonly used in photogrammetry when dealing with rotationally symmetric objects like globes or cylindrical seals (Verhoeven 2017;Reh et al., 2016;Menna et al., 2012;Adami and Guerra, 2008).
Objects sitting on the turn table on their bottom need to be placed upside down or laid on a side to allow capturing an additional set of images needed to survey the previously hidden parts.In Santos et al (2017a) a glass disc plate is used as basis and images are taken directly through the glass.At least one reference length between two points must be known or be measured for scaling purposes.
Once the images have been collected, a typical data processing pipeline including automated tie point extraction, bundle adjustment, object scaling and dense image matching/Multi-view Stereo reconstruction to create a dense point cloud is used.The raw dense point cloud is then further processed to obtain a mesh with photographic texture mapped on it, typically at full image resolution (Remondino et al., 2013;Menna et al., 2012).

ORION in action
For the image capturing a user can choose whether to control the camera only or the camera and lights together, or when in stereo configuration to project the structured light pattern (in the public release a single random pattern at HD resolution is provided).Different combinations can be achieved and with python scripting more complex image capturing scenarios can be covered.With a turn table system, the object rotates against a still background, thus breaking the assumption typically done in photogrammetry where the entire scene must not change shape or deform during the survey.This issue is solved by digitally masking or excluding the part of the images that corresponds to the background so that tie points are sought only on the object of interest, which must be a rigid body.To this end, a uniform colour background is placed behind the object to help selecting the areas which should be excluded in the tie point extraction procedures.
Albeit very common in video making industry, green backdrops should be avoided when accurate colour reproduction is needed, as slanted surface patches of the object may reflect the background and produce greenish colour casts.Despite being less effective than green backdrops, only neutral black or white backdrops are used with the ORION system when colour texture accuracy is important.Also, calibrated photographic LED and flash units are used as only sources of light in these cases.To provide consistency between different camera sensors, lenses and brands a X-Rite ColorChecker Passport Photo is used to colour profile the cameras.
Figure 5: Two examples of circular camera networks achieved with a single camera placed at one (up) and two (below) heights.The images were processed respectively inColmap (up) and Photoscan (below) The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLII-2/W8, 2017 5th International Workshop LowCost 3D -Sensors, Algorithms, Applications, 28-29 November 2017, Hamburg, Germany When dealing with very reflecting surfaces, the use of cross polarization (i.e. using polarizing filters on lights and camera lens) has proved effectiveness and great potential (Menna et al., 2016, Nicolae et al., 2014).

EXAMPLES AND PERFORMED TESTS
With the aim to provide an overview of ORION capabilities, some test objects have been digitised with the current release as summarised in table 4.These collected datasets feature challenging characteristics typically found in digitisation projects the FBK-3DOM unit has carried out in the last years.Object sizes vary from a volume about 9x5x9 cm 3 for the "Mother elephant" up to about 25x25x40 cm 3 for the "Augusto" dataset.Typical image acquisition scale varies from 1:6 to 1:15 corresponding to a spatial resolution of the final 3D point cloud ranging between 0.050-0.15mm (using a 24 Mpx full frame camera and a 60 mm macro lens).
Datasets like "Fish" and "Mother Elephant" are characterized by a complex surface geometry with several occlusions which require images taken only at small angle apart from each other.
The "Gas detector" was imaged with the same strategy not because of occlusions but because of the "low signal" given by the almost textureless texture.A redundant number of images helps in these cases to achieve a better signal to noise ratio.
The "Vase" dataset is shown because of its mixed surface texture characteristics which required an alternate acquisition of both images with a projected random pattern and with LED panels for an accurate reproduction of the color.
The "Romantic Robot" was chosen because of its heart shaped balloon that easily swings once moved.This dataset is representative of all those objects that are very delicate requiring a low acceleration and slow rotation speed.Also, in order to make sure the oscillation of the balloon stopped completely, a three second delay was given between the table rotation and the camera shooting using an ad-hoc implemented feature in ORION.
The "Augusto" was chosen because it represents a reference dataset for FBK-3DOM unit and for which a better accuracy 3D model is available to assess the accuracy of generated 3D point clouds.
Figure 6 shows the comparison between a 3D point cloud obtained with ORION using three cameras (Nikon D3100, D3x and D750 and 50 mm full frame equivalent focal length) and the random pattern projection.The comparison shows that an accuracy better than 0.15 mm can be easily achieved using ORION.

FURTHER DEVELOPMENTS
Among the different steps comprised in a 3D digitization workflow, the image acquisition is crucial to obtaining high quality 3D results.In particular, the closer the camera to the object, the shallower the depth of field.Sometimes, even with a careful planning and optimisation of the camera network, the depth of field volume may not be sufficient, in particular with objects larger than the depth of field volume and with a nonrotational symmetric shape.In these cases, parts of the object may extend in front or beyond the DoF volume.These parts outside the depth of field may result blurred to such an extent that accurate photogrammetric measurements would be not possible at all.Refocusing at different distances while keeping the camera body still may solve the problem from a photographic point of view but would cause a change of the interior orientation parameters with a different camera calibration needed for each shot.A possible solution would entail the use of a professionalgrade lens, such as a tilt-shift macro lens, which allows to adapt the DoF to the actual extent of the object of interest (Nocerino et al., 2016).Such lenses are very expensive and need to be manually adjusted to properly fit the DoF to the object.An alternative and feasible possibility is to use a classic lens and move the camera-lens system placed onto a linear stage.This way the interior orientation parameters are kept constant.The latter method is currently under development in ORION (Figure 7).Further activities will be devoted to optimize the controller and remote data processing.

CONCLUSIONS
The paper presented ORION, an image-based 3D reconstruction system designed for automated photogrammetric acquisitions and processing.It includes dedicated hardware and software components for the 3D digitization of heritage artefacts, industrial components or design pieces.Despite some features are still under development, the experiments described in this paper showed its main functionalities, performances and reliability for various types of objects.
ORION was originally conceived to fulfil the needs of the cultural heritage community, however, thanks to its flexibility, it can be easily deployed in other applications like reverse engineering and rapid prototyping, design, etc.
ORION is cross-platform and compatible with most operating systems (Linux, Windows, and Mac-OSX), the hardware components are pretty low-cost and the software components are compatibles with various cameras.
Thanks to the integration of the miniaturised computer Raspberry Pi and the microcontroller Arduino, ORION can be controlled remotely and access to remote processing functionalities.This will allow ORION to boost up its computing capabilities by using the Raspberry Pi onboard computing power only for simple calculations and leaving the most complex operations to the remote PC.
ORION is ready to accomplish tasks as simple as acquire a circular network of images up to automatize more complex acquisitions where occlusion analysis, camera placement on the basis of the DoF can be automatically carried out.

Figure 3 .
Figure 3.A vertical setup with the two cameras realized for a demo during the 2017 European Researchers' Night.
Python libraries used in ORION.

Figure 4 .
Figure 4. Current graphical user interface of ORION software application.
Figure 5 shows two examples of simple datasets acquired with ORION, respectively processed with the open source 3D reconstruction pipeline Colmap (Schöenberger and Frahm, 2016) and the commercial software solution Agisoft Photoscan.

Figure 6 :
Figure 6: An example of random pattern projected onto the Augusto face to allow 3D dense image matching (left) and a comparison with a ground truth data (right).

Figure 7 :
Figure 7: A schematic view of the camera shift along the optical axis using a linear stage

Table 1 .
Arduino UNO Rev3 main characteristics.In ORION the first Arduino is used to turn the rotating table.The second one controls the timing for the two cameras and flash units, while the Raspberry Pi manages the entire workflow, projects patterns over the table through the projector, and downloads pictures from cameras.

Table 2 .
Raspberry Pi3 Model B main characteristics.