# SLAM 3D Digital Terrain Mapping with SqueezeNet Driven by Road Traffic Data

Authors: Liuwan Gu; Hao Zhang; Xingjie Wu
Journal: Scientific Programming
 (2022)

---

## Abstract

In order to improve the efficiency of dynamic visualization of large-scale road traffic data in a web environment, this paper proposes a SLAM 3D digital terrain map visualization method using SqueezeNet in a web environment. We propose a hierarchical organization method of the road network, taking into account road attributes and drawing roads at different view heights; a multiroad merging method based on the line segment indexing feature of WebGL (web graphics library) technology, and optimizing the scene by combining view rejection and multithreading technology. The prototype system was developed and case studies were carried out using the national road network data as an example. The experimental results show that the frame rate of large-scale road traffic data visualization in the network environment is above 40 frames/second, which is 20–30 frames/second higher than that of Baidu’s ECharts GL visualization method.


---

## Body

## 1. Introduction

Along with the urbanization boom, the contradiction between supply and demand between increasing urban car ownership and limited traffic resources has become more and more intense [1], and as a direct result, traffic congestion is a problem. Real-time visualization of road traffic information can clearly show the real-time traffic congestion status, reveal the trend of traffic flow changes, assist the traffic department to monitor the traffic flow information in real-time and timely release to society [2], allowing people to choose their travel time and route according to the traffic status in a more planned manner. However, the existing performance of the browser can hardly support the display of massive real-time traffic information [3]. Therefore, the key problem is how to efficiently visualize the massive amounts of real-time road traffic data in the web environment. Most of the existing web visualization technologies require the installation of browser plug-ins to achieve efficient rendering of massive data, but this poses certain difficulties in maintenance and updating later, and at the same time, browser plug-ins cannot meet users’ expectations for the convenience and real-time of Web GIS [4, 5]. However, WebGL, as a plug-in-free web visualization technology, cannot directly support the high quality and efficient rendering of large-scale road traffic data.Most domestic and foreign research on road visualization using WebGL technology reflects changes in traffic dynamics through changes in vehicle trajectory flow [6]. Public-oriented electronic products, such as Baidu Maps, Gaode Maps, and Tencent Maps, generally draw arrows on the map, using the direction, thickness, or color of the arrows to represent the direction of the trajectory and the degree of density [3], with poor visualization effects compared to animation. Data representation methods give a lower sense of stimulation to the human brain’s thinking. [7] used Baidu’s ECharts open-source visualization product to dynamically visualize the public transport trajectory in Chongqing; [5] visualized the vehicle trajectory by linking two and three dimensions, adding three-dimensional attribute values to the two-dimensional map to represent the speed and traffic flow, but the above method does not support the rendering of large-scale traffic data and still has shortcomings in efficiency.In visualization systems, the use of appropriate animation and transition effects is an effective way to enhance the richness and comprehensibility of the visualization result view [8]. Streamlines and color gradients are two fundamental ways to improve visualization and have a huge impact on the visual effect and user interaction. Streamlines, which produce a flowing effect by constantly updating optical properties such as color and transparency [9], have a stronger visual impact than static lines, and color gradients can be used as an aid to increase the sensitivity of users to observe changes in traffic patterns. If a huge amount of road traffic data is rendered directly in the browser, there will be problems such as slow data acquisition, low transmission efficiency, and poor rendering effect.Therefore, this paper proposes a lightweight visualization method for real-time road traffic data of large-scale streamlined networks. Firstly, we use the high-precision large-scale road network data as the object of study, based on which the road network data reconstruction is carried out. Based on the hierarchical organization of the road network based on road attributes, we systematically study a multiroad merging method based on the WebGL line segment indexing feature. Secondly, the scene is optimized using view rejection and multithreading techniques to design and implement animation effects such as fading and efficient real-time dynamic streamlines that support real-time changes in road congestion states. Finally, the experiment and analysis of large-scale streamline network visualization were carried out using the national road network data as an example.


## 2. Programme Designed

The color image obtained from the Kinect camera is extracted and matched with the previous frame, and the PnP (perspective-n-point) is solved based on the correctly matched feature information combined with the distance information of the depth image to obtain the pose transformation between the two frames [10]. The keyframes are selected by setting a reasonable range of motion, and the pose transformation information between the keyframes and the adjacent keyframes is stored. The current keyframe is loopback detected with all previous keyframes, and if loopback occurs, the two keyframes are subjected to feature extraction, feature matching, and PnP solving. Then all the positional information is globally optimized using the graph optimization tool, and the point cloud map is stitched together based on the optimized information.


### 2.1. Feature Extraction

The main problem in building a visual odometer is how to compute the positional transformation of the camera from the image, so it is desirable to find some specific points in the image. Traditional visual SLAM algorithms usually use SIFT or SURF features, which are invariant, but their computations are all very time-consuming and cannot meet the real-time requirements of SLAM. In [11], the ORB algorithm is proposed, which is faster than SURF and SIFT and has good invariance. For this reason, this paper adopts the ORB algorithm for feature extraction.The ORB operator consists of two parts: the key point, called “Oriented FAST (features from accelerated segment test),” is a modified FAST corner point [12]; the descriptor is called BRIEF (binary robust independent elementary features). FAST corner points are places in an image where the grey gradient varies considerably, as shown in Figure 1, where f1 is the order in the horizontal direction. First, a pixel is taken from the image and compared with the grey level of 16 pixels on a circle of radius 3, and if N consecutive points are greater or less than a set threshold, the point is considered a corner point.Figure 1
Diagram of FAST corner.To address the issue of corner point orientation, scale and rotation characteristics were added to the description. Scale invariance is achieved by constructing an image pyramid and detecting feature points for each layer of the image and then identifying the commonly detected feature points as the correct detection result. Rotation properties are described by the greyscale center of mass method, which determines the center of mass of an image from the greyscale values [13]. The image moments in an image block M are defined as(1)mf1f2=∑x,y∈Mxf1yf2Ix,y,where mf1f2 is the image moment, f2 is the order in the vertical direction, and I(x, y) is the greyscale value at point (x, y).The coordinates of the centre of mass C of the image block arem10/m00,m01/m00, and the direction vector OC is obtained by connecting the geometric centre O of the image block to the centre of mass C.BRIEF is a binary descriptor of a vector of 0’s and 1’s that encodes the relationship between the sizes of two pixels near a key point. If 128 key points are taken, a 128-dimensional vector of 0’s and 1’s is obtained. Combining the rotational properties of the FAST corner point results in a BRIEF descriptor with rotational properties.


### 2.2. Feature Matching and Pn P Solving

After feature extraction of the image, a fast nearest-neighbor search algorithm is used for feature matching. A random K-D tree is built to find the corresponding point of a feature in another image, and then the Hamming distance between the BRIEF descriptors of the two feature points is calculated. The distance of the smallest matching point in the image is denoted as D. A threshold of 4 times this distance is used as a filtering criterion to filter all the matching points, and the points smaller than this distance are considered the correct matching points. Finally, the same operation is performed on the other image, and the points that are matched together are considered the final matching points.Pn P is a method for solving 3D to 2D point pair motion [14]. If the spatial 3D coordinates of the feature points of one of the two images are known, at least three pairs of points are needed to estimate the motion of the camera. The spatial 3D coordinates of the feature points can be determined from the depth map of the camera. There are various methods for solving the Pn P problem, such as P3P, direct linear transformation, and nonlinear optimization.As shown in Figure2, for a feature point P in space, P1 is a reprojection point due to the presence of observation noise, there is a deviation between the observed position (pixel coordinates) p^2 and the projection position p2 calculated according to the current camera pose, which is the reprojection error, and e is the internode error.Figure 2
Error because of reprojection.Suppose that the rotation matrix of the spatial pointPi=Xi,Yi,Zi,i=1,2,⋯,n. The rotation matrix of the camera’s locus is R and the displacement vector is t. We construct the pn problem as a nonlinear least-squares problem defined by minimizing the reprojection error on the Lie algebra, denoting the Lie algebra of R and t by ξ, and pi the pixel coordinates of the reprojection point pξ∧ in this locus are ui,vi, then(2)siuivi1=Kexpξ∧XiYiZi1,where si is the depth at point i; K is the conversion factor, and ξ∧ is the Lie algebraic antisymmetric matrix.If there aren pairs of matching features, the least-squares problem can be built based on the reprojection error mentioned above, as in the following equation:(3)ξ∗=argminξ12∑i=1npi−1siKexpξ∧Pi22,where ξ∗ is the Lie algebraic reprojection.This least-squares problem can be solved by the Gauss–Newton method or the Levernberg–Marquardt method. In SLAM, the process of minimizing the error by adjusting the camera poses and the coordinates of the waypoint is called BA (bundle adjustment) [15].


### 2.3. Loopback Detection

If the visual odometry is built considering only the motion between adjacent frames, it may lead to an accumulation of errors, and if the camera can be detected passing the same position, then constraints can be added to the estimated camera motion trajectory to make it closer to the real trajectory [16].A convolutional neural network is a feed-forward neural network that consists mainly of convolutional and pooling layers [17]. Compared with the artificially designed image features in traditional computer vision, the image features extracted by CNN can better reflect the real characteristics of images and are much more effective than traditional computer vision methods in the field of image classification and recognition. Therefore, in this paper, CNN is used instead of the traditional bag-of-words method to perform loopback detection.SqueezeNet was designed by UC Berkeley and Stanford researchers, not to achieve the best CNN recognition accuracy, but to simplify the complexity of the network and achieve the recognition accuracy of public networks. The core composition of SqueezeNet is the Fire module. SqueezeNet consists of 8 Fire modules from fire2 to fire9, where the structure of fire2 is shown in Figure3, where H and W are the height and width of the feature map, respectively, and e3 is the number of channels.Figure 3
Structure of fire2.SqueezeNet reduces the number of parameters and flops in the network by means of Fire modules, each of which consists of squeeze and expand modules. The squeeze module uses e1 1 × 1 convolutional kernels to reduce the dimensionality of the feature map, and the feature map is H × W ×e1 after ReLu activation. The feature map is H × W × e2 after the two taps of expand (with 1 × 1 and 3 × 3 convolutional kernels, respectively) are computed separately, and then the feature maps of the two taps are stitched together by the concat layer to generate H × W × e3. e2 = 4e1 and e3 = 2 e2 = Since the convolutional kernels of the fire network are identical in size, only the number of channels differs. Figure 4 shows that the fire structure is labeled only with the number of channels of the fire structure output e3.Figure 4
Network structure of SqueezeNet.When the network input is a 224 × 224 × 3 RGB image, the network computation is only 837 MFlops, so the network structure is more suitable for light-weight devices such as intelligent mobile robots. The network structure of SqueezeNet used in this paper is shown in Figure4 [18].The image is fed into the SqueezeNet network as a 224 × 224 three-channel RGB image, and the 1 000-dimensional array A = (a1, a2, a3, …, a1 000) is extracted as the feature vector of this image. Let us assume that the feature vector of the other image is B = (b1, b2, b3, …, b1 000). The cosine similarity of the eigenvectors of these two images can be used to determine whether the two images are similar, as in the following equation:(4)cosθ=A·BA×B.If the cosine similarity is greater than the set threshold, then loopback is considered to have occurred. Otherwise, we skip to the next frame and compare with the feature vector of the input image again until loopback occurs.


### 2.4. Global Optimization

In the SLAM process, the global optimization of the back-end needs to be considered. Camera motion can be represented by a rose diagram, as shown in Figure5, where each node represents the camera pose for each keyframe and the edges between the nodes represent the camera pose transformation between two keyframes.Figure 5
Pose graph.The camera’s pose has 6 degrees of freedom, 3 axial positions, and torques around 3 axes, denoted bywk, i.e., wk=xkykzkγkκkϑk,k=1,2,⋯,j.The transformation relationship between the two poses is(5)Ek,j=R3×3t3×101×31.The error between the two connected nodesk and j is(6)exk,xj,Ek,j=xk∗−Ek,jxj∗,where xk∗ is the estimated value of node k.Summing up all the internode errors and scalarizing them gives a total error of(7)E=∑k,j∈Fexk,xj,Ek,jTΩk,jexk,xj,Ek,j,where F is the set of nodes and Ωk,j is the information matrix between xk and xj.The optimized poses can be obtained by solving the least squares problem. In this paper, we use the generic graphical optimization g2o to obtain the optimised poses [19]. The types of vertices and edges are defined, information about the nodes and edges is added, and a suitable solver and iterative algorithm for the optimization algorithm are selected. g2o provides three different linear solvers: CSparse, Cholmod based Cholsky decomposition, and PCG based preconditioned conjugate gradient, and iterative algorithms including Gaussian–Newton, Levernberg–Marquardt, and Powell’s dogleg.


## 2.1. Feature Extraction

The main problem in building a visual odometer is how to compute the positional transformation of the camera from the image, so it is desirable to find some specific points in the image. Traditional visual SLAM algorithms usually use SIFT or SURF features, which are invariant, but their computations are all very time-consuming and cannot meet the real-time requirements of SLAM. In [11], the ORB algorithm is proposed, which is faster than SURF and SIFT and has good invariance. For this reason, this paper adopts the ORB algorithm for feature extraction.The ORB operator consists of two parts: the key point, called “Oriented FAST (features from accelerated segment test),” is a modified FAST corner point [12]; the descriptor is called BRIEF (binary robust independent elementary features). FAST corner points are places in an image where the grey gradient varies considerably, as shown in Figure 1, where f1 is the order in the horizontal direction. First, a pixel is taken from the image and compared with the grey level of 16 pixels on a circle of radius 3, and if N consecutive points are greater or less than a set threshold, the point is considered a corner point.Figure 1
Diagram of FAST corner.To address the issue of corner point orientation, scale and rotation characteristics were added to the description. Scale invariance is achieved by constructing an image pyramid and detecting feature points for each layer of the image and then identifying the commonly detected feature points as the correct detection result. Rotation properties are described by the greyscale center of mass method, which determines the center of mass of an image from the greyscale values [13]. The image moments in an image block M are defined as(1)mf1f2=∑x,y∈Mxf1yf2Ix,y,where mf1f2 is the image moment, f2 is the order in the vertical direction, and I(x, y) is the greyscale value at point (x, y).The coordinates of the centre of mass C of the image block arem10/m00,m01/m00, and the direction vector OC is obtained by connecting the geometric centre O of the image block to the centre of mass C.BRIEF is a binary descriptor of a vector of 0’s and 1’s that encodes the relationship between the sizes of two pixels near a key point. If 128 key points are taken, a 128-dimensional vector of 0’s and 1’s is obtained. Combining the rotational properties of the FAST corner point results in a BRIEF descriptor with rotational properties.


## 2.2. Feature Matching and Pn P Solving

After feature extraction of the image, a fast nearest-neighbor search algorithm is used for feature matching. A random K-D tree is built to find the corresponding point of a feature in another image, and then the Hamming distance between the BRIEF descriptors of the two feature points is calculated. The distance of the smallest matching point in the image is denoted as D. A threshold of 4 times this distance is used as a filtering criterion to filter all the matching points, and the points smaller than this distance are considered the correct matching points. Finally, the same operation is performed on the other image, and the points that are matched together are considered the final matching points.Pn P is a method for solving 3D to 2D point pair motion [14]. If the spatial 3D coordinates of the feature points of one of the two images are known, at least three pairs of points are needed to estimate the motion of the camera. The spatial 3D coordinates of the feature points can be determined from the depth map of the camera. There are various methods for solving the Pn P problem, such as P3P, direct linear transformation, and nonlinear optimization.As shown in Figure2, for a feature point P in space, P1 is a reprojection point due to the presence of observation noise, there is a deviation between the observed position (pixel coordinates) p^2 and the projection position p2 calculated according to the current camera pose, which is the reprojection error, and e is the internode error.Figure 2
Error because of reprojection.Suppose that the rotation matrix of the spatial pointPi=Xi,Yi,Zi,i=1,2,⋯,n. The rotation matrix of the camera’s locus is R and the displacement vector is t. We construct the pn problem as a nonlinear least-squares problem defined by minimizing the reprojection error on the Lie algebra, denoting the Lie algebra of R and t by ξ, and pi the pixel coordinates of the reprojection point pξ∧ in this locus are ui,vi, then(2)siuivi1=Kexpξ∧XiYiZi1,where si is the depth at point i; K is the conversion factor, and ξ∧ is the Lie algebraic antisymmetric matrix.If there aren pairs of matching features, the least-squares problem can be built based on the reprojection error mentioned above, as in the following equation:(3)ξ∗=argminξ12∑i=1npi−1siKexpξ∧Pi22,where ξ∗ is the Lie algebraic reprojection.This least-squares problem can be solved by the Gauss–Newton method or the Levernberg–Marquardt method. In SLAM, the process of minimizing the error by adjusting the camera poses and the coordinates of the waypoint is called BA (bundle adjustment) [15].


## 2.3. Loopback Detection

If the visual odometry is built considering only the motion between adjacent frames, it may lead to an accumulation of errors, and if the camera can be detected passing the same position, then constraints can be added to the estimated camera motion trajectory to make it closer to the real trajectory [16].A convolutional neural network is a feed-forward neural network that consists mainly of convolutional and pooling layers [17]. Compared with the artificially designed image features in traditional computer vision, the image features extracted by CNN can better reflect the real characteristics of images and are much more effective than traditional computer vision methods in the field of image classification and recognition. Therefore, in this paper, CNN is used instead of the traditional bag-of-words method to perform loopback detection.SqueezeNet was designed by UC Berkeley and Stanford researchers, not to achieve the best CNN recognition accuracy, but to simplify the complexity of the network and achieve the recognition accuracy of public networks. The core composition of SqueezeNet is the Fire module. SqueezeNet consists of 8 Fire modules from fire2 to fire9, where the structure of fire2 is shown in Figure3, where H and W are the height and width of the feature map, respectively, and e3 is the number of channels.Figure 3
Structure of fire2.SqueezeNet reduces the number of parameters and flops in the network by means of Fire modules, each of which consists of squeeze and expand modules. The squeeze module uses e1 1 × 1 convolutional kernels to reduce the dimensionality of the feature map, and the feature map is H × W ×e1 after ReLu activation. The feature map is H × W × e2 after the two taps of expand (with 1 × 1 and 3 × 3 convolutional kernels, respectively) are computed separately, and then the feature maps of the two taps are stitched together by the concat layer to generate H × W × e3. e2 = 4e1 and e3 = 2 e2 = Since the convolutional kernels of the fire network are identical in size, only the number of channels differs. Figure 4 shows that the fire structure is labeled only with the number of channels of the fire structure output e3.Figure 4
Network structure of SqueezeNet.When the network input is a 224 × 224 × 3 RGB image, the network computation is only 837 MFlops, so the network structure is more suitable for light-weight devices such as intelligent mobile robots. The network structure of SqueezeNet used in this paper is shown in Figure4 [18].The image is fed into the SqueezeNet network as a 224 × 224 three-channel RGB image, and the 1 000-dimensional array A = (a1, a2, a3, …, a1 000) is extracted as the feature vector of this image. Let us assume that the feature vector of the other image is B = (b1, b2, b3, …, b1 000). The cosine similarity of the eigenvectors of these two images can be used to determine whether the two images are similar, as in the following equation:(4)cosθ=A·BA×B.If the cosine similarity is greater than the set threshold, then loopback is considered to have occurred. Otherwise, we skip to the next frame and compare with the feature vector of the input image again until loopback occurs.


## 2.4. Global Optimization

In the SLAM process, the global optimization of the back-end needs to be considered. Camera motion can be represented by a rose diagram, as shown in Figure5, where each node represents the camera pose for each keyframe and the edges between the nodes represent the camera pose transformation between two keyframes.Figure 5
Pose graph.The camera’s pose has 6 degrees of freedom, 3 axial positions, and torques around 3 axes, denoted bywk, i.e., wk=xkykzkγkκkϑk,k=1,2,⋯,j.The transformation relationship between the two poses is(5)Ek,j=R3×3t3×101×31.The error between the two connected nodesk and j is(6)exk,xj,Ek,j=xk∗−Ek,jxj∗,where xk∗ is the estimated value of node k.Summing up all the internode errors and scalarizing them gives a total error of(7)E=∑k,j∈Fexk,xj,Ek,jTΩk,jexk,xj,Ek,j,where F is the set of nodes and Ωk,j is the information matrix between xk and xj.The optimized poses can be obtained by solving the least squares problem. In this paper, we use the generic graphical optimization g2o to obtain the optimised poses [19]. The types of vertices and edges are defined, information about the nodes and edges is added, and a suitable solver and iterative algorithm for the optimization algorithm are selected. g2o provides three different linear solvers: CSparse, Cholmod based Cholsky decomposition, and PCG based preconditioned conjugate gradient, and iterative algorithms including Gaussian–Newton, Levernberg–Marquardt, and Powell’s dogleg.


## 3. Test Results and Analysis

The experiments were conducted on a Turtlebot2 robotics platform with a Kinect V1 depth camera and a NvidiaTX2 development board [20]. The algorithms were run on an Ubuntu 14.04 system, involving the ROS robotics operating system and open-source libraries such as Caffe, OpenCV, Eigen, PCL, and g2o [21]. The experimental datasets include the TUM (technical university of music) [22] dataset, the nyuv2 dataset, and the dataset collected by Turtlebot2 itself, as shown in Table 1. The TUM dataset was acquired by the Computer Vision Group of the Technical University of Munich [23] and is based on a depth camera with a high-precision motion sensor that allows the acquisition of color and depth images along with the true motion of the camera. The TUM dataset also presents a method to calculate the trajectory error between the estimated trajectory of the SLAM algorithm and the standard trajectory acquired by the high-precision motion sensor.Table 1
Datasets used in the experiment.
Serial numberDatasetNumber/frame1Nyuv27822TUM fr39383Turtlebot2 acquisition9684TUM fr1_xyz902


### 3.1. Comparison with the Algorithm for Loopback-Free Detection

Dataset acquired indoors using Turtlebot2, consisting of 968 frames of color images with a resolution of 640 × 480 pixels and corresponding depth images, acquired at a rate of 30 frames/s.The results of the building estimation with and without loopback detection are shown in Figure6. When the algorithm without loopback detection is used to build the map, the camera trajectory drifts and fails to close due to the accumulation of errors. In contrast, when this algorithm is used, the motion constraint is added to the loopback due to the successful detection of the loopback, resulting in a closed motion trajectory [24].Figure 6
Comparison of building estimates.Figure7 shows the point cloud map obtained when using the loopback detection algorithm and the loopback detection algorithm in this paper. The point cloud maps largely overlap at the locations where loops occur, indicating that the estimated trajectory is in error from the true trajectory. This shows that this algorithm can successfully detect loops and add constraints to the global trajectory optimization, making the estimated motion and the built map closer to the real situation.Figure 7
Comparison of point cloud plots (red circles are where loops appear).


### 3.2. Compare and Contrast with the Bag-of-Words Method

The algorithm to determine whether a loopback has occurred may be different from the fact that there are roughly 4 different scenarios, as shown in Table2.Table 2
Possible results of loopback testing.
Detection resultIn fact, there is a loopbackIn fact, there is no loopbackIt is a loopTrue positiveFalse positiveNot a loopFalse negativeTrue negativeAccuracyTa and recall Tr are used to measure the goodness of the loopback detection results, as in equations (8) and (9).(8)Ta=T1T1+T2,(9)Tr=T1T1+T3,where T1, T2, and T3 are the number of true positives, false positives, and false negatives, respectively.The loopback detection algorithm and bag-of-words method proposed in this paper were tested on the new college dataset and the self-made dataset, respectively, and the experimental results of the accuracy and recall comparison were obtained as shown in Figure8, and the specific data are shown in Table 3.Figure 8
Accuracy and recall curves of this algorithm compared with the bag-of-words method.Table 3
Comparison of our algorithm with the bag-of-words method.
AlgorithmRecall rate with an accuracy of 1Time taken for similarity calculation of two pictures/SWord bag method0.330.50Paper algorithm0.400.13Difference between the two0.070.37Percentage%2174As can be seen from Figure8, the recall rate of this algorithm is significantly higher than that of the bag-of-words method for the same accuracy. Since accuracy is much more important than recall in loopback detection algorithms, a false positive result will have a very bad impact on the final map, so it is important to ensure that the accuracy is 1. The recall of this algorithm is 0.4 when the accuracy is 1, while the recall of the bag-of-words method is 0.33. The algorithm improves by about 21% compared to the bag-of-words method, and the time taken to calculate the similarity of the two images is reduced by 74%. The time taken to calculate the similarity between the two images was reduced by 74%.


### 3.3. Accuracy of Build

The Computer Vision Group at the Technical University of Munich, Germany, provides a measure of trajectory error and absolute trajectory error (ATE) in the TUM dataset [25–28]. ATE is obtained by calculating the root mean square error of the estimated trajectory and the standard trajectory. Assuming that the standard trajectory of the camera is X=X1,X2,⋯,Xn and the estimated trajectory of the camera is X^=X^1,X^2,…,X^n, the root mean square of the absolute trajectory error is(10)AX^,X=1n∑i=1ntransX^i−transXi2,where trans(-) is the function to obtain the gesture translation vector.Figure9 shows the estimated trajectory of the algorithm and the standard trajectory obtained by the high-precision motion sensor. Due to the high acquisition frequency of the high-precision motion sensors used in the TUM dataset, the trajectory information obtained is much richer.Figure 9
Standard trajectory, estimated trajectory, and trajectory error. (a) TUM fr3_stf dataset. (b) TUM fr3_xyz dataset.
(a)(b)Table4 compares the mapping accuracy of the algorithms. The total acquisition time of the TUM fr3_stf dataset used is 31.55 s, the total length of the standard trajectory is 5.884 m, and the average camera movement speed is 0.193 m/s. The root mean square error of the absolute trajectory estimated by the algorithm is 0.050 0 m. The same mapping was performed using RGB-D SLAM [23], and the root mean square error of the absolute trajectory is 0.049 0 m. The RMS value of the absolute trajectory error is 0.049 0 m. From Figure 9(a), it can be seen that there is no loopback in TUM fr3_stf, and the error of this algorithm is similar to that of RGB-DSLAM.Table 4
Comparison of mapping errors.
Data setAlgorithm error in this paper/MLiterature algorithm error/MDifference%TUM fr3_stf0.0050.0492TUM fr3_xyz0.0100.01329The data collection time of TUM fr3_xyz used is 30.09 s, the total length of the standard trajectory is 7.112 m, and the average speed of camera movement is 0.244 m/s. The root mean square (RMS) of the absolute trajectory error is 0.010 4 m. The RMS of the absolute trajectory error is 0.013 5 m when the same RGB-D SLAM is used to build the map. From Figure9(b), we can see that there are more loops in TUM fr3_xyz, and the error in building the map is reduced by 29% compared to RGB-D SLAM.


## 3.1. Comparison with the Algorithm for Loopback-Free Detection

Dataset acquired indoors using Turtlebot2, consisting of 968 frames of color images with a resolution of 640 × 480 pixels and corresponding depth images, acquired at a rate of 30 frames/s.The results of the building estimation with and without loopback detection are shown in Figure6. When the algorithm without loopback detection is used to build the map, the camera trajectory drifts and fails to close due to the accumulation of errors. In contrast, when this algorithm is used, the motion constraint is added to the loopback due to the successful detection of the loopback, resulting in a closed motion trajectory [24].Figure 6
Comparison of building estimates.Figure7 shows the point cloud map obtained when using the loopback detection algorithm and the loopback detection algorithm in this paper. The point cloud maps largely overlap at the locations where loops occur, indicating that the estimated trajectory is in error from the true trajectory. This shows that this algorithm can successfully detect loops and add constraints to the global trajectory optimization, making the estimated motion and the built map closer to the real situation.Figure 7
Comparison of point cloud plots (red circles are where loops appear).


## 3.2. Compare and Contrast with the Bag-of-Words Method

The algorithm to determine whether a loopback has occurred may be different from the fact that there are roughly 4 different scenarios, as shown in Table2.Table 2
Possible results of loopback testing.
Detection resultIn fact, there is a loopbackIn fact, there is no loopbackIt is a loopTrue positiveFalse positiveNot a loopFalse negativeTrue negativeAccuracyTa and recall Tr are used to measure the goodness of the loopback detection results, as in equations (8) and (9).(8)Ta=T1T1+T2,(9)Tr=T1T1+T3,where T1, T2, and T3 are the number of true positives, false positives, and false negatives, respectively.The loopback detection algorithm and bag-of-words method proposed in this paper were tested on the new college dataset and the self-made dataset, respectively, and the experimental results of the accuracy and recall comparison were obtained as shown in Figure8, and the specific data are shown in Table 3.Figure 8
Accuracy and recall curves of this algorithm compared with the bag-of-words method.Table 3
Comparison of our algorithm with the bag-of-words method.
AlgorithmRecall rate with an accuracy of 1Time taken for similarity calculation of two pictures/SWord bag method0.330.50Paper algorithm0.400.13Difference between the two0.070.37Percentage%2174As can be seen from Figure8, the recall rate of this algorithm is significantly higher than that of the bag-of-words method for the same accuracy. Since accuracy is much more important than recall in loopback detection algorithms, a false positive result will have a very bad impact on the final map, so it is important to ensure that the accuracy is 1. The recall of this algorithm is 0.4 when the accuracy is 1, while the recall of the bag-of-words method is 0.33. The algorithm improves by about 21% compared to the bag-of-words method, and the time taken to calculate the similarity of the two images is reduced by 74%. The time taken to calculate the similarity between the two images was reduced by 74%.


## 3.3. Accuracy of Build

The Computer Vision Group at the Technical University of Munich, Germany, provides a measure of trajectory error and absolute trajectory error (ATE) in the TUM dataset [25–28]. ATE is obtained by calculating the root mean square error of the estimated trajectory and the standard trajectory. Assuming that the standard trajectory of the camera is X=X1,X2,⋯,Xn and the estimated trajectory of the camera is X^=X^1,X^2,…,X^n, the root mean square of the absolute trajectory error is(10)AX^,X=1n∑i=1ntransX^i−transXi2,where trans(-) is the function to obtain the gesture translation vector.Figure9 shows the estimated trajectory of the algorithm and the standard trajectory obtained by the high-precision motion sensor. Due to the high acquisition frequency of the high-precision motion sensors used in the TUM dataset, the trajectory information obtained is much richer.Figure 9
Standard trajectory, estimated trajectory, and trajectory error. (a) TUM fr3_stf dataset. (b) TUM fr3_xyz dataset.
(a)(b)Table4 compares the mapping accuracy of the algorithms. The total acquisition time of the TUM fr3_stf dataset used is 31.55 s, the total length of the standard trajectory is 5.884 m, and the average camera movement speed is 0.193 m/s. The root mean square error of the absolute trajectory estimated by the algorithm is 0.050 0 m. The same mapping was performed using RGB-D SLAM [23], and the root mean square error of the absolute trajectory is 0.049 0 m. The RMS value of the absolute trajectory error is 0.049 0 m. From Figure 9(a), it can be seen that there is no loopback in TUM fr3_stf, and the error of this algorithm is similar to that of RGB-DSLAM.Table 4
Comparison of mapping errors.
Data setAlgorithm error in this paper/MLiterature algorithm error/MDifference%TUM fr3_stf0.0050.0492TUM fr3_xyz0.0100.01329The data collection time of TUM fr3_xyz used is 30.09 s, the total length of the standard trajectory is 7.112 m, and the average speed of camera movement is 0.244 m/s. The root mean square (RMS) of the absolute trajectory error is 0.010 4 m. The RMS of the absolute trajectory error is 0.013 5 m when the same RGB-D SLAM is used to build the map. From Figure9(b), we can see that there are more loops in TUM fr3_xyz, and the error in building the map is reduced by 29% compared to RGB-D SLAM.


## 4. Conclusions

This paper presents a lightweight visualization method for SLAM 3D digital terrain maps using SqueezeNet in a web environment. This paper proposes a multiroad merging method based on the line indexing feature of WebGL (web graphics library) technology and optimizes the scene by combining the view rejection and multithreading technology and designing and implementing the animation effects such as fading and dynamic streamlines that support the real-time change of road congestion state. Finally, the prototype system was developed, and case experiments and analyses were carried out with national road network data. The experimental results show that, compared with RGB-D SLAM, the algorithm described in this paper is more suitable for the dynamic visualization of large-scale road traffic data in a network environment with a 29% reduction in the error of map construction.



---

*Source: 9562527-2022-03-24.xml*