Statistical-based railway catenary scene structure branch line fitting method
By merging straight lines and curves in railway contact network scenarios based on statistical methods, the problem of line segmentation is solved, the accuracy and reliability of detection are improved, and it is suitable for railway facility posture analysis.
Patent Information
- Application Number
- CN202410988991.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-07-23
AI Technical Summary
In the existing railway contact network scenario, the line detection algorithm is easily broken due to factors such as occlusion, local blur and intersection, affecting the detection accuracy.
A statistical method is used to merge straight lines and curves through image acquisition, line extraction, slope and intercept analysis, combined with mapping data structure, and data merging and screening using slope and intercept error thresholds to form complete straight line and curve results.
The accuracy and reliability of straight line calculations are improved, and continuous straight lines can be extracted from complex scenes, providing more reliable facility posture analysis.
Smart Images

Figure CN119723506B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of railway line graph analysis processing method, and particularly relates to a railway catenary scene structure branch fitting method based on statistics. BACKGROUND
[0002] In the operation line of a railway, especially a high-speed railway, a power supply system is a system composed of a power supply system and a power transmission and distribution system, which generates electric energy and supplies and transmits the electric energy to electric equipment. In a long-distance power supply system, there is often a problem of difficult maintenance due to damage of line equipment. This means that in the work along the line, a large amount of graph monitoring work is faced, and in the railway line graph analysis, most of the LSD line segment detection algorithms can obtain a straight line segment detection result. Through local analysis of an image, a pixel point set of a straight line is obtained, and then the pixel point set is verified and solved through assumed parameters, the pixel point set is combined with an error control set, and the number of false detections is adaptively controlled. Generally speaking, to detect a straight line in an image, the most basic idea is to detect a pixel point set with a large gradient change in the image, and the LSD algorithm also uses gradient information and level lines to detect a straight line.
[0003] However, the prior art has the following problems:
[0004] (1) In the prior art, for the case of intersection of straight lines, since it is set whether each point is USED, each point can only belong to one straight line, and if there is intersection, at least one straight line is split into two. Since it is based on gradient, the gradient value at the intersection point of the straight lines is often small (not detected as an edge point), so it is very likely that the two intersecting straight lines are split into four line segments at the intersection point.
[0005] (2) Due to the self-growth characteristics of the local detection algorithm, a long line segment is often split into multiple straight lines due to occlusion, local blur and other reasons.
[0006] That is, the traditional LSD method has certain limitations in processing these cases, and cannot screen the most accurate straight line, thereby affecting the accuracy of straight line calculation. SUMMARY
[0007] The purpose of the present application is to solve the common problems faced by the straight line detection part in the railway catenary scene facility posture analysis, that is, the straight line is often fragmented due to factors such as occlusion, local blur and intersection. That is, to solve the problem that the straight line is often fragmented due to factors such as occlusion, local blur and intersection, the present method proposes a statistical method for calculating complete straight lines, and the structure posture of the facility in the image is calculated by using the statistical classification technology. By analyzing the characteristics, slope and intercept of the straight line in the image, we can infer how to merge the straight line. This method improves the LSD algorithm and dynamically classifies the parameters to restore the straight line.
[0008] The specific scheme of the present application is:
[0009] A statistical railway catenary scene structure branch line fitting method is designed, which comprises the following steps:
[0010] (1) Image acquisition: install a video recording device outside the head of a high-speed train, and when the high-speed train runs at a speed of 150 KM / h or above, take pictures every 0.2 to 0.5 seconds to form an acquisition image, which is communicated to or input into a timed hard disk image processing system to start identification and screening;
[0011] (2) Image line extraction: starting from the lower right corner of the acquisition image, the image line extraction is performed from the lower right corner to the upper left corner in a single pixel unit, and the pixel points are checked horizontally. The LSD algorithm is used to detect all straight line elements in the image to form a sample image A;
[0012] (3) Analyzing the sample image A: in the sample image A, each branch line is taken as a data group, and the pixel coordinate information of at least two points in each data group is collected. The slope of the data group is obtained by using the slope-intercept equation b=y-mx, wherein, x1,y1 is the pixel coordinate information of one of the pixel points, and x0,y0 is the pixel coordinate information of the other pixel point;
[0013] (4) Merging data according to the slope information:
[0014] a. Set the slope error threshold LK and the intercept error threshold LB;
[0015] b. Create a mapping data structure MAP to store the classified straight line data;
[0016] c. Obtain the slope m and intercept b of the next straight line, and if there is no straight line data, end the algorithm;
[0017] If the MAP is empty, the current straight line is directly put into the dictionary, the key of the dictionary is 1, and then step (3) is executed. If the MAP is not empty, step (5) is executed;
[0018] d. Traverse the MAP, check if the slope m of the first element in all keys in the MAP is less than LK and the intercept b is less than LB. If the conditions are met, merge the slope m and the intercept b of the current straight line into the straight line set corresponding to the key, and continue to perform step (3); if the conditions are not met, create a new key in the MAP, the value of the key is the maximum value of the existing key plus 1, then put the current straight line into the straight line set corresponding to the new key, and then perform step (3);
[0019] (5) Merge the branches according to the keys of the dictionary: N sets of straight line sets have been obtained through step (3), let the straight line set be U ij , i represents the i-th group of straight lines, j represents the j-th line segment, j<=n, n is the number of line segments; let x i be the x coordinate of the straight line, 0<i<1, i=0 is the starting point coordinate, i=1 is the end point coordinate; let y i be the y coordinate of the straight line, 0<i<1, i=0 is the starting point coordinate, i=1 is the end point coordinate; let the result combination be R i , i represents the i-th group of merged straight line results.
[0020] The merging formula is:
[0021] R i = ((U i0 x0, U i0 y0), (U in x1, U in y1))
[0022] In the merging process, the starting point coordinates (U i0 x0, U i0 y0) of the first group of straight lines are taken as the starting point coordinates of the result set R i , and the end point coordinates (U in x1, U in y1) of the last group of straight lines are taken as the end point coordinates of the result set R i .
[0023] After step (5) is completed, combine the sample image A in step (1), screen out the data of the merged straight lines to form a sample image B, and perform secondary screening on the remaining straight lines in the sample image B. The screening steps are as follows:
[0024] (6) In the sample image B, take each branch line as a data group, collect the pixel point coordinate information of at least 3 points on each data group, use the parabola formula y=dx 2 +ex+cf to form 3 ternary quadratic equations, and then form a set of ternary quadratic equation groups, solve d, e, f, and take d, e, f as the judgment array conditions;
[0025] a. Create a mapping data structure MAP to store the classified curve data;
[0026] b. Get the array condition of the next curve. If there is no array condition data, the algorithm ends;
[0027] If MAP is empty, the current line is directly put into the dictionary with the key 1, and then step (6) is executed. If MAP is not empty, step (5) is executed.
[0028] c. Traverse the MAP and check whether the array conditions in all keys in the MAP are the same as the previous array conditions. If the conditions are met, merge the current curve into the curve set corresponding to the key and continue with step (3); if the conditions are not met, create a new key in the MAP with the value of the key being the maximum value of the existing key plus 1, then put the current curve into the curve set corresponding to the new key and continue with step (6);
[0029] (7) Merge branches according to the dictionary key: N sets of curves have been obtained through step (3), and the set of straight lines is U ij , i represents the i-th group of straight lines, j represents the j-th line segment, j<=n, n is the number of line segments; let x i is the x-coordinate of the line, 0 <i<1,i=0时为起点坐标,i=1时为终点坐标;设y i is the y coordinate of the line, 0 <i<1,i=0时为起点坐标,i=1时为终点坐标;设结果结合为R i , i represents the combined curve result of group i;
[0030] The combined formula is:
[0031] R i =((U i0 x0,U i0 y0),(U in x1,U in y1))
[0032] During the merging process, we take the starting coordinates of the first set of lines (U i0 x0,U i0 y0) as the result set R i The starting coordinates of the last set of straight lines (U in x1,U in y1) as the result set R i The end point coordinates.
[0033] Before step (2), the image is decolorized.
[0034] After step (7), combined with the sample image A in step (2), the data of the merged straight line and the data of the curve are screened out to form a sample image C, and pixel analysis is performed on the remaining lines in the sample C to further determine the type of the components.
[0035] The beneficial effects of the present application are:
[0036] The technology of the present patent can extract continuous and unbroken straight lines from various complex scenes such as occlusion, partial blur, and intersection by applying innovative methods and algorithms. The introduction of this technology will significantly improve the accuracy of straight line calculation and provide a more reliable solution for railway catenary scene facility posture analysis.
[0037] The present patent aims to protect the proposed method for detecting linear structures in railway structures. This includes algorithm improvements and optimizations specifically for railway scene structure detection to improve the accuracy and reliability of straight line fitting. The patent may specifically specify technical details and innovations in this specific scenario, such as specific image processing steps, optimization algorithms, etc. BRIEF DESCRIPTION OF DRAWINGS
[0038] Fig. 1 is the corresponding comparison figure after the original photo in the present application and the existing technology LSD algorithm;
[0039] Fig. 2 is the comparison figure after the existing technology LSD algorithm in the present application and the fitting in the present application;
[0040] Fig. 3 is the flowchart of the steps of the present algorithm. DETAILED DESCRIPTION
[0041] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings, and it should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application.
[0042] Example 1
[0043] A statistical-based railway catenary scene structure branch line fitting method, as shown in Figs. 1 to 3 , comprising the following steps:
[0044] (1) Image acquisition: install a video recording device on the outside of the head of a high-speed train, and when the high-speed train runs at a speed of 150 KM / h or above, take a picture every 0.2 to 0.5 seconds to form an acquisition image, which is communicated to or input into a hard disk image processing system to start recognition and screening;
[0045] (2) Image line extraction: starting from the lower right corner of the collected image to the upper left corner, the pixels are checked in a single pixel unit horizontally, and the LSD algorithm is used to detect all straight line elements in the image to form a sample image A;
[0046] (3) Analysis of sample image A: in sample image A, each branch line is taken as a data group, and the pixel coordinate information of at least two points on each data group is collected. The slope of the data group is obtained by using the slope-intercept equation, b=y-mx; wherein, x1, y1 is the pixel coordinate information of one of the pixel points, and x0, y0 is the pixel coordinate information of the other pixel point;
[0047] (4) Data merging based on slope information:
[0048] a. Set the slope error threshold LK and the intercept error threshold LB;
[0049] b. Create a mapping data structure MAP to store the classified straight line data;
[0050] c. Obtain the slope m and intercept b of the next straight line. If there is no straight line data, the algorithm ends;
[0051] If MAP is empty, the current straight line is directly put into the dictionary, the key of the dictionary is 1, and then step (3) is executed. If MAP is not empty, step (5) is executed;
[0052] d. Traverse MAP and check whether the slope m of the first element in all keys in MAP is less than LK and the intercept b is less than LB. If the conditions are met, the slope m and intercept b of the current straight line are merged into the straight line set corresponding to the key, and step (3) is continued. If the conditions are not met, a new key is created in MAP, the value of the new key is the maximum value of the existing keys plus 1, and then the current straight line is put into the straight line set corresponding to the new key, and step (3) is executed again;
[0053] (5) Merge branch lines according to the keys of the dictionary: N sets of straight line sets have been obtained through step (3), and the straight line set is denoted as U ij , i represents the i-th straight line set, j represents the j-th line segment, j<=n, n is the number of line segments; x i is the x-coordinate of the straight line, 0<i<1, i=0 is the starting point coordinate, and i=1 is the end point coordinate; y i is the y-coordinate of the straight line, 0<i<1, i=0 is the starting point coordinate, and i=1 is the end point coordinate; and R i is the result of the combined i-th set of merged straight lines.
[0054] The merging formula is:
[0055] R i = ((U i0 x0, U i0 y0), (U in x1, U in y1))
[0056] In the merging process, the starting point coordinates (U i0 x0, U i0 y0) of the first group of straight lines are taken as the starting point coordinates of the result set R i , and the end point coordinates (U in x1, U in y1) of the last group of straight lines are taken as the end point coordinates of the result set R i .
[0057] Through this merging formula, multiple straight line segments can be merged into a curve. This merging method is suitable for cases where there is continuity between multiple straight line segments and can play an important role in graphics processing, computer vision, and other fields. The present application provides a straight line merging method based on starting point coordinates and end point coordinates to improve the readability and processing efficiency of straight line data, providing a new solution for the development and practical application of related fields.
[0058] In this embodiment, all lines with the same slope are found, and the intersection and merging are performed based on the same slope condition, and the unified line segment is managed, so that the line segments are grouped and managed and named, which is convenient for later processing.
[0059] Example 2
[0060] The previous steps of this embodiment are the same as those of Example 1, and the specific difference is that after step (5) is completed, the sample image A in step (1) is combined to screen out the data of the merged straight lines to form a sample image B, and the remaining straight lines in the sample image B are subjected to secondary screening, and the screening steps are as follows:
[0061] (6) In the sample image B, each branch line is taken as a data group, and the pixel point coordinate information of at least 3 points on each data group is collected, and a parabolic formula y = dx 2 +ex+cf is used to form 3 ternary quadratic equations, and then a set of ternary quadratic equation groups is formed, and d, e, and f are solved as the array condition;
[0062] a Create a mapping data structure MAP to store the classified curve data;
[0063] b, obtain the array condition of the next curve. If there is no array condition data, the algorithm is ended;
[0064] If MAP is empty, the current straight line is directly put into the dictionary, the key of the dictionary is 1, and then step (6) is executed; if MAP is not empty, step (5) is executed;
[0065] c. Traversing MAP, checking the array condition in all keys in MAP is the same as the previous array condition, if the condition is met, the current curve is merged into the curve set corresponding to the key, and step (3) is continued to be executed; if the condition is not met, a new key is created in MAP, the value of the key is the maximum value of the existing key plus 1, then the current curve is put into the curve set corresponding to the new key, and step (6) is executed;
[0066] (7) Merging branch lines according to the key of the dictionary: N sets of curve sets have been obtained through step (3), assuming that the straight line set is U ij , i represents the i-th set of straight lines, j represents the j-th line segment, j<=n, n is the number of line segments; assuming that x i is the x-coordinate of the straight line, 0 i is the y-coordinate of the straight line, 0 i , i represents the i-th set of merged curve results;
[0067] The merging formula is:
[0068] R i = ((U i0 x0,U i0 y0), (U in x1,U in y1))
[0069] In the merging process, the starting point coordinates (U i0 x0,U i0 y0) of the first set of straight lines are taken as the starting point coordinates of the result set R i , and the end point coordinates (U in x1,U in y1) of the last set of straight lines are taken as the end point coordinates of the result set R i . In this embodiment, the design purpose is to realize the recognition of curves, that is, the recognition of cables.
[0070] Before step (2), the image is subjected to desaturation processing.
[0071] In the field of computer vision, LSD stands for line segment detector, which is a line segment detection algorithm that can provide sub-pixel level accuracy in linear time. The algorithm forms a horizon line field by calculating the horizontal line angle of each pixel point, and further divides it into connected regions, which are called line support regions. By counting the number of pixels and alignment points in these regions, it can be determined whether there is a line segment.
[0072] Embodiment 3
[0073] This embodiment is after the step of embodiment 2, that is, after step (8), combined with the sample image A in step (1), the data of the merged straight line and the data of the curve are screened out to form the sample image C. For the remaining lines in sample C, pixel analysis is performed to further determine the type of the components. This step is equivalent to reverse judgment. After screening out all the branch line curves, the remaining branch line segments or curve line segments are analyzed in detail, which can save the subsequent analysis time and highlight the image.
[0074] Finally, it should be noted that the above description is only the preferred embodiments of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent replacements to some technical features. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A railway overhead line scenario structure branch line fitting method based on statistics, characterized in that: The steps include: (1) Image acquisition: A video recording device is installed on the outside of the front of the high-speed rail car. When the high-speed rail runs at a speed of 150 km / h or above, a camera is taken every 0.2 to 0.5 seconds to form a captured image. The captured image is input into the communication or the hard disk at a fixed time to start the recognition and screening of the image processing system; (2) Image line extraction: Starting from the lower right corner of the captured image toward the upper left corner, the pixel points along the way are horizontally checked in units of single pixels. All straight line elements in the image are detected using the LSD algorithm to form a sample image A. (3) Analyze sample image A: In sample image A, take each branch line as a data group, collect pixel coordinate information of at least two points in each data group, and use the slope-intercept equation, b = y – mx; to obtain the slope of the data group, where x1, y1 are the pixel coordinate information of pixel one, and x0, y0 are the pixel coordinate information of pixel two; (4) Data merging based on slope information: a. Set the slope error threshold LK and intercept error threshold LB; b. Create a mapping data structure MAP to store the classified line data; c. Get the slope m and intercept b of the next straight line. If there is no straight line data, terminate the algorithm. If MAP is empty, the current line is directly put into the dictionary with the key 1, and then step (3) is executed. If MAP is not empty, step (5) is executed. d. Traverse the MAP and check whether the slope m of the first element in all keys in the MAP is less than LK and whether the intercept b is less than LB. If the conditions are met, merge the slope m and intercept b of the current line into the line set corresponding to the key and continue with step (3); if the conditions are not met, create a new key in the MAP with the value of the key being the maximum value of the existing key plus 1, then put the current line into the line set corresponding to the new key and continue with step (3); (5) Merge the branches according to the keys of the dictionary: N sets of straight-line sets have been obtained through step (3). Let the straight-line set be U ij , i represents the i-th set of straight lines, j represents the j-th line segment, j <= n, where n is the number of line segments; let x i be the x coordinate of the straight line, 0 < i < 1, the starting point coordinate when i = 0, and the ending point coordinate when i = 1; let y i be the y coordinate of the straight line, 0 < i < 1, the starting point coordinate when i = 0, and the ending point coordinate when i = 1; let the result combination be R i , i represents the result of the merged straight lines in the i-th group The combined formula is: R i =((U i0 x0,U i0 y0),(U in x1,U in y1)) During the merging process, we take the starting coordinates of the first set of lines (U i0 x0,U i0 y0) as the result set R i The starting coordinates of the last set of straight lines (U in x1,U in y1) as the result set R i The end point coordinates.
2. The method for fitting railway overhead contact network scene structure branches based on statistics according to claim 1, characterized in that: After step (5) is completed, the data of the merged straight lines are screened out in combination with the sample image A in step (1) to form a sample image B. The remaining straight lines in the sample image B are screened twice. The screening steps are as follows: (6) In sample image B, each branch line is a data group, and the pixel coordinate information of at least 3 points in each data group is collected. Using the parabola formula, y = dx 2 +ex+cf, forming three quadratic equations with three variables, and then forming a set of quadratic equations with three variables, solving d, e, f, with d, e, f as the judgment array conditions; a. Create a mapping data structure MAP to store the classified curve data; b. Get the array condition of the next curve. If there is no array condition data, the algorithm ends. If MAP is empty, the current line is directly put into the dictionary with the key 1, and then step (6) is executed. If MAP is not empty, step (5) is executed. c. Traverse the MAP and check whether the array conditions in all keys in the MAP are the same as the previous array conditions. If the conditions are met, merge the current curve into the curve set corresponding to the key and continue with step (3); if the conditions are not met, create a new key in the MAP with the value of the key being the maximum value of the existing key plus 1, then put the current curve into the curve set corresponding to the new key and continue with step (6); (7) Merge branches according to the keys of the dictionary: N sets of curve collections have been obtained through step (3). Let the set of lines be U ij , where i represents the i-th set of lines, j represents the j-th line segment, j <= n, and n is the number of line segments; let x i be the x-coordinate of the line. When 0 < i < 1, it is the starting point coordinate when i = 0 and the ending point coordinate when i = 1; let y i be the y-coordinate of the line. When 0 < i < 1, it is the starting point coordinate when i = 0 and the ending point coordinate when i = 1; let the result combination be R i , where i represents the result of the merged curve of the i-th group; The combined formula is: R i =((U i0 x0,U i0 y0),(U in x1,U in y1)) During the merging process, we take the starting coordinates of the first set of lines (U i0 x0,U i0 y0) as the result set R i The starting coordinates of the last set of straight lines (U in x1,U in y1) as the result set R i The end point coordinates.
3. The method for fitting railway overhead contact network scene structure branches based on statistics according to claim 1, characterized in that: Before step (2), the image is decolorized.
4. The method for fitting railway overhead contact network scene structure branches based on statistics according to claim 2, characterized in that: After step (7), the sample image A in step (2) is combined to screen out the data of the merged straight lines and the data of the curves to form a sample image C. The remaining lines in sample C are subjected to pixel analysis to further determine their component types.
Citation Information
Patent Citations
Railway traffic overhead line system inspection method based on attention mechanism full convolutional network
CN111553500A
Method for extracting discontinuous straight lines in image
CN111932506A