Railway safety area division method based on unmanned aerial vehicle and GSD
By combining drones and GSD technology with deep learning algorithms, foreign objects along railway lines can be identified and safe zones can be delineated, solving the problems of low efficiency and low accuracy in existing technologies and achieving efficient and accurate railway safety zone delineation.
Patent Information
- Application Number
- CN202211425652.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-11-15
AI Technical Summary
Existing methods for dividing railway safety zones are inefficient, computationally intensive, and have low accuracy, making them ineffective in detecting the impact of foreign object intrusion on train safety.
The system employs drones and GSD (Ground Sampling Distance) technology to capture video along railway lines, combines deep learning algorithms to identify foreign objects, extracts track contours through image processing and delineates safe zones based on the track centerline, uses the YOLOv5 algorithm to identify foreign objects, calculates the ground sampling interval (GSD), and adapts to safe zone standards in different regions.
It achieves efficient and accurate railway safety zone delineation, reduces the need for manpower and material resources, adapts to the differences in standards in different regions, avoids blind spots and dead zones, and improves detection efficiency and accuracy.
Smart Images

Figure CN115861339B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a railway safety area division technology, in particular to a railway safety area division method based on a UAV and a GSD. BACKGROUND
[0002] Due to bad weather and the like, light objects such as color steel tiles, plastic films, dustproof nets, greenhouses and mulching films often invade a certain range on both sides of high-speed and conventional railways. If the invading objects invade the safety area of the railway, different degrees of harm will be caused to the railway operation, or the normal work of the overhead contact system will be affected. Because of the train accidents caused by the invading objects, it is crucial to determine whether the invading objects will affect the safe operation of the train.
[0003] However, the detection of the invading objects around the railway line is generally performed by manual inspection along the railway line during the window period, or by dividing the safety area after the video shooting by the monitoring equipment. The efficiency is low, there are dead angles and blind areas, and a fixed standard part needs to be selected as a reference to determine the range of the area. When the standard part needs to be selected as the reference, firstly, it is difficult to select the standard part that always exists in the shooting process along the railway line, and the standard part that always exists along the railway line may be damaged or deformed due to bad weather and extreme conditions. Secondly, after the standard part is selected, the UAV needs to maintain a fixed flight height for shooting, so as to ensure that the number of pixels corresponding to the standard part in the image is unchanged. Once the flight height changes, the number of pixels corresponding to the standard part in the image will also change, thereby causing inaccurate division of the safety area. At the same time, because the inspection is high-altitude inspection, the selected standard part occupies a very small proportion of the picture and has a very small pixel value, resulting in a large error between the actual distance and the number of pixels, and poor reliability. Because the height of the camera during shooting is uncertain, the standard part needs to be determined as the reference for subsequent calculation for each picture, resulting in a large amount of data calculation. At the same time, because the reference occupies a very small number of pixels in the picture, the accuracy is low in the size proportion conversion process. SUMMARY
[0004] The purpose of the present application is to provide a railway safety area division method based on a UAV and a GSD, so as to solve the problems of low efficiency, large amount of calculation and low accuracy in the existing railway safety area division.
[0005] The present application is implemented as follows: a railway safety area division method based on a UAV and a GSD, comprising the following steps.
[0006] S1. A UAV is used to shoot videos along the electrified railway, to obtain the shooting videos along the railway, and to record the actual flight height of the UAV, the tilt angle of the camera and the zoom ratio of the camera.
[0007] S2. Frame extraction is performed on the obtained video to obtain a large number of pictures along the railway.
[0008] S3. According to the recorded actual flight height of the unmanned aerial vehicle, the tilt angle of the camera and the zoom parameter, the ground sampling distance GSD of the camera at the flight time is calculated.
[0009] S4. The pictures containing foreign matters along the railway are identified and screened out by a deep learning algorithm.
[0010] S5. The region of interest image is extracted from the screened pictures containing foreign matters.
[0011] S6. The track contour is obtained by image processing on the region of interest image, and the linear equation of the track is obtained by identifying and fitting two tracks.
[0012] S7. The track center line is obtained according to the linear equation of the two tracks.
[0013] S8. According to the foreign matter intrusion safety area specification standard of different regional railway bureaus and the sampling interval GSD of the camera, the corresponding pixel number n in the image is calculated when the track center line of the railway is translated to both sides by the actual distance, and the track center line is expanded to both sides by n pixels to obtain two limits, and the area between the two limits is defined as the safety area.
[0014] In step S3, the ground sampling distance GSD of the camera is the tilt image GSD, and the calculation formula is as follows:
[0015]
[0016] Wherein, H is the actual flight height of the unmanned aerial vehicle, a is the pixel size, f is the focal length of the camera, and β is the tilt angle of the camera.
[0017] In step S4, the YOLOv5 algorithm is used to identify the pictures containing foreign matters along the railway.
[0018] In step S5, the polygon region is obtained by mouse interaction, the RGB channel value of each pixel in the selected polygon region is filled as 255 as a mask image, the mask image is subjected to mask operation with the original picture, and the region of interest image is extracted.
[0019] In step S6, the region of interest image is subjected to a grayscale processing, edge information in x direction and y direction is extracted from the obtained grayscale image, the extracted edges are fused, then a corrosion operation in morphology is adopted to filter out noises around the image, an expansion operation in morphology is utilized to expand the boundary of the image to promote the connection of regions, then a probabilistic Hough transformation is performed on the image to obtain a random point subset sufficient for line detection, a linear equation is fitted according to the random point subset, and a straight line identical with the position of the two tracks is drawn according to the fitted linear equation.
[0020] In step S7, the linear equations fitted by recognizing the two tracks are subjected to a spatial geometric analysis, so that an expression of the track center line is obtained, and the track center line is drawn.
[0021] In step S8, the pixel number n is obtained by comparing the extended distance L under different safety region standards with the GSD obtained in step S3, n is the pixel number that the track center line needs to be extended to two sides, two points on the track center line are selected, and the same pixel number n is translated to one side in the same direction and distance, the two translated points are connected to obtain the limit on one side, and the selected two points on the track center line are translated to the other side to obtain the limit on the other side, and the region between the two limits is the safety region.
[0022] In step S1, a wide-angle camera of the unmanned aerial vehicle is used to shoot a video along the railway line, and a zoom camera of the unmanned aerial vehicle is used to shoot a video along the railway line when the key region along the railway line is inspected.
[0023] The focal length of the zoom camera is:
[0024]
[0025] Wherein, f2 is the equivalent focal length of the wide-angle camera, f min is the minimum focal length of the zoom camera, f 1min is the minimum equivalent focal length of the zoom camera, and alpha is the zoom ratio of the camera.
[0026] The unmanned aerial vehicle is used to shoot a video for the inspection of the railway line, has the advantages of simple and convenient inspection, high efficiency, no blind area, no dead angle, high flexibility, and can perform the inspection work of the railway line in the non-skylight period. Since the unmanned aerial vehicle adopts a high-definition zoomable camera, safe operation can be performed at a long distance. The operation of the unmanned aerial vehicle is simple, only needs to fly along the line, and the use of manpower and material resources is greatly reduced.
[0027] When the safety region is divided, the application can adapt to the standard difference of different regions, does not need to select a fixed standard part as a reference object, and has a more free application environment. The operation is simple, the calculation amount is small, and the detection efficiency is high. Attached Figure Description
[0028] Figure 1 This is a flowchart of the present invention.
[0029] Figure 2 This is a schematic diagram of the vertical image GSD calculation principle of the present invention.
[0030] Figure 3 This is a geometric relationship diagram of the two orbits after fitting a straight line according to the present invention.
[0031] Figure 4 This is a diagram illustrating the division of safe zones. Detailed Implementation
[0032] like Figure 1 As shown, the present invention is a method for delineating railway safety zones based on unmanned aerial vehicles (UAVs) and GSD (Global Deployment System), which includes the following steps.
[0033] S1. Use drones to film videos along the electrified railway line, and record the actual flight altitude of the drone, the tilt angle of the camera, and the zoom level of the camera.
[0034] S2. Frame extraction is performed on the obtained video footage taken along the railway line to obtain a large number of images along the railway line.
[0035] S3. Based on the recorded actual flight altitude of the drone, camera tilt angle, and zoom level, calculate the ground sampling interval (GSD) of the camera at the moment of flight.
[0036] S4. Use deep learning algorithms to identify and filter images containing foreign objects along the railway line.
[0037] S5. Extract the region of interest from the filtered images containing foreign objects.
[0038] S6. Obtain the orbital contour from the region of interest image through image processing, and identify and fit the two orbits to obtain the linear equation of the orbit.
[0039] S7. Obtain the centerline of the orbit based on the linear equations of the two orbits.
[0040] S8. Based on the standards for foreign object intrusion into the safe zone set by railway bureaus in different regions and the sampling interval GSD of the camera, calculate the number of pixels n in the image corresponding to the actual distance when the actual distance is shifted to both sides based on the center line of the railway track. The center line of the track is extended to both sides by n pixels to obtain two boundaries. The area between the two boundaries is defined as the safe zone.
[0041] In step S1, a wide-angle camera carried by the unmanned aerial vehicle is used to take a video along the railway line. When taking the video, the camera is kept at a certain tilt angle with the position along the railway line, so as to ensure that the camera is not parallel to the railway line. The tilt angle is controlled by the camera gimbal pitch angle. Before takeoff of the unmanned aerial vehicle, the expected actual flight height is set to ensure the safety of the unmanned aerial vehicle and no hidden danger. After takeoff, the actual flight height and the camera gimbal pitch angle are adjusted to ensure that the unmanned aerial vehicle can safely, stably and clearly obtain the image along the railway line, and the actual flight height and the camera tilt angle at this moment are recorded. Then, the operator of the unmanned aerial vehicle only needs to perform simple along-line flight operation. If the actual flight height and the tilt angle need to be adjusted due to the shooting requirement, the unmanned aerial vehicle is kept in the hovering state, and after the actual flight height and the camera tilt angle are adjusted, the above-mentioned method is repeated to obtain the video along the electrified railway line.
[0042] When the key area along the railway line is inspected, a zoom camera is used for shooting. In this case, the unmanned aerial vehicle needs to record the zoom factor of the camera in addition to the actual flight height and the camera tilt angle. Then, the above-mentioned method is used for inspection operation to obtain the video along the railway line.
[0043] In step S2, the obtained video is read by using the VideoCapture class in the Opencv module, a suitable frame rate interval is selected to perform frame extraction processing on the video, and each frame read is stored in a specified folder for saving by using cv2.imwrite, so as to obtain a large number of photos along the electrified railway line.
[0044] In step S3, the ground sampling distance GSD of the camera is the tilt image GSD, and the calculation formula is as follows:
[0045]
[0046] Wherein, H is the actual flight height of the unmanned aerial vehicle, a is the pixel size, f is the focal length of the camera, and β is the tilt angle of the camera.
[0047] The ground sampling distance GSD represents the ground size corresponding to a single pixel in the digital image. According to the recorded actual flight height, camera tilt angle and zoom factor, combined with the optical sensor theory and tilt photography technology, the ground sampling distance (GSD) of the wide-angle camera and the zoom camera at the flight moment can be calculated.
[0048] Wherein, the pixel is the smallest light sensing unit on the camera chip, and each pixel corresponds to a pixel on the image. The pixel size a is calculated by the following formula:
[0049]
[0050] Calculation of zoom camera focal length
[0051]
[0052] where f min is the minimum focal length of the zoom camera, f 1min is the minimum equivalent focal length of the zoom camera, and f1 is the equivalent focal length of the zoom camera.
[0053] Since the focal length of the wide-angle camera is a fixed value, the zoom ratio of the zoom camera is obtained based on the equivalent focal length of the wide-angle camera as follows:
[0054]
[0055] That is, the focal length of the zoom camera expressed in terms of the zoom ratio is:
[0056]
[0057] where f2 is the equivalent focal length of the wide-angle camera, f min is the minimum focal length of the zoom camera, f 1min is the minimum equivalent focal length of the zoom camera, a is the zoom ratio of the camera, f2, f min , and f 1min are all fixed parameters.
[0058] Orthophoto is a remote sensing image with orthographic projection properties, which is obtained by the camera shooting directly at the ground when the unmanned aerial vehicle is flying.
[0059] The actual flight height of the unmanned aerial vehicle is:
[0060] H = H1 - H2
[0061] where H is the actual flight height, H1 is the current flight height, and H2 is the flight height above sea level.
[0062] When a pixel is projected onto the ground, it is not a perfect square. The orthophoto GSD based on the sensor height is:
[0063]
[0064] where Sesnor Height is the sensor height, Image Height is the image height, H is the actual height, and f is the camera focal length.
[0065] The orthophoto GSD based on the sensor width is:
[0066]
[0067] Wherein, Sesnor Width is the sensor width, Image Width is the image width, H is the actual height, and f is the camera focal length.
[0068] Because the two calculation results using the sensor height and the sensor width as the standard are different when calculating the GSD, the maximum or minimum value is generally selected as the orthophoto GSD.
[0069] GSD 正 = min{GSD w ,GSD h} or GSD 正 = max{GSD w ,GSD h}
[0070] As shown in Figure 2 , the camera pixel unit of the unmanned aerial vehicle is μm level, the unit is small, and therefore the GSD h and GSD w errors can be ignored. For the convenience of operation, the pixel length and width are generally considered to be equal, and the obtained ground sampling distance is:
[0071]
[0072] Wherein, GSD 正 is the orthophoto ground sampling distance, H is the actual flight height, f is the camera focal length, and a is the pixel size.
[0073] When the unmanned aerial vehicle patrols the electrified railway line, in order to ensure that the observation field of view is wide enough, the flight safety is guaranteed, and the operation is convenient, the tilt photography is generally used for the patrol, and the tilt image GSD is derived from the calculation of the orthophoto GSD.
[0074] The unmanned aerial vehicle used is controlled by a remote controller, the camera tilt angle is controlled by adjusting the gimbal pitch angle, the gimbal pitch angle is δ, the angle range is -120° to 30°, and the relationship between the camera tilt angle and the gimbal pitch angle is:
[0075] β = 90 - |δ|
[0076] The angle between the camera tilt surface and the vertical surface is the camera tilt angle β, which can be represented by , that is:
[0077]
[0078] Wherein, L is the tilt distance, β is the tilt angle, and H is the actual flight height of the unmanned aerial vehicle.
[0079] According to the vertical image The GSD formula of the oblique image is converted as follows:
[0080]
[0081] wherein H is the actual flight height of the UAV, a is the pixel size, f is the camera focal length, and β is the tilt angle.
[0082] In step S4, the YOLOv5 algorithm is used to identify the pictures containing foreign matters in the pictures along the railway. Specifically, the steps include the following.
[0083] S41. Create the required folder
[0084] Four folders are created in the data folder in the root directory of YOLOv5, which are an images folder for storing prepared railway line photos in jpg format, an Annotations folder for storing xml files corresponding to the photos in the images folder, an ImageSets folder for storing the classification of training data sets and test data sets, and a labels folder for storing the txt file of the marked content.
[0085] S42. Image annotation using Colabeler tool
[0086] The required xml format file in the Annotations folder needs to be obtained by using the Colabeler mapping tool software. First, the software is used to open the picture folder to be marked, the Rectangle button is selected (use the rectangular frame marking button), the foreign matter is selected by dragging the frame with the mouse, and the marking is completed by saving. After all the marking is completed, the original picture data set is placed in the images folder, the software is used to convert all the marked pictures into xml format files, and all the xml format files are placed in the Annotations folder.
[0087] S43. Classification of data set and generation of txt file
[0088] Two files are established in the root directory of YOLOv5, which are makeTxt.py (the main function of the internal code is to classify the data set into training set and test data set) and voc_label.py (the main function of the internal code is to read the annotation information in the xml file after the picture data set is marked and write it).
[0089] After running makeTxt.py, four files will appear in the ImageSets folder, including train.txt (writing the picture used for training), val.txt (writing the picture name used for verification), trainval (the combination of train and val), and test.txt (the picture name used for testing).
[0090] After running voc_label.py, the annotation information in the xml file after annotating the picture dataset is read and written into a txt file. After running, all the annotation information of the picture dataset appears in the labels folder.
[0091] S44. Create a yaml file
[0092] Where nc represents the number of recognized object categories, names represent category names, and path represents the file path.
[0093] S45. Run train.py for model training
[0094] Use train.py in the YOLOv5 source code package to train the model. After training, the weight file for target detection is obtained. The surrounding foreign objects along the railway line can be automatically detected.
[0095] S46. Target detection of foreign objects around the railway line
[0096] Run the detect.py file in the YOLOv5 source code package. After that, the detection completed picture will appear under the runs / detect / exp folder, and the output picture will frame the foreign objects. The more the number of training dataset pictures, the better the detection effect will be.
[0097] In step S5, due to the complex environment around the railway line, the recognition of the railway track has a great influence. In a certain background, the track can be recognized, but in another background, the track cannot be recognized. Therefore, the mouse mechanism is used to demarcate the region of interest (ROI region) that we are interested in. After that, a series of image processing is performed on the region of interest, so that the interference of external factors on the track extraction can be greatly reduced, the recognition accuracy is enhanced, and the universality is improved.
[0098] For the selection of the region of interest, the polygon region is obtained by mouse interaction. Specifically, the polygon region is divided by using cv2.EVENT_LBUTTONDOWN (left mouse button click event) in the OpenCV library. At this time, drawing = True, that is, the left mouse button is clicked to select the ROI vertex. The division of the polygon region is ended by using cv2.EVENT_RBUTTONDOWM (right mouse button click event) in the OpenCV library. At this time, drawing = False, the right mouse button is clicked to end the ROI selection. The pts = [] is used to store the ROI coordinate vector. When the left mouse button is clicked, len(pts) > 0. The cv2.circle() is used to draw the vertex mark at the corresponding position. When the left button is pressed again, len(pts) > 1. The cv2.circle is used to draw the vertex mark at the corresponding position. The cv2.line() is used to draw the boundary line segment between the vertex at this time and the last marked vertex. Finally, when the right button is pressed to end the drawing, the starting point pts[0] and the ending point pts[-1] are connected to complete the drawing of the last boundary line segment.
[0099] The RGB channel value of each pixel in the enclosed polygon region is filled with 255, which is used as a mask image. That is, the mask value in the bitwise AND function cv2.bitwise_and() function is used to complete the mask operation with the original image, so as to extract the region of interest image.
[0100] In step S6, the cv2.cvtColor() is used to perform grayscale processing on the region of interest image, so that the unmanned aerial vehicle can well extract the edge features when the camera is used to shoot the image regardless of the shooting angle. The Sobel operator cv2.Sobel() is used to extract the edge information in x direction and y direction of the obtained grayscale image, and the extracted edges are fused by using the cv2.addWeighted().
[0101] Then, the erosion operation in morphology is used to filter the noise around the image, and the dilation operation in morphology is used to expand the boundary of the image to promote the connection of the region. The erosion and dilation of the image are processed by using the open operation, and the function is cv2.morphologyEx(), wherein the parameter op is set to “cv2.MORPH_OPEN”.
[0102] Then the image after the opening operation is subjected to a probability Hough transform using cv2.HoughLinesP(), to obtain a random point subset sufficient for line detection. According to the random point subset, a RANSAC algorithm is used for linear fitting, and two linear equations y1=k1x+b1 and y2=k2x+b2 are obtained by fitting. According to the linear equations obtained by fitting, a straight line with the same position as the two tracks is drawn. The fitted straight line is as follows Figure 4 Two straight lines on the track.
[0103] Four points are selected on the x-axis and brought into the expressions of the two straight lines, to obtain two points (x 11 , y 11 ) and (x 12 , y 12 ) on the straight line y1=k1x+b1, and two points (x 21 , y 21 ) and (x 22 , y 22 ) on the straight line y2=k2x+b2. The original image is copied using img_final=img.copy(), and the linear equation y1=k1x+b1 obtained by fitting is drawn on img_final using cv2.line() combined with the two points (x1, y1) and (x2, y2), to obtain a straight line with the same position as the track. Similarly, y2=k2x+b2 can be drawn on img_final to obtain another straight line with the same position as the other track.
[0104] In step S7, the linear equations obtained by fitting the two tracks are subjected to spatial geometric analysis, to obtain the expression of the track center line, which is drawn on img_final using the expression and cv2.line().
[0105] The expression of the track center line is
[0106]
[0107] Two values x1 and x2 are selected on the x-axis and substituted into the formula to obtain y Center line1 , y Center line2 . The track center line can be drawn on img_final using cv2.line() combined with the two points (x1, y Center_line1 ) and (x2, y Center_line2 ), to complete the recognition of the track center line.
[0108] In step S8, the safety area is divided according to different specifications and standards of different regional railway bureaus for foreign matter intrusion into the safety area. Taking the track center line of the main line as the reference, the safety area is expanded by L meters to both sides.
[0109] The number of pixels n is obtained by comparing the extended distance L under different safety area standards with the GSD obtained in step S3, n is the number of pixels that the center line of the track needs to be expanded to both sides, two points on the center line of the track are selected, and the same number of pixels n is translated to one side in the same direction and distance, and the two points after translation are connected by cv2.line to obtain the limit on one side, and the selected two points on the center line of the track are translated to the other side to obtain the limit on the other side, and the area between the two limits is the safety area. Figure 3 Figure 4 As shown in the figure.
[0110] When the point is translated, the translation direction is inclined translation, which is divided into horizontal translation and vertical translation, the horizontal translation distance is n*sinα, and the horizontal translation distance is n*cosα.
[0111] Wherein the inclination angle α is the same as the angle between the fitting straight line and the x-axis, that is,
[0112]
[0113] The unmanned aerial vehicle is used to patrol and shoot video along the railway, has the advantages of simple and convenient inspection, high efficiency, no blind area, no dead angle, high flexibility, can carry out the inspection work along the railway in the non-skylight period. Since the unmanned aerial vehicle adopts a high-definition zoom camera, it can operate safely at a long distance. It will not cause harm to the operation of high-speed trains, and the unmanned aerial vehicle is simple to operate, only needs to fly along the line, greatly reducing the use of manpower and material resources.
[0114] After obtaining the pictures along the railway, the pictures containing foreign matters are identified by an algorithm, and then the safety area is divided in the pictures containing foreign matters. Since a railway may pass through multiple regions, when dividing the safety area, the safety area is divided according to the standards of different regions. After the safety area of the picture detected with foreign matters is determined, if the foreign matter is in the safety area, it is judged as a hidden foreign matter that needs to be removed in time, and if the foreign matter is not in the safety area, it can be ignored, and it is not a hidden foreign matter.
[0115] In the safety area division, the limit position is directly determined by the ground sampling distance (GSD) of the unmanned aerial vehicle camera, without needing to select a fixed standard part as a reference, only needing to record the actual flight height of the unmanned aerial vehicle when shooting the picture, the tilt angle of the camera and the zoom ratio of the camera, and other calculation required parameters are inherent parameters of the camera, the calculation process is simple, the calculation amount is small, and the precision and efficiency are high.
Claims
1. A railway safety zone division method based on a UAV and GSD, characterized in that, The method comprises the following steps: S1. Using a UAV to take videos along the electrified railway, obtaining the videos taken along the railway, and recording the actual flight height of the UAV, the tilt angle of the camera, and the zoom ratio of the camera; S2. Frame extraction processing is performed on the obtained videos taken along the railway to obtain a large number of pictures along the railway; S3. According to the recorded parameters of the actual flight height of the UAV, the tilt angle of the camera, and the zoom ratio, the ground sampling distance GSD of the camera at the flight time is calculated; The ground sampling distance GSD of the camera is the tilt image GSD, and the calculation formula is as follows: ; Wherein, H is the actual flight height of the unmanned aerial vehicle, a is the pixel size, f is the focal length of the camera, β is the tilt angle of the camera; S4. The pictures containing foreign matters in the pictures along the railway are identified and screened out through a deep learning algorithm; S5. The region of interest image is extracted from the screened pictures containing foreign matters; S6. The track profile is obtained by image processing on the region of interest image, and the linear equations of the two tracks are identified and fitted; S7. The track center line is obtained according to the linear equations of the two tracks; S8. According to the foreign matter intrusion safety area specification standards of different regional railway bureaus and the sampling distance GSD of the camera, the corresponding pixel number n is calculated when the track center line is translated by the actual distance to both sides as the reference, the track center line is expanded by n pixels to both sides to obtain two limits, and the area between the two limits is defined as the safety area; The expansion distance L under different safety area standards is compared with the GSD obtained in step S3 to obtain the pixel number n, which is the number of pixels that the track center line needs to be expanded to both sides, two points on the track center line are selected, and the same number of pixels n is translated to one side in the same direction and distance, and the two points after translation are connected to obtain the limit on one side, and the selected two points on the track center line are translated to the other side to obtain the limit on the other side, and the area between the two limits is the safety area.
2. The UAV and GSD based railway safety zone division method according to claim 1, wherein, In step S4, the YOLOv5 algorithm is used to identify the pictures containing foreign matters in the pictures along the railway.
3. The UAV and GSD based railway safety zone division method according to claim 1, wherein, In step S5, a polygon region is obtained by mouse interaction, the RGB channel values of each pixel in the selected polygon region are filled as 255 to obtain a mask image, the mask image is subjected to mask operation with the original picture, and the region of interest image is extracted.
4. The UAV and GSD based railway safety zone division method of claim 1, wherein, In step S6, the region of interest image is subjected to grayscale processing, the obtained grayscale image is extracted to obtain the edge information in the x direction and the y direction, the extracted edges are fused, then the erosion operation in morphology is used to filter the noise around the image, the expansion operation in morphology is used to expand the boundary of the image to promote the connectivity of the region, then the image is subjected to probabilistic Hough transformation to obtain a random point subset sufficient for line detection, the linear equation is fitted according to the random point subset, and a straight line with the same position as the two tracks is drawn according to the fitted linear equation.
5. The UAV and GSD based railway safety zone division method of claim 1, wherein, In step S7, the linear equations of the two tracks after identification and fitting are subjected to spatial geometric analysis to obtain the expression of the track center line, and the track center line is drawn.
6. The UAV and GSD based railway safety zone division method of claim 1, wherein, In step S1, the wide-angle camera of the unmanned aerial vehicle is used to take a video along the railway line, and the zoom camera of the unmanned aerial vehicle is used to take a video along the railway line when inspecting the key areas along the railway line.
7. The UAV and GSD based railway safety zone division method of claim 2, wherein, The focal length of the zoom camera is: ; where f2 is the wide-angle camera equivalent focal length, f min is the minimum focal length of the zoom camera, f 1min is the minimum equivalent focal length of the zoom camera, and a is the camera zoom factor.