DEVELOPMENT OF 3D ENVIRONMENTAL LASER SCANNER USING PINHOLE PROJECTION

L a t e e f A b d Z a i d Q u d r Doctor of Computer Sciences, Senior Lecturer Department of Computer Techniques Engineering AlSafwa University College Almamalje str., Karbala, Iraq, 56001 E-mail: latifkhder@alsafwa.edu.iq Three-dimensional (3D) information of capturing and reconstructing an object existing in its environment is a big challenge. In this work, we discuss the 3D laser scanning techniques, which can obtain a high density of data points by an accurate and fast method. This work considers the previous developments in this area to propose a developed cost-effective system based on pinhole projection concept and commercial hardware components taking into account the current achieved accuracy. A laser line auto-scanning system was designed to perform close-range 3D reconstructions for home/office objects with high accuracy and resolution. The system changes the laser plane direction with a microcontroller to perform automatic scanning and obtain continuous laser strips for objects’ 3D reconstruction. The system parameters were calibrated with Matlab’s built-in camera calibration toolbox to find camera focal length and optical center constraints. The pinhole projection equation was defined to optimize the prototype rotating axis equation. The developed 3D environmental laser scanner with pinhole projection proved the system’s effectiveness on close-range stationary objects with high resolution and accuracy with a measurement error in the range (0.05–0.25) mm. The 3D point cloud processing of the Matlab computer vision toolbox has been employed to show the 3D object reconstruction and to perform the camera calibration, which improves efficiency and highly simplifies the calibration method. The calibration error is the main error source in the measurements, and the errors of the actual measurement are found to be influenced by several environmental parameters. The presented platform can be equipped with a system of lower power consumption, and compact smaller size


Introduction
In order to enhance the implementation of different object designs and human-environment solutions for 3D printing purposes and object regenerations, advanced digital applications can have a considerable impact. The innovation of 3D scanners is important because it can settle the problems that are usually associated with the construction and design of existing objects. It can present better quality, more precise and faster analysis and feature detection for small or large-scale environment surveys [1]. A laser-based 3D scanner is directed to the physical object's under-scan and the beam of the laser is targeted to the object over a grid of points. The position in the 3D space of each scanned point on the object is recognized by determining the laser flight time (scanner-physical objects-scanner). This process results in a «cloud of points» that includes thousands of 3-dimensional space points. This information provides an accurate representation of the scanned object. This data can be transformed into a 3D model. Related researches have proven that the 3D laser scanners can provide effective sensing modality to create an accurate model [2,3]. Three-dimensional (3D) laser scanners require high resolution to reconstruct an accurate 3D model [4,5].
Several types of research implemented 3D laser scanner in various applications such as in 3D complex topography with terrestrial applications [6][7][8][9], for autonomous driving [10][11][12][13][14][15], for orthodontic applications [16][17][18], for industrial and robotics applications [19][20][21][22][23], and in biological applications [24,25]. In these applications, short-distance cameras and sensors were used to acquire accurate 3D geometrical data of an object. Cameras are commonly utilized as passive sensors while other sensors have relied on light projection or sounds. The 3D environments are sensed with a series of photos acquired from various viewpoints in passive methods. Therefore, the object 3D data will be retrieved with algorithms of stereo matching or image features matching [26,27]. The accuracy of the restructured model is highly influenced by the visibility environment and needs a textured scene to obtain satisfactory outcomes [1,28]. The wavelength diversity of projection light and the larger lighting volume will guide to wider absorption and scattering stages. In a 3D scanner environment, scanners with different wavelengths of laser were used in a low absorption environment. Higher luminance with small power is necessary to obtain an accurate and efficient model to identify the object. A motor-based motion generator is essential to cover a large area during the scan with a single laser line.
The main motivation of this work is to develop a 3D scanner to provide a restructured industry model [29], autonomous manipulation [30][31][32], or 3D printing tasks with high accuracy and low cost [33][34][35]. Therefore, the system camera, mechanism, and algorithm need to accurately provide geometrical measurements for the object under test, including position, size, shape, etc. Also, the precision of the motion control mechanism is an essential issue in 3D reconstructions.
Therefore, studies that are devoted to 3D laser scanners are relatively complex and costly systems when utilizing in topography with terrestrial applications, autonomous driving, orthodontic applications, biological, industrial, and robotics. In these applications, long and short-distance cameras and sensors were used to acquire accurate 3D geometrical data of an object.
The accuracy of the restructured model is highly influenced by the visibility environment and needs a textured scene to obtain satisfactory outcomes. Higher luminance with small power is necessary to obtain an accurate and efficient model to identify the object. A motor-based motion generator is essential to cover a large area during the scan with a single laser line.

Literature review and problem statement
3D laser scanner techniques in a built environment have been discussed in several previous studies. The 3D terrestrial laser scanner for the built environment was presented as a world data model in [36]. This approach used different planes to produce 2D planes, which improves the efficiency and quality of construction projects such as maintenance of buildings, but there is no sufficient information about the system design. The study [37] discussed the application of underwater 3D reconstruction with a laser line auto-scanning system, it employed a galvanometer's rotating axis equation. This work doesn't address a generalized algorithm that can automatically split shape objects with respect to the view field point cloud.
The paper [38] investigated the feasibility of utilizing scanners with handheld structure sensors to create a 3D graphical representation of an object. This work is good for scanning objects with less than 1 m 3 volume. Larger object ability to scan is done by using HDS 3000 by Leica Geosystem [39], but it was with expensive components and complex software. The reasons for it can be objective difficulties connected to the laser source and the costly camera, which makes the corresponding researches unaffordable. An option to overcome the relevant difficulties can be the use of hand-held structure sensors that are inexpensive and accurate solutions [40]. In the study [41], the accuracy of Transport Layer Security (TLS) was assessed by scanning and modeling a room, the work compared the measurement differences with a high-accuracy laser scanner [42]. The study removes the noise and aligned multiple scans with SketchUp 3D modelling software [43]. However, all this allows us to argue that it is appropriate to conduct a study devoted to a cost-effective design with appropriate hardware components and a control algorithm competing with the current structures in the 3D reconstruction accuracy.

The aim and objectives of the study
The study aims to build a 3D reconstruction environmental laser scanner for close-range home/office objects with high accuracy and resolution.
The following objectives have been set to achieve the goal: -to calibrate system parameters with Matlab's built-in camera calibration toolbox to find camera focal length and optical center constraints; -to develop an algorithm for getting a point cloud for the tested object in its 3D environment; -to get a mesh representation by defining the pinhole projection equation to optimize the prototype rotating axis equation.

Materials and methodology
The methodology includes a design of a 3D reconstruction with an affordable controllable turntable, model scale, camera calibration, and laser line filtering. The system is composed of a stepper motor, C920 Webcam [44], Laser Line diode LASIRIS series (ProPhotonix Limited, Salem, UT, USA), and Arduino controlled turntable. Fig. 1 shows the developed system structure. The experimental measurements have been conducted in different light conditions to also check the effect of the environmental light. The generated mesh representation has been validated by measuring the error as compared with the physical object.

Fig. 1. Developed system setup
A camera and a laser-stepper motor motion module unit were mounted in two independent places and fixed to a base structure to keep its relative position stationary. The distances between the camera, the laser source, and the object were accurately measured after the system was processed and installed. The servomotor can be controlled to rotate in the range of ±20 by a signal ranging between -10 V to +10 V from the D/A of the controller. The laser plane is projected onto the scanned object. The stepper motor controls the laser plane rotating within a certain step angle. The 3D data of the object surface could be obtained based on the computation of the optical information with the pinhole projection equation and triangulation methods. 3D point cloud processing of the Matlab computer vision toolbox has been employed to show the 3D object reconstruction.

1. Stepper motor configuration
The full step sequence of the stepper motor function can be described in Fig. 2  The steps of controlling the motor of the laser are initialized with 0.005 s pause time and 312 loops at 0.7°/loop equivalent to 360°. The pins (8)(9)(10)(11) were used to control the stepper motor movement direction and speed. The scan is stopped when the scan accomplished its limits. Fig. 3 shows a simple pinhole camera description.

Image plane Lens
Center of projection

Fig. 3. Pinhole camera description
This work presents a stepper motor-based motion mechanism and the laser plane orientation is changed accurately according to the camera feedback and a controlled algorithm using the pinhole projection principle. The minimal control accuracy for the scanning sector of the stepper motor is 10 µrad, which provides high image resolution and accurate object reconstruction. The outer dimensions of the prototype were 580 m (length) × 130 mm (width) × 200 mm (height). The system voltage supply was 12 V with an average power consumption of 6.5 W, which makes this design suitable for performing 3D reconstruction tasks of mobile applications.

3. Camera calibration
We've used Matlab's built-in camera calibration toolbox to find camera focal length and optical center at a set resolution. The camera is with 960×720 resolution and got a Focal Length = 919 px and optical center [495, 335] with 0.13 px accuracy and each square on the checkerboard plane = 13 mm. Photos from the calibration process are shown in Fig. 4, while the description of the camera's optical center, at a normal matrix coordinates of an image Fig. 5, a, and translated to camera coordinates Fig. 5 b -at translated to camera coordinates As described above, the basic mathematical pinhole equation is given by: Since we set each square to 13 mm, the length of the yellow line should equal 26. The checkerboard is 260 mm away and the focal length = 919 px with the yellow line length = ∆x o : By using cross multiplication: The geometric model of the camera can be demonstrated as shown in Fig. 6.
Accordingly, to determine the depth from the laser line, we can write the following formula: In order to find ∆θ per loop, we mark a point on the turntable, then we run the scan function until 360 degrees is complete. This provides information to figure out how many loops the scan function takes to make a full 360-degree rotation. In the implemented prototype, it was 515 loops so 3.600/515 = 0.7° per loop.

3D reconstruction
The main program loops the first depth map script and saves the values of each depth map into a variable. However, before each depth map is saved, the points are translated to the world coordinates of the center of the rotating platform then rotated ∆θ per loop around the Y-axis. The transformation matrix equation can be given by: The transformation matrix equation is performed before each mapping step, where the points are translated to the world coordinates of the center of the rotating platform.

1. Camera calibration
The camera and system parameters were calibrated with Matlab's built-in camera calibration toolbox to find camera focal length and optical center constraints. Fig. 8 shows the images of three steps of the developed approach; laser scanning, filtering, depth mapping.

2. Getting a point cloud of the 3D object
The result of carrying out the developed algorithm to get point cloud for the tested object is shown in Fig. 9. In order to create a 3D printable mesh, it is required to import the point cloud into mesh environment software such as MeshLab, which is free and open-source software [45].

3. 3D printable mesh
The 3D reconstruction of the developed algorithm as a mesh representation for the tested object is shown in Fig. 10. The generated figures show successful 3D printable mesh and the use of the point cloud into mesh environment software. The developed system proved that this scheme can execute scanning for an object and acquire the 3D point cloud and its outcome validates the accuracy under ideal environments.

Discussion of the results of the 3D laser scanner
The results in Fig. 9, 10 show that the developed 3D reconstruction using pinhole formulas and the point cloud can get a successful 3D printable representation. The error was measured in the range (0.05-0.25) mm, which can be considered as accurate 3D reconstruction under this scale of work.
The calibration is carried out with the Matlab camera calibration toolbox, which improves efficiency and highly simplifies the calibration method. The calibration error is the main error source in the measurements, and the errors of the actual measurement are found to be influenced by several environmental parameters.
With the environmental conditions, the reconstructed image is influenced by various lighting and caused by different contrast. With laser and camera parameters, the contrast, gain, offset of the camera, and laser intensity parameters all must be consistent during the scan. These parameters should be optimized to improve the reconstruction accuracy and quality. With the angle between the laser and the camera, when this angle becomes large, the coverage of the scan is also increased and the platform gets compact but this angle needs to be automatically adjusted to fit the scanned object width. This process is done by detecting that there is no intersection with any object except the back wall. Finally, the light scattering is growing, the reconstructed image of an object becomes inaccurate, which may require a laser source with a higher power.
Thanks to which particular features of the proposed solutions, the advantages of the proposed prototype are simple in its hardware components and software with easy implemented control algorithm, and it was also inexpensive as the total cost of the system components is approximately 28 USD, which is less expense and complexity than other current related studies.
The close-range stationary objects were the limitation when applying this approach in the real world. Therefore, more investigation in terms of laser power, laser scanning resolution, and feed-back control actuator is recommended to develop this system to expand its applications.

Conclusions
1. The presented calibration of system parameters using Matlab's built-in camera calibration toolbox can be directly applied to find camera focal length and optical center constraints, which consequently reduces the computation cost, and components cost to about 28 USD.
2. The developed 3D environmental laser scanner with pinhole projection proved the system's effectiveness on closerange stationary objects with high resolution and accuracy with a measurement error in the range (0.05-0.25) mm.
3. The developed approach obtained a mesh representation by defining the pinhole projection equation to optimize the prototype rotating axis equation. The system is able to measure a closer distance (140 mm) with an accuracy of (32 µm).