A shield machine tail gap measurement method, device, equipment and medium
Through the improved Yolov8 model, the laser area in the laser image of the tail of the shield machine was extracted, and the shield tail gap was calculated by combining feature point extraction, which solved the problems of low accuracy, slow speed and light source interference of the existing measurement methods, and achieved efficient and accurate shield Tail gap measurement.
Patent Information
- Application Number
- CN202411124280.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-08-16
AI Technical Summary
The existing shield tail gap measurement methods of shield mechanisms have problems such as fast contact loss, cumbersome installation, low accuracy and slow speed of non-contact type, and it is difficult to avoid light source interference.
The improved Yolov8 model is used to extract the laser area in the laser image of the tail of the shield machine. The feature points of the laser line are obtained through feature extraction, and the true value of the shield tail gap can be calculated, which can eliminate light source interference and achieve efficient and accurate measurement. .
It realizes efficient and accurate measurement of shield tail gap, avoids light source interference, improves measurement speed and accuracy, and is suitable for the automation development of shield machine and engineering safety.
Smart Images

Figure CN118640816B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of shield tail clearance measurement, and in particular to a shield tail clearance measurement method, device, equipment and medium for shield machine. Background Art
[0002] Shield machines are widely used in subway construction and mountain tunnel construction. The shield tail gap is the gap between the outer wall of the segment and the inner wall of the shield tail (i.e. the inner wall of the tail of the shield machine). If the shield machine wants to move forward, the inner wall of the shield tail cannot contact the outer wall of the segment. Therefore, the shield tail gap is an important parameter of the shield machine. During the construction of the shield machine, rapid and accurate measurement of the shield tail gap is a prerequisite for the safe construction of the shield machine.
[0003] In the actual engineering application of shield tail gap measurement, the existing contact measurement method has fast loss and cumbersome installation, and the existing non-contact measurement method has low accuracy and slow speed. Based on this, designing an efficient and accurate shield tail gap measurement method that can avoid light source interference is of great significance to the automation development of shield machines and the engineering safety of shield machines. Summary of the invention
[0004] The purpose of this application is to provide a shield tail gap measurement method, device, equipment and medium for shield machine, which can realize efficient and accurate measurement of the shield tail gap of the shield machine.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides a method for measuring the gap between the shield tail of a shield machine, and the method for measuring the gap between the shield tail of a shield machine comprises:
[0007] Acquire a laser image of the tail of the shield machine; the laser image includes a laser area, and the laser area includes a first laser line and a second laser line, the first laser line is a laser line irradiated on the end surface of the segment at the tail of the shield machine when the shield machine head emits laser to the tail of the shield machine, and the second laser line is a laser line irradiated on the inner wall of the tail of the shield machine when the shield machine head emits laser to the tail of the shield machine;
[0008] The laser image is used as input, and the laser area in the laser image is extracted using a trained target area extraction model to obtain a laser area image; the trained target area extraction model adopts an improved Yolov8 model, and the improved Yolov8 model is obtained by improving the Yolov8 model, and the improvement includes: replacing the convolution structure in the C2f module of the feature extractor of the Yolov8 model with a double convolution structure, adding an attention mechanism layer before the middle C2f module of the feature extractor of the Yolov8 model, and removing the small target detector and the medium target detector of the target detector of the Yolov8 model; the middle C2f module is a C2f module in the feature extractor of the Yolov8 model except the first C2f module and the last C2f module;
[0009] Extracting features of the first laser line and the second laser line in the laser area image to obtain a first feature point, a second feature point and a third feature point; the first feature point is an end point of the first laser line; the second feature point is the other end point of the first laser line; the third feature point is an intersection point of the first laser line and the second laser line;
[0010] Based on the pixel coordinates of the first feature point, the pixel coordinates of the second feature point, and the pixel coordinates of the third feature point, the first pixel distance of the wall thickness of the segment and the second pixel distance of the shield tail gap are calculated, and based on the true value of the wall thickness of the segment, the first pixel distance, and the second pixel distance, the true value of the shield tail gap is calculated; the shield tail gap is the distance between the outer wall of the segment and the inner wall of the tail of the shield machine.
[0011] In a second aspect, the present application provides a shield tail gap measuring device for a shield machine, the shield tail gap measuring device for a shield machine comprising:
[0012] An image acquisition module is used to acquire a laser image of the tail of the shield machine; the laser image includes a laser area, and the laser area includes a first laser line and a second laser line. The first laser line is a laser line irradiated on the end surface of the pipe segment at the tail of the shield machine when the shield machine head emits laser to the tail of the shield machine, and the second laser line is a laser line irradiated on the inner wall of the tail of the shield machine when the shield machine head emits laser to the tail of the shield machine;
[0013] A laser region extraction module is used to extract the laser region in the laser image using the laser image as input and to obtain a laser region image by using a trained target region extraction model; the trained target region extraction model adopts an improved Yolov8 model, and the improved Yolov8 model is obtained by improving the Yolov8 model, wherein the improvement includes: replacing the convolution structure in the C2f module of the feature extractor of the Yolov8 model with a double convolution structure, adding an attention mechanism layer before the middle C2f module of the feature extractor of the Yolov8 model, and removing the small target detector and the medium target detector of the target detector of the Yolov8 model; the middle C2f module is a C2f module in the feature extractor of the Yolov8 model except the first C2f module and the last C2f module;
[0014] A feature point extraction module is used to extract features of the first laser line and the second laser line in the laser area image to obtain a first feature point, a second feature point and a third feature point; the first feature point is an end point of the first laser line; the second feature point is the other end point of the first laser line; the third feature point is the intersection of the first laser line and the second laser line;
[0015] A shield tail gap calculation module is used to calculate a first pixel distance of the wall thickness of the segment and a second pixel distance of the shield tail gap based on the pixel coordinates of the first feature point, the pixel coordinates of the second feature point and the pixel coordinates of the third feature point, and to calculate the true value of the shield tail gap based on the true value of the wall thickness of the segment, the first pixel distance and the second pixel distance; the shield tail gap is the distance between the outer wall of the segment and the inner wall of the tail of the shield machine.
[0016] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned shield tail gap measurement method of a shield machine.
[0017] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned shield tail gap measurement method for a shield machine.
[0018] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0019] The present application provides a shield tail gap measurement method, device, equipment and medium for a shield machine. The laser area in the laser image of the tail of the shield machine is extracted by using a trained target area extraction model to obtain a laser area image. Subsequently, the first laser line and the second laser line in the laser area image are feature extracted to obtain a first feature point, a second feature point and a third feature point. The true value of the shield tail gap is calculated based on the pixel coordinates of the first feature point, the pixel coordinates of the second feature point, the pixel coordinates of the third feature point and the true value of the wall thickness of the pipe segment. The present invention extracts the laser area through an improved Yolov8 model, and subsequently processes the laser area image to measure the shield tail gap. The present invention can eliminate interference from the on-site environment, such as light source interference, and with the advantages of high precision and lightweight of the improved Yolov8 model, efficient and accurate measurement of the shield tail gap is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 This is an application environment diagram of a shield machine tail gap measurement method provided in Example 1 of the present application.
[0022] Figure 2 A schematic flow chart of a method for measuring the gap between the tail of a shield machine provided in Example 1 of the present application.
[0023] Figure 3 A measurement principle diagram of a shield machine tail gap measurement method provided in Example 1 of the present application.
[0024] Figure 4 A detailed flow chart of a shield machine tail gap measurement method provided in Example 1 of the present application.
[0025] Figure 5 This is a schematic diagram of the network structure of the Yolov8 model provided in Example 1 of the present application.
[0026] Figure 6 Schematic diagram of the network structure of the attention mechanism layer provided in Example 1 of the present application.
[0027] Figure 7 This is a schematic diagram of the network structure of the improved Yolov8 model provided in Example 1 of the present application.
[0028] Figure 8 A schematic diagram of a black and white image provided in Example 1 of the present application.
[0029] Fig. 9 Schematic diagram of the feature extraction results of the L-CNN algorithm provided in Example 1 of the present application.
[0030] Fig.10 A schematic diagram of the feature extraction results of the Hough algorithm provided in Example 1 of the present application.
[0031] Fig.11 This is a schematic diagram of the measurement area provided in Example 1 of the present application.
[0032] Fig.12 A schematic diagram of the functional modules of a shield tail gap measuring device for a shield machine provided in Example 2 of the present application.
[0033] Fig.13 A schematic diagram of the functional modules of another shield tail gap measurement device for a shield machine provided in Example 2 of the present application.
[0034] Fig.14 A schematic diagram of the structure of a computer device provided in Example 3 of the present application.
[0035] Reference numerals:
[0036] 1-segment; 2-inner wall at the rear of the shield machine. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0038] Example 1
[0039] The shield tail clearance measurement method provided in this embodiment can be applied to Figure 1In the application environment shown. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be set up separately, integrated on the server, or placed on the cloud or other servers. The terminal can send the laser image to be processed to the server. After the server receives the laser image to be processed, for the laser image to be processed, the server uses the laser image as input, uses the trained target area extraction model to extract the laser area in the laser image, obtains the laser area image, extracts the first laser line and the second laser line in the laser area image, obtains the first feature point, the second feature point and the third feature point, calculates the first pixel distance of the wall thickness of the pipe segment and the second pixel distance of the shield tail gap based on the pixel coordinates of the first feature point, the pixel coordinates of the second feature point and the pixel coordinates of the third feature point, and calculates the true value of the shield tail gap based on the true value of the wall thickness of the pipe segment, the first pixel distance and the second pixel distance. The server can feedback the obtained true value of the shield tail gap to the terminal.
[0040] In addition, in some embodiments, the shield tail gap measurement method of the shield machine can also be implemented independently by a server or a terminal. For example, the terminal can directly perform image processing on the laser image to be processed, or the server can obtain the laser image to be processed from the data storage system and perform image processing on the laser image to be processed.
[0041] The terminal may be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The server may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.
[0042] like Figure 2 As shown, this embodiment provides a shield tail gap measurement method for a shield machine. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In this embodiment, the method is applied to Figure 1 Taking the server in the example as an example, the shield tail gap measurement method of the shield machine includes the following steps:
[0043] S1: Acquire a laser image of the tail of the shield machine; the laser image includes a laser area, and the laser area includes a first laser line and a second laser line. The first laser line is a laser line irradiated on the end surface of the pipe segment at the tail of the shield machine when the laser is emitted from the head of the shield machine to the tail of the shield machine, and the second laser line is a laser line irradiated on the inner wall of the tail of the shield machine when the laser is emitted from the head of the shield machine to the tail of the shield machine.
[0044] S2: Taking the laser image as input, extracting the laser area in the laser image using the trained target area extraction model to obtain a laser area image; the trained target area extraction model adopts an improved Yolov8 model, and the improved Yolov8 model is obtained by improving the Yolov8 model, and the improvements include: replacing the convolution structure in the C2f module of the feature extractor of the Yolov8 model with a double convolution structure, adding an attention mechanism layer before the middle C2f module of the feature extractor of the Yolov8 model, and removing the small target detector and the medium target detector of the target detector of the Yolov8 model; the middle C2f module is the C2f module in the feature extractor of the Yolov8 model except the first C2f module and the last C2f module.
[0045] S3: Extract features of the first laser line and the second laser line in the laser area image to obtain a first feature point, a second feature point and a third feature point; the first feature point is an endpoint of the first laser line; the second feature point is the other endpoint of the first laser line; the third feature point is the intersection of the first laser line and the second laser line.
[0046] S4: Based on the pixel coordinates of the first feature point, the pixel coordinates of the second feature point and the pixel coordinates of the third feature point, the first pixel distance of the wall thickness of the segment and the second pixel distance of the shield tail gap are calculated, and based on the true value of the wall thickness of the segment, the first pixel distance and the second pixel distance, the true value of the shield tail gap is calculated; the shield tail gap is the distance between the outer wall of the segment and the inner wall of the tail of the shield machine.
[0047] By implementing the above steps S1 to S4, this embodiment improves the Yolov8 model so that the improved Yolov8 model has the advantages of high detection accuracy and fast detection speed. The improved Yolov8 model is subsequently used to extract the laser area in the laser image, and the shield tail gap is further measured based on the extracted laser area image. In the process of measuring the shield tail gap, light source interference can be avoided, and the true value of the shield tail gap can be calculated efficiently and accurately.
[0048] This embodiment is based on a hardware platform composed of a laser transmitter and a high-definition industrial camera, and designs a shield tail gap measurement scheme with high accuracy, high speed and strong practicality. By identifying the laser line characteristics of the shield tail gap, the true value of the shield tail gap is calculated based on the mathematical relationship between the laser line and the pixel coordinates. Figure 3 As shown, a laser emitter installed at the head of the shield machine is used to irradiate the laser perpendicular to the end face of the segment 1 onto the tail of the shield machine to generate a laser line , , , ,in, , is the first laser line, located on the end face of tube segment 1, , is the second laser line, located on the inner wall 2 of the tail of the shield machine, the first laser line is perpendicular to the tangent of the inner wall and the tangent of the outer wall of the segment 1 respectively, the tangent of the inner wall refers to the tangent at the intersection of the first laser line on the inner wall and the inner wall, the tangent of the outer wall refers to the tangent at the intersection of the first laser line on the outer wall and the outer wall, and the first laser line and the second laser line are perpendicular. It is particularly pointed out that the first laser line and the second laser line are perpendicular in space, and Figure 3 The schematic diagram provided is from the perspective of the end face of the vertical segment 1, so Figure 3 The first laser line and the second laser line shown in FIG. 1 are the corresponding laser lines when observed from the perspective of the vertical end face of the tube segment 1. Figure 3 The first laser line and the second laser line shown in the figure are not perpendicular, but those skilled in the art can understand that the positional relationship between the first laser line and the second laser line in space is perpendicular. A and B are the first characteristic points, C and D are the second characteristic points, and E and F are the third characteristic points. Figure 3 The dotted line in is the extension line of the first laser line, and the pixel distance of the wall thickness of the tube segment is , , the pixel distance of the shield tail gap is , , the true value of the wall thickness of the tube segment is , then the true value of the shield tail gap , Satisfies the following relationship:
[0049] ;
[0050] Therefore, after the laser image is obtained by shooting with a high-definition industrial camera, the laser image is processed to extract all feature points (first feature point, second feature point, third feature point), and the pixel distance of the wall thickness of the pipe segment is calculated according to the pixel coordinates of all feature points. , And the pixel distance of the shield tail gap , According to the above formula, the true value of the shield tail gap can be obtained , .
[0051] Based on the above measurement principle, Figure 4As shown in FIG. 1 , it is a detailed flow chart of S1-S4, including: step 1, using the image acquisition equipment (which can be a high-definition industrial camera) at the engineering site to obtain the laser image of the tail of the shield machine; step 2, using the laser image obtained at the engineering site to create a data set; step 3, using the data set to train the improved Yolov8 model to obtain a trained target area extraction model; step 4, inputting the measured laser image into the trained target area extraction model, extracting the laser area of the laser image, and outputting the laser area image; step 5, performing image processing on the output laser area image to eliminate interference features; step 6, extracting The feature points of the first laser line and the second laser line in the laser area image after image processing are obtained to obtain the first feature point, the second feature point and the third feature point, and the pixel coordinates of the first feature point, the second feature point and the third feature point are output, and the pixel coordinates refer to the coordinates of the first feature point, the second feature point and the third feature point in the laser area image; step 7, based on the pixel coordinates of the first feature point, the second feature point and the third feature point, solve the first pixel distance of the wall thickness of the pipe segment and the second pixel distance of the shield tail gap; step 8, multiply the ratio of the second pixel distance to the first pixel distance by the true value of the wall thickness of the pipe segment to obtain the true value of the shield tail gap.
[0052] While the shield machine is excavating, the high-definition industrial camera installed on the head of the shield machine will move forward with it, and the laser area in the laser image will gradually decrease. Other light sources at the construction site will also directly interfere with the recognition of the laser image. Therefore, it is necessary to extract the region of interest from the laser image to minimize the influence of other interference factors. This embodiment uses the laser image as input and uses the trained target area extraction model to extract the laser area in the laser image to obtain a laser area image.
[0053] In this embodiment, the trained target region extraction model adopts the improved Yolov8 model, and the improved Yolov8 model is obtained by improving the Yolov8 model.
[0054] like Figure 5 As shown in Figure 1, the Yolov8 model includes: input end, feature extractor, feature fusion device and target detector. Figure 5 In the model, SPPF (Spatial Pyramid Pooling-Fast) is the spatial pyramid pooling module, and Concat is the concatenation layer. The modules of the Yolov8 model have simple structures and small network size, so they perform well in speed, but lack accuracy, so the Yolov8 model needs to be improved.
[0055] This embodiment combines the dual convolution structure and the GAM attention mechanism (Global Attention Mechanism) to achieve improved accuracy. When the GAM attention mechanism is added, the computational complexity and complexity of the model also increase to a certain extent. To cope with this situation, this embodiment introduces the dual convolution structure into the C2f module to make the model more lightweight. The improvements include:
[0056] (1) Replace the convolutional structure in the C2f module of the feature extractor of the Yolov8 model with a double convolutional structure.
[0057] (2) An attention mechanism layer is added before the intermediate C2f module of the feature extractor of the Yolov8 model. The intermediate C2f module is the C2f module in the feature extractor of the Yolov8 model except the first C2f module and the last C2f module.
[0058] The attention mechanism layer adopts the GAM attention mechanism, such as Figure 6 As shown, it includes a sequentially connected channel attention mechanism and a spatial attention mechanism. After the input feature is processed by the channel attention mechanism, the output first feature is multiplied by the input feature to obtain the second feature. After the second feature is processed by the spatial attention mechanism, the output third feature is multiplied by the second feature to obtain the output feature.
[0059] (3) Remove the small object detector and medium object detector of the object detector of the Yolov8 model.
[0060] In the field of target detection, the size of the identified target is usually classified by the size of the pixel. The sizes of the targets that can be identified by the small target detector, the medium target detector, and the large target detector in the Yolov8 model increase successively. A large target refers to an object with pixels less than 96×96 pixels in the image. Even after the shield machine reaches the maximum distance, the number of pixels in the laser area is still greater than the size of the large target in the target detection field. Therefore, this embodiment further improves the model in terms of lightweight. In the Yolov8 model, after the feature fuser fuses the features of the image, the features will be output to the target detector for identification. The features are input into the small target detector, the medium target detector, and the large target detector in order from shallow to deep. In order to better measure the shield tail gap, only the deepest large target detector is retained, and the remaining target detectors are removed to further achieve the purpose of lightweight.
[0061] The improved Yolov8 model is as follows Figure 7 As shown, Figure 7In the figure, C2f-Dual means that the convolution structure in the C2f module has been replaced with a dual convolution structure. Compared with the Yolov8 model before the improvement, the improved Yolov8 model is more accurate, has a simpler structure, and runs faster.
[0062] In this embodiment, the training process of the improved Yolov8 model includes:
[0063] (1) The collected laser images are screened, and the laser images blocked by water stains and mud are removed. The laser images with clear images and completely containing the laser area are selected from all the laser images to obtain sample laser images.
[0064] (2) Use Labelme annotation software to load the original sample laser image, mark the laser areas in the sample laser image one by one, and generate the corresponding file label data in txt format.
[0065] (3) All sample laser images and the file label data corresponding to each sample laser image are combined into a data set, and the data set is divided according to an appropriate ratio to obtain a training set and a validation set.
[0066] (4) Set the model training parameters, use the training set to train the improved Yolov8 model to obtain the trained model, use the validation set to verify the trained model, and obtain the average accuracy. If the average accuracy is greater than the preset value, the trained model is used as the trained target area extraction model. Otherwise, increase the number of iterations and continue training.
[0067] In order to more accurately extract the feature points of the laser line, this embodiment first performs image processing on the laser area image before extracting the features of the first laser line and the second laser line in the laser area image. The image processing process includes:
[0068] (1) Binarize the laser area image to obtain a black and white image.
[0069] (2) Filter the black and white image to obtain a filtered image.
[0070] (3) Performing stroke processing on the first laser line and the second laser line in the filtered image to obtain a stroked image, and using the stroked image as a new laser area image.
[0071] In this embodiment, the laser area image obtained after the laser area extraction is binarized to eliminate interference features; the black and white image is low-pass filtered by a filtering algorithm to eliminate noise around the laser line; the LSD (Line Segment Detector) algorithm is used to outline the laser line in the filtered image to make the laser line clearer, further eliminate environmental interference to a certain extent, and realize accurate measurement of the shield tail gap.
[0072] In this embodiment, grayscale recognition is performed on the laser area image obtained after extraction, grayscale values of the first laser line and the second laser line are obtained, and the grayscale values of the first laser line and the second laser line are used as grayscale thresholds to perform binarization processing on the laser area image. Binarization processing is performed on the laser area image to obtain a black and white image, which specifically includes:
[0073] (1) Based on the grayscale value of each first pixel point in the laser area image, a grayscale distribution curve is determined, and based on the grayscale distribution curve, a grayscale threshold is determined, wherein the grayscale distribution curve includes the number of first pixel points corresponding to different grayscale values.
[0074] After pixel traversal of the laser area image, the grayscale values of all first pixel points are obtained, and a grayscale distribution curve is drawn with the grayscale value as the abscissa and the number of first pixel points as the ordinate.
[0075] After the laser area extraction is completed, due to the elimination of the interference of ambient light, the number of high grayscale value pixels in the laser area image is small, the pixel grayscale of the laser line is similar and the grayscale value is high, which will be reflected in the grayscale distribution curve in the form of a steep wave. The grayscale threshold can be set to the rising starting value of the wave. This embodiment uses the following formula to calculate the grayscale threshold:
[0076] ;
[0077] in, is the grayscale threshold; is a constant; is a variable representing grayscale value; To be infinitely close and greater than The value of Can be regarded as Round down to get; represents the functional relationship between the gray value corresponding to the gray distribution curve and the number of the first pixel points, which can be determined when the gray value is The number of the first pixel when ; and Respectively represent Perform first and second derivatives; Representatives in Infinitely close and greater than hour The value of Representatives in Infinitely close and greater than hour The value of .
[0078] The meaning of the above formula is: If Infinitely close and greater than hour, ,and ,but That is the determined grayscale threshold.
[0079] (2) For each first pixel point in the laser area image, determine whether the grayscale value of the first pixel point is greater than the grayscale threshold value. If so, adjust the grayscale value of the first pixel point to a first preset value. If not, adjust the grayscale value of the first pixel point to a second preset value to perform binarization processing to obtain a black and white image.
[0080] The first preset value may be 255, which is white, and the second preset value may be 0, which is black. Figure 8 shown.
[0081] The binarization process eliminates the influence of most interference features. However, the interference noise generated by the scattering of the laser line itself still exists in the black-and-white image. This embodiment can use existing commonly used filtering algorithms to filter the black-and-white image, such as the mean filtering algorithm, the median filtering algorithm, and the Gaussian filtering algorithm.
[0082] Since the image to be filtered is a black and white image, if the mean filter algorithm is used for processing, the edge of the laser line will be blurred; the median filter algorithm has a faster processing speed and can well retain the edge features, but the median filter algorithm will process the end features of the laser line together with the interference features, affecting the subsequent feature point recognition and ultimately causing errors; the Gaussian filter algorithm has a complex formula, and the edge of the laser line will also be blurred after filtering. In order to solve the problems of the above-mentioned existing algorithms, this embodiment specifically designs a new filtering algorithm for the black and white image of the shield tail gap to complete the filtering of the black and white image. In this embodiment, the black and white image is filtered to obtain the filtered image, which specifically includes:
[0083] (1) For each second pixel in the black-and-white image, determine whether the grayscale value of the second pixel is a first preset value to obtain a first determination result.
[0084] (2) If the first judgment result is no, setting the grayscale value of the second pixel to a second preset value.
[0085] (3) If the first judgment result is yes, determine whether there are A target pixel points in the local area corresponding to the second pixel point, and obtain a second judgment result, where the local area is an area with the second pixel point as the center point and a side length of 3 pixels, A is 0 or 1, and the target pixel point is a pixel point in the local area other than the second pixel point whose grayscale value is the first preset value.
[0086] (4) If the second judgment result is yes, the grayscale value of the second pixel is set to a second preset value.
[0087] (5) If the second judgment result is no, determine whether there are B target pixel points in the local area corresponding to the second pixel point, and obtain a third judgment result, where B is 2, 3, or 4.
[0088] (6) If the third judgment result is no, setting the grayscale value of the second pixel to the first preset value.
[0089] (7) If the third judgment result is yes, determine whether there are two adjacent target pixels among the B target pixels. If so, set the grayscale value of the second pixel to the first preset value; if not, set the grayscale value of the second pixel to the second preset value.
[0090] After processing each second pixel point through the above algorithm, a filtered image can be obtained, which can ensure that the edge of the laser line is clear while ensuring that the end feature of the laser line is not eliminated.
[0091] In this embodiment, the first laser line and the second laser line in the filtered image are stroked to obtain a stroked image, which specifically includes: using an LSD algorithm to stroke the first laser line and the second laser line in the filtered image to obtain a stroked image.
[0092] In this embodiment, feature extraction is performed on the first laser line and the second laser line in the laser area image to obtain a first feature point, a second feature point, and a third feature point, specifically including:
[0093] (1) If Fig. 9 As shown, the L-CNN (Line-Convolutional Neural Network) algorithm is used to extract features of the first laser line and the second laser line in the laser area image to obtain the first feature point and the second feature point.
[0094] The feature point extraction result of the L-CNN algorithm includes the endpoints of the first laser line and the endpoints of the second laser line. This embodiment further combines the coordinates of each endpoint to determine the first feature point and the second feature point. Specifically, the upper left corner vertex of the laser area image is taken as the origin, the right is the positive direction of the x-axis, and the downward is the positive direction of the y-axis. If there are two first laser lines and two second laser lines, the two endpoints with the smallest y coordinates are selected as the first feature points, and the two endpoints with the second smallest y coordinates are selected as the second feature points.
[0095] (2) If Fig.10 As shown, the Hough algorithm is used to extract features of the first laser line and the second laser line in the laser area image to obtain a third feature point.
[0096] The Hough algorithm is used to identify the first laser line and the second laser line, and then the identified first laser line and the second laser line are extended to obtain the intersection of the extended lines to obtain the third feature point.
[0097] In this embodiment, based on the pixel coordinates of the first feature point, the pixel coordinates of the second feature point, and the pixel coordinates of the third feature point, the first pixel distance of the wall thickness of the tube segment and the second pixel distance of the shield tail gap are calculated, and based on the true value of the wall thickness of the tube segment, the first pixel distance and the second pixel distance, the true value of the shield tail gap is calculated, specifically including:
[0098] (1) Based on the pixel coordinates of the first feature point and the pixel coordinates of the second feature point, the distance between the first feature point and the second feature point is calculated to obtain a first pixel distance of the wall thickness of the tube segment.
[0099] Herein, the distance may refer to the Euclidean distance.
[0100] (2) Based on the pixel coordinates of the second feature point and the pixel coordinates of the third feature point, the distance between the second feature point and the third feature point is calculated to obtain the second pixel distance of the shield tail gap.
[0101] (3) Calculate the ratio of the second pixel distance to the first pixel distance, and calculate the product of the ratio and the true value of the wall thickness of the segment to obtain the true value of the shield tail gap.
[0102] This embodiment provides a shield tail gap measurement method for a shield machine, including: identifying a laser image and extracting a laser area in the laser image; performing image processing on the obtained laser area image and identifying the characteristic points of the laser line; calculating based on the pixel coordinates of the characteristic points to obtain the pixel distance of the shield tail gap, and further obtaining the true value of the shield tail gap by using mathematical relationships. This embodiment applies the improved Yolov8 model to the shield tail gap measurement process, and performs timely and effective detection of the shield tail gap, which solves the problem of low accuracy and slow speed of the existing shield tail gap measurement method, and can eliminate environmental interference to a certain extent, and further realize accurate measurement of the shield tail gap.
[0103] In this embodiment, the improved Yolov8 model is used to extract the laser area with speed and accuracy. The laser area image is binarized, filtered and stroked to eliminate the influence of interference features in the image with higher accuracy. The first feature point and the second feature point are identified by the L-CNN algorithm, and the third feature point is identified by the Hough algorithm. The laser line can be detected more accurately and the interference of complex background can be effectively removed.
[0104] This embodiment further simulates, first installing image acquisition equipment to collect laser images of the industrial site in different time periods. From the 1,000 laser images taken, the laser images with dim light, unclear light or laser areas that failed to be captured were eliminated, and finally 941 clear and well-lit laser images were obtained to form the data set. In order to make the data more diverse, the acquisition positions of the laser images were set to four parts of the shield machine, such as Fig.11 As shown, each measurement area (i.e. Fig.11 The included angles between the center lines of measurement areas 1, 2, 3 and 4 in the simulation and the horizontal and vertical lines are all 45 degrees. The images are taken while the shield machine is moving forward, and other environmental factors such as the lighting on site are not processed, so that the data can include images of various states of the shield machine, while eliminating accidental factors to ensure the authenticity of the simulation results.
[0105] There are 941 laser images in the dataset. In the test experiment of the improved Yolov8 model, 377 laser images are randomly selected as the validation set and 534 laser images are randomly selected as the training set. The test results are shown in Table 1, including the test accuracy at 95% confidence level. The experimental results show that the proposed method can accurately extract the laser area, and the true value of the shield tail gap can be further accurately obtained based on the extracted laser area image.
[0106] Table 1 Test accuracy
[0107]
[0108] In summary, the method disclosed in this embodiment solves the problem of shield tail gap measurement very well. The laser area of the laser image is extracted through the improved Yolov8 model, and the feature points of the laser line are detected based on the extracted laser area image to calculate the true value of the shield tail gap. Experimental verification shows that this method has good accuracy and speed and can meet actual engineering needs.
[0109] This embodiment also provides an application scenario, which applies the above-mentioned shield tail gap measurement method of the shield machine. Specifically, the shield tail gap measurement method provided by this embodiment can be applied in the shield machine working scenario. The shield machine working scenario includes an image acquisition link, an image processing link and a shield tail gap application link. The image acquisition link is used to acquire laser images, and the image processing link is used to process the laser images to obtain the true value of the shield tail gap. The shield tail gap application link is used to control the working process of the shield machine based on the true value of the shield tail gap. The shield tail gap measurement method provided by this embodiment belongs to the image processing link.
[0110] Example 2
[0111] Based on the same inventive concept, this embodiment also provides a shield machine tail gap measuring device for implementing the shield machine tail gap measuring method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the shield machine tail gap measuring device provided below can refer to the limitations of the shield machine tail gap measuring method above, and will not be repeated here.
[0112] like Fig.12 As shown, this embodiment provides a shield tail gap measuring device for a shield machine, comprising:
[0113] An image acquisition module is used to acquire a laser image of the tail of a shield machine; the laser image includes a laser area, and the laser area includes a first laser line and a second laser line. The first laser line is a laser line irradiated on the end surface of the pipe segment at the tail of the shield machine when the laser is emitted from the head of the shield machine to the tail of the shield machine, and the second laser line is a laser line irradiated on the inner wall of the tail of the shield machine when the laser is emitted from the head of the shield machine to the tail of the shield machine.
[0114] The laser region extraction module is used to extract the laser region in the laser image using the trained target region extraction model with the laser image as input to obtain a laser region image; the trained target region extraction model adopts an improved Yolov8 model, and the improved Yolov8 model is obtained by improving the Yolov8 model, wherein the improvements include: replacing the convolution structure in the C2f module of the feature extractor of the Yolov8 model with a double convolution structure, adding an attention mechanism layer before the middle C2f module of the feature extractor of the Yolov8 model, and removing the small target detector and the medium target detector of the target detector of the Yolov8 model; the middle C2f module is a C2f module in the feature extractor of the Yolov8 model except the first C2f module and the last C2f module.
[0115] A feature point extraction module is used to extract features of the first laser line and the second laser line in the laser area image to obtain a first feature point, a second feature point and a third feature point; the first feature point is an end point of the first laser line; the second feature point is the other end point of the first laser line; the third feature point is the intersection of the first laser line and the second laser line.
[0116] A shield tail gap calculation module is used to calculate a first pixel distance of the wall thickness of the segment and a second pixel distance of the shield tail gap based on the pixel coordinates of the first feature point, the pixel coordinates of the second feature point and the pixel coordinates of the third feature point, and to calculate the true value of the shield tail gap based on the true value of the wall thickness of the segment, the first pixel distance and the second pixel distance; the shield tail gap is the distance between the outer wall of the segment and the inner wall of the tail of the shield machine.
[0117] As an optional embodiment, Fig.13 As shown, this embodiment provides a shield tail gap measuring device for a shield machine, comprising:
[0118] The first main module is used to obtain laser images of the tail of the shield machine at different shooting distances using image acquisition equipment at the engineering site.
[0119] The second main module is used to use the laser images obtained at the engineering site to produce a data set of the engineering application environment.
[0120] The third main module is used to train the improved Yolov8 model using the data set to obtain a trained target area extraction model.
[0121] The fourth main module is used to input the measured laser image into the trained target area extraction model and output the laser area image.
[0122] The fifth main module is used to process the output laser area image, eliminate interference features, and filter out related noise.
[0123] The sixth main module is used to extract the feature points of the first laser line and the second laser line in the laser area image after image processing, obtain the first feature point, the second feature point and the third feature point, and output the pixel coordinates of the first feature point, the second feature point and the third feature point, where the pixel coordinates refer to the coordinates of the first feature point, the second feature point and the third feature point in the laser area image.
[0124] The seventh main module is used to solve the first pixel distance of the wall thickness of the shield machine segment and the second pixel distance of the shield tail gap based on the pixel coordinates of the first feature point, the second feature point and the third feature point.
[0125] The eighth main module is used to multiply the ratio of the second pixel distance to the first pixel distance by the real value of the wall thickness of the shield machine segment to obtain the real value of the shield tail gap.
[0126] Example 3
[0127] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig.14 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store laser images. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the shield tail gap measurement method of the shield machine described in Example 1 is implemented.
[0128] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0129] In an exemplary embodiment, a computer device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the shield tail gap measurement method of the shield machine described in Example 1.
[0130] Example 4
[0131] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the shield tail gap measurement method of the shield machine described in Example 1 is implemented.
[0132] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0133] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for measuring the gap between the tail of a shield machine, characterized in that: The shield tail clearance measurement method of the shield machine comprises: Acquire a laser image of the tail of the shield machine; the laser image includes a laser area, and the laser area includes a first laser line and a second laser line, the first laser line is a laser line irradiated on the end surface of the segment at the tail of the shield machine when the shield machine head emits laser to the tail of the shield machine, and the second laser line is a laser line irradiated on the inner wall of the tail of the shield machine when the shield machine head emits laser to the tail of the shield machine; The laser image is used as input, and the laser area in the laser image is extracted using a trained target area extraction model to obtain a laser area image; the trained target area extraction model adopts an improved Yolov8 model, and the improved Yolov8 model is obtained by improving the Yolov8 model, and the improvement includes: replacing the convolution structure in the C2f module of the feature extractor of the Yolov8 model with a double convolution structure, adding an attention mechanism layer before the middle C2f module of the feature extractor of the Yolov8 model, and removing the small target detector and the medium target detector of the target detector of the Yolov8 model; the middle C2f module is a C2f module in the feature extractor of the Yolov8 model except the first C2f module and the last C2f module; Extracting features of the first laser line and the second laser line in the laser area image to obtain a first feature point, a second feature point and a third feature point; the first feature point is an end point of the first laser line; the second feature point is the other end point of the first laser line; the third feature point is an intersection point of the first laser line and the second laser line; Based on the pixel coordinates of the first feature point, the pixel coordinates of the second feature point, and the pixel coordinates of the third feature point, a first pixel distance of the wall thickness of the segment and a second pixel distance of the shield tail gap are calculated, and based on the true value of the wall thickness of the segment, the first pixel distance, and the second pixel distance, a true value of the shield tail gap is calculated; the shield tail gap is the distance between the outer wall of the segment and the inner wall of the tail of the shield machine; Extracting features of the first laser line and the second laser line in the laser area image to obtain a first feature point, a second feature point, and a third feature point specifically includes: Using the L-CNN algorithm to extract features of the first laser line and the second laser line in the laser area image to obtain a first feature point and a second feature point; The Hough algorithm is used to extract features of the first laser line and the second laser line in the laser area image to obtain a third feature point.
2. The shield tail clearance measurement method of a shield machine according to claim 1, characterized in that: Before extracting features from the first laser line and the second laser line in the laser area image, the shield tail clearance measurement method of the shield machine further includes: Binarizing the laser region image to obtain a black and white image; Performing filtering on the black-and-white image to obtain a filtered image; The first laser line and the second laser line in the filtered image are subjected to a stroke process to obtain a stroked image, and the stroked image is used as a new laser area image.
3. The shield tail clearance measurement method of a shield machine according to claim 2, characterized in that: Binarization processing is performed on the laser area image to obtain a black and white image, specifically including: Determine a grayscale distribution curve based on the grayscale value of each first pixel point in the laser area image, and determine a grayscale threshold based on the grayscale distribution curve; the grayscale distribution curve includes the number of first pixel points corresponding to different grayscale values; For each first pixel point in the laser area image, determine whether the grayscale value of the first pixel point is greater than the grayscale threshold; if so, adjust the grayscale value of the first pixel point to a first preset value; if not, adjust the grayscale value of the first pixel point to a second preset value to perform binarization processing to obtain a black and white image.
4. The shield tail clearance measurement method of a shield machine according to claim 2, characterized in that: Performing filtering on the black-and-white image to obtain a filtered image specifically includes: For each second pixel in the black-and-white image, determining whether the grayscale value of the second pixel is a first preset value, and obtaining a first determination result; If the first judgment result is no, setting the grayscale value of the second pixel point to a second preset value; If the first judgment result is yes, determine whether there are A target pixel points in the local area corresponding to the second pixel point, and obtain a second judgment result; the local area is an area with the second pixel point as the center point and a side length of 3 pixels; A is 0 or 1; the target pixel point is a pixel point in the local area except the second pixel point whose grayscale value is a first preset value; If the second judgment result is yes, setting the grayscale value of the second pixel point to a second preset value; If the second judgment result is no, then judging whether there are B target pixel points in the local area corresponding to the second pixel point, and obtaining a third judgment result; B is 2, 3 or 4; If the third judgment result is no, setting the grayscale value of the second pixel point to a first preset value; If the third judgment result is yes, determine whether there are two adjacent target pixels among the B target pixels; if so, set the grayscale value of the second pixel to the first preset value; if not, set the grayscale value of the second pixel to the second preset value.
5. The shield tail clearance measurement method of a shield machine according to claim 2, characterized in that: Performing a stroke process on the first laser line and the second laser line in the filtered image to obtain a stroked image specifically includes: The first laser line and the second laser line in the filtered image are subjected to a stroke process by using an LSD algorithm to obtain a stroked image.
6. The shield tail clearance measurement method of a shield machine according to claim 1, characterized in that: Based on the pixel coordinates of the first feature point, the pixel coordinates of the second feature point, and the pixel coordinates of the third feature point, a first pixel distance of the wall thickness of the tube segment and a second pixel distance of the shield tail gap are calculated, and based on the true value of the wall thickness of the tube segment, the first pixel distance, and the second pixel distance, a true value of the shield tail gap is calculated, specifically including: Based on the pixel coordinates of the first feature point and the pixel coordinates of the second feature point, a distance between the first feature point and the second feature point is calculated to obtain a first pixel distance of the wall thickness of the tube segment; Based on the pixel coordinates of the second feature point and the pixel coordinates of the third feature point, calculating the distance between the second feature point and the third feature point to obtain a second pixel distance of the shield tail gap; The ratio of the second pixel distance to the first pixel distance is calculated, and the product of the ratio and the true value of the wall thickness of the tube segment is calculated to obtain the true value of the shield tail gap.
7. A shield tail gap measuring device for a shield machine, characterized in that: The shield tail gap measuring device of the shield machine comprises: An image acquisition module is used to acquire a laser image of the tail of the shield machine; the laser image includes a laser area, and the laser area includes a first laser line and a second laser line. The first laser line is a laser line irradiated on the end surface of the pipe segment at the tail of the shield machine when the shield machine head emits laser to the tail of the shield machine, and the second laser line is a laser line irradiated on the inner wall of the tail of the shield machine when the shield machine head emits laser to the tail of the shield machine; A laser region extraction module is used to extract the laser region in the laser image using the laser image as input and to obtain a laser region image by using a trained target region extraction model; the trained target region extraction model adopts an improved Yolov8 model, and the improved Yolov8 model is obtained by improving the Yolov8 model, wherein the improvement includes: replacing the convolution structure in the C2f module of the feature extractor of the Yolov8 model with a double convolution structure, adding an attention mechanism layer before the middle C2f module of the feature extractor of the Yolov8 model, and removing the small target detector and the medium target detector of the target detector of the Yolov8 model; the middle C2f module is a C2f module in the feature extractor of the Yolov8 model except the first C2f module and the last C2f module; A feature point extraction module is used to extract features of the first laser line and the second laser line in the laser area image to obtain a first feature point, a second feature point and a third feature point; the first feature point is an end point of the first laser line; the second feature point is the other end point of the first laser line; the third feature point is the intersection of the first laser line and the second laser line; a shield tail gap calculation module, for calculating a first pixel distance of the wall thickness of the segment and a second pixel distance of the shield tail gap based on the pixel coordinates of the first feature point, the pixel coordinates of the second feature point and the pixel coordinates of the third feature point, and calculating a true value of the shield tail gap based on the true value of the wall thickness of the segment, the first pixel distance and the second pixel distance; the shield tail gap is the distance between the outer wall of the segment and the inner wall of the tail of the shield machine; Extracting features of the first laser line and the second laser line in the laser area image to obtain a first feature point, a second feature point, and a third feature point specifically includes: Using the L-CNN algorithm to extract features of the first laser line and the second laser line in the laser area image to obtain a first feature point and a second feature point; The Hough algorithm is used to extract features of the first laser line and the second laser line in the laser area image to obtain a third feature point.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the shield tail gap measurement method of any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the shield tail gap measurement method of any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Underwater structure disease identification method and system, and storage medium
CN117011688A
Defect detection method, device and system and storage medium
CN117664984A