A railway tunnel disease detection method, system, device and medium
By using mixed-resolution image acquisition and dynamic precision coefficient matrix calibration, the problem of isomorphic camera design being unable to adapt to mixed-resolution hardware architecture has been solved, achieving high precision and low cost in railway tunnel defect detection and enabling real-time detection in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA TIESIJU CIVIL ENGINEERING GROUP CO LTD
- Filing Date
- 2026-03-24
- Publication Date
- 2026-06-23
Smart Images

Figure CN122265783A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and rail transit maintenance technology, specifically relating to a method, system, equipment and medium for detecting defects in railway tunnels. Background Technology
[0002] With the continuous increase in the operational mileage of urban rail transit, higher requirements are being placed on the daily maintenance and defect detection of tunnel internal structures. Currently, machine vision-based intelligent tunnel inspection vehicles have become mainstream equipment. Their core lies in using high-speed line-scan cameras to acquire high-resolution images of the tunnel surface and then automatically identifying and quantitatively analyzing defects such as cracks, seepage, and spalling through image processing algorithms and artificial intelligence models. In existing technological systems, tunnel inspection vision systems typically employ a homogeneous hardware architecture, i.e., equipped with multiple (usually eight) identical line-scan cameras (e.g., all 8K resolution) to cover the entire tunnel cross-section. The accompanying image stitching algorithms, defect detection models, and physical parameter measurement algorithms are usually custom-trained and hard-coded for this specific resolution. While this highly coupled hardware and software approach is stable in a single scenario, it lacks flexibility and scalability.
[0003] With the iterative updates of sensor technology and the dual pursuit of cost control and detection accuracy in engineering applications, inspection systems are facing the need to upgrade to a heterogeneous hybrid resolution architecture. Specifically, to capture minute cracks in critical areas (such as arches and rail surfaces), higher resolution cameras (e.g., 16K) are required; while in non-critical edge areas, to reduce data transmission bandwidth and hardware costs, lower resolution cameras (e.g., 4K) can be used, and the total number of cameras can be optimized and reduced (e.g., from 8 to 6). However, existing software systems designed for homogeneous cameras cannot directly adapt to this hybrid resolution hardware architecture, and directly accessing image data of different specifications faces the following significant technical barriers:
[0004] AI model adaptation failure: Existing deep learning detection models typically require a fixed input size. If images of different resolutions are directly input, significant scaling or cropping is necessary. This can not only cause the model to fail due to changes in feature scale, but also lead to the loss of subtle crack features captured by high-resolution cameras due to crude downsampling, negating the purpose of hardware upgrades.
[0005] Multi-view stitching misalignment: Traditional image stitching algorithms often rely on the assumption of fixed pixel offsets. Under mixed resolution, the physical size (pixel equivalent) represented by a unit pixel is no longer consistent in images acquired by different cameras. Direct stitching will lead to severe geometric misalignment and scale imbalance in the overlapping areas of the images, making it impossible to generate a coherent tunnel panorama.
[0006] Errors in physical parameter calculation: The calculation of physical indicators of defects (such as crack length and area) and mileage location information is highly dependent on the "pixel-physical size" mapping relationship. In existing systems, this mapping relationship is usually treated as a global constant. When the system uses cameras of different resolutions, the horizontal (X-axis) and vertical (Y-axis) pixel precision of the images become separated and different. Using the original algorithm will lead to huge deviations in the calculation results of core data such as crack length, area, and mileage location, rendering them unusable for engineering reference.
[0007] Accumulated offset in mileage positioning: Railway inspection systems typically rely on high-precision encoders mounted on wheels to obtain the mileage coordinates of defects. However, in actual operation, tunnel track surfaces are often covered with oil, water, or frost. Inspection vehicles are prone to wheel slippage or spinning during high-speed travel or acceleration / deceleration, causing a disconnect between encoder pulse counts and actual displacement. Furthermore, encoders have inherent cumulative errors in long-distance measurements; as the inspection distance increases, the virtual mileage coordinates generated by the system will exhibit non-linear offsets. If this positioning deviation is not corrected in time, the physical location corresponding to the defect detection results will deviate significantly from the actual location, posing significant challenges to subsequent manual verification and engineering remediation work. Summary of the Invention
[0008] This invention aims to solve the problem that existing software systems for isomorphic camera designs cannot directly adapt to hardware architectures with mixed resolutions.
[0009] The present invention solves the above-mentioned technical problems through the following technical means: A method for detecting defects in railway tunnels, comprising: S1. Simultaneously acquire image data from multiple line scan cameras, including at least two cameras with different physical resolutions; S2. Normalize the acquired mixed resolution images to obtain normalized image frames; S3. Use normalized image frames to locate diseases. For the suspected disease areas located, backtrack to the original high-resolution image data for refined feature extraction and measurement. S4. Based on the original physical parameters and scaling ratio of each camera, construct a dynamic accuracy coefficient matrix and calculate the pixel coordinates of the detection results into the true physical size and mileage information. S5. Based on the preset overlap range, the edge region of interest is cut off for adjacent normalized image frames, feature point matching is performed in the edge region of interest to calculate the dynamic offset, and the image is fused and stitched based on the offset. S6. To address the positioning drift problem caused by wheel slippage or encoder cumulative errors during long-distance inspections, a multi-source data fusion mechanism is introduced.
[0010] This application breaks through the traditional reliance on homogeneous camera arrays for tunnel inspection, allowing the mixed use of high-resolution (e.g., 16K) and conventional-resolution (e.g., 4K) cameras. High-precision cameras can be used in critical defect areas such as the arch, while low-precision cameras can be used in edge areas. This significantly reduces the overall system bandwidth pressure and hardware cost, and solves the problem that the software system of existing homogeneous camera designs cannot be directly adapted to the hardware architecture of mixed resolutions.
[0011] Preferably, the specific process of the mixed resolution normalization preprocessing in step S2 includes: […]. The raw image data stream from camera number 1 is recorded as follows: Its width is denoted as Set virtual standard resolution ,like ≠ Then the bilinear interpolation function is called for scaling; for the coordinates in the target image Using the formula: Calculate pixel value In the formula The corresponding coordinates are respectively , , , .
[0012] Preferably, the specific process of dual-channel parallel defect detection in step S3 includes: for crack defects, using cascaded crack detection based on resolution pyramid; and normalizing the image... Press M The grid is divided into N grids, and overlapping regions are set between adjacent slices. The slices are input into a deep learning model to obtain the disease bounding box, and the target coordinates are output. Using formulas and The coordinates are restored; NMS (Non-Maximum Suppression) is applied to the restored global coordinate frame, and settings are set. Intersection over Union (IoU) thresholding is used to remove redundant bounding boxes; a coordinate mapping matrix is constructed based on the resolution ratio between the normalized image and the original image, using the following mapping formula: , , The mapping matrix is used to map the disease bounding box to the original image coordinate system, and a local image at the original resolution is extracted. An edge detection algorithm is performed on the local image at the original resolution to calculate the sub-pixel-level geometric parameters of the disease. For seepage and spalling diseases, seepage and spalling detection based on full-image scaling is adopted. The normalized image is then processed. Maintain aspect ratio and scale to the model input scale, filling the gray border; input the segmentation network, output the lesion mask and bounding box; linearly map the results in the target coordinate system output by the model back to the original coordinate system according to the scaling factor; where: These are the local pixel coordinates of the disease within the current slice image; The column and row indices (starting from 0) of the current slice in the M×N grid. These are the width and height pixel values of the slice, respectively; The width of the overlap pixels between adjacent slices; To restore the normalized full image Global pixel coordinates in For the first The original horizontal resolution of the camera. This is a virtual standard width; These are the single-frame heights of the original image and the normalized image, respectively.
[0013] Subpixel calculation details: Edge pixels are extracted using the Sobel operator or Canny algorithm, and the Zernike moment algorithm or Gaussian surface fitting method is used to perform subpixel-level positioning of the edges to obtain crack width features that are superior to the original pixel resolution.
[0014] Preferably, the specific process of physical quantity calibration based on dynamic accuracy coefficient in step S4 includes: firstly, using the formula Calculate the lateral accuracy coefficient For physical resolutions lower than For cameras with a resolution higher than [specific value], the coefficient is the native precision divided by the scaling factor; for cameras with a physical resolution higher than [specific value], the coefficient is the native precision divided by the scaling factor. For the camera, the coefficients are the native precision multiplied by the scaling factor; then, the longitudinal precision coefficients are constructed. : Keep the camera's native line scanning accuracy unchanged; Where: lateral accuracy coefficient Indicates the first The actual horizontal physical length (unit: mm / pixel) represented by each pixel in the normalized image from camera number 1, and the vertical accuracy coefficient. Indicates the first The physical distance traveled for each scan line of the camera. For the first The actual physical width (mm) covered by camera number 1 on the tunnel surface.
[0015] Preferably, the physical quantity calibration process based on dynamic accuracy coefficient described in step S4 further includes: first using the formula: Calculate the width of the disease, then use the formula Calculate the length of the disease using the formula. Calculate the actual mileage; finally, use the formula. Calculate the actual area of the disease; where: Indicates the true physical width of the disease. These represent the pixel width and pixel height of the bounding rectangle of the lesion in the image, respectively. Indicates To collect the actual mileage of the starting point, This is the sequence number of the current image frame; The pixel height of each frame of the image; This represents the vertical pixel coordinates of the disease center within the current frame; dividing by 1000 converts millimeters to meters. This represents the total number of pixels with non-zero pixel values in the defect mask.
[0016] Preferably, the specific process of the dynamic stitching algorithm based on ROI (Region of Interest) feature fusion described in step S5 includes: two adjacent normalized images, defined as the preceding image. and subsequent images The process involves extracting strip images of predetermined widths from the right boundary of the previous image and the left boundary of the next image; extracting feature descriptors from the two strip images and matching them; calculating the average translation vector after removing mismatched points using the RANSAC algorithm; if feature matching is successful, using the calculated translation vector as the stitching coordinates; if feature matching fails, using preset fixed physical overlap parameters as backup stitching coordinates; after determining the precise stitching position, a weighted average fusion algorithm is used to eliminate stitching seams caused by color and exposure differences between the two images; the width of the overlapping region is defined as... For any pixel within the overlapping region The merged pixel values for: The weighting function The abscissa decays linearly or in an S-shape from 0 to 1, achieving a smooth transition from the preceding image to the following image; where: The weighted fusion factor is preferably calculated using the following method: or linear function ,in Let the horizontal relative position of the pixels within the overlapping area enable the seam to be aligned from... arrive Seamless transition; This represents the merged pixel values; These represent the original pixel values of the preceding and following images within the overlapping region, respectively.
[0017] Preferably, the specific process of dynamic mileage error calibration based on semantic anchors in step S6 includes: constructing a road sign semantic recognition model, identifying mileage signs containing absolute position information or segment joints with fixed spacing features as semantic anchors in the normalized image; when a semantic anchor is identified, obtaining its true physical mileage, and using the formula... The difference between this value and the current visual cumulative mileage calculated based on the encoder is used to obtain the cumulative drift error; based on the cumulative drift error, the following is used... The historical disease location data between this anchor point and the previous anchor point are retrospectively corrected; where: The absolute deviation between the visually recognized mileage and the actual mileage at the anchor point; The system calculates mileage when the current anchor point is identified; The actual physical mileage marked on the anchor point sign; The corrected mileage of the damage; The physical mileage of the previous calibrated anchor point; This indicates the original mileage of the defect that needs to be corrected.
[0018] Preferably, the present invention also provides a system for the aforementioned railway tunnel defect detection method, comprising: An image acquisition module is used to simultaneously acquire image data from multiple line scan cameras, including at least two cameras with different physical resolutions. The normalization processing module is used to perform normalization preprocessing on the acquired mixed resolution images to obtain normalized image frames; The disease detection module is used to locate diseases using normalized image frames. For suspected disease areas located, it backtracks to the original high-resolution image data for fine feature extraction and measurement. The physical quantity calibration module is used for physical quantity calibration calculation based on dynamic accuracy coefficients. It constructs a dynamic accuracy coefficient matrix based on the original physical parameters and scaling ratio of each camera, and calculates the pixel coordinates of the detection results into the true physical size and mileage information. The dynamic stitching module is used for dynamic stitching calculation based on ROI feature fusion. Based on the preset overlap range, it performs edge region of interest cropping on adjacent normalized image frames, performs feature point matching in the edge region of interest to calculate the dynamic offset, and performs image fusion stitching based on the offset. The mileage error calibration module is used for dynamic calibration of mileage error based on semantic anchor points. It introduces a multi-source data fusion mechanism to address the positioning drift problem caused by wheel slippage or encoder cumulative error during long-distance inspections.
[0019] Preferably, the present invention also provides an apparatus for the railway tunnel defect detection method described above, comprising at least one processor and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor can execute the railway tunnel defect detection method by calling the program instructions.
[0020] Preferably, the present invention also provides a computer-readable storage medium for the railway tunnel defect detection method described above, characterized in that the computer-readable storage medium stores computer instructions that cause the computer to execute the railway tunnel defect detection method described above.
[0021] The advantages of this invention are: (1) High detection accuracy and cost balance: In railway or subway tunnel inspection, the requirements for crack accuracy in key areas such as the arch and rail surface are usually higher than those in the sidewall area. This application allows for the configuration of cameras with different resolutions for different parts of the tunnel (e.g., 16K for the core area and 4K for the edge area). This method can effectively reduce the total bandwidth requirement and storage load of the system data transmission while ensuring the detection quality of key areas. (2) Resolving the contradiction between model input limitations and feature preservation: Deep learning detection models typically require low-resolution input sizes, and directly scaling the high-resolution full image can lead to the loss of features of minor defects. This application uses a mechanism of "normalized coarse localization + original image backtracking for fine measurement" to enable the system to extract sub-pixel-level features from the original high-resolution image while performing fast detection using low-resolution images. This ensures the reliability of the accuracy of detecting minor cracks and avoids the missed detection problem caused by global downsampling in traditional algorithms. (3) Ensuring geometric consistency under heterogeneous data: Under a hybrid resolution architecture, the pixel equivalent (i.e., the physical size represented by a single pixel) of cameras of different specifications varies. This application introduces a dynamic precision coefficient matrix to normalize the data from different cameras at the same physical scale, ensuring the proportional coordination of the panoramic stitched images. In later engineering maintenance, it can provide accurate quantitative indicators such as the length and area of defects, providing a unified physical reference standard for tunnel health status evaluation; (4) Improve the processing efficiency of long-distance high-resolution images: For the large-scale image data generated during the operation of the track inspection vehicle, this application adopts a dynamic stitching strategy based on ROI cutting. By narrowing the search range of feature point matching, the amount of computation in the image stitching process is significantly reduced. This optimization enables the system to adapt to higher inspection vehicle speeds, meet the real-time requirements of data processing, and reduce the performance dependence on onboard computing resources; (5) Improve positioning reliability in complex operating environments: In enclosed track environments such as tunnels, mileage positioning often deviates due to wheel slippage or the cumulative error of the encoder itself. This application utilizes the semantic anchor points of the mileage markers identified during the inspection process for error backtracking correction. This mechanism can effectively eliminate positioning drift, making the mileage positioning information of the fault more accurate, and facilitating the rapid and accurate arrival of maintenance personnel at the fault site. Attached Figure Description Figure 1 This is a flowchart of the railway tunnel defect detection method based on a hybrid resolution linear array camera according to the first embodiment of the present invention. Figure 2 This is a flowchart of the dual-scale cascaded detection algorithm of the first embodiment of the present invention; Figure 3 This is a flowchart of the ROI-based dynamic stitching algorithm of the first embodiment of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] Example 1: See Figure 1 This application provides an intelligent detection method for railway tunnel defects. The specific steps of the detection method include: S1. Mixed resolution image acquisition: Simultaneously acquire image data from multiple line scan cameras, wherein the cameras contain at least two different physical resolutions; The specific process of S1 is as follows: Configure N line scan cameras (6 in this embodiment), wherein some cameras are at the first resolution (cameras 1 and 6 in this embodiment, with a resolution of 4K), and some cameras are at the second resolution (cameras 2, 3, 4, and 5 in this embodiment, with a resolution of 16K).
[0024] S2. Hybrid resolution normalization preprocessing: Set a virtual standard resolution. The acquired images at different resolutions are scaled in real time and then uniformly converted to a width of [missing value]. The normalized image frame is obtained while retaining the original high-resolution image data; the specific process of S2 is as follows: input the first normalized image frame, while retaining the original high-resolution image data; the specific process of S2 is: input the first Raw image data stream from camera No. 1 Its width is The height is (8192 in this example), default standard processing width =8192 (i.e., virtual standard resolution is 8K), read Obtain the original width from the header information. ;like ≠ Then, the bilinear interpolation function is called for scaling; for the coordinates in the target image Its pixel value From the four nearest neighbor pixels in the source image , , , The weighted calculation yields:
[0025] for Cameras with a resolution of 4096 (such as cameras 1 and 6) undergo a 2x upsampling; for Cameras with a resolution of 16384 (e.g., cameras 2-5) undergo a 0.5x downsampling; output: a normalized image with uniform specifications. The dimensions are 8192 pixels wide and 120 pixels high. H (Here, 8192 refers to the horizontal pixels in industrial linear arrays; for convenience, this example uses 8K instead.) H Also set to 8192); The purpose of step S2 is to solve the data compatibility problem of cameras with different hardware specifications (4K and 16K). The system performs normalization during the memory loading stage.
[0026] S3. Dual-channel parallel disease detection: Rapid disease localization is achieved using normalized image frames. For suspected disease areas, the original high-resolution image data is used for refined feature extraction and measurement. The specific process of step S3 includes: (See...) Figure 2 The normalized image is processed using a dual-threaded pipeline, and cascaded detection is performed in conjunction with the original data. Specifically, for defects such as cracks (channel A), a cascaded crack detection method based on a resolution pyramid is adopted: first, coarse localization is performed; that is, to prevent the loss of fine crack features due to scaling during the normalization process, a dynamic piecewise detection strategy is adopted to divide the normalized image into pieces. Press M N grids are used for segmentation (M=N=7 in this embodiment); slice width ,high Set overlapping area To prevent the diseased target from being cut off, overlapping areas are set between adjacent slices. (In this embodiment) , (Originally obtained from experiments); the slices are input into a deep learning detection model, and the target coordinates are output. and using the formula , Perform coordinate restoration.
[0027] Since overlapping regions may cause the same crack to be detected multiple times, non-maximum suppression (NMS) is applied to the restored global frame, setting... A threshold of 0.45 (selected based on actual conditions) is used to remove redundant bounding boxes. After coarse localization, fine-grained measurements are performed: for detected crack boxes, a coordinate mapping operator is constructed to map them back from the normalized coordinate system to the original image coordinate system. The mapping formula is as follows: , , , In the formula, Normalized images The center coordinates, width, and height of the disease frame; For the first The original horizontal resolution of the camera. This is a virtual standard width; These are the single-frame heights of the original image and the normalized image, respectively.
[0028] Subsequently, from the original high-resolution image Based on the mapped coordinates Extract the corresponding area ,exist Skeletonization and edge detection are performed on the first image to calculate the pixel-level width and length of the crack. For defects such as water seepage and spalling (set as channel B), a water seepage and spalling detection method based on full-image scaling is adopted: first, the original high-resolution image is... Maintain the aspect ratio and scale to the model input scale (e.g., 1024×1024), fill the gray border; then input the segmentation network to output the mask and bounding box of the lesion; finally, linearly map the results of the model output in the 640×640 coordinate system back to the original coordinate system according to the scaling factor Scale.
[0029] S4. Physical quantity calibration based on dynamic accuracy coefficients: A dynamic accuracy coefficient matrix is constructed based on the original physical parameters and scaling ratios of each camera, and the pixel coordinates of the detection results are inversely calculated into the true physical size and odometer information. The specific process of S4 is as follows: First, using the formula... Calculate the lateral accuracy coefficient (For 4K cameras (stretched):) For 16K cameras (compressed): Longitudinal accuracy coefficient It maintains the original precision (such as 0.28, 0.21, etc.) and is not affected by Resize.
[0030] If a lesion box is detected on the normalized image, its pixel width is The height is The central ordinate is The frame number is Actual mileage calculation algorithm: True length of the disease: True width of the disease: Simultaneously, by utilizing two different precision coefficients, one horizontal and one vertical, the area error caused by non-square pixels is corrected by statistically analyzing the total number of non-zero pixels in the segmentation mask. Calculate the actual area of the disease: In the formula Indicates the first The horizontal accuracy coefficient of the camera, in millimeters per pixel; Indicates the first The actual physical width of the tunnel surface covered by the camera; This indicates the set virtual standard resolution width; Indicates the actual physical width of the disease; These represent the pixel height and pixel width of the bounding rectangle of the lesion, respectively. This represents the actual physical mileage corresponding to the disease; Indicates the starting mileage of the inspection; Indicates the image frame number; Indicates the pixel height of a single frame image; This represents the vertical coordinate pixel value of the disease center within the current frame; Indicates the longitudinal accuracy coefficient; This represents the actual physical area of the disease. This represents the total number of non-zero pixels within the defect mask.
[0031] S5. Dynamic stitching algorithm based on ROI feature fusion: Based on a preset overlap range, adjacent normalized image frames are cropped at the edge ROI. Feature points are matched within the ROI region to calculate the dynamic offset, and image fusion and stitching are performed based on this offset. The specific process of S5 is as follows: (See...) Figure 3 Since the physical installation positions of adjacent cameras are relatively fixed, their image overlap range is roughly known. To reduce the computational load of full-image feature matching on 8K ultra-high resolution images, ROI cropping is performed first: two adjacent normalized images are defined as the preceding images. and subsequent images And estimate the overlap width. (e.g., 500 pixels), and search redundancy margin. (e.g., 100 pixels), from Cut out the width from the far right. The stripe, denoted as ,from Cut out the width from the far left. The stripe, denoted as Then cut out and Perform feature matching to calculate accurate pixel offsets: Detect using either the Accelerated Robust Features (SURF) or Oriented Fast Rotation (ORB) algorithm. and The feature points in the data are analyzed and feature descriptors are calculated. A fast nearest neighbor search (such as FLANN) is used to match the two sets of descriptors. Matching pairs with a distance ratio greater than a threshold (such as 0.75) are removed.
[0032] Since linear scan camera images primarily involve translation transformations, the Random Sample Consensus (RANSAC) algorithm is used to calculate the optimal homography matrix or affine transformation matrix. Outliers that do not conform to the translation model are removed, and the mean of the coordinate differences of all interior point matching pairs is calculated to obtain the dynamic correction offset of the subsequent image relative to the preceding image. , , If there are too few feature points, resulting in a matching failure (such as a solid-color wall), the system will automatically backtrack and use a preset fixed offset. Finally, after determining the precise stitching position, a weighted average fusion algorithm was used to eliminate the stitching lines caused by color differences and exposure differences between the two images: the width of the overlapping area was defined as... (Depend on (Confirmed), for any pixel within the overlapping region The merged pixel values for: The weighting function The abscissa decreases linearly or in an S-shape from 0 to 1, achieving a smooth transition from the preceding image to the following image; where This represents the merged pixel values; These represent the original pixel values of the preceding and following images within the overlapping region, respectively. Indicates the relationship with the x-axis Changing weighting factors; Indicates the merging width of the overlapping area.
[0033] Step S5, to eliminate image misalignment caused by camera installation errors and vehicle vibrations, employs a "coarse positioning and cropping + refined feature matching" strategy, expanding the feature matching search space from... Reduced to approximately The computational workload was reduced by more than 90%, enabling real-time processing.
[0034] S6. Dynamic calibration of mileage error based on semantic anchor points: To address the positioning drift problem caused by wheel slippage or encoder cumulative error during long-distance inspections, a multi-source data fusion mechanism is introduced. The specific process of S6 is as follows: This embodiment uses visually recognized environmental features as "soft sensors" and fuses them with encoder data to correct mileage drift. In the normalized image stream, a lightweight target detection network is run in parallel, specifically for identifying two types of features: explicit anchor points and implicit anchor points. Explicit anchor points are mileage markers on the tunnel wall, whose absolute physical mileage is obtained through OCR recognition. Implicit anchor points are tunnel segment joints. Given the standard segment width, the physical mileage is estimated by counting the number of joints. Then, the error is calculated: assuming the current frame... The mileage marker was identified, and its OCR result was: Calculate the cumulative drift error Assume the previous calibration anchor point appeared in frame 1. Drift error is considered to accumulate linearly with distance, for intervals... All disease mileage within Using formula Make corrections; in the formula Indicates the cumulative drift error; This represents the cumulative visual mileage when the current anchor point is identified. Indicates the actual physical mileage corresponding to the anchor point; This indicates the corrected mileage for locating the disease. Indicates the original mileage of the defect that needs to be corrected; It represents the actual physical mileage of the previous semantic anchor point.
[0035] In step S6, the nonlinear cumulative error of long-distance inspection is discretized into several short intervals of linear error and eliminated one by one.
[0036] Example 2: This embodiment, based on Embodiment 1, also provides a railway tunnel defect detection system corresponding to the above-described railway tunnel defect detection method, including... The image acquisition module is used to simultaneously acquire image data from multiple line scan cameras, including at least two cameras with different physical resolutions. In this embodiment, six cameras are used, two of which are at the first resolution (cameras 1 and 6 in this embodiment, with a resolution of 4K), and four cameras are at the second resolution (cameras 2, 3, 4, and 5 in this embodiment, with a resolution of 16K. The specific number and resolution of cameras are selected according to the actual situation). The normalization processing module is used to perform normalization preprocessing on the acquired mixed-resolution images to obtain normalized image frames; for this embodiment, for Cameras with a resolution of 4096 (such as cameras 1 and 6) undergo a 2x upsampling; for Cameras with a resolution of 16384 (e.g., cameras 2-5) undergo a 0.5x downsampling; output: a normalized image with uniform specifications. Its horizontal pixel width is 8192 and its height is H (8192 in this embodiment). The disease detection module is used to locate diseases using normalized image frames. For suspected disease areas located, it backtracks to the original high-resolution image data for fine feature extraction and measurement. The physical quantity calibration module is used for physical quantity calibration calculation based on dynamic accuracy coefficients. It constructs a dynamic accuracy coefficient matrix based on the original physical parameters and scaling ratio of each camera, and calculates the pixel coordinates of the detection results into the true physical size and mileage information. The dynamic stitching module is used for dynamic stitching calculation based on ROI feature fusion. Based on the preset overlap range, it performs edge region of interest cropping on adjacent normalized image frames, performs feature point matching in the edge region of interest to calculate the dynamic offset, and performs image fusion stitching based on the offset. The mileage error calibration module is used for dynamic calibration of mileage error based on semantic anchor points. It introduces a multi-source data fusion mechanism to address the positioning drift problem caused by wheel slippage or encoder cumulative error during long-distance inspections.
[0037] This application presents a method for detecting defects in railway tunnels. Logically, it constructs a closed-loop architecture encompassing heterogeneous data source processing (S1-S2), multi-scale target detection (S3), heterogeneous coordinate space mapping (S4), dynamic geometric stitching (S5), and long-distance positioning closed-loop calibration (S6). This architecture not only solves the data inconsistency problem caused by mixed resolutions but also compensates for the potential accuracy loss caused by hardware downgrading through software algorithms, achieving automated, high-precision, and highly reliable detection of tunnel defects in complex heterogeneous sensing environments.
[0038] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Terms such as "upper," "lower," "left," "right," "front," and "rear" used in the invention are merely for clarity of description and are not intended to limit the scope of the invention. Changes or adjustments to their relative relationships, without substantially altering the technical content, should also be considered within the scope of the invention.
[0039] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting defects in railway tunnels, characterized in that, include: S1. Simultaneously acquire image data from multiple line scan cameras, including at least two cameras with different physical resolutions; S2. Normalize the acquired mixed resolution images to obtain normalized image frames; S3. Use normalized image frames to locate diseases. For the suspected disease areas located, backtrack to the original high-resolution image data for refined feature extraction and measurement. S4. Based on the original physical parameters and scaling ratio of each camera, construct a dynamic accuracy coefficient matrix and calculate the pixel coordinates of the detection results into the true physical size and mileage information. S5. Based on the preset overlap range, the edge region of interest is cut off for adjacent normalized image frames, feature point matching is performed in the edge region of interest to calculate the dynamic offset, and the image is fused and stitched based on the offset. S6. To address the positioning drift problem caused by wheel slippage or encoder cumulative errors during long-distance inspections, a multi-source data fusion mechanism is introduced.
2. The method for detecting defects in railway tunnels according to claim 1, characterized in that, Step S2, the specific process of mixed resolution normalization preprocessing includes: ... The raw image data stream from camera number 1 is recorded as follows: Its width is denoted as Set virtual standard resolution ,like ≠ Then the bilinear interpolation function is called for scaling; for the coordinates in the target image Using the formula: Calculate pixel value In the formula The corresponding coordinates are respectively , , , .
3. The method for detecting defects in railway tunnels according to claim 1, characterized in that, The specific process of dual-channel parallel defect detection described in step S3 includes: for crack defects, cascaded crack detection based on resolution pyramid is adopted; the normalized image is... Press M The grid is divided into N grids, and overlapping regions are set between adjacent slices. The slices are input into a deep learning model to obtain the disease bounding box, and the target coordinates are output. Using formulas and The coordinates are restored; non-maximum suppression is applied to the restored global coordinate frame, and the following settings are applied: Thresholding is applied to remove redundant bounding boxes; based on the resolution ratio between the normalized image and the original image, a coordinate mapping matrix is constructed, with the mapping formula as follows: , , The mapping matrix is used to map the disease bounding box to the original image coordinate system, and a local image at the original resolution is extracted. An edge detection algorithm is then performed on the local image at the original resolution to calculate the sub-pixel level geometric parameters of the disease. Where... These are the local pixel coordinates of the disease within the current slice image; Provide the column and row indices of the current slice in the M×N grid; These are the width and height pixel values of the slice, respectively; The width of the overlap pixels between adjacent slices; To restore the normalized full image Global pixel coordinates in For the first The original horizontal resolution of the camera. This is a virtual standard width; These are the single-frame heights of the original image and the normalized image, respectively; for seepage and spalling defects, seepage and spalling detection is based on full-image scaling; the normalized image... Maintain the aspect ratio and scale to the model input scale, then fill the gray border; input the segmentation network and output the lesion mask and bounding box; linearly map the results in the target coordinate system output by the model back to the original coordinate system according to the scaling factor Scale.
4. The method for detecting defects in railway tunnels according to claim 1, characterized in that, The specific process of physical quantity calibration based on dynamic accuracy coefficient described in step S4 includes: firstly, using the formula Calculate the lateral accuracy coefficient For physical resolutions lower than For cameras with a resolution higher than [specific value], the coefficient is the native precision divided by the scaling factor; for cameras with a physical resolution higher than [specific value], the coefficient is the native precision divided by the scaling factor. For the camera, the coefficients are the native precision multiplied by the scaling factor; then, the longitudinal precision coefficients are constructed. : Maintain the camera's native line scanning accuracy unchanged; where the lateral accuracy coefficient is... Indicates the first In the normalized image, each pixel of the camera represents the actual horizontal physical length, and the vertical accuracy coefficient is... Indicates the first The physical distance traveled for each scan line of the camera. For the first The actual physical width of the area covered by the camera on the tunnel surface.
5. The method for detecting defects in railway tunnels according to claim 4, characterized in that, The specific process of physical quantity calibration based on dynamic accuracy coefficient described in step S4 also includes: first using the formula: Calculate the width of the disease, then use the formula Calculate the length of the disease using the formula. Calculate the actual mileage; finally, use the formula. Calculate the actual area of the disease; where Indicates the actual physical width of the disease; These represent the pixel height and pixel width of the bounding rectangle of the lesion, respectively. This represents the actual physical mileage corresponding to the disease; Indicates the starting mileage of the inspection; Indicates the image frame number; Indicates the pixel height of a single frame image; This represents the vertical coordinate pixel value of the disease center within the current frame; This represents the actual physical area of the disease. This represents the total number of non-zero pixels within the defect mask.
6. The method for detecting defects in railway tunnels according to claim 1, characterized in that, The specific process of the dynamic stitching algorithm based on ROI feature fusion described in step S5 includes: two adjacent normalized images are defined as preceding images. and subsequent images The process involves extracting strip images of predetermined widths from the right boundary of the previous image and the left boundary of the next image; extracting feature descriptors from the two strip images and matching them; calculating the average translation vector after removing mismatched points using the RANSAC algorithm; if feature matching is successful, using the calculated translation vector as the stitching coordinates; if feature matching fails, using preset fixed physical overlap parameters as backup stitching coordinates; after determining the precise stitching position, a weighted average fusion algorithm is used to eliminate stitching seams caused by color and exposure differences between the two images; the width of the overlapping region is defined as... For any pixel within the overlapping region The merged pixel values for: The weighting function The abscissa decreases linearly or in an S-shape from 0 to 1, achieving a smooth transition from the preceding image to the following image; where This represents the merged pixel values; These represent the original pixel values of the preceding and following images within the overlapping region, respectively. Indicates the relationship with the x-axis Changing weighting factors; Indicates the merging width of the overlapping area.
7. The method for detecting defects in railway tunnels according to claim 1, characterized in that, The specific process of dynamic mileage error calibration based on semantic anchors in step S6 includes: constructing a road sign semantic recognition model, identifying mileage signs containing absolute position information or segment joints with fixed spacing features as semantic anchors in the normalized image; when a semantic anchor is identified, obtaining its true physical mileage, and using the formula... The difference between this value and the current visual cumulative mileage calculated based on the encoder is used to obtain the cumulative drift error; based on the cumulative drift error, the following is used... The historical disease location data between this anchor point and the previous anchor point are retrospectively corrected; where Indicates the cumulative drift error; This represents the cumulative visual mileage when the current anchor point is identified. Indicates the actual physical mileage corresponding to the anchor point; This indicates the corrected mileage for locating the disease. Indicates the original mileage of the defect that needs to be corrected; It represents the actual physical mileage of the previous semantic anchor point.
8. A system for detecting defects in railway tunnels, characterized in that, include: An image acquisition module is used to simultaneously acquire image data from multiple line scan cameras, including at least two cameras with different physical resolutions. The normalization processing module is used to perform normalization preprocessing on the acquired mixed resolution images to obtain normalized image frames; The disease detection module is used to locate diseases using normalized image frames. For suspected disease areas located, it backtracks to the original high-resolution image data for fine feature extraction and measurement. The physical quantity calibration module is used for physical quantity calibration calculation based on dynamic accuracy coefficients. It constructs a dynamic accuracy coefficient matrix based on the original physical parameters and scaling ratio of each camera, and calculates the pixel coordinates of the detection results into the true physical size and mileage information. The dynamic stitching module is used for dynamic stitching calculation based on ROI feature fusion. Based on the preset overlap range, it performs edge region of interest cropping on adjacent normalized image frames, performs feature point matching in the edge region of interest to calculate the dynamic offset, and performs image fusion stitching based on the offset. The mileage error calibration module is used for dynamic calibration of mileage error based on semantic anchor points. It introduces a multi-source data fusion mechanism to address the positioning drift problem caused by wheel slippage or encoder cumulative error during long-distance inspections.
9. A device for detecting defects in railway tunnels, characterized in that, It includes at least one processor and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor can execute the method as described in any one of claims 1-7 by invoking the program instructions.
10. A computer-readable storage medium for detecting defects in railway tunnels, characterized in that, The computer-readable storage medium stores computer instructions that cause the computer to perform the method as described in any one of claims 1-7.