A tunnel lining image distortion correction method

By establishing a process of 'circular parameter fitting - pixel - arc length mapping - homogenization correction' for tunnel lining images, the problem of image distortion in tunnel lining was solved, and high-precision image correction and detection were achieved.

CN121437342BActive Publication Date: 2026-03-24CHENGDU TANGYUAN ELECTRICAL APPLIANCE +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

The geometric distortion caused by the arc-shaped structure of tunnel lining images is severe, which affects the quantitative measurement accuracy of parameters such as crack width and spalling area. Existing technologies are difficult to effectively correct in dynamic scenes.

Method used

The method of 'circular arc parameter fitting-pixel-arc length mapping-homogenization correction' is adopted. By establishing the camera, object, and image coordinate systems, and combining the field of view characteristics of the linear array camera and the geometric characteristics of the tunnel lining, a distortion correction process is constructed, including coordinate system establishment, distortion analysis, circular arc parameter fitting, pixel-arc length mapping, and image resampling.

Benefits of technology

High-precision correction of tunnel lining images was achieved, reducing the distortion rate from 16.8% to 0.21%, meeting the detection requirements and providing a practical high-precision detection method for engineering applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121437342B_ABST
    Figure CN121437342B_ABST
Patent Text Reader

Abstract

The application discloses a tunnel lining image distortion correction method and relates to the technical field of image correction. The method comprises the following steps: establishing a camera coordinate system, an object coordinate system and an image coordinate system; analyzing the tunnel lining image distortion causes; fitting the known coordinate points of the tunnel lining profile by using the least square method, determining the center and radius of the tunnel lining arc; establishing a mapping model of the image element and the parameter angle, and solving the parameter angle by using the Newton iteration method; based on the solved parameter angle, establishing a linear correlation model of the arc length and the parameter angle, and then obtaining a nonlinear curve of the image element and the arc length; constructing a uniform correction coordinate model to correct the nonlinear curve of the image element and the arc length, so that the image element and the arc length are linearly correlated, and then combining the bilinear interpolation to perform tunnel lining image resampling. The application can realize the elimination of the stretching distortion through the correction process of the arc fitting-perspective mapping-uniformization, and achieves the imaging effect of the equivalent parallel straight line segments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image correction technology, and more specifically to a method for correcting image distortion in tunnel lining. Background Technology

[0002] In high-precision visual inspection of surface defects in tunnel linings, the acquisition of images suffers from severe geometric distortion due to the arc-shaped structure of the tunnel lining and the fact that line-scan cameras typically scan along the tunnel axis. This distortion causes inconsistencies in the proportion of the actual arc length of pixels at different locations in the image, significantly affecting the accuracy of quantitative measurements of defect parameters such as crack width and spalling area. Therefore, effective geometric distortion correction of tunnel arc-shaped structure images is a crucial prerequisite for achieving high-precision automated inspection.

[0003] Currently, there are two main approaches to distortion correction: one is camera intrinsic parameter correction based on calibration plates. This method is more suitable for the regular environment in the laboratory, but in the tunnel site, especially in the dynamic scene of high-speed train operation, the calibration device is difficult to set up in practice and cannot meet the needs of on-site testing; the other is distortion elimination based on planar perspective transformation, but it can only deal with the imaging distortion of planar objects and cannot be directly applied to curved surfaces such as arcs, so its applicability is insufficient in the testing of curved structures such as tunnel linings. Summary of the Invention

[0004] To overcome the shortcomings of the existing technology, this invention discloses a method for correcting image distortion of tunnel lining. This invention proposes to take "object arc length homogenization" as the core objective, and combine the geometric characteristics of the arc and the perspective imaging law of the line array camera to construct a correction process of "arc parameter fitting - pixel - arc length mapping - homogenization correction", which ultimately realizes distortion elimination and equivalent straight line segment imaging, providing a theoretical basis and a feasible engineering method for high-precision detection of tunnel lining.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] A method for correcting image distortion of tunnel lining includes the following steps:

[0007] I. Establishment of Coordinate System

[0008] S1. Input the tunnel lining image and tunnel lining profile, and establish the camera coordinate system, object coordinate system and image coordinate system;

[0009] Preferably, the camera coordinate system, object coordinate system, and image coordinate system correspond to the camera space coordinates, the actual object coordinates, and the imaging effect coordinates, respectively.

[0010] Preferably, establishing the camera coordinate system, object coordinate system, and image coordinate system includes:

[0011] The camera coordinate system is defined as follows: :camera The number of pixels in the direction is ,origin For the camera's optical center; The optical axis centered on the image plane is perpendicular to the image plane. The axis is along the direction of pixel arrangement; The axis represents the camera scanning direction, which is either the vehicle's direction of travel or the row direction of the graphic; the number of rows is... Parallel to the tunnel's central axis;

[0012] The object coordinate system is defined as :origin It coincides with the center of the circle fitted according to the tunnel lining profile; The axis is parallel to the tunnel's central axis and is aligned with the camera. Shaft synchronization; The plane represents the tunnel cross-section, and the lining arc lies within this cross-section. The coordinates of the center of the lining arc are... , radius is ;

[0013] Image coordinate system : The scan direction row coordinates, the range of which is... ; The column coordinates of the cell arrangement direction, the range of which is... .

[0014] In this invention, the purpose of establishing the coordinate system is to facilitate unified calculation. When the camera is fixed, the camera coordinate system is established to observe the distribution of pixels on the profile of the final cross section, thus leading to the processing in step S2. When the profile is fixed, the coordinate system is established to observe the distortion intensity, leading to the profile fitting in step S3.

[0015] II. Distortion Handling

[0016] S2. Based on the established coordinate system, the causes of distortion in tunnel lining images are derived and analyzed through the camera's field of view characteristics.

[0017] Preferably, the analysis of the causes of distortion in the tunnel lining image includes: the essence of the distortion is pixel... Arc length of object The nonlinear mapping is derived through the field-of-view characteristics of the linear array camera.

[0018] Preferably, the derivation using the field-of-view characteristics of the line scan camera includes:

[0019] The field of view of the linear scan camera in the Y direction is Then the total length of the pixels for:

[0020] ;

[0021] in, The focal length of the camera;

[0022] Total length of regular object for:

[0023] ;

[0024] in, This is the shortest object distance from the camera's optical center to the object.

[0025] View angle per unit pixel for:

[0026] ;

[0027] in, For line scan camera Number of pixels in direction;

[0028] For any point on the object plane, the object distance to the camera optical center is: ,in Let be the angle between this arbitrary point and the optical axis; then the object length corresponding to a unit pixel is:

[0029] ;

[0030] in, In the object coordinate system coordinate;

[0031] The lining is an arc, and different pixels correspond to... coordinates and They are all different, and , The distance from the upper edge of the field of view to the lining wall. The distance from the lower edge of the field of view to the lining wall leads to Follower The effects of nonlinear changes are as follows:

[0032] Lower edge of field of view: , , ;

[0033] Top edge of view: , , ;

[0034] in, , These are the intersections of the upper and lower view edges with the lining arc, respectively. coordinate, , These are the angles between the upper and lower fields of view and the optical axis, respectively.

[0035] like ,but The imaging exhibits distortion characteristics of "stretching upwards and compressing downwards".

[0036] In this invention, the ultimate goal of the above distortion processing is to achieve an equivalent distortion-free situation, to see what it would look like without distortion, thus leading to the mapping processing in step S4.

[0037] III. Lining Circular Arc Parameter Fitting

[0038] S3. Based on the established coordinate system, the known coordinate points of the tunnel lining profile are fitted using the least squares method to determine the center and radius of the tunnel lining arc.

[0039] Preferably, determining the center and radius of the tunnel lining arc includes:

[0040] In the tunnel lining profile, find the arc of the tunnel lining. Coordinates of points , ;

[0041] and To describe the coordinate variables of the tunnel lining arc position in a spatial coordinate system, a spatial coordinate system is established with the center of the tunnel lining as the origin. Let the coordinates be the center of the circle. Given the radius of the tunnel lining arc, establish the equation for the tunnel lining arc:

[0042] ;

[0043] in Let the coordinates be the center of the circle. Let be the radius, and be all parameters to be determined.

[0044] Based on the equation of the circular arc of the tunnel lining, and the circular arc of the tunnel lining Using the coordinates of points and the least squares method, the center and radius of the tunnel lining arc are determined.

[0045] Preferably, determining the center and radius of the tunnel lining arc includes:

[0046] Expand and simplify the equation of the circular arc of the tunnel lining:

[0047] ;

[0048] Let the constant term Then the equation of the circular arc of the tunnel lining is transformed into a linear form:

[0049] ;

[0050] radius :

[0051] ;

[0052] right Given points on the circular arc of the tunnel lining, construct a system of linear equations. ,in:

[0053] Build a coefficient matrix of three rows and three columns :

[0054] ;

[0055] Variable vector ;

[0056] Right-hand vector :

[0057] ;

[0058] According to the least squares principle, the optimal solution for the variable vector is:

[0059] ;

[0060] in, For transpose;

[0061] Based on the above optimal solution, the center and radius of the tunnel lining arc are obtained.

[0062] In this invention, the purpose of fitting the above-mentioned lining arc parameters is that the tunnel profile is basically equivalent to a combination of multiple arcs, and fitting a part of it facilitates calculation. This way, the center and radius of the lining arc can be known, leading to the arc parameterization and perspective imaging part in step S4.

[0063] IV. Perspective Mapping of Pixel-Object Arc Length

[0064] S4. Based on the causes of distortion in the tunnel lining image, the center and radius of the tunnel lining arc, a mapping model between pixels and parameter angles is established, and the parameter angles are obtained by solving the Newton iteration method. Based on the obtained parameter angles, a linear relationship model between arc length and parameter angles is established. Then, based on the mapping model between pixels and parameter angles and the linear relationship model between arc length and parameter angles, a nonlinear curve between pixels and arc length is obtained.

[0065] Preferably, the parameter angle is the angle between the line segment formed by the point on the arc and the center of the circle in the polar coordinate system and the positive direction of the Z-axis.

[0066] (1) Circular arc parameterization and perspective imaging

[0067] Preferably, the step of establishing the mapping model between pixels and parameter angles includes:

[0068] Based on the center and radius of the circular arc of the tunnel lining, a model for calculating the object's coordinates is established.

[0069] A vertical distance conversion model is established based on pinhole camera perspective.

[0070] Establish an image plane position-pixel number conversion model;

[0071] By combining the object coordinate calculation model, the vertical distance transformation model, and the image plane position-pixel number conversion model, a mapping model between pixels and parameter angles is obtained.

[0072] Preferably, the establishment of the object coordinate calculation model includes:

[0073] Any point on the arc Placed at the center In a polar coordinate system established with the origin, the parametric angle is used. express and The angle between the positive axes; in this polar coordinate system, when the radius of the arc is At time, point The polar coordinates are represented as By utilizing the conversion relationship between polar coordinates and rectangular coordinates, a model for calculating object coordinates is established:

[0074] ;

[0075] in, This represents the vertical distance between the corresponding point on the tunnel lining and the real-world space. This represents the horizontal distance in real space from the corresponding point on the tunnel lining.

[0076] Preferably, the establishment of the vertical distance conversion model includes:

[0077] Based on the perspective of a pinhole camera, the vertical distance of a point on the image from the center of the image is related to the actual position of the corresponding point on the tunnel lining. A vertical distance conversion model is then established based on this.

[0078] ;

[0079] in, The vertical distance from a point on the photograph to the center of the photograph; The focal length of the camera; This represents the vertical distance between the corresponding point on the tunnel lining and the real-world space. This represents the horizontal distance in real space from the corresponding point on the tunnel lining.

[0080] Preferably, the establishment of the image plane position-pixel number conversion model includes:

[0081] Assume the pixel number at the very center of the image plane is It is the total number of pixels. Half of that, then the distance from a point on the surface to the middle position. It is equal to the pixel number of this point. Subtract the middle pixel number Multiply by the actual physical size of each pixel The specific image plane location-pixel number conversion model is as follows:

[0082] ;

[0083] in, This is the distance from a point on the image plane to the center position; Number the cell at this point; Number the intermediate pixels; The actual physical size of each pixel, also known as the pixel size, is used to convert the number of pixels into the actual physical length and establish the physical relationship between the pixel and the image plane coordinates.

[0084] Preferably, the mapping model between the pixel and the parameter angle is as follows:

[0085] ;

[0086] in, The pixel number of a point on the image plane; Number the intermediate pixels; Pixel size; The Z-coordinate of the center of the circle; The radius of the arc; For parameter angles; The focal length of the camera; The Y-coordinate is the center of the circle.

[0087] In this invention, the purpose of the above-mentioned arc parameterization and perspective imaging is to establish the correspondence between pixels and image planes, so as to lead to the third section in the subsequent S4 step.

[0088] (2) Parameter angle Numerical solution

[0089] Preferably, the step of obtaining the parameter angle using Newton's iteration method includes: establishing an objective function based on a mapping model between pixels and parameter angles, and continuously adjusting the value of the parameter angle using Newton's iteration method so that the objective function gradually approaches 0, thereby solving for the parameter angle.

[0090] Preferably, the objective function is:

[0091] ;

[0092] in, The objective function is... The pixel number of a point on the image plane; Number the intermediate pixels; Pixel size; The Z-coordinate of the center of the circle; The radius of the arc; For parameter angles; The focal length of the camera; The Y-coordinate is the center of the circle.

[0093] Preferably, the basic iterative formula of the Newton iteration method is:

[0094] ;

[0095] in: Indicates the first Approximate root or variable value at the next iteration; Indicates after the first The approximate root obtained after the nth iteration; Is The objective function at the location; It is a function exist The first derivative at point is used to determine the direction and step size of the iteration. ;

[0096] By repeatedly performing this iterative process, the function is gradually approximated. The root.

[0097] In this invention, the above-mentioned parameter angle The purpose of numerical solution is to facilitate calculations related to arc length.

[0098] (3) Arc length With parameter angle linear correlation

[0099] Preferably, the linear relationship model between the arc length and the parameter angle includes:

[0100] ;

[0101] in, For any pixel The corresponding arc length, And follow Monotonically increasing; The radius is ; For pixels The corresponding parameter angle; The parameter angle is the starting point of the arc length on the lower field of view edge.

[0102] In this invention, the aforementioned arc length With parameter angle The purpose of the linear correlation is to transform the coordinate system corresponding to the camera and the profile into a description of the correspondence between arc length and parameter angle, so that the description in this subsection can replace the description of the above coordinate system, so as to construct the uniform coordinates in subsection (1) of step S5.

[0103] In this invention, the purpose of the above-mentioned perspective mapping of pixel-object arc length is: the resampling in the subsequent S5 step needs to have an input basis, and the correspondence between the pixel and the object arc length is the source basis for calibration and correction.

[0104] V. Uniformity Correction and Image Resampling

[0105] S5. Construct a uniformized correction coordinate model to correct the nonlinear curve between pixels and arc length, so that pixels and arc length are linearly related, and then combine bilinear interpolation to resample the tunnel lining image.

[0106] (1) Homogenized coordinates Construction

[0107] Preferably, the homogenized correction coordinate model is:

[0108] ;

[0109] in, For the corrected pixels; For line scan camera Number of pixels in direction; It is the maximum value of the arc length; For pixels The corresponding arc length.

[0110] Preferably, the construction of the uniformized correction coordinate model includes:

[0111] According to the definition of linear relations, a linear transformation is expressed as: In the form of uniformized and corrected coordinates, let the minimum arc length be... At this point, the corresponding pixel coordinates are at their minimum value, let's call them... Substituting into the linear transformation formula, we can obtain Therefore, the intercept ;

[0112] The maximum value of the arc length is set to The corresponding cell coordinates are ;in, The radius of the arc is the arc length. , These are the upper and lower field-of-view edge parameter angles, respectively. For line scan camera Number of pixels in direction; substitute into the simplified linear transformation formula From this, we can obtain slope , soon to be nonlinear The curve is mapped to a linear path. For a straight line, the number of pixels per unit arc length is At this point, the object arc lengths corresponding to all pixels are consistent, eliminating stretching distortion.

[0113] In this invention, the above-mentioned homogenized coordinates The purpose of this construction is to make the length and width of the actual object corresponding to each pixel as consistent as possible, thereby reducing stretching distortion.

[0114] (2) Bilinear interpolation resampling

[0115] Preferably, the bilinear interpolation includes: for each target coordinate of the corrected tunnel lining image. The algorithm finds the pixels with four integer coordinates (up, down, left, and right) around the tunnel lining image, calculates the gray value of the target point by updating the adjacent two-dimensional linear interpolation, and transforms the coordinates of the decimal point into new coordinates.

[0116] Preferably, the bilinear interpolation includes:

[0117] Determine the integer and fractional coordinates of the neighborhood of the target coordinates;

[0118] In the neighborhood integer coordinates, linear interpolation is performed on the row direction pixels to obtain two intermediate gray values;

[0119] Based on two intermediate gray values, linear interpolation is performed on the pixels in the column direction to obtain the gray values ​​of the target coordinates of the corrected tunnel lining image.

[0120] Preferably, the integer coordinates and fractional part of the neighborhood of the target coordinates include:

[0121] For each target coordinate of the corrected tunnel lining image First, find its four adjacent integer pixel coordinates in the original image, as follows:

[0122] Split Round down to the nearest integer. The integer part is denoted as The decimal part is denoted as ;

[0123] Split Round down to the nearest integer. The integer part is denoted as The decimal part is denoted as ;

[0124] The four neighboring integer pixel coordinates corresponding to the target coordinates in the original tunnel lining image are: ( ), ( ), ( ), ( Their grayscale values ​​are denoted as follows: , , , .

[0125] Preferably, the linear interpolation of the row-direction pixels includes:

[0126] fixed and ,along Axis interpolation;

[0127] First in the original image row and number Okay, according to decimal part Linear interpolation is performed on two pixels in the column direction to obtain two intermediate gray values:

[0128] No. The middle value of the row: ;

[0129] No. The middle value of the +1 row: .

[0130] Preferably, the linear interpolation of the column-direction pixels includes:

[0131] fixed ,along Axis interpolation;

[0132] according to decimal part For the two intermediate gray values ​​obtained and Linear interpolation is performed to obtain the grayscale value of the target coordinates in the corrected image. :

[0133] ;

[0134] Will and After substituting, it simplifies to a direct calculation formula:

[0135] .

[0136] In this invention, the purpose of the above-mentioned bilinear interpolation resampling is: (1) to avoid the case of gray values ​​having decimals; (2) to make the transition smoother, the imaging more uniform, and less abrupt.

[0137] The beneficial effects of this invention are:

[0138] This invention describes the causes of distortion and establishes a quantitative relationship between distortion rate and object distance and field of view. A corresponding correction method is then proposed, which eliminates stretching distortion through a circular arc fitting-perspective mapping-homogenization correction process, achieving an equivalent parallel straight line segment imaging effect. Finally, experimental verification shows that this method can significantly reduce the distortion rate, decreasing the distortion rate of lining imaging from 16.8% to 0.21%, meeting the image requirements for tunnel lining defect detection and demonstrating strong engineering practical significance. Attached Figure Description

[0139] Figure 1 This is the overall processing flow of the present invention;

[0140] Figure 2 This is a schematic diagram of the camera coordinate system of the present invention;

[0141] Figure 3 This is a schematic diagram of the object-side coordinate system of the present invention;

[0142] Figure 4 This is a schematic diagram of the object-side coordinate system fitting of the present invention;

[0143] Figure 5 This is a schematic diagram of the image coordinate system of the present invention;

[0144] Figure 6 This is an equivalent schematic diagram of the camera coordinate system of the present invention;

[0145] Figure 7 This is an equivalent schematic diagram of the object-side coordinate system of the present invention;

[0146] Figure 8 This is a schematic diagram showing the coordinate system coincidence of the present invention;

[0147] Figure 9 This is a schematic diagram of the camera and object imaging of the present invention;

[0148] Figure 10 This is a schematic diagram of the distortion range deviation of the present invention (gray shading).

[0149] Figure 11 The relationship between arc length and parametric angle in this invention Figure 1 ;

[0150] Figure 12 The relationship between arc length and parametric angle in this invention Figure 2 ;

[0151] Figure 13 This is the bilinear interpolation process of the present invention;

[0152] Figure 14 The calibration effect of this invention under heavy iron conditions (before calibration);

[0153] Figure 15 This is the correction effect (after correction) under heavy iron conditions according to the present invention.

[0154] Figure 16 This is the correction effect of the present invention in a subway environment (before correction);

[0155] Figure 17 This is the correction effect (after correction) in a subway environment according to the present invention. Detailed Implementation

[0156] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention.

[0157] A method for correcting image distortion of tunnel lining, such as Figure 1 As shown, it includes the following steps:

[0158] To facilitate calculations and unify modeling dimensions, this invention defines three types of coordinate systems: camera, object, and image coordinate systems, which correspond to camera spatial coordinates, actual object coordinates, and imaging effect coordinates, respectively.

[0159] (1) The camera coordinate system is defined as follows: The camera's pixel count is Generally, these are 2K, 4K, and 8K cameras, with a certain number of pixels. Generally corresponds to 2048, 4096, and 8192; origin. For the camera's optical center; The optical axis centered on the image plane is perpendicular to the image plane. The axis is along the direction of pixel arrangement; The axis is the camera scanning direction, typically the direction of vehicle movement or the row direction of a graphic, with the number of rows being [number missing]. It is parallel to the central axis of the tunnel.

[0160] (2) The object coordinate system is defined as follows: :origin It coincides with the center of the circle fitted according to the tunnel lining profile; The axis is parallel to the tunnel's central axis (and the camera). (axis synchronization) The plane represents the tunnel cross-section, and the lining arc lies within this plane. The coordinates of the center of the arc are... , radius is (See Table 1 for the sampling points).

[0161] (3) Image coordinate system : The scan direction row coordinates, the range of which is... ; Column coordinates of pixel arrangement direction .

[0162] Schematic diagram as follows Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 and Figure 8 As shown.

[0163] The parameters are defined in the table below.

[0164] Table 1. Known Parameters and Physical Meaning

[0165]

[0166] 1. Distortion handling

[0167] The essence of distortion is pixels. Arc length of object Nonlinear mappings, such as Figure 9 As shown, the following can be derived from the field-of-view characteristics of a line scan camera:

[0168] The field of view of the linear scan camera in the Y direction is Then the total length of the pixels for:

[0169] ;

[0170] in, The focal length of the camera;

[0171] Total length of regular object for:

[0172] ;

[0173] in, This is the shortest object distance from the camera's optical center to the object.

[0174] View angle per unit pixel for:

[0175] ;

[0176] in, For line scan camera Number of pixels in direction;

[0177] For any point on the object plane, the object distance to the camera optical center is: ,in Let be the angle between this arbitrary point and the optical axis; then the object length corresponding to a unit pixel is:

[0178] ;

[0179] in, In the object coordinate system coordinate;

[0180] The lining is an arc, and different pixels correspond to... coordinates and They are all different, and , The distance from the upper edge of the field of view to the lining wall. The distance from the lower edge of the field of view to the lining wall leads to Follower The effects of nonlinear changes are as follows:

[0181] Lower edge of field of view: , , ;

[0182] Top edge of view: , , ;

[0183] in, , These are the intersections of the upper and lower view edges with the lining arc, respectively. coordinate, , These are the angles between the upper and lower fields of view and the optical axis, respectively.

[0184] like ,but The imaging exhibits distortion characteristics of "upward stretching and downward compression," such as... Figure 10 As shown.

[0185] 2. Fitting of lining arc parameters

[0186] By establishing a system of linear equations using points with known tunnel profiles, the solution of distortion parameters is transformed into equation solving, thereby establishing an accurate distortion correction model and achieving effective correction of imaging distortion.

[0187] Given the arc Coordinates of points ( (prior data);

[0188] Y and Z are coordinate variables describing the position of the circular arc of the tunnel lining in a spatial coordinate system. The spatial coordinate system is established with the center of the tunnel lining as the origin. Let the coordinates be the center of the circle. Let be the radius of the tunnel lining arc. Then, the equation of the tunnel lining arc in this coordinate system can be expressed as:

[0189] ;

[0190] in Let the coordinates be the center of the circle. Let be the radius, and be parameters to be determined.

[0191] Expand the above equation and rearrange it:

[0192] ;

[0193] make (Constant term), then the equation is transformed into a linear form:

[0194] ;

[0195] Radius R:

[0196] ;

[0197] Construct a system of linear equations for N known points. ,in:

[0198] Construct an N x 3 coefficient matrix :

[0199] ;

[0200] Variable vector ;

[0201] Right-hand vector :

[0202] ;

[0203] According to the least squares principle, the optimal solution for the variable vector is:

[0204] .

[0205] 3. Perspective mapping of pixel-object arc length

[0206] (1) Circular arc parameterization and perspective imaging

[0207] In a two-dimensional polar coordinate system, for a point on a circular arc, when the position of the center and the radius are known, only one parameter angle is needed. ( and The position can be determined by the angle between the axes, and then the object coordinates can be obtained.

[0208] Any point on the arc Placed at the center In a polar coordinate system established with the origin, the parametric angle is used. express( for and (The angle between the positive axes). In this polar coordinate system, when the radius of the arc is... At time, point The polar coordinates can be expressed as Using the conversion relationship between polar coordinates and rectangular coordinates, its object coordinates are:

[0209] ;

[0210] According to the perspective model of a pinhole camera, the distance (denoted as y, where the image center is the origin, equivalent to the exact center of the coordinate system) of a point on the image in the vertical direction (i.e., the Y-direction of the image plane) from the center of the image is related to the actual position of the corresponding point on the tunnel lining. The specific relationship can be expressed by this formula:

[0211] ;

[0212] The vertical distance from a point on the graph to the center of the photograph; The focal length of the camera lens; It is the vertical distance between the corresponding point on the tunnel lining and the real space. It is the horizontal distance between the corresponding point on the tunnel lining and the real space.

[0213] A pixel is the smallest unit that makes up an image, and image plane coordinates are the coordinates that describe the position of a pixel on the imaging plane.

[0214] Position on the surface and the corresponding cell number There exists the following conversion relationship: assuming the pixel number at the very center of the image plane is... (Total number of pixels) (half of the distance), then the distance from a point on the surface to the middle position. It is equal to the pixel number of this point. Subtract the middle pixel number Multiply by the actual physical size of each pixel This can be expressed as a formula:

[0215] ;

[0216] in, This is the distance from a point on the image plane to the center position; Number the cell at this point; Number the intermediate pixels; The actual physical size of each pixel, also known as the pixel size, is used to convert the number of pixels into the actual physical length and establish the physical relationship between the pixel and the image plane coordinates.

[0217] Solve the three formulas above simultaneously and eliminate , obtain pixels With parameter angle The mapping equation:

[0218] ;

[0219] in, The pixel number of a point on the image plane; Number the intermediate pixels; Pixel size; The Z-coordinate of the center of the circle; The radius of the arc; For parameter angles; The focal length of the camera; The Y-coordinate is the center of the circle.

[0220] (2) Parameter angle Numerical solution

[0221] The above mapping equation is calculated using Newton's iteration method. Newton's iteration method is a classic and efficient numerical computation method, particularly suitable for handling this type of nonlinear equation. It approximates the solution of the equation through continuous iteration.

[0222] Define the objective function:

[0223] ;

[0224] Solve using Newton's iteration method time This value can be used to correct the stretching distortion of the circular arc image of the tunnel lining.

[0225] The objective function will include the measurement parameters during the imaging process (such as pixel coordinates). Initial pixel coordinates Camera internal parameters Geometric parameters of tunnel lining (center coordinates) ,radius and the angle parameters to be solved Correlation. Continuously adjust using Newton's iterative method. The value of makes the objective function Gradually approaching 0, thus solving for the accurate value. value.

[0226] The basic iterative formula of Newton's method is:

[0227] ;

[0228] in:

[0229] Indicates the first Approximate root or variable value at the next iteration;

[0230] Indicates after the first The approximate root obtained after the nth iteration;

[0231] Is The objective function at the location;

[0232] It is a function exist The first derivative at a given point is used to determine the direction and step size of the iteration. By repeatedly performing this iterative process, the function is gradually approximated. The root.

[0233] Substitute the proposed values ​​into the formula to obtain the variable values ​​for the next round, observe convergence, and repeat the iteration.

[0234] Where the derivative .

[0235] Let the coordinates of the midpoint of the arc be... From the object coordinates, we get: After deformation, the inverse iteration initial value is taken as the value corresponding to the midpoint of the arc. Calculated by precision As can be seen from the data range, the accuracy is generally within... Between the mm range, reserved The order of magnitude, and the convergence condition set during calculation are as follows: .

[0236] (3) Arc length With parameter angle linear correlation

[0237] like Figure 11 and Figure 12 As shown, the arc length of the circular arc With parameter angle There is a strict linear relationship (radius) (Constant). Remove the view edge (here). Represents the pixel number, denoted as , () is the starting point of the arc length, corresponding to the parameter angle. Then any pixel The corresponding arc length is:

[0238] ;

[0239] in, For any pixel The corresponding arc length, And follow Monotonically increasing; The radius is ; For pixels The corresponding parameter angle; The parameter angle is the starting point of the arc length on the lower field of view edge.

[0240] 4. Uniformity Correction and Image Resampling

[0241] (1) Homogenized coordinates Construction

[0242] The goal of correction is to make the corrected pixels Arc length of object The relationship is linear, meaning that a unit arc length corresponds to a fixed number of pixels, which is equivalent to imaging a parallel straight line segment. The correction goal is to make the corrected pixels have a linear relationship with the object arc length, meaning that a unit arc length corresponds to a fixed number of pixels, which is equivalent to imaging a parallel straight line segment.

[0243] According to the definition of linear relations, a linear transformation is expressed as: In the case of uniformized coordinate correction, let the minimum arc length be... (Starting point), at this point the corresponding pixel coordinates should also be at their minimum value, which can be set to 0. Substituting this into the linear transformation formula yields... Therefore, the intercept .

[0244] The maximum value of the arc length is set to ( (where the upper field of view edge parameter angle is) corresponds to the pixel coordinates as follows: Substitute the values ​​into the simplified linear transformation formula. From this, we can obtain slope , soon to be nonlinear The curve is mapped to a linear path. For a straight line, the number of pixels per unit arc length is At this point, ensure that the object-side arc length corresponding to all pixels is consistent to eliminate stretching distortion.

[0245] The calculated slope Substituting into the linear transformation formula, we can obtain the formula for uniformized correction coordinates:

[0246] ;

[0247] in, For the corrected pixels; For line scan camera Number of pixels in direction; It is the maximum value of the arc length; For pixels The corresponding arc length.

[0248] (2) Bilinear interpolation resampling

[0249] To avoid the target coordinates of the corrected image calculated during the tunnel lining image correction process being as follows: When decimal values ​​cannot correspond to true coordinates, resampling techniques are needed to map the grayscale values ​​of the original image to new coordinates. The core of bilinear interpolation is to address each target coordinate in the corrected image. The process involves finding pixels with four integer coordinates (up, down, left, right) around the target point in the original image. Then, by updating the grayscale value of the target point using linear interpolation in adjacent two dimensions, the coordinates of the decimal point are transformed into new coordinates, achieving a smooth transition in image operations. Figure 13 As shown, the processing flow is as follows:

[0250] (1) First determine the integer coordinates and decimal part of the neighborhood of the target coordinates.

[0251] For each target coordinate in the corrected image ( The coordinates are the row direction coordinates. (For column direction coordinates), first find its four corresponding integer pixel coordinates in the original image, as follows:

[0252] Split Round down to the nearest integer, such as 128.4. ), decimal part ;

[0253] Split Round down to the nearest integer, such as 256.3. ), decimal part ;

[0254] The corresponding 4-neighborhood integer pixel coordinates in the original image are: ( ), ( ), ( ), ( Their grayscale values ​​are denoted as follows: , , , .

[0255] (2) Perform linear interpolation on the pixels in the row direction (fixed) and ,along (axis interpolation)

[0256] First in the original image row and number Okay, according to decimal part Linear interpolation is performed on two pixels in the column direction to obtain two intermediate gray values:

[0257] No. The middle value of the row: ;

[0258] No. The middle value of the +1 row: ;

[0259] (3) Perform linear interpolation on the column direction pixels (fixed) ,along (axis interpolation) and then according to decimal part For the two intermediate values ​​obtained in the first step, and Linear interpolation is performed to obtain the target coordinates of the corrected image. grayscale value :

[0260] ;

[0261] Will and After substituting the values, it can be simplified to a direct calculation formula:

[0262] .

[0263] like Figure 14 and Figure 15 As shown, this is the correction effect under heavy iron conditions.

[0264] like Figure 16 and Figure 17 As shown, this is the correction effect in a subway environment.

[0265] The embodiments of the present invention have been described in detail above, but the present invention is not limited to the described embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalents or substitutions are all included within the scope defined by the claims of the present invention.

Claims

1. A method for correcting image distortion in tunnel lining, characterized in that, include: Input the tunnel lining image and tunnel lining profile, and establish the camera coordinate system, object coordinate system, and image coordinate system; Based on the established coordinate system, the causes of distortion in tunnel lining images are derived and analyzed through the camera's field of view characteristics. Based on the established coordinate system, the center and radius of the tunnel lining arc are determined by fitting the known coordinate points of the tunnel lining profile using the least squares method. Based on the causes of distortion in tunnel lining images, the center and radius of the tunnel lining arc, a mapping model between pixels and parameter angles is established, and the parameter angles are obtained by solving the Newton iteration method. Based on the obtained parameter angles, a linear correlation model between arc length and parameter angles is established. Then, based on the mapping model between pixels and parameter angles and the linear correlation model between arc length and parameter angles, a nonlinear curve between pixels and arc length is obtained. A uniformized correction coordinate model is constructed to correct the nonlinear curve between pixels and arc length, so that pixels and arc length are linearly related. Then, bilinear interpolation is combined to resample the tunnel lining image. in: The camera coordinate system, object coordinate system, and image coordinate system correspond to the camera space coordinates, the actual object coordinates, and the imaging effect coordinates, respectively. The establishment of the camera coordinate system, object coordinate system, and image coordinate system includes: The camera coordinate system is defined as follows: :camera The number of pixels in the direction is ,origin For the camera's optical center; The optical axis centered on the image plane is perpendicular to the image plane. The axis is along the direction of pixel arrangement; The axis represents the camera scanning direction, which is either the vehicle's direction of travel or the row direction of the graphic; the number of rows is... Parallel to the central axis of the tunnel; The object coordinate system is defined as :origin It coincides with the center of the circle fitted according to the tunnel lining profile; The axis is parallel to the tunnel's central axis and is aligned with the camera. Shaft synchronization; The plane represents the tunnel cross-section, and the lining arc lies within this cross-section. The coordinates of the center of the lining arc are... , radius is ; Image coordinate system : The scan direction row coordinates, the range of which is... ; The column coordinates of the cell arrangement direction, the range of which is... ; The mapping model between the pixel and the parameter angle is as follows: ; in, The pixel number of a point on the image plane; Number the intermediate pixels; Pixel size; The Z-coordinate of the center of the circle; The radius of the arc; For parameter angles; The focal length of the camera; The Y-coordinate of the center of the circle; The linear relationship model between the arc length and the parameter angle includes: ; in, For any pixel The corresponding arc length, And follow Monotonically increasing; The radius is ; For pixels The corresponding parameter angle; The parameter angle corresponding to the starting point of the arc length of the lower field of view edge; The homogenization correction coordinate model is as follows: ; in, For the corrected pixels; For line scan camera Number of pixels in direction; It is the maximum value of the arc length; For pixels The corresponding arc length.

2. The method for correcting image distortion of tunnel lining as described in claim 1, characterized in that, The establishment of the mapping model between pixels and parameter angles includes: Based on the center and radius of the circular arc of the tunnel lining, a model for calculating the object's coordinates is established. A vertical distance conversion model is established based on pinhole camera perspective. Establish an image plane position-pixel number conversion model; By combining the object coordinate calculation model, the vertical distance transformation model, and the image plane position-pixel number conversion model, a mapping model between pixels and parameter angles is obtained.

3. The method for correcting image distortion of tunnel lining as described in claim 1, characterized in that, The method of obtaining the parameter angle by Newton's iteration method includes: establishing an objective function based on the mapping model between pixels and parameter angles, and continuously adjusting the value of the parameter angle by Newton's iteration method so that the objective function gradually approaches 0, thereby solving for the parameter angle.

4. The method for correcting image distortion of tunnel lining as described in claim 1, characterized in that, The bilinear interpolation includes: for each target coordinate of the corrected tunnel lining image. The algorithm finds the pixels with four integer coordinates (up, down, left, and right) around the tunnel lining image, calculates the gray value of the target point by updating the adjacent two-dimensional linear interpolation, and transforms the coordinates of the decimal point into new coordinates.

5. The method for correcting image distortion of tunnel lining as described in claim 4, characterized in that, The bilinear interpolation includes: Determine the integer and fractional coordinates of the neighborhood of the target coordinates; In the neighborhood integer coordinates, linear interpolation is performed on the row direction pixels to obtain two intermediate gray values; Based on two intermediate gray values, linear interpolation is performed on the pixels in the column direction to obtain the gray values ​​of the target coordinates of the corrected tunnel lining image.

6. The method for correcting image distortion of tunnel lining as described in claim 5, characterized in that, The integer coordinates and fractional part of the neighborhood of the target coordinates are included; For each target coordinate of the corrected tunnel lining image First, find its four adjacent integer pixel coordinates in the original image, as follows: Split Round down to the nearest integer. The integer part is denoted as The decimal part is denoted as ; Split Round down to the nearest integer. The integer part is denoted as The decimal part is denoted as ; The four neighboring integer pixel coordinates corresponding to the target coordinates in the original tunnel lining image are: ( ), ( ), ( ), ( Their grayscale values ​​are denoted as follows: , , , ; The linear interpolation of pixels in the row direction includes: fixed and ,along Axis interpolation; First in the original image row and number Okay, according to decimal part Linear interpolation is performed on two pixels in the column direction to obtain two intermediate gray values: No. The middle value of the row: ; No. The middle value of the +1 row: ; The linear interpolation of pixels in the column direction includes: fixed ,along Axis interpolation; according to decimal part For the two intermediate gray values ​​obtained and Linear interpolation is performed to obtain the grayscale value of the target coordinates in the corrected image. : ; Will and After substituting, it simplifies to a direct calculation formula: 。

Citation Information

Patent Citations

  • Rapid detection method for tunnel lining crack

    CN108596869A

  • Wide-angle camera distortion image correction method and device based on track visual detection

    CN120807369A