Tunnel target identification center positioning method
The method uses a monocular camera with adaptive canny operator and ellipse fitting to enhance tunnel deformation monitoring precision and reduce hardware needs, addressing the limitations of traditional methods with high-speed and cost-effective target detection.
Patent Information
- Application Number
- CN202411157360.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-10-21
AI Technical Summary
Traditional tunnel deformation monitoring methods using total stations and laser measurement are prone to human error, have insufficient monitoring frequency, and are costly, while monocular camera technology lacks precision and requires expensive equipment.
A method for tunnel target identification center positioning using a monocular camera with adaptive canny operator, edge pixel extraction, boundary search, ellipse fitting, and statistical verification to achieve high-speed and high-precision target detection.
The method achieves 5 Hz target detection capability with high precision and reduced hardware requirements, enabling real-time and cost-effective tunnel deformation monitoring.
Smart Images

Figure CN119131072A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of tunnel monitoring, and in particular relates to a method for locating a tunnel target recognition center. Background Art
[0002] During tunnel construction and after completion, long-term observation of the deformation of the tunnel support surface and ground settlement is required to ensure personnel safety and the stability of the tunnel structure. However, the traditional method of using total stations has problems such as the need to install reflective prisms, prone to human errors, and insufficient monitoring frequency. Laser measurement technology cannot be deployed in large quantities due to its expensive equipment, and there are also problems such as insufficient monitoring frequency and high costs. The development of monocular camera measurement technology has made it possible to deploy cameras and multi-point observation targets for tunnel deformation monitoring at a very low cost, achieving 24-hour uninterrupted online observation.
[0003] With the development and widespread application of computer vision technology, the target detection and measurement technology of monocular cameras has begun to play an important role in more and more fields, especially in unmanned driving and industrial automation. In recent years, due to its advantages of low cost, simplicity, compact structure, multi-target detection, and high precision, monocular vision measurement has gradually begun to be used in daily deformation monitoring of tunnels. The core of this technology lies in the precise positioning algorithm of the target center. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention proposes a tunnel target identification center positioning method. The method of the present invention can achieve a target detection capability of about 5 Hz, greatly improves the real-time performance, has the characteristics of high speed and high precision, and reduces the measurement requirements for system hardware equipment, so that the system can be widely used in tunnel deformation monitoring projects.
[0005] In order to achieve the above object, the present invention is implemented by the following technical scheme: A method for locating a tunnel target identification center is performed according to the following steps:
[0006] Step 1) performing distortion correction and cropping on the single frame data collected by the monocular camera;
[0007] Step 2) Use the adaptive canny operator to extract edge pixels f(x, y) from the cut target pattern, and fit the sub-pixel edge points based on the edge gradient value. The formula is:
[0008]
[0009] f(x)=x+x min ×Dx
[0010] f(y)=y+x min ×Dy
[0011] Among them, Dx and Dy are respectively the gradient direction values of the current point taking {0, 1}, and g(A), g(B), and g(C) are the gradient values at points A, B, and C respectively;
[0012] Step 3) For the above results, use the 8-neighborhood method to perform boundary search, and break at corner points and inflection points to form new search line segments, and finally complete the directed connection of all edge lines;
[0013] Step 4) Eliminate short arc segments, straight arc segments, and invalid arc segments in the generated arc segments;
[0014] Step 5) Aggregate the larger arc segments remaining after Step 4) into effective arc segments, sort the arc segment data by arc length, fit ellipses from large to small respectively to obtain the fitted ellipse data, and use the constraint strategy to extract the effective arc segments belonging to the target circle;
[0015] Step 6) After extracting the effective arc segments, use the least squares method to fit the target ellipse, evaluate the quality of the fitted ellipse equation, judge whether the points are on the ellipse edge, eliminate the invalid points, and then use the remaining points to iteratively fit the ellipse again. The obtained ellipse center is the accurate center coordinate of the target circle.
[0016] Further, the definitions of corner points and inflection points in Step 3) are as follows:
[0017] Corner point: If the angle difference between the connections of adjacent two points is greater than the given threshold T = 90°, |θ1 - θ2| > T, then it is a corner point;
[0018] Inflection point: Let θ = 5, extract the edge points as continuous short arc segments with θ as the step size, calculate the concavity and convexity of each arc segment, and when the concavity and convexity change, the change point is the inflection point.
[0019] Further, the positioning of short arc segments, straight arc segments, and invalid arc segments in Step 4) is as follows:
[0020] The judgment threshold for short arc segments is taken as T = 25, and the arc segments with L i < T are eliminated;
[0021] Straight arc segments and invalid arc segments:
[0022] Define the two end points of the arc segment as M(x1, y2) and N(x1, y2), then draw a line parallel to the two end points at the midpoint of the arc segment, and then draw perpendiculars from the two end points to this line. The two perpendicular points are P(x3, y3) and Q(x4, y4) respectively. The rectangle formed by the four points has the short side as MQ and the long side as MN. Define Set the threshold TL = 0.05, then when μ < TL, it is defined as a straight arc segment or an invalid arc segment, and this arc segment is eliminated.
[0023] Furthermore, the constraint strategy in step 5) adopts the following four constraint strategies:
[0024] A. Area Constraint
[0025] If the ellipses fitted by two elliptical arc segments belong to the same cluster, then the ratio of the areas of the two ellipses is Take the large arc segment as the basic arc and eliminate the arc segments with smaller areas;
[0026] B. Center point distance constraint
[0027] If the ellipses fitted by two elliptical arc segments belong to the same cluster, the distance between the centers of the two ellipses is less than 0.1×S, where S is the length of the major axis a of the ellipse;
[0028] C. Circumscribed quadrilateral position constraints
[0029] If the ellipses fitted by two elliptical arc segments belong to the same cluster, then the circumscribed quadrilaterals must intersect, and the large arc segment is used as the basic arc, and the non-intersecting small arc segments are eliminated;
[0030] D. Fitting ellipse flattening constraint;
[0031] During the installation process, the target surface is often not parallel to the imaging surface. Therefore, the target circle becomes an ellipse due to perspective difference during imaging. The flattening of the ellipse is proportional to the angle α between the target surface and the parallel surface.
[0032] Furthermore, the criterion for determining whether the midpoint in step 6) is on the ellipse is:
[0033] Take |F(x i ,y i )|<0.1 is the effective point;
[0034]
[0035]
[0036] In the above formula, ρ is the angle between the center line of the ellipse and the X-axis, a is the major axis of the ellipse and b is the minor axis of the ellipse;
[0037] Statistical ratio of effective points to total points If Tp<0.8, invalid points are removed and the remaining points are used to iteratively fit the ellipse again until Tp>0.8. The center of the ellipse obtained is the precise coordinate of the center of the target circle.
[0038] Furthermore, the method also includes step 7) result verification: a circular window with a radius of 20 pixels is taken at the center coordinates of the target circle, and the accuracy of the center coordinates is verified by statistical methods. If the above result coordinates are indeed the target center, the grayscale centroid of the black and white triangle area statistics will coincide with the result coordinates, and the distance error will be less than the threshold of 1 pixel, thereby verifying the accuracy of the result.
[0039] Furthermore, the grayscale centroid S(x0,y0) in the window circle f(u,v) in step 7) is calculated as follows:
[0040]
[0041]
[0042] Where W(u,v) is the weight, (u,v)∈window circle f(u,v).
[0043] Compared with the prior art, the invention has the following beneficial effects: the invention provides a vector feature positioning algorithm and a statistical feature verification algorithm for the sub-pixel center coordinates of the specific target to ensure the uniqueness and reliability of the measurement results. The algorithm of the invention can achieve target detection capabilities of about 5 Hz, greatly improves real-time performance, has the characteristics of high speed and high precision, and reduces the requirements of the measurement on the system hardware equipment, so that the system can be widely used in tunnel deformation monitoring items. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 Hardware system architecture for tunnel deformation monitoring.
[0045] Figure 2 Schematic diagram of the active target.
[0046] Figure 3 Schematic diagram of the unique object box obtained for cropping.
[0047] Figure 4 Schematic diagram of fitting sub-pixel edge points.
[0048] Figure 5 Schematic diagram of corner points and inflection points.
[0049] Figure 6 It is a rectangular diagram.
[0050] Figure 7 Schematic diagram of the calculation of the imaging ellipse flattening.
[0051] Figure 8 A schematic diagram of a circular window.
[0052] Fig. 9 This is a schematic diagram of the center coordinates of actual continuous measurement. DETAILED DESCRIPTION
[0053] The following will describe the implementation methods of the present invention in detail with reference to the accompanying drawings and examples, so as to fully understand and implement the implementation process of how the present invention applies technical means to solve technical problems and achieve technical effects.
[0054] Before introducing the method of the present invention, the supporting hardware devices and connection relationships of the present invention are briefly introduced. The corresponding equipment developed by the present invention and the supporting system software are applied to tunnel deformation monitoring. The system architecture is as follows: Figure 1 As shown. It includes a monocular monitoring camera, an active target, a cloud Internet of Things, and a software system embedded with the algorithm of the present invention. The monocular camera and the target are installed in the tunnel as required and connected to the mains. The monocular camera performs regular image acquisition of the target at a set frequency, and transmits the collected image data to the Internet of Things cloud through the built-in Linux host via the 5G wireless network. Once the data arrives at the Internet of Things cloud, the remote computer software system will be immediately notified to process the data and obtain the monitoring information of the target position in real time. The monocular camera uses the Hikvision MV-CU120-10UM 1200W black and white camera.
[0055] The active targets used in the system of the present invention are as follows Figure 2 As shown, a circular carbon plate and a barcode plate are provided on the light source plate, a detection area is provided in the center of the circular carbon plate, and the detection area includes one or more hollow areas, and the barcode plate is processed from a carbon plate and is provided under the circular carbon plate. The active target has applied for a related patent.
[0056] First, the monocular camera needs to be calibrated before measurement, using the Zhang Zhengyou calibration method to correct camera distortion and obtain the internal and external parameters of the camera to improve the accuracy of image processing and pose calculation.
[0057] Secondly, the target image data is collected and uploaded to the IoT cloud through the 5G network. After the remote computer receives the uploaded image data, it will be solved in real time. Before that, the first station setting needs to configure the station and initialize the target area position. The neural network YOLOV7 is used to perform initial detection of the target. The YOLOV7 model has been trained in advance and can accurately identify the target with light source in a dark environment.
[0058] Then, the target center positioning frame identified above is accurately positioned. Since there is only one target pattern in the positioning frame, the target image is less disturbed by the background, which can greatly improve the recognition accuracy. The specific process of the present invention is discussed in detail below. A method for positioning the center of a tunnel target is performed according to the following steps:
[0059] Step 1) perform distortion correction and cropping on the single frame data collected by the monocular camera. Figure 3The single-frame data collected by the monocular camera is subjected to distortion correction and cropping. The cropping window is 640*640, and the displacement step is the minimum target size, which is taken as 100 pixels here. The size of the collected image is 4024*3036. After cropping, there are about 811 data sets. The data sets are respectively recognized, and finally the result target boxes are normalized to obtain the unique target positioning box.
[0060] Step 2) Use the adaptive canny operator to extract the edge pixels f(x, y) from the cropped target pattern, as Figure 4 shown. Based on the edge gradient value, fit the sub-pixel edge points. The formula is:
[0061]
[0062] f(x) = x + x min × Dx
[0063] f(y) = y + x min × Dy
[0064] where Dx and Dy are respectively the gradient direction values of the current point taking {0, 1}, and g(A), g(B), and g(C) are the gradient values at points A, B, and C respectively.
[0065] Step 3) For the above results, use the 8-neighborhood method to search for the boundary, and break at the corner points and inflection points to form new search line segments, and finally complete the directed connection of all edge lines; the corner points and inflection points are as Figure 5 shown and defined as follows:
[0066] Corner point: If the angle difference between the connecting lines of two adjacent points is greater than the given threshold T = 90°, |θ1 - θ2| > T, then it is a corner point;
[0067] Inflection point: Let θ = 5, extract the edge points as continuous short arc segments with θ as the step distance, calculate the concavity and convexity of each arc segment, and when the concavity and convexity change, the change point is the inflection point.
[0068] Step 4) Eliminate the short arc segments, straight arc segments, and invalid arc segments in the generated arc segments;
[0069] The judgment threshold for short arc segments is taken as T = 25, and the arc segments with L i < T are eliminated;
[0070] Straight arc segments, invalid arc segments:
[0071] Define the two end points of the arc segment as M(x1, y2) and N(x1, y2), then draw a straight line parallel to the two end points at the midpoint of the arc segment, and then draw perpendicular lines from the two end points to this straight line. The two perpendicular points are P(x3, y3) and Q(x4, y4) respectively. The four points form the shape as Figure 6For the rectangle shown, the short side is MQ and the long side is MN. Define Set the threshold TL = 0.05. Then, when μ < TL, it is defined as a straight arc segment or an invalid arc segment, and this arc segment is removed.
[0072] Step 5) Since the target pattern has the target circle as the main pattern and has a small amount of background texture noise, the larger arc segments remaining after Step 4) must be the boundaries of the target circle. Therefore, sort the arc segment data by arc length and fit ellipses from largest to smallest to obtain the fitted ellipse data. Use the following constraint strategies to extract the valid arc segments belonging to the target circle;
[0073] A. Area constraint
[0074] If the ellipses fitted by two elliptical arc segments belong to the same cluster, then the ratio of the areas of the two ellipses is Based on the larger arc segment as the basic radian, remove the arc segments with smaller areas;
[0075] B. Center point distance constraint
[0076] If the ellipses fitted by two elliptical arc segments belong to the same cluster, then the distance between the centers of the two ellipses is less than 0.1×S, where S is the length of the major axis a of the ellipse;
[0077] C. Position constraint of the circumscribed quadrilateral
[0078] If the ellipses fitted by two elliptical arc segments belong to the same cluster, then the circumscribed quadrilaterals must intersect. Based on the larger arc segment as the basic radian, remove the non - intersecting small arc segments;
[0079] D. Constraint on the ellipticity of the fitted ellipse;
[0080] During the installation of the target, the target surface is often not parallel to the imaging surface. Therefore, due to perspective difference, the target circle becomes an ellipse during imaging. The ellipticity of this ellipse is proportional to the angle α between the target surface and the parallel plane.
[0081] As Figure 7 shown, in actual use, the target is always installed facing the camera, and the deflection angle is always within a certain range. Let α < 45°. Therefore, the ellipticity of the imaging ellipse:
[0082]
[0083] In the formula, L is the imaging object distance, and R is the radius of the target circle. The larger α is, the larger the ellipticity e is. When α < 45°, e < 0.3. Considering the fitting error, the threshold Te = 0.35 can be set. For the fitted elliptical arc segments with e i > Te, they are discarded.
[0084] Step 6) After extracting the valid arc segments, the least squares method is used to fit the target ellipse, and the quality of the fitted ellipse equation is evaluated to determine whether the point is on the edge of the ellipse. After eliminating the invalid points, the remaining points are used to iteratively fit the ellipse again. The center of the ellipse obtained is the precise coordinate of the center of the target circle.
[0085] The criteria for judgment are:
[0086] Take |F(x i ,y i )|<0.1 is the effective point;
[0087]
[0088]
[0089] In the above formula, ρ is the angle between the center line of the ellipse and the X-axis, a is the major axis of the ellipse and b is the minor axis of the ellipse;
[0090] Statistical ratio of effective points to total points If Tp<0.8, invalid points are removed and the remaining points are used to iteratively fit the ellipse again until Tp>0.8. The center of the ellipse obtained is the precise coordinate of the center of the target circle.
[0091] Step 7) Result verification: Figure 8 As shown, a circular window with a radius of 20 pixels is taken at the center coordinates of the target circle, and the accuracy of the center coordinates is verified by statistical methods. If the above result coordinates are indeed the target center, the grayscale centroid of the black and white triangle area statistics will coincide with the result coordinates, and the distance error is less than the threshold of 1 pixel, thereby verifying the accuracy of the result.
[0092] The grayscale centroid can be regarded as a weighted centroid method with grayscale square as weight. The grayscale centroid method is used to extract the center of the image spot to obtain higher positioning accuracy. This method does not need to binarize the image to avoid introducing integer errors. The grayscale centroid S(x0,y0) in f(u,v) is calculated as follows:
[0093] The calculation method of the grayscale center S(x0,y0) in the window circle f(u,v) is:
[0094]
[0095]
[0096] Where W(u,v) is the weight, (u,v)∈window circle f(u,v).
[0097] The center coordinate displacement data continuously obtained by the method of the present invention is as follows: Fig. 9 As shown in the figure, it can be seen that the center positioning error of this method is better than 0.1mm in target monitoring at a distance of 10m.
[0098] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A tunnel target identification center positioning method, characterized in that: Follow these steps: Step 1) performing distortion correction and cropping on the single frame data collected by the monocular camera; Step 2) Use the adaptive canny operator to extract edge pixels f(x, y) from the cut target pattern, and fit the sub-pixel edge points based on the edge gradient value. The formula is: f(x)=x+x min ×Dx f(y)=y+x min ×Dy Among them, Dx and Dy are the gradient direction values of the current point, taking {0,1}, g(A), g(B), and g(C) are the gradient values at points A, B, and C; Step 3) For the above results, use the 8-neighborhood method to search the boundaries, and break at the corners and inflection points to form new search line segments, and finally complete the directed links of all edge lines; Step 4) Eliminate short arc segments, straight arc segments, and invalid arc segments from the generated arc segments; Step 5) aggregate the larger arc segments remaining after step 4) into valid arc segments, sort the arc segment data by arc length, fit ellipses from large to small, obtain fitted ellipse data, and use constraint strategies to extract valid arc segments belonging to the target circle; Step 6) After extracting the valid arc segments, the least squares method is used to fit the target ellipse, and the quality of the fitted ellipse equation is evaluated to determine whether the point is on the edge of the ellipse. After eliminating the invalid points, the remaining points are used to iteratively fit the ellipse again. The center of the ellipse obtained is the precise coordinate of the center of the target circle.
2. A tunnel target identification center positioning method according to claim 1, characterized in that: The definition of corner points and inflection points in step 3) is: Corner point: If the angle difference between two adjacent points is greater than a given threshold T = 90°, |θ1-θ2|>T, then it is a corner point; Inflection point: Let θ = 5, extract the edge points into continuous short arc segments with a step distance of θ, calculate the concavity of each arc segment, and when the concavity changes, the change point is the inflection point.
3. A tunnel target identification center positioning method according to claim 1, characterized in that: The positioning of short arc segments, straight arc segments, and invalid arc segments in step 4) is: The short arc segment judgment threshold is taken as T = 25, and the arc segments with L i < T are excluded; Straight arc segment, invalid arc segment: Define the two endpoints of the arc segment as M(x1, y2) and N(x1, y2). Then, draw a line parallel to the two endpoints at the midpoint of the arc segment. Next, draw perpendicular lines from the two endpoints to this line, and the two perpendicular points are P(x3, y3) and Q(x4, y4) respectively. The rectangle formed by the four points has the short side MQ and the long side MN. Define Set the threshold TL = 0.
05. Then, when μ < TL, it is defined as a linear arc segment or an invalid arc segment, and this arc segment is removed.
4. A tunnel target identification center positioning method according to claim 3, characterized in that: The constraint strategy in step 5) adopts the following four constraint strategies: A. Area Constraint If the ellipses fitted by two elliptical arc segments belong to the same cluster, then the ratio of the areas of the two ellipses is Take the large arc segment as the basic arc and eliminate the arc segments with smaller areas; B. Center point distance constraint If the ellipses fitted by two elliptical arc segments belong to the same cluster, the distance between the centers of the two ellipses is less than 0.1×S, where S is the length of the major axis a of the ellipse; C. Circumscribed quadrilateral position constraints If the ellipses fitted by two elliptical arc segments belong to the same cluster, then the circumscribed quadrilaterals must intersect, and the large arc segment is used as the basic arc, and the non-intersecting small arc segments are eliminated; D. Fitting ellipse flattening constraint; During the installation process, the target surface is often not parallel to the imaging surface. Therefore, the target circle becomes an ellipse due to perspective difference during imaging. The flattening of the ellipse is proportional to the angle α between the target surface and the parallel surface.
5. A tunnel target identification center positioning method according to claim 4, characterized in that: The judgment criteria of step 6) whether the midpoint is on the ellipse are: Take |F(x i ,y i )|<0.1 is the effective point; In the above formula, ρ is the angle between the center line of the ellipse and the X-axis, a is the major axis of the ellipse and b is the minor axis of the ellipse; Statistical ratio of effective points to total points If Tp<0.8, invalid points are removed and the remaining points are used to iteratively fit the ellipse again until Tp>0.
8. The center of the ellipse obtained is the precise coordinate of the center of the target circle.
6. A tunnel target identification center positioning method according to claim 5, characterized in that: It also includes step 7) result verification: a circular window with a radius of 20 pixels is taken at the center coordinates of the target circle, and the accuracy of the center coordinates is verified by statistical methods. If the above result coordinates are indeed the target center, the grayscale centroid of the black and white triangle area statistics will coincide with the result coordinates, and the distance error will be less than the threshold of 1 pixel, so as to verify the accuracy of the result.
7. A tunnel target identification center positioning method according to claim 6, characterized in that: The calculation method of the grayscale center S(x0,y0) in the window circle f(u,v) in step 7) is: Where W(u,v) is the weight, (u,v)∈window circle f(u,v).
Citation Information
Patent Citations
Pose calculation method based on combination target, system, medium and equipment
CN108765489A
Easily-expandable high-precision target center coordinate extraction method
CN115713540A
Photogrammetry coding mark identification method based on convolutional neural network and support arc
CN118587692A
AU2020103105A4
