Abstract
In recent years, machine vision has been increasingly applied in automated monitoring of civil engineering. However, the rapid and accurate acquisition of displacement and shape changes of structures remains a challenge. In the use of structured light to measure medium and large-sized objects, there generally exist shadow and insufficient field of view problems, especially for the traditional monocular structured light measurement method. To solve these, this article discusses a dual monocular structured light measurement method, which projects two-way stripe structured light and performs three-step phase shift, also proposes a new phase-unwrapping method of structured light, and discusses a point filtering algorithm of fusion and stitching of the point cloud data. The phase-unwrapping method and the point filtering algorithm proposed, respectively, improves the measuring speed, especially for large-sized objects, and accuracy, compared with gray-coding method and traditional ICP (iterative closest point) method. This article performs three-dimensional measurements of ball work pieces, and the experimental results show that the fused and stitched data is significantly better than the single-field data, and the diameter error is <0.15mm for 35mm ball workpieces, and 0.32mm for 45mm ball workpieces. In addition, this article compares the experimental results with gray-coding method and traditional ICP method.
Introduction
In the past two decades, with the acceleration of new urbanization in China, the contradiction between the supply of land resources and the growing spatial demand has become increasingly prominent. Urban development has shown a trend toward three-dimensional (3D), high-density development, and the spatial dimension of urban service facilities has become taller and deeper. For deep excavation engineering in highly sensitive environments, the requirements for continuous monitoring data and compatibility with the construction status are gradually increasing. The safety operation and maintenance standards of adjacent existing municipal facilities are becoming more stringent. The defects of traditional manual monitoring systems cannot effectively meet the increasingly strict requirements of safety production. A dynamic, continuous, online, interference-free, and nonfailure automatic intelligent monitoring system is the development trend of the industry. The automated intelligent monitoring system of deep excavation pits mainly digitizes the traditional manual monitoring methods, breaks through the time limit of monitoring, realizes high-frequency continuous data acquisition, and solves the problem of timely monitoring. It also breaks through the limitations of space and environment to meet monitoring requirements under complex operating conditions. Currently, automated monitoring of excavation pits is moving from low-efficiency single-point measurement towards noncontact, large-scale, and fast dynamic and static combination monitoring, as well as toward the development of 3D laser scanning technology and close-range photogrammetry technologies.
Currently, monitoring the displacement and shape of structures during automated excavation pit monitoring is still a challenge. How to quickly and accurately obtain the displacement and shape changes of structures is an urgent issue that needs to be addressed. With the continuous development of machine vision technology and image acquisition equipment, structural displacement monitoring methods based on machine vision have emerged and have been validated in practical engineering applications (Dong et al., 2018; Feng et al., 2015; Xu and James, 2018). Due to its many advantages such as long-distance, noncontact, high precision, time-saving, labor-saving, and multipoint monitoring, it has attracted increasing attention from researchers and engineers.
Using structured light to perform 3D measurement of objects is an important noncontact measurement method (Liu et al., 2021; Nguyen et al., 2017; Song et al., 2019). Monocular structured light measurement (Tran and Ha, 2018) and binocular structured light measurement (Li et al., 2019; Yang et al., 2008) are two common measurement methods. Monocular structured light measurement is characterized by its relative simplicity, and its compactness and small size in structure. Lu et al. (2021) adopted monocular structured light measurement for 3D seam extraction of welding robot. However, for this method a reference plane is required which requires high accuracy for the camera and projector, and more importantly, the shadow formed at the edge of the measured object due to the projection of structured light pattern is difficult to solve. Binocular structured light measurement can overcome the problem of shadow. The key to this method is the pixel stereo matching, and some methods of pixel matching are proposed. Liu et al. (2014) proposed triangulation method and subpixel interpolation, and Chen et al. (2022b) performed quadratic polynomial fitting to constrain point cloud matching, Chen et al. (2022a) adopted epipolar-geometry and cross-ratio invariance method. However, binocular structured light measurement is still less effective especially for the work pieces lacking texture and is prone to sparse and less accurate point clouds. To solve the problems of shadow and insufficient field of view problems, a dual monocular structured light system is designed in this article for 3D measurement of medium- and large-sized objects. Meanwhile, this system avoids the problems such as occlusion and various distortions in stereo matching of the binocular structured light measurement system.
The 3D measurement of objects using monocular structured light or binocular structured light can be conducted through the phase measurement (Chen et al., 2010), which measures the continuous change in the gray level of the structured light stripe on the object and calculates the phase change to obtain the 3D of the object. Since the object space can be divided continuously, this method has a very high spatial resolution. The measurement can also be conducted through code measurement (Geng, 2011), which projects a special code pattern onto the object so that the object space is encoded by region. Since the coded pattern projected can only make a limited division of the object space, its spatial resolution is not high. For reasons of real-time and ease of operation, this article uses three-step phase shift in the N-step phase shift method for fast phase measurement.
To obtain a globally complete continuous phase, it is also necessary to unwrap the phase principal values of the spatial points to obtain a unique absolute phase value in the global range. Carsten et al. (2000) and Wan et al. (2020) proposed a multifrequency heterodyne method for phase-unwrapping in 3D complex objects measurement. This method is not sensitive to the surface color or reflection of the measured objects, and can obtain better stability and accuracy. However, this method needs to project multiple grating images of different frequencies, which has certain limitations on frequencies of fringe patterns, and has high requirements for phase accuracy. Wu et al. (2022), He et al. (2020), and Wu et al. (2019) presented a gray-coding plus phase-shifting method for phase-unwrapping, which uses multiple gray-code patterns to assign a unique codeword to each
In this research, we propose a new method based on gray-coding method, to unwrap the phase. This method proposed improves the measuring speed, especially for large-sized objects. Compared gray-coding method, this method is more suitable for real-time measurement of objects with some requirements and large-sized objects.
In 3D reconstruction, we propose a point filtering algorithm of fusion and stitching of the point cloud data based on iterative closest point (ICP) method. This method is used to improve the measurement accuracy in the case of local shadow or noises during the measurement.
The rest of the article is organized as follows. The second section illustrates the dual monocular structured light measurement system, details the new method proposed for phase-unwrapping, and the algorithm of fusion and stitching of the point cloud data. The third section shows the experimental results conducted to validate the proposed system and method. And the fourth section summarizes this article.
Dual monocular structured light system
Introduction to the measurement system
The diagram of the dual monocular structured light measurement system used in this article is shown as in Figure 1. It consists of a computer, a projector, two CCD (charge coupled device) cameras on the left and right, an optical stage, a fixed support and a calibration plate. The distance from the left and right cameras to the projector is equal and is located on both sides of the projector. The optical stage and support serve to keep the spatial position of the camera projector constant. The parameters of the projector and cameras are listed in Table 1.

Schematic diagram of the dual monocular structured light system.
Parameters of projector and cameras.
Structured light encoding
The diagram of dimensional measurement of object using structured light stripe phase is shown as in Figure 2. The distance from the camera center Oc to the projector center Op is l, and the distance from Op to the reference plane is d. The line OpOc is parallel to the reference plane. The CCD camera captures the object-modulated sinusoidal grating stripe from the projector.

Dimensional measurement of object using structured light stripe phase.
Suppose a point on the object is B, its height h can be expressed as equation (1),
where p is the period of the sinusoidal grating stripe, and Δϕ is the phase difference between points D and E, is also the phase difference between point B on the object and the corresponding point on the reference plane. The key problem of height measurement is thus transformed into the measurement of the phase difference between the reference plane and after the object is placed on it. N grating stripe patterns that shift phase 2π/N at a time are projected sequentially onto the object, and the ith deformed grating fringe image intensity acquired by the CCD camera can be expressed as equation (2),
where (x,y) represents the coordinate of a point on the object, A(x,y) is the average projection intensity, B(x,y) the modulation projection intensity,
where I0(x,y), I1(x,y), and I2(x,y) are the ith grating fringe image intensity as in equation (2). Thus by the three-step phase shift, the phase values of the object and the reference plane are measured, respectively, by equation (3), and the values of
Phase unwrapping
According to the properties of the inverse tangent function, the solved phase principal values are truncated between (−π,π) and have unique values in a period range, and there are multiple period stripes in the whole measurement space range.
The phase-unwrapping process using this method is described in Figure 3. As shown in Figure 3(c), each period of encoded patterns corresponds to each
where ϕ is the absolute phase value, and φ the phase in 2π phase-change period of fringe, k1k2k3k4 the gray-code corresponding to a 2π phase-change period of fringe, and kn the extended gray-code.

Process of the adopted phase-unwrapping method.
3D reconstruction and measurement
In the 3D measurement using stripe projection, it is difficult to obtain directly all the 3D information of the object measured from a single point of view in some cases. For example, the measured object itself is large in size, and cannot be collected the complete information from a single viewpoint; the measured object itself has quite complex surface shapes, such as large slopes, or the local specular reflection. These cases will lead to local shadows of the collected stripes, and incomplete 3D data. To solve these problems, multiple viewing angles can be selected to measure the object, or the relative motion between the object and the measurement system can be used to obtain 3D data at different angles, and finally obtain the complete 3D data of the object through coordinate system transformation and data fusion. Since the latter need to rely on relative motion to complete multiple measurements to achieve stitching, the stitching of data from multiple viewing angles used in this article is more conducive to real-time measurement.
Multiview measurement data are measured from different viewpoints, and the world coordinate system is different. So a conversion is necessary from local to global coordinate system, and then the data is fused and stitched to obtain the complete 3D measurement results. There are many ways to realize the localization of local space and the stitching of data, such as the multi-aperture scanning stitching technique (Chen et al., 2006), data stitching by marked points (Li and Wang, 2009), the iterative method of multi-aperture scanning stitching technique in cylindrical coordinate system (Guo and Chen, 2000), etc. The stitching of 3D surface shapes consists of two main parts: the transformation of coordinate systems of different viewpoints and the fusion of data.
In this research, the fusion and stitching of the point cloud dataset obtained by the left camera and one by the right camera is realized with ICP algorithm (Besl and McKay, 1992). Here the ICP algorithm is used to evaluate a rotation matrix R and a translation matrix t. And then by using
To solve these problems as above, a point filtering algorithm is proposed in this research before using the ICP algorithm.
The process of fusion and stitching is shown in Figure 4(a), and the principle and process of filtering points is shown in Figure 4(b). There may be amplitude jumps between points in left or right point cloud set, possibly due to local shadow (or occlusion), system noises, or normal fluctuations of the object measured itself. To distinguish these cases as above, the high and low thresholds, denoted as THH and THL, are introduced in the point filtering algorithm. The judgment of the points when their amplitude jumps exceed THH or smaller than THL is easy. However, when the amplitude jumps is between THH and THL, the point may be valid (due to normal fluctuations of the object measured itself), or invalid (due to noises or shadow).The judgment of the points in the case as above is made by the validity of their neighboring points.

Flow charts of (a) fusion and stitching and (b) filtering points.
Experimental verification
Image acquisition
In order to verify the dual monocular structured light system and the corresponding phase unwrapping and fusion and stitching methods described as above, two spheres with different diameters are selected for testing. In the measurement, d in equation (1), that is, the distance between the camera and the projector to the reference plane, is 1410 mm, and l, that is, the distance between the camera and the projector, is 270 mm. The grating frequency is 0.2 mm−1. The diameters of spheres are, respectively, 35 and 45 mm. The parameters of projector and cameras are shown as in Table 1. The photographs of the system measuring workpieces are shown as in Figure 5.

Photographs of the system (a) measuring the balls and (b) measuring the metal heads.
Figure 6 shows the images of 35mm sphere grating modulation acquired by the left camera in the measurement system. From the equation (3), it is known that to acquire the phase values of the measured object and the reference plane, it is necessary to acquire three images for the left and right cameras, respectively, with sinusoidal grating phase shifts of 0, 2π/3, and 4π/3. From Figure 6, it can be seen that when the grating stripe is projected onto the sphere it is distorted due to the modulation by the height of the sphere surface. By demodulating these images carrying the height information of the object, the 3D data of the object can be obtained.

Sphere grating modulation images of the left camera, with sinusoidal grating phase shifts of (a) Δφ = 0, (b) Δφ = 2π/3, and(c) Δφ = 4π/3.
Image unwrapping
Figure 7 shows the process of absolute phase retrieval. Figure 7(a) and (b) are, respectively, two-dimensional and 3D wrapped phase images. To unwrap the phase principal values of the spatial points in the global range, the modified gray-code patterns are projected onto the sphere, which are shown in Figure 7(c). Figure 7(d) is the image of one cross-section of the wrapped phase and the corresponding codeword. Due to the disturbance of local shadow of the sphere, the phase around the 100th pixel cannot be obtained accurately, including the codeword of this location. Despite this case, the codeword of the neighboring period is not affected, and can be obtained accurately. By using the proposed phase-unwrapping method as above, it can be seen from Figure 7(e) that the valid information is perfectly unwrapped except for the shadow part.

(a) Two-dimensional wrapped phase; (b) three-dimensional wrapped phase; (c) phase unwrapping used the proposed phase-unwrapping method; (d) one cross-section of the wrapped phase and the codeword; and (e) unwrapped phase.
3D reconstruction and results analysis
The 3D effect display of the measured 3D data of the sphere is shown in the Figure 8 as below. It is obvious from Figure 8(a) and (b) that the reconstruction effect of the left and right spheres can’t be reconstructed very well because of the shadows. By the left and right sphere data fusion and stitching using the methods as above, the effect of shadows on reconstruction has been removed, which is shown as in Figure 8(c).

Three-dimensional reconstructions of (a) the left sphere, (b) the right sphere, and (c) after fusion and stitching of the left and right sphere.
Based on the reconstruction result of Figure 8(c), we measured the diameters of spheres. The measurement results and the comparison of proposed method with only ICP method are listed in Tables 2 and 3. And the time comparison of 3D reconstructions based on the method proposed with based on gray-coding method are listed in Table 4. The configuration of PC platform for reconstructions is as follows: CPU: Intel Core i3-8100 3.60GHz, RAM: 16.0GB.
Comparison of proposed method with only ICP (diameter of 35mm).
ICP: iterative closest point.
Comparison of proposed method with only ICP (diameter of 45mm).
ICP: iterative closest point.
Comparison of time cost of three-dimensional reconstructions.
From Table 2, it can be obtained that the relative error of sphere diameter varies from 0.26% (left view) and 0.43% (right view) to 0.17% after the stitching and fusion of the left and right view data. Compared with only ICP method, the error percentage of the proposed method is reduced from 1.15% to 0.17%. From Table 3, the relative error varies from 0.72% (left view) and 0.17% (right view) to 0.22%. Compared with only ICP method, the error percentage of the proposed method is reduced from 2.29% to 0.22%.
The time cost of 3D reconstructions in Table 4 has two parts. One is the time of image acquisition, and another is the time of reconstruction and fusion. The time cost of the latter is basically the same, and however, the time cost of the former is significantly shorter, as shown as in Table 4.
The measurement of larger sized objects were also conducted using the dual monocular structured light system and the methods described as above. Figure 9 is a 3D reconstruction of the head of a metal pressure vessel with a diameter of 201.00mm.

(a) Three-dimensional reconstructions of the left sphere, (b) the left hemisphere, (c) the right hemisphere reconstructed by point clouds filtering algorithm, and (d) after fusion and stitching of the left and right sphere.
The measurement results of this head and other large-size metal heads are listed in Table 5. In addition, the depths of the heads based on 3D reconstruction were measured.
Measured diameters and depths of large-size metal heads.
Conclusion
When using displacement measurement methods based on machine vision, various factors can affect the measurement accuracy, leading to measurement errors. In this article, we adopt a dual monocular structured light measurement system to solve shadow and insufficient field of view problems during the 3D measurement of objects using structured light. For reasons of high spatial resolution and fast phase measurement, three-step phase shift method is used to encode object.
In order to unwrap easily the phase principal values during the actual measurement, a code-based method is proposed. Compared with the multifrequency heterodyne method, the method proposed in this article has the advantages of gray-coding method’s simplicity and ease of implementation. And compared with gray-coding method, the method has faster measuring speed, especially for large-sized objects. However, this method requires certain methods to improve accuracy when dealing with objects with rich surface colors or high reflection, such as spraying powder on the surface of the objects.
Finally, an algorithm of fusion and stitching of the point cloud data is used to get the final data. The article experiments with this system and methods proposed using spheres with different diameters, and the results show that the accuracy is improved compared to single-channel structured light detection when dealing with workpieces with shadowed regions, and the problems of shadows, insufficient field of view and so on are also solved.
Footnotes
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the Zhejiang Province Public Welfare Technology Application Research Project (grant number LGG22E050051), and the Science and Technology Innovation Funding of Hangzhou CBD Investment Group (grant number QT202201B001).
