Rapid identification and spatial positioning method for feature marker in tunnel
Through the combination of image recognition and point cloud spatial information, the characteristic marks in the tunnel are automatically identified and mileage data are corrected. The edge detection and Alpha Shape algorithm fit the tunnel section to achieve efficient and precise positioning in the tunnel, solving the problems of low positioning efficiency and poor accuracy in the existing technology.
Patent Information
- Application Number
- CN202510140361.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-05-30
AI Technical Summary
The existing tunnel detection technology has the problem of large cumulative errors during long-distance positioning, which cannot achieve accurate positioning.
Image recognition is used to combine point cloud spatial information, and through YOLOv7 convolutional neural network and MLP neural network, the characteristic identifiers in the tunnel are automatically identified, the mileage data of the encoder is corrected, and the tunnel section fitting is combined with edge detection algorithm and Alpha Shape algorithm to realize tunnel ring and longitudinal positioning.
It realizes efficient and precise positioning in the tunnel, and solves the problems of low positioning efficiency and poor accuracy in the prior art.
Smart Images

Figure CN120071082A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of tunnel positioning, and in particular to a method for rapid identification and spatial positioning of feature markers in a tunnel. Background Art
[0002] With the rapid development of tunnel construction technology, various long tunnel sections are common. However, the characteristics of long sections and large inner diameters pose great challenges to subsequent inspection and maintenance work. In particular, how to quickly achieve positioning in a tunnel is a major problem faced by rapid tunnel inspection. Currently, tunnel inspection generally uses a ranging wheel based on an encoder to achieve positioning. The encoder converts mechanical signals into electrical signals to measure the driving mileage. However, when detecting over a long distance, it has the disadvantage of large cumulative errors and cannot complete the precise positioning of the target.
[0003] The Chinese patent "A High-Precision and Rapid Positioning Device and Method in a Tunnel" with the patent application number CN201911013283.2 discloses a tunnel lining positioning method using an encoder, a laser scanner, and a positioning image sensor, which can achieve high-precision and rapid positioning in a tunnel. However, it requires customized positioning tags, and the detection equipment and detection methods are relatively complex. The Chinese patent "A High-Precision Positioning Method in a Tunnel" with the patent application number CN202111215735.2 uses multiple base stations to achieve precise positioning of vehicles and personnel in a tunnel. Due to the limited distribution of base stations in the tunnel, an ideal geometric distribution of base stations cannot be obtained, thus reducing the accuracy and reliability of measurement data.
[0004] Developing an accurate spatial positioning method based on feature markers has important application value for the rapid detection of shield tunnel structure diseases. Summary of the Invention
[0005] The purpose of the present invention is to provide a method for rapid identification and spatial positioning of feature markers in a tunnel according to the deficiencies of the above-mentioned existing technologies. This method uses image recognition combined with point cloud spatial information for tunnel ring and longitudinal positioning, solves the technical problems of low efficiency and poor accuracy in current tunnel detection and positioning, and can achieve efficient and precise positioning in a tunnel.
[0006] The purpose of the present invention is achieved by the following technical solutions:
[0007] A method for rapid identification and spatial positioning of feature markers in a tunnel, the method comprising the following steps:
[0008] S1: Determine the coordinate transformation of the tunnel section contour point cloud and generate a tunnel spread diagram according to the positional relationship between the laser scanner and the center point of the tunnel section;
[0009] S2: Build a YOLOv7 convolutional neural network for automatic identification and positioning of mileage signs in a tunnel;
[0010] S3: Use an MLP neural network to recognize the characters on the signboard, and correct the mileage recorded by the incremental encoder based on the recognition result to complete the longitudinal mileage positioning of the tunnel.
[0011] S4: Use an edge detection algorithm to fit the point cloud of the tunnel section contour, and perform a piecewise quadratic fit on the fitted section based on different line type models.
[0012] S5: Complete the circumferential positioning of the tunnel according to the mapping relationship between the fitted section model and the pixel size of the signboard.
[0013] The specific steps of step S1 are as follows:
[0014] S1.1: Take the scanning lens of the laser scanner as the origin O(x o , y o ), with the positive X-axis direction horizontally to the right and the positive Y-axis direction vertically upward to establish a rectangular coordinate system.
[0015] S1.2: Fit the tunnel section according to different section fitting forms. Taking the circular section as an example, the center coordinates C(x c , y c ) and radius r of the tunnel section can be obtained.
[0016] S1.3: Let any point cloud of the tunnel section be P(x p , y p ), and perform coordinate transformation on point P according to the positional relationship between point O and point C. The corresponding relationship between point O and point C is:
[0017]
[0018] Δy = y c - y o Equation 2;
[0019] Δx = x c - x o Equation 3;
[0020] In the formula, α is the angle between the line connecting the center coordinate C of the tunnel section to point P and the horizontal direction, and β is the angle between the line connecting the coordinate O of the scanner lens to point P and the horizontal direction.
[0021] S1.4: Obtain the gray value of the point cloud after coordinate transformation, and use the gray value after coordinate transformation of each scan line as the image gray matrix to obtain the tunnel spread diagram.
[0022] The specific steps in step S2 are as follows:
[0023] S2.1: Select the images with mileage signs as the basic data by using the tunnel spread diagram generated in step S1;
[0024] S2.2: Use the image enhancement method to amplify the basic data. The amplified images are divided into a training set and a validation set according to a ratio of 8:2. Use the LabelImg image annotation software to box and annotate the mileage sign data;
[0025] Among them, the image enhancement method includes translation transformation, rotation transformation, contrast adjustment, and blurring;
[0026] S2.3: Load the YOLOv7 convolutional neural network with an extended efficient layer aggregation network and a cascade model, and input the training set and validation set data for model training;
[0027] Among them, the YOLOv7 convolutional neural network consists of an input, a backbone network, and a prediction head;
[0028] S2.4: According to the training results, set different hyperparameters, compare the loss value change curve and accuracy change curve during model training, and find the optimal hyperparameters;
[0029] Among them, the hyperparameters include learning rate, total number of iterations, weight decay, and loss function weight;
[0030] S2.5: Assemble the weight parameter model under the optimal hyperparameters to achieve automatic recognition and positioning of mileage signs in the tunnel.
[0031] The specific steps in step S3 are as follows:
[0032] S3.1: Build the MLP neural network based on the network node weight relationship. The mathematical expression of the model of the MLP neural network is:
[0033]
[0034] In the formula, X is the input feature vector, w i is the matrix composed of the weights of each node between the input layer and the hidden layer i, b i is the bias vector between the input layer and the hidden layer i, n is the number of hidden layers, W o is the weight matrix from the hidden layer to the output layer, b o is the bias vector from the hidden layer to the output layer, Softmax is the normalization function, and y(x) is the output result of the model of the MLP neural network;
[0035] S3.2: Input the image within the bounding box of the mileage sign identified and located in step S2 into the MLP neural network to achieve automatic recognition of the mileage number;
[0036] S3.3: Use the recognized mileage result as the reference mileage to perform reverse correction on the mileage data recorded by the incremental encoder.
[0037] The specific steps in step S4 are as follows:
[0038] S4.1: In the tunnel cross-section point cloud with noise removed, arbitrarily take the median value of any dimension as the root node, traverse all point clouds to construct a KD-tree search, use the KD-tree to search for KNN neighboring points, and calculate the average distance of the distances between neighboring points and the nearest neighbor point when K = 2. The specific formula is as follows:
[0039]
[0040]
[0041] In the formula, d ik1 and d ik2 are the distances between the two closest points to p i and p i respectively. p i is the i-th point of the tunnel cross-section point cloud with noise removed. x i , y i and z i are the three-axis coordinates of p i respectively. x ik1 , y ik1 and z ik1 are the three-axis coordinates of one of the two closest points to p i respectively. x ik2 , y ik2 and z ik2 are the three-axis coordinates of the other of the two closest points to p i respectively. d i is the average distance between d ik1 and d ik2 . d is the average distance between the input point cloud and its nearest neighbor point;
[0042] S4.2: Use the average distance d of the nearest neighbor points as the input parameter of the Alpha Shape algorithm, input each point in the tunnel cross-section contour point cloud into the boundary discrimination algorithm, and complete the fitting of the entire tunnel contour cross-section;
[0043] S4.3: Based on the fitted tunnel contour cross-section, divide the interval according to the angle between the connection line of adjacent points and the X-axis, and perform quadratic fitting using the circular arc line and straight line models.
[0044] The specific steps in step S5 are as follows:
[0045] S5.1: Calculate the length of the fitted tunnel cross-section contour segment by segment to obtain the length L of the entire tunnel cross-section contour.
[0046] S5.2: Calculate the position \(L\) where the mileage sign is located according to the corresponding relationship between the pixel height \(H\) of the tunnel layout diagram image and the length \(L\) of the tunnel section contour. b , and the calculation formula is as follows:
[0047]
[0048] In the formula, \(I\) b is the pixel height of the mileage sign in the picture.
[0049] The advantages of the present invention are:
[0050] (1) By adopting image recognition combined with point cloud spatial information for tunnel ring and longitudinal positioning, high-efficiency and precise positioning in the tunnel can be achieved;
[0051] (2) Identify and locate according to the image features of the tunnel sign, and complete the reverse correction of the encoder driving mileage by recognizing the existing characters;
[0052] (3) Using the distance of the nearest point as the fitting parameter can adaptively complete the contour fitting and circumferential positioning of point clouds with different types of cross-sections and different scanning frequencies. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 is a flowchart of the method for rapid recognition and spatial positioning of characteristic markers in the tunnel of the present invention;
[0054] Figure 2 is a schematic diagram of longitudinal mileage positioning of the tunnel of the present invention;
[0055] Figure 3 is a schematic diagram of contour edge detection and fitting of the present invention;
[0056] Figure 4 is a result diagram of quadratic fitting of tunnel contour segmentation of the present invention;
[0057] Figure 5 is a schematic diagram of longitudinal positioning of the tunnel of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0058] The following further details the features of the present invention and other related features through embodiments in conjunction with the drawings for the understanding of those skilled in the same industry:
[0059] Embodiment: As Figure 1 shown, this embodiment relates to a method for rapid recognition and spatial positioning of characteristic markers in a tunnel. The method mainly includes the following steps:
[0060] S1: Determine the coordinate transformation of the tunnel section contour point cloud and generate a tunnel layout diagram according to the positional relationship between the laser scanner and the center point of the tunnel section.
[0061] Among them, the specific steps of step S1 are as follows:
[0062] S1.1: Taking the scanning lens of the laser scanner as the origin O(x o , y o ), with the positive direction of the X-axis horizontally to the right and the positive direction of the Y-axis vertically upward, establish a rectangular coordinate system;
[0063] S1.2: Fit the tunnel section according to different section fitting forms. Taking the circular section as an example, the center coordinates C(x c , y c ) and radius r of the tunnel section can be obtained;
[0064] S1.3: Let any point cloud of the tunnel section be P(x p , y p ). Perform coordinate transformation on point P according to the positional relationship between point O and point C. The corresponding relationship between point O and point C is:
[0065]
[0066] Δy = y c - y o Equation 2;
[0067] Δx = x c - x o Equation 3;
[0068] In the formula, α is the angle between the line connecting the center coordinate C of the tunnel section to point P and the horizontal direction, and β is the angle between the line connecting the coordinate O of the scanner lens to point P and the horizontal direction;
[0069] S1.4: Obtain the gray value of the point cloud after coordinate transformation, and use the gray values of each scanning line after coordinate transformation as the image gray matrix to obtain the tunnel spread diagram.
[0070] S2: Build a YOLOv7 convolutional neural network to automatically identify and locate the mileage signs in the tunnel.
[0071] Among them, the specific steps in step S2 are as follows:
[0072] S2.1: Using the tunnel spread diagram generated in step S1, select the images with mileage signs as the basic data;
[0073] S2.2: Use the image enhancement method to amplify the basic data. The amplified images are divided into a training set and a validation set according to a ratio of 8:2, and use the LabelImg image annotation software to frame and annotate the mileage sign data;
[0074] Specifically, the image enhancement method includes translation transformation, rotation transformation, contrast adjustment, and blurring processing;
[0075] S2.3: Load the YOLOv7 convolutional neural network with an extended efficient layer aggregation network and a cascade model, and input the training set and validation set data for model training;
[0076] Specifically, the YOLOv7 convolutional neural network consists of an input, a backbone network, and a prediction head. The input can adjust the image for the model and can process the size and format. The backbone network can extract the image features of the input network, and the prediction head can classify and predict the position of the feature map. As a part of the backbone network, the extended efficient layer aggregation network combines channel transformation features and different convolutional features, enabling the network to learn more features and have stronger robustness;
[0077] S2.4: According to the training results, set different hyperparameters, compare the loss value change curve and accuracy change curve during model training, and find the optimal hyperparameters;
[0078] Specifically, the hyperparameters include the learning rate, total number of iterations, weight decay, and loss function weight. The quality of the model is determined by judging the maximum value of the accuracy change curve (accuracy rising curve) and the smoothness and convergence-divergence of the loss value change curve (loss value falling curve);
[0079] S2.5: Assembling the weight parameter model under the optimal hyperparameters can achieve the automatic recognition and positioning of the mileage signs in the tunnel.
[0080] S3: Use the MLP neural network to recognize the sign characters, and correct the mileage recorded by the incremental encoder based on the recognition results to complete the longitudinal mileage positioning of the tunnel.
[0081] Among them, as Figure 2 shown, the specific steps in step S3 are as follows:
[0082] S3.1: Build an MLP neural network based on the network node weight relationship. The mathematical expression of the MLP neural network model is:
[0083]
[0084] In the formula, X is the input feature vector, w i is the matrix composed of the weights of each node between the input layer and the hidden layer i, b i is the bias vector between the input layer and the hidden layer i, n is the number of hidden layers, W o is the weight matrix from the hidden layer to the output layer, b ois the bias vector from the hidden layer to the output layer, Softmax is the normalization function, and y(x) is the output result of the MLP neural network model;
[0085] Specifically, after continuously adjusting the hidden layer of the MLP neural network to 3 layers (i.e., when n in Equation 4 is 3), the recognition effect is the best;
[0086] S3.2: Input the image within the bounding box of the mileage signpost identified and located in step S2 into the MLP neural network to achieve automatic recognition of the mileage;
[0087] Specifically, the pixel range within the bounding box can be determined according to the center point coordinates and the length and width values of the predicted anchor box, and all pixels within the anchor box are extracted and input into the MLP neural network;
[0088] S3.3: Use the recognized mileage result as the reference mileage to perform reverse correction on the mileage data recorded by the incremental encoder;
[0089] Specifically, the incremental encoder under synchronous control corresponds one-to-one with the laser scanner, and the mileage number after the mileage signpost is recognized can perform reverse correction on the encoder mileage number.
[0090] S4: Use the edge detection algorithm to fit the tunnel cross-section point cloud, and perform piecewise quadratic fitting on the fitted cross-section based on different line type models.
[0091] Among them, as Figure 3 and Figure 4 shown, the specific steps in step S4 are as follows:
[0092] S4.1: In the tunnel cross-section point cloud after removing noise, take the intermediate value of any dimension as the root node, traverse all point clouds to construct a KD-tree search, use the KD-tree to search for KNN neighboring points, and calculate the average value of the distances between neighboring points and the nearest neighbor point when K = 2. The specific formula is as follows:
[0093]
[0094] In the formula, d ik1 and d ik2 are the distances between the two nearest points to p i and p i respectively, p i is the i-th point of the tunnel cross-section point cloud after removing noise, x i , y i and z i are the three-axis coordinates of p i respectively, x ik1 , y ik1 and z ik1 are the three-axis coordinates of one of the two nearest points to p i respectively, xik2 , y ik2 and z ik2 are respectively the three-axis coordinates of the other point among the two points closest to p i , and d i is the average distance between d ik1 and d ik2 . d is the average value of the distances between the input point cloud and its nearest neighbor points;
[0095] S4.2: Use the average value d of the nearest neighbor point distances as the input parameter of the Alpha Shape algorithm, and input each point in the tunnel cross-section contour point cloud into the boundary discrimination algorithm to complete the fitting of the entire tunnel contour cross-section;
[0096] Specifically, the Alpha Shape algorithm uses a circle with a radius of 2α as the selection condition, and the points touched by the circle on the tunnel contour are the fitting contour points;
[0097] S4.3: Based on the fitted tunnel contour cross-section, divide the intervals according to the angle between the connecting lines of adjacent points and the X-axis, and use the circular arc line and straight line models to carry out secondary fitting;
[0098] Specifically, the angle between different line type models with respect to the X-axis will change abruptly, and the abrupt points are used as the basis for line type division to complete the division of the contour intervals.
[0099] S5: Complete the circumferential positioning of the tunnel according to the mapping relationship between the fitted cross-section model and the pixel size of the signboard.
[0100] Among them, as Figure 5 shown, the specific steps in step S5 are as follows:
[0101] S5.1: Calculate the length of the fitted tunnel cross-section contour segment by segment to obtain the length L of the entire tunnel cross-section contour;
[0102] S5.2: Calculate the position L b where the mileage signboard is located according to the corresponding relationship between the pixel height H of the tunnel layout diagram image and the length L of the tunnel cross-section contour. The calculation formula is as follows:
[0103]
[0104] In the formula, I b is the pixel height of the mileage signboard in the picture.
[0105] The beneficial technical effects of this embodiment are:
[0106] (1) Using image recognition combined with point cloud spatial information for tunnel circumferential and longitudinal positioning can achieve efficient and precise positioning in the tunnel;
[0107] (2) Identify and locate according to the image features of the tunnel sign, and complete the reverse correction of the encoder driving mileage through the recognition of existing characters;
[0108] (3) Using the distance of the nearest point as the fitting parameter, the contour fitting and circumferential positioning of point clouds with different types of cross-sections and different scanning frequencies can be adaptively completed.
[0109] Although the above embodiments have detailed the concept and implementation of the object of the present invention with reference to the drawings, those of ordinary skill in the art can recognize that various improvements and transformations can still be made to the present invention without departing from the scope defined by the claims, so they will not be elaborated one by one here.
Claims
1. A method for rapid identification and spatial positioning of characteristic markers in a tunnel, characterized in that The method comprises the following steps: S1: According to the positional relationship between the laser scanner and the center point of the tunnel section, the coordinate transformation of the tunnel section contour point cloud is determined and the tunnel layout diagram is generated; S2: Build a YOLOv7 convolutional neural network to automatically identify and locate mileage signs in tunnels; S3: Use the MLP neural network to recognize the characters on the signboard, and correct the mileage recorded by the incremental encoder based on the recognition results to complete the longitudinal mileage positioning of the tunnel; S4: Use edge detection algorithm to fit the tunnel section contour point cloud, and perform segmented quadratic fitting on the fitting section based on different line models; S5: Complete the circumferential positioning of the tunnel according to the mapping relationship between the fitted cross-section model and the pixel size of the signboard.
2. A method for rapid identification and spatial positioning of characteristic markers in a tunnel as claimed in claim 1, characterized in that The specific steps of step S1 are as follows: S1.1: Take the scanning lens of the laser scanner as the origin O(x o ,y o ), the horizontal right is the positive direction of the X axis, and the vertical upward is the positive direction of the Y axis, and a rectangular coordinate system is established; S1.2: Fit the tunnel section according to different section fitting forms. Taking the circular section as an example, the center coordinates C(x c ,y c ) and radius r; S1.3: Let the arbitrary point cloud of the tunnel section be P(x p ,y p ), according to the positional relationship between point O and point C, the coordinate transformation of point P is performed. The corresponding relationship between point O and point C is: Δy = y c -y o Equation 2; Δx = x c -x o Equation 3; Wherein, α is the angle between the line connecting the center coordinates C of the tunnel section to point P and the horizontal direction, and β is the angle between the line connecting the coordinates O of the scanner lens to point P and the horizontal direction; S1.4: Obtain the grayscale value of the point cloud after coordinate transformation, use the grayscale value of each scan line after coordinate transformation as the image grayscale matrix, and obtain the tunnel layout diagram.
3. A method for rapid identification and spatial positioning of characteristic markers in a tunnel as claimed in claim 2, characterized in that The specific steps in step S2 are as follows: S2.1: Using the tunnel layout map generated in step S1, select an image with a mileage sign as basic data; S2.2: Use image enhancement methods to amplify the basic data. The amplified images are divided into training sets and validation sets according to a ratio of 8:
2. Use LabelImg image annotation software to select and annotate the mileage sign data. Wherein, the image enhancement method includes translation transformation, rotation transformation, contrast adjustment and blur processing; S2.3: Equipped with the YOLOv7 convolutional neural network with an extended efficient layer aggregation network and a cascade model, the training set and validation set data are input for model training; Wherein, the YOLOv7 convolutional neural network consists of input, backbone network and prediction head; S2.4: According to the training results, set different hyperparameters, compare the loss value change curve and accuracy change curve during model training, and find the optimal hyperparameters; Wherein, the hyperparameters include learning rate, total number of iterations, weight decay and loss function weight; S2.5: Assembling the weight parameter model under the optimal hyperparameters can realize the automatic recognition and positioning of mileage signs in tunnels.
4. A method for rapid identification and spatial positioning of characteristic markers in a tunnel as claimed in claim 3, characterized in that The specific steps in step S3 are as follows: S3.1: The MLP neural network is constructed based on the network node weight relationship. The mathematical expression of the MLP neural network model is: Where X is the input feature vector, w i is the matrix composed of the weights of each node between the input layer and the hidden layer i, b i is the bias vector of the input layer and hidden layer i, n is the number of hidden layers, W o is the weight matrix from the hidden layer to the output layer, b o is the bias vector from the hidden layer to the output layer, Softmax is the normalization function, and y(x) is the output result of the MLP neural network model; S3.2: Inputting the image within the boundary box of the mileage sign identified and located in step S2 into the MLP neural network to realize automatic recognition of the mileage; S3.3: Using the identified mileage result as a reference mileage, reversely correct the mileage data recorded by the incremental encoder.
5. A method for rapid identification and spatial positioning of characteristic markers in a tunnel as claimed in claim 4, characterized in that The specific steps in step S4 are as follows: S4.1: In the tunnel cross-section point cloud after removing noise points, take the middle value of any dimension as the root node, traverse all point clouds to construct KD-tree retrieval, use KD-tree to retrieve KNN neighboring points, and calculate the distance between neighboring points and the average distance between the nearest neighboring points when K=2. The specific formula is as follows: Where, d ik1 and d ik2 The distance p i The two nearest points and p i The distance between i is the i-th point of the tunnel cross-section point cloud after removing noise points, x i ,y i and z i They are p i The three-axis coordinates, x ik1 ,y ik1 and z ik1 The distance p i The three-axis coordinates of one of the two nearest points, x ik2 ,y ik2 and z ik2 The distance p i The three-axis coordinates of the other point among the two nearest points, d i is d ik1 and d ik2 , d is the average distance between the input point cloud and its nearest neighbor; S4.2: Using the average value d of the nearest neighboring point distance as the input parameter of the AlphaShape algorithm, each point in the tunnel section contour point cloud is input into the boundary discrimination algorithm to complete the entire tunnel section contour fitting; S4.3: Based on the fitted tunnel profile section, the interval is divided according to the line connecting the adjacent points and the X-axis angle, and the arc line and straight line model are used to perform secondary fitting.
6. A method for rapid identification and spatial positioning of characteristic markers in a tunnel as claimed in claim 5, characterized in that The specific steps in step S5 are as follows: S5.1: Calculate the length of each segment based on the fitted tunnel cross-sectional profile, thereby obtaining the length L of the entire tunnel cross-sectional profile; S5.2: Calculate the location of the mileage sign L according to the corresponding relationship between the pixel height H of the tunnel layout map and the length L of the tunnel section contour b , the calculation formula is as follows: In the formula, I b The pixel height of the mileage sign in the image.
Citation Information
Patent Citations
A high-precision and rapid positioning device and method for tunnels
CN110849368B
High-precision positioning method in tunnel
CN113965883A
Cited By
Railway kilometer post prediction method and device based on geographic space data and medium
CN120930884A