A railway shunting distance measuring device and method
The railway shunting distance measuring equipment, which combines video cameras and 3D LiDAR, enables accurate detection and distance measurement of locomotives or vehicles on the tracks. This solves the problems of low distance measurement accuracy and low automation in existing technologies, and improves the safety and efficiency of shunting operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU XUJIAN SCI & TECH CO LTD
- Filing Date
- 2026-03-12
- Publication Date
- 2026-06-05
Smart Images

Figure CN122143972A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of railway shunting distance measurement, specifically to a railway shunting distance measurement device and method. Background Technology
[0002] In railway shunting operations, when pushing carriages to the storage line, it is essential to maintain a safe distance from vehicles already parked ahead to prevent collisions. Currently, most railway stations still rely on manual observation, experience-based judgment, or simple distance measuring tools for distance estimation, which has the following significant drawbacks: Large human error: Relying on manual visual estimation, it is affected by factors such as ambient light, weather, and visual fatigue, resulting in low accuracy and poor consistency, easily leading to safety accidents. Low efficiency: Repeated manual distance verification slows down the shunting process, affecting marshalling and transportation efficiency. Low automation: Existing distance measuring equipment has limited functionality, only providing distance data and unable to intelligently integrate with the track area and the position of locomotives / vehicles ahead, making it difficult to directly use for automatic parking control. Poor environmental adaptability: In low-visibility conditions such as nighttime, rain, and snow, the reliability of traditional visual or single-sensor solutions decreases significantly. Therefore, it is essential to provide a railway shunting distance measuring device and method. Summary of the Invention
[0003] The purpose of this invention is to provide a railway shunting distance measuring device and method that can complete the identification of railway track areas, detection of obstacles ahead and distance measurement in real time, accurately and automatically, and can directly output the results, so as to solve the existing technical defects and unmet technical requirements.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a railway shunting distance measuring device, comprising: The video camera module is used to acquire video images in front of the ranging device, generate video frames from the video images, and then send the video frames to the visual semantic segmentation module. The visual semantic segmentation module is used to receive video frames sent by the video camera module, classify and predict the pixels of the video frames to obtain the railway track area in the video frames, and send the video frames containing the railway track area to the double track detection module. The double track detection module is used to receive video frames containing the railway track area sent by the visual semantic segmentation module, find the vanishing point of the railway track according to the left and right boundaries of the railway track, and send the railway track area identifier of the train locomotive to the locomotive ranging module. The 3D LiDAR module scans the area in front of the ranging device using a micro-mirror to obtain a point cloud depth map of the area in front of the ranging device, and then sends the point cloud depth map to the ground segmentation module and the locomotive detection module. The ground segmentation module receives point cloud depth maps from the 3D LiDAR module, obtains the horizon region identifier from the point cloud depth map, and then sends the horizon region identifier to the locomotive detection module. The locomotive detection module is used to receive the horizon area identifier (used to filter blocks that do not intersect with the horizon area, since the locomotive must intersect with the horizon) sent by the ground segmentation module (5) and the point cloud depth map of the position in front of the ranging device sent by the 3D laser radar module. The point cloud depth map is divided into continuous depth blocks, that is, if the depth difference between two adjacent points is less than a preset value, they are still the same block. Blocks that do not intersect with the horizon area are filtered out. After filtering out other objects on the railway, the remaining blocks are candidate locomotive blocks. The minimum depth of the candidate locomotive block is the distance of the locomotive block. The locomotive detection module sends the candidate locomotive block identifier and distance to the locomotive ranging module. The locomotive ranging module receives a point cloud depth map of the position in front of the ranging device sent by the 3D LiDAR module and the distances between all candidate locomotive blocks sent by the locomotive detection module. It then performs coordinate system transformation on the candidate locomotive blocks (the LiDAR acquires a point cloud image with depth, with the top left corner (0,0) and the bottom right corner (width, height), indicating the start of detection and the presence of coordinates when a candidate locomotive block is detected). The transformed coordinates are mapped to the coordinate system of the video camera module. The module then determines whether the candidate locomotive block is on the railway track. If it is, the received distance to the candidate locomotive block is output as the distance to the preceding locomotive for automatic stopping.
[0005] A method for measuring distances during railway shunting includes the following steps: I. Image Acquisition 1.1) Set the railway shunting distance measuring equipment in front of the locomotive being shunted; 1.2) Acquire video images of the area in front of the ranging equipment by using the video camera module on the railway shunting ranging equipment; 1.3) Convert the acquired images and videos into video frames; 1.4) Send the obtained video frames to the visual semantic segmentation module; II. Determination of Railway Track Location 2.1) The visual semantic segmentation module receives video frames sent from the video camera module; 2.2) Classify and predict the pixels of the video frame to obtain the railway track area of the video frame; 2.3) Send video frames containing the railway track area to the double track detection module; III. Determining the location where the railway tracks disappeared 3.1) The dual-track detection module is used to receive video frames containing the railway track area sent by the visual semantic segmentation module; 3.2) Locate the vanishing point of the railway track based on its left and right boundaries; 3.3) Send the track area to the locomotive ranging module; IV. Point Cloud Depth Information Acquisition 4.1) Using a 3D LiDAR module, a micro-mirror is used to scan the area in front of the ranging device to obtain a point cloud depth map of the area in front of the ranging device (the point cloud depth map is an image, and each point is depth data). 4.2) Send the point cloud depth map to the ground segmentation module and the locomotive detection module; V. Determining the Horizon Position 5.1) The ground segmentation module receives the point cloud depth map sent by the 3D LiDAR module; 5.2) Obtain the area where the horizon is located using the point cloud depth map; 5.3) Send the area where the horizon is located to the locomotive detection module; VI. Debris Filtration and Distance Detection 6.1) The locomotive detection module receives the horizon area marker sent by the ground segmentation module and the point cloud depth map of the position in front of the ranging device sent by the 3D LiDAR module. 6.2) Perform depth continuous blockization on the two point cloud depth maps respectively, filter out other objects on the railway, and make the minimum depth of the candidate locomotive block the distance of the locomotive block; 6.3) The locomotive detection module sends the candidate locomotive blocks and distances to the locomotive ranging module; VII. Position Calibration 7.1) The locomotive ranging module receives the point cloud depth map of the position in front of the ranging device sent by the 3D LiDAR module and the distance between candidate locomotive blocks sent by the locomotive detection module. 7.2) and perform coordinate system transformation on the candidate locomotive blocks to obtain the distance to the preceding locomotive; 7.3) Output the distance to the vehicle in front for automatic parking.
[0006] Preferably, in step 1.3), the video frame is a continuous video frame, generally 25 frames per second.
[0007] Preferably, in step 2.2), obtaining the rail region content of the video frame is done by using the SegFormer-B1 segmentation network through the visual semantic segmentation module to classify and predict each pixel of the video frame, and to determine whether a pixel is a rail pixel or a non-rail pixel.
[0008] Preferably, in step 3.2), the content for finding the vanishing point of the railway track from the video frame is: 3.2.1) The double track detection module scans the track area in the video frame from bottom to top line by line. When the track area is detected for the first time, it is determined whether the track width meets the preset range. If it does not meet the range, the track is discarded and it is considered that the track is not the track where the current locomotive is located. 3.2.2) When multiple matching rail areas are detected, the middle rail area is selected as the rail where the currently shunted vehicle is located. 3.2.3) The double-track detection module continues to scan the railway track area above the video frame line by line from bottom to top along the left and right boundaries of the railway track area; 3.2.4) Find new left boundaries on the left and right sides of the new row after the detected left boundary is used as the measured value of the left boundary. Use the nearest point and the third front point of the left boundary of the scanned area to calculate the calculated value of the left boundary of the current row by connecting the two points (i.e., calculate the predicted value of the current row by connecting the two points). 3.2.5) Input the measured value and the calculated value into the Kalman filter to obtain the predicted value of the left boundary. Finally, the predicted value of the left boundary is used as the boundary value of the current row of the left boundary (i.e. the value of the left boundary of the current row of the rail). 3.2.6) Process the right boundary again using the content in steps 3.2.1)-3.2.5). When an intersection occurs at the single left and right boundary, the search for the railway area ends in order to find the vanishing point of the railway.
[0009] In this application, an adaptive noise filter using a Kalman filter is employed. By leveraging the slow and strong structural constraints of the stable geometry of the railway track, detection errors in the visual semantic segmentation module 2 are avoided, and problems such as vanishing point jumps at the left boundary are resolved.
[0010] Preferably, in step 5.2), the content of the horizon region obtained from the point cloud depth map is as follows: 5.2.1) The point cloud depth map is evenly divided into small segments from bottom to top using the ground segmentation module; 5.2.2) Then extract the median of the point cloud depth map for each small segment. That is, first sort all the depth values of the point cloud depth map of the small segment, and take the value at the very center of the sort as the median. 5.2.3) If the median of a small segment is greater than a preset threshold, then the small segment is considered to be the segment containing the horizon.
[0011] Preferably, in step 6.2), the specific operation of filtering out redundant content in the point cloud depth map is as follows: 6.2.1) The locomotive detection module performs depth continuous blockization on the point cloud depth map, and two adjacent points with a depth difference less than a preset value are still considered to be the same block; 6.2.2) Then, based on the blocks whose filter size (length and width) is smaller than the preset value, small objects, pedestrians, and stray structures are removed.
[0012] 6.2.3) The ground will naturally merge into large blocks. The locomotive detection module determines that the size (length and width) is greater than the preset value and filters out the ground. 6.2.4) Filter out blocks that do not intersect with the horizon and filter out other objects on the railway tracks.
[0013] The specific content of distance detection is: the minimum depth of the candidate locomotive block is the distance of the locomotive block.
[0014] Preferably, in step 7.2), the information obtained regarding the distance to the vehicle in front is: 7.2.1) The candidate locomotive blocks are transformed using the locomotive ranging module (i.e., the video camera and the lidar are aligned in coordinates). The upper left corner of the locomotive is (x, y). The coordinates are offset (x_alt, y_alt) to (x+x_alt, y+y_alt), and then scaled by a factor of s to become ((x+x_alt)*s, (y+y_alt)*s). Here, alt is an abbreviation for alternative, which means "alternative, offset, or spare". It is used here to distinguish between the "original coordinates" and the "offset coordinates". x, y: represent the original coordinates of the upper left corner of the locomotive, and x_alt, y_alt: represent the offset coordinates to be superimposed.
[0015] 7.2.2) The locomotive ranging module coordinates are offset and then scaled (), and the converted coordinates are mapped to the coordinate system where the video camera module is located. The coordinate offset and scaling factor are calibrated in advance. 7.2.3) Determine whether the candidate locomotive block is on the rail area. If the candidate locomotive block is on the rail area, then the distance of the received candidate locomotive block is taken as the distance of the preceding locomotive to be shunted.
[0016] In this application, it is necessary to further explain that the video camera of the ranging device and the 3D LiDAR are installed in fixed positions.
[0017] Compared with the prior art, the beneficial effects of the present invention are: 1. This application integrates visual camera and 3D LiDAR data, comprehensively utilizes visual semantic segmentation to accurately identify the railway track area, and uses the precise depth information of LiDAR point cloud to achieve accurate detection and distance measurement of locomotives or vehicles on the railway track. The measurement results can be directly used in the automatic parking system, significantly improving the automation level and safety of shunting operations, and realizing high-precision and automated distance measurement of the preceding vehicle.
[0018] 2. At the visual level, this application uses the SegFormer-B1 network for semantic segmentation, which improves the accuracy of rail recognition. By combining the dual-track detection module with the Kalman filter, the rail boundary is tracked and predicted, which effectively suppresses the detection jitter and "vanishing point jump" problems caused by image noise, illumination changes, etc., and ensures the stability of rail area recognition.
[0019] Furthermore, by identifying the horizon region through a ground segmentation module and combining multiple filtering mechanisms such as depth continuous blockization, size filtering, and intersection with the horizon, interference from pedestrians, small debris, trackside structures, and the ground itself can be effectively eliminated, accurately separating candidate locomotive targets and improving the reliability of target detection. This makes this application highly adaptable to the environment and robust. 3. This application uses a locomotive ranging module to transform and map the coordinates of candidate locomotive blocks detected by the lidar to the visual coordinate system, and then performs position verification with the visually identified railway track area. Only candidate targets located on the railway track area are ultimately confirmed as the preceding locomotive and their distance is output. This fusion judgment mechanism greatly reduces the risk of false alarms, ensures the effectiveness of the output distance information, and improves the practicality and reliability of the system. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the overall logic of each module in this invention; In the diagram: 1. Video camera module; 2. Visual semantic segmentation module; 3. Dual track detection module; 4. 3D LiDAR module; 5. Ground segmentation module; 6. Locomotive detection module; 7. Locomotive ranging module. Detailed Implementation
[0021] The following will refer to the appendices in the embodiments of the present invention. Figure 1 The technical solutions in the embodiments of the present invention are clearly and completely described herein. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0022] Please see Figure 1 Embodiments of the present invention: Example: As shown in the figure: A railway shunting distance measuring device includes: Video camera module 1 is used to acquire video images in front of the location of the ranging device, generate video frames from the video images, and then send the video frames to the visual semantic segmentation module 2. Among them, video frames are continuous video frames, generally 25 frames per second.
[0023] The visual semantic segmentation module 2 is used to receive video frames sent by the video camera module 1, classify and predict the pixels of the video frames to obtain the railway track area in the video frames, and send the video frames containing the railway track area to the double track detection module 3. The double track detection module 3 receives video frames containing the railway track area sent by the visual semantic segmentation module 2, finds the vanishing point of the railway track based on the left and right boundaries of the track, and sends the railway track area identifier of the locomotive being moved to the locomotive ranging module 7. The 3D LiDAR module 4 scans the area in front of the ranging device using a micro-mirror to obtain a point cloud depth map of the area in front of the ranging device, and then sends the point cloud depth map to the ground segmentation module 5 and the locomotive detection module 6. Ground segmentation module 5 is used to receive the point cloud depth map sent by 3D LiDAR module 4, obtain the horizon region identifier from the point cloud depth map, and then send the horizon region identifier to locomotive detection module 6. The locomotive detection module 6 is used to receive the horizon area identifier sent by the ground segmentation module 5 and the point cloud depth map of the position in front of the ranging device sent by the 3D lidar module 4. The point cloud depth map is divided into continuous depth blocks, that is, if the depth difference between two adjacent points is less than a preset value, they are still considered as the same block. Blocks that do not intersect with the horizon area are filtered out, and other objects on the railway are also filtered out. The remaining blocks after filtering are candidate locomotive blocks. The minimum depth of the candidate locomotive block is the distance of the locomotive block. The locomotive detection module 6 sends all candidate locomotive block identifiers and distances to the locomotive ranging module 7. The locomotive ranging module 7 receives the point cloud depth map of the position in front of the ranging device sent by the 3D LiDAR module 4 and the distances between all candidate locomotive blocks and their identifiers sent by the locomotive detection module 6. It then performs coordinate system transformation on the candidate locomotive blocks and maps the transformed coordinates to the coordinate system of the video camera module 1. It determines whether the candidate locomotive blocks are on the railway track. If they are, the received distances to the candidate locomotive blocks are output as the distance to the preceding locomotive for automatic stopping.
[0024] A method for measuring distances during railway shunting includes the following steps: II. Image Acquisition 1.1) Set the railway shunting distance measuring equipment in front of the locomotive being shunted; 1.2) Acquire video images of the area in front of the ranging equipment by using the video camera module 1 on the railway shunting ranging equipment; 1.3) Convert the acquired images and videos into video frames; Specifically, in step 1.3), the video frame is a continuous video frame, which is 25 frames per second; 1.4) Send the obtained video frames to the visual semantic segmentation module 2; II. Determination of Railway Track Location 2.1) The visual semantic segmentation module 2 receives video frames sent from the video camera module 1; 2.2) Classify and predict the pixels of the video frame to obtain the railway track area of the video frame; In step 2.2), obtaining the railway track region content of the video frame involves using the SegFormer-B1 segmentation network in the visual semantic segmentation module 2 to classify and predict each pixel in the video frame, determining whether a pixel belongs to the railway track or not. 2.3) Send the video frames containing the railway track area to the double track detection module 3; III. Determining the location where the railway tracks disappeared 3.1) The dual-track detection module 3 is used to receive video frames containing the railway track area sent by the visual semantic segmentation module 2; 3.2) Locate the vanishing point of the railway track based on its left and right boundaries; In step 3.2), the content for finding the vanishing point of the railway track from the video frame is as follows: 3.2.1) The double track detection module 3 scans the track area in the video frame from bottom to top line by line. When the track area is detected for the first time, it is determined whether the track width meets the preset range. If it does not meet the range, the track is discarded and it is considered that the track is not the track where the current locomotive is located. 3.2.2) When multiple matching rail areas are detected, the middle rail area is selected as the rail where the currently shunted vehicle is located. 3.2.3) The double track detection module 3 continues to scan the track area above the video frame line by line from bottom to top along the left and right boundaries of the track area; 3.2.4) Find the new left boundary on the left and right sides of the new line after the detected left boundary is used as the measurement value of the left boundary. Use the nearest point and the third previous point of the left boundary of the scanned area to calculate the calculated value of the left boundary of the current line by connecting the two points. 3.2.5) Input the measured and calculated values into the Kalman filter to obtain the predicted value of the left boundary. The predicted value of the left boundary is then used as the boundary value of the left boundary in the row. 3.2.6) Process the right boundary again using the content in steps 3.2.1)-3.2.5). When an intersection occurs at the single left and right boundary, the search for the railway area ends in order to find the vanishing point of the railway.
[0025] 3.3) Send the track area to the locomotive ranging module 7; IV. Point Cloud Depth Information Acquisition 4.1) Using the 3D LiDAR module 4, a micro-mirror is used to scan the area in front of the ranging device to obtain a point cloud depth map of the area in front of the ranging device. 4.2) Send the point cloud depth map to the ground segmentation module 5 and the locomotive detection module 6; V. Determining the Horizon Position 5.1) The ground segmentation module 5 receives the point cloud depth map sent by the 3D lidar module 4; 5.2) Obtain the area where the horizon is located using the point cloud depth map; In step 5.2), the content of the horizon region obtained from the point cloud depth map is as follows: 5.2.1) The ground segmentation module 5 evenly divides the point cloud depth map into small segments from bottom to top; 5.2.2) Then extract the median of the point cloud depth map for each small segment. That is, first sort all the depth values of the point cloud depth map of the small segment, and take the value at the very center of the sort as the median; (if the total number of values is even, take the average value). 5.2.3) If the median of a small segment is greater than a preset threshold, then the (small segment) is considered to be the segment containing the horizon.
[0026] 5.3) Send the area where the horizon is located to the locomotive detection module 6; VI. Debris Filtration and Distance Detection 6.1) The locomotive detection module 6 receives the horizon area marker sent by the ground segmentation module 5 and the point cloud depth map of the position in front of the ranging device sent by the 3D lidar module 4. 6.2) Perform depth continuous blockization on the two point cloud depth maps respectively, filter out other objects on the railway, and make the minimum depth of the candidate locomotive block the distance of the locomotive block; In step 6.2), the specific operation of filtering out redundant content in the point cloud depth map is as follows: 6.2.1) The locomotive detection module 6 performs depth continuous blockization on the point cloud depth map, and if the depth difference between two adjacent points is less than a preset value, they are still considered to be the same block; 6.2.2) Then, based on the blocks whose filter size is smaller than the preset value, small objects, pedestrians, and stray structures are removed.
[0027] 6.2.3) The ground will naturally merge into large blocks. The locomotive detection module 6 determines that the size is greater than the preset value and filters out the ground. 6.2.4) Filter out blocks that do not intersect with the horizon and filter out other objects on the railway tracks.
[0028] The specific content of distance detection is: the minimum depth of the candidate locomotive block is the distance of the locomotive block.
[0029] 6.3) The locomotive detection module 6 sends the candidate locomotive blocks and distances to the locomotive ranging module 7; VII. Position Calibration 7.1) The locomotive ranging module 7 receives the point cloud depth map of the position in front of the ranging device sent by the 3D LiDAR module 4 and the distance between candidate locomotive blocks sent by the locomotive detection module 6. 7.2) and perform coordinate system transformation on the candidate locomotive blocks to obtain the distance to the preceding locomotive; In step 7.2), the information obtained regarding the distance to the vehicle in front is as follows: 7.2.1) The candidate locomotive blocks are transformed using the locomotive ranging module 7; 7.2.2) The coordinates of the locomotive ranging module 7 are offset and then scaled to map the transformed coordinates to the coordinate system of the video camera module 1. The coordinate offset and scaling factor are calibrated in advance. 7.2.3) Determine whether the candidate locomotive block is on the rail area. If the candidate locomotive block is on the rail area, then the distance of the received candidate locomotive block is taken as the distance of the preceding locomotive to be shunted.
[0030] 7.3) Output the distance to the vehicle in front for automatic parking.
[0031] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the scope of the invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0032] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A railway shunting distance measuring device, characterized in that, include: The video camera module (1) is used to acquire video images in front of the location of the ranging device, generate video frames from the video images, and then send the video frames to the visual semantic segmentation module (2). The visual semantic segmentation module (2) is used to receive video frames sent by the video camera module (1), classify and predict the pixels of the video frames to obtain the area of the railway in the video frames, and send the video frames containing the railway area to the double track detection module (3). The double track detection module (3) is used to receive video frames containing the railway track area sent by the visual semantic segmentation module (2), find the vanishing point of the railway track according to the left and right boundaries of the railway track, and send the railway track area identifier of the locomotive being adjusted to the locomotive ranging module (7). The 3D LiDAR module (4) scans the front of the ranging device by a micro-mirror to obtain a point cloud depth map of the position in front of the ranging device, and then sends the point cloud depth map to the ground segmentation module (5) and the locomotive detection module (6). Ground segmentation module (5) is used to receive the point cloud depth map sent by the 3D LiDAR module (4), obtain the horizon area identifier through the point cloud depth map, and then send the horizon area identifier to the locomotive detection module (6). The locomotive detection module (6) is used to receive the horizon area identifier sent by the ground segmentation module (5) and the point cloud depth map of the position in front of the ranging device sent by the 3D laser radar module (4). The point cloud depth map is divided into continuous depth blocks, that is, if the depth difference between two adjacent points is less than a preset value, they are still the same block. Blocks that do not intersect with the horizon area are filtered out, and other objects on the railway are filtered out. The remaining blocks after filtering are candidate locomotive blocks. The minimum depth of the candidate locomotive block is the distance of the locomotive block. The locomotive detection module (6) sends all candidate locomotive block identifiers and distances to the locomotive ranging module (7). The locomotive ranging module (7) is used to receive the point cloud depth map of the position in front of the ranging device sent by the 3D laser radar module (4) and the distance between all candidate locomotive blocks sent by the locomotive detection module (6). The locomotive ranging module (7) performs coordinate system transformation on the candidate locomotive blocks and maps the transformed coordinates to the coordinate system of the video camera module (1). It determines whether the candidate locomotive blocks are on the railway track area. If the candidate locomotive blocks are on the railway track area, the distance of the received candidate locomotive blocks is output as the distance of the shunted locomotive in front of the vehicle for automatic parking.
2. A method for measuring distances during railway shunting, characterized by comprising the following steps: I. Image Acquisition 1.1) Set the railway shunting distance measuring equipment in front of the locomotive being shunted; 1.2) The video image in front of the location of the ranging equipment is acquired by the video camera module (1) on the railway shunting ranging equipment; 1.3) Convert the acquired images and videos into video frames; 1.4) Send the obtained video frames to the visual semantic segmentation module (2); II. Determination of Railway Track Location 2.1) The video frame sent by the video camera module (1) is received through the visual semantic segmentation module (2); 2.2) Classify and predict the pixels of the video frame to obtain the railway track area of the video frame; 2.3) Send the video frames containing the railway track area to the double track detection module (3); III. Determining the location where the railway tracks disappeared 3.1) The double track detection module (3) is used to receive video frames containing the railway track area sent by the visual semantic segmentation module (2); 3.2) Locate the vanishing point of the railway track based on its left and right boundaries; 3.3) Send the track area to the locomotive ranging module (7); IV. Point Cloud Depth Information Acquisition 4.1) Using the 3D LiDAR module (4), the front of the ranging device is scanned by a micro-mirror to obtain the point cloud depth map of the position in front of the ranging device; 4.2) Send the point cloud depth map to the ground segmentation module (5) and the locomotive detection module (6); V. Determining the Horizon Position 5.1) The ground segmentation module (5) receives the point cloud depth map sent by the 3D lidar module (4); 5.2) Obtain the area where the horizon is located using the point cloud depth map; 5.3) Send the area where the horizon is located to the locomotive detection module (6); VI. Debris Filtration and Distance Detection 6.1) The locomotive detection module (6) receives the horizon area marker sent by the ground segmentation module (5) and the point cloud depth map of the position in front of the ranging device sent by the 3D lidar module (4); 6.2) Perform depth continuous blockization on the two point cloud depth maps respectively, filter out other objects on the railway, and make the minimum depth of the candidate locomotive block the distance of the locomotive block; 6.3) The locomotive detection module (6) sends the candidate locomotive blocks and distances to the locomotive ranging module (7); VII. Position Calibration 7.1) The locomotive ranging module (7) receives the point cloud depth map of the position in front of the ranging device sent by the 3D lidar module (4) and the distance between candidate locomotive blocks sent by the locomotive detection module (6). 7.2) and perform coordinate system transformation on the candidate locomotive blocks to obtain the distance to the preceding locomotive; 7.3) Output the distance to the vehicle in front for automatic parking.
3. The railway shunting distance measurement method according to claim 2, wherein in step 1.3), the video frame is a continuous video frame, which is 25 frames per second.
4. The railway shunting distance measurement method according to claim 2, characterized in that, In step 2.2), the content of the railway track area in the video frame is obtained by using the SegFormer-B1 segmentation network through the visual semantic segmentation module (2) to classify and predict each pixel in the video frame, and to determine whether a pixel is a railway track pixel or a non-railway track pixel.
5. The railway shunting distance measurement method according to claim 2, characterized in that, In step 3.2), the content for finding the vanishing point of the railway track from the video frame is as follows: 3.2.1) The double track detection module (3) scans the track area in the video frame from bottom to top line by line. When the track area is detected for the first time, it is determined whether the track width meets the preset range. If it does not meet the range, the track is discarded and it is considered that the track is not the track where the current locomotive is located. 3.2.2) When multiple matching rail areas are detected, the middle rail area is selected as the rail where the currently shunted vehicle is located. 3.2.3) The double track detection module (3) continues to scan the track area above the video frame line by line from bottom to top along the left and right boundaries of the track area; 3.2.4) Find the new left boundary on the left and right sides of the new line after the detected left boundary is used as the measurement value of the left boundary. Use the nearest point and the third previous point of the left boundary of the scanned area to calculate the calculated value of the left boundary of the current line by connecting the two points. 3.2.5) Input the measured and calculated values into the Kalman filter to obtain the predicted value of the left boundary. The predicted value of the left boundary is then used as the boundary value of the left boundary in the row. 3.2.6) Process the right boundary again using the content in steps 3.2.1)-3.2.5). When an intersection occurs at the single left and right boundary, the search for the railway area ends in order to find the vanishing point of the railway.
6. The railway shunting distance measurement method according to claim 2, characterized in that, In step 5.2), the content of the horizon region obtained from the point cloud depth map is as follows: 5.2.1) The point cloud depth map is uniformly divided into small segments from bottom to top by the ground segmentation module (5); 5.2.2) Then extract the median of the point cloud depth map for each small segment. That is, first sort all the depth values of the point cloud depth map of the small segment, and take the value at the center of the sort as the median. 5.2.3) If the median of a small segment is greater than a preset threshold, then the small segment is considered to be the segment containing the horizon.
7. A railway shunting distance measurement method according to claim 2, characterized in that, In step 6.2), the specific operation of filtering out redundant content in the point cloud depth map is as follows: 6.2.1) The locomotive detection module (6) performs depth continuous blockization on the point cloud depth map, and if the depth difference between two adjacent points is less than the preset value, they are still considered to be the same block; 6.2.2) Then, based on the blocks whose size is smaller than the preset value, small objects, pedestrians, and miscellaneous structures are eliminated; 6.2.3) The ground will naturally merge into large blocks, and the locomotive detection module (6) will determine that the size is greater than the preset value and filter out the ground; 6.2.4) Filter out blocks that do not intersect with the horizon and filter out other objects on the railway tracks.
8. A railway shunting distance measurement method according to claim 2, characterized in that, In step 7.2), the information obtained regarding the distance to the vehicle in front is as follows: 7.2.1) The candidate locomotive blocks are transformed into their coordinate systems using the locomotive ranging module (7); 7.2.2) The locomotive ranging module (7) is offset and then scaled to map the converted coordinates to the coordinate system of the video camera module (1), where the coordinate offset and scaling factor are calibrated in advance; 7.2.3) Determine whether the candidate locomotive block is on the rail area. If the candidate locomotive block is on the rail area, then the distance of the received candidate locomotive block is taken as the distance of the preceding locomotive to be shunted.