A vehicle speed measurement method based on road marking semantic segmentation

CN118570279BActive Publication Date: 2026-08-28INNER MONGOLIA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410713973.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2026-08-28
Estimated Expiration
2044-06-04

AI Technical Summary

Technical Problem

但该规范中所记录的帧数均为整数,会产生较大的误差

Benefits of technology

[0050] 1. This invention discloses a vehicle speed measurement method based on road marking semantic segmentation, which uses a deep learning semantic segmentation model combined with the relationship between lane lines and detection lines to realize vehicle speed measurement by an on-board camera.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570279B_ABST
    Figure CN118570279B_ABST
Patent Text Reader

Abstract

The application discloses a kind of vehicle speed measurement methods based on road marking line semantic segmentation, it includes the following steps: S1: training semantic segmentation model;S2: lane line detection;S3: determine lane line contour;S4: determine detection line position;S5: calculate the frame number of vehicle passing;S6: calculate vehicle speed.The beneficial effect: the application discloses a kind of vehicle speed measurement methods based on road marking line semantic segmentation, to depth learning semantic segmentation model is combined with lane line and detection line relationship as foundation, realize the vehicle speed measurement of vehicle-mounted camera, with the position of adjacent frame lane line and detection line as foundation, realized " non whole frame counting", improve the accuracy of speed measurement, realized the cycle speed measurement of " blank area " " line area ", shorten the time window of speed measurement, so that the measured speed is closer to instantaneous speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical fields:

[0001] This invention patent belongs to the field of vehicle speed measurement technology, specifically relating to a vehicle speed measurement method based on road marking semantic segmentation. Background technology:

[0002] Vehicle speed is a crucial factor in analyzing traffic accident processes, determining accident facts, and identifying accident causes. Furthermore, vehicle speed is also an important parameter in technical research such as car-following models and overtaking models. Traditional vehicle-mounted speed measurement equipment is expensive and has significant limitations in its use. With technological advancements, calculating vehicle speed using onboard vision systems has become a key technology. Cameras are not only inexpensive but also acquire richer road information. As camera resolution continues to improve, the accuracy of the technical processing based on them is also constantly increasing.

[0003] The public security industry standard GA / T 1133-2014 proposes a method for calculating vehicle speed from vehicle-mounted video images. This method involves selecting a reference object and calculating the vehicle speed based on the number of frames the vehicle passes over that reference object. However, the frame numbers recorded in this standard are all integers, which can lead to significant errors.

[0004] This invention proposes a counting scheme that can calculate non-integer frames, as well as a speed measurement rule based on the positional relationship between lane lines and detection lines in adjacent frames, which improves the accuracy of vehicle speed measurement. The equipment used is simple and easy to operate. Summary of the Invention:

[0005] In view of this, the purpose of this invention is to provide a vehicle speed measurement method based on road marking semantic segmentation. The vehicle speed measurement method based on road marking semantic segmentation provided by this invention uses a deep learning semantic segmentation model combined with the relationship between lane lines and detection lines to realize vehicle speed measurement by an onboard camera. Based on the positions of lane lines and detection lines in adjacent frames, it realizes "non-integer frame counting", which improves the accuracy of vehicle speed measurement. It realizes cyclic speed measurement of "blank areas" and "line areas", shortens the speed measurement time window, and makes the measured vehicle speed closer to the instantaneous vehicle speed.

[0006] The present invention discloses a vehicle speed measurement method based on road marking semantic segmentation, which includes the following steps: S1: training a semantic segmentation model; S2: lane line detection; S3: determining lane line contours; S4: determining the position of the detection line; S5: calculating the number of vehicle passing frames; S6: calculating vehicle speed.

[0007] Specifically, step S5, which calculates the number of frames the vehicle passes through, includes the following steps:

[0008] S51: Divide the area into lines, and divide the positions of the lane markings in the dashed lane markings into line areas, and divide the blank areas between the markings into blank areas.

[0009] S52: Determine the area where the detection line is located. Based on the position between the highest and lowest points of the target lane line contour in two consecutive frames of lane line detection images and the detection line, determine whether the detection line is located in the line area or blank area divided in step S51.

[0010] S53: Calculate the number of frames the detection line passes through the corresponding region.

[0011] In step S52, the detection line in cases 1, 5, and 6 is located in the blank area, and is recorded as 1 respectively; in case 3, the detection line is located in the line area, and is recorded as 1.

[0012] In case 2, the blank area is a missing frame F 空白区域1 The line region missing frame F is calculated using formula (1). 线区域1 Calculations are performed using formula (2);

[0013] F 空白区域1 =(mv MAX ) / (v' MAX -v MAX (1)

[0014] F 线区域1 =1-F 空白区域1 (2)

[0015] In the formula v MAX v' is the coordinate v value of the highest point in the previous frame. MAX v is the coordinate value of the highest point in the current frame, and m is the coordinate value of the detection line in the v direction of the image coordinate system;

[0016] In case 4, the line region is missing frame F 线区域2 The blank area fragment frame F is calculated using formula (3). 空白区域2 Calculations are performed using formula (4);

[0017] F 线区域2 =(mv MIN ) / (v' MIN -v MIN (3)

[0018] F 空白区域2 =1-F 线区域2 (4)

[0019] In the formula v MIN v' is the coordinate v value of the lowest point in the previous frame. MIN v is the coordinate value of the lowest point in the current frame, and m is the coordinate value of the detection line in the v direction of the image coordinate system;

[0020] The total number of frames where the detection line passes through the blank area is F.空白区域 The total number of frames in the line region is calculated using formula (5). 线区域 Calculations are performed using formula (6);

[0021] F 空白区域 =F 空白区域1 +F 空白区域i +F 空白区域2 (5)

[0022] F 线区域 =F 线区域1 +F 线区域i +F 线区域2 (6)

[0023] In the formula F 空白区域i F represents the sum of the number of times situation 1, situation 5, and / or situation 6 occur. 线区域i This represents the sum of the number of times condition 3 occurs.

[0024] Furthermore, step S52, which involves determining the specific conditions of the area where the detection line is located, includes:

[0025] Case 1: The highest and lowest points of the target lane line contour in two adjacent frames of lane line detection images do not pass through the detection line, indicating that the detection line is in the blank area for two consecutive frames;

[0026] Case 2: In two adjacent frames of lane line detection images, the highest and lowest points of the target lane line contour in the previous frame are both outside the detection line, while the highest point of the target lane line contour in the current frame is outside the detection line but the lowest point is outside the detection line. This indicates that in the previous frame, the detection line was located in a blank area, while in the current frame, the detection line is located in a line area.

[0027] Case 3: The highest point of the target lane line contour in two adjacent frames of lane line detection images both cross the detection line, while the lowest point does not cross the detection line, indicating that the detection line is located in the line region for two consecutive frames.

[0028] Case 4: In two adjacent frames of lane line detection images, the highest point of the target lane line contour in the previous frame passes through the detection line, but the lowest point does not. In the current frame, both the highest and lowest points of the target lane line contour pass through the detection line, indicating that in the previous frame, the detection line was located in the line area, and in the current frame, the detection line is located in the blank area.

[0029] Case 5: The highest and lowest points of the target lane line contour in two adjacent frames of lane line detection images both pass through the detection line, indicating that the detection line is located in the blank area for two consecutive frames;

[0030] Case 6: In two adjacent frames of lane line detection images, the highest and lowest points of the target lane line contour in the previous frame both pass through the detection line, while the highest and lowest points of the target lane line contour in the current frame do not pass through the detection line, indicating that the detection line is in the blank area for two consecutive frames.

[0031] Furthermore, step S1, training the semantic segmentation model, specifically includes:

[0032] S11: Data acquisition, extracting one image every 50 frames from the driving video to form a dataset;

[0033] S12: Build a semantic segmentation model by replacing the backbone network of the Deeplabv3 plus model with MobileNetV2 to lighten the overall model and meet real-time requirements; add a CBAM attention module after the ASPP module of Deeplabv3 plus to optimize the accuracy of the model segmentation boundary.

[0034] S13: Train the semantic segmentation model. Using the semantic segmentation model built in step S12, train the model using the dataset from step S11 so that the model can recognize lane lines.

[0035] Furthermore, step S2, lane line detection, specifically includes: using the semantic segmentation model obtained in step S1, performing lane line detection frame by frame on the image captured by the camera fixed in front of the vehicle to obtain a lane line detection image.

[0036] Furthermore, step S3, determining the lane line contour, specifically includes:

[0037] S31: Find all lane line contours, perform grayscale processing on the lane line detection image obtained in step S2, and then use the maximum inter-class variance method to binarize the image data to obtain a binary image; extract the boundary contours in the binary image, increase the connectivity of the contours through closing operation, and then obtain the lane line contours.

[0038] S32: Find the target lane line contour. In step S31, the center point of the lane line contour is located in the lower half of the lane line detection image, and the area of ​​the lane line contour is calculated by the function cv2.contourArea() provided by OpenCV. The lane line contour with an area greater than or equal to 100 is selected as the lane line contour set. Within the above set, the lane line contour with the smallest Euclidean distance from the center point of the lane line contour to one of the endpoints of the lower edge of the lane line detection image is selected as the target lane line contour.

[0039] S33: Output the extreme values ​​of the target lane line contour coordinates; output the v of the highest point of the target lane line contour in the v direction of the image coordinate system. MAX Value and the lowest point v MIN value.

[0040] Furthermore, step S4, determining the position of the detection line, specifically includes: marking a detection line along the u direction in the lane line detection image where the target lane line contour was determined in step S3, wherein the distance between the detection line and the lower edge of the lane line detection image is one-sixth of the height of the lane line detection image.

[0041] Furthermore, step S6, calculating the vehicle speed, specifically includes:

[0042] S61: The speed V of the vehicle as it passes through the blank area D Calculated using formula (7);

[0043]

[0044] In the formula D B The blank area represents the actual length of the blank area, and fps represents the camera's frame rate. 空白区域 This represents the total number of frames in the blank areas of step S53.

[0045] S62: Vehicle speed V in the area crossing the line L Calculated using formula (8);

[0046]

[0047] In the formula D L This indicates the actual length of the line area, and fps represents the camera's frame rate. 线区域 This is the total number of frames in the line region in step S53.

[0048] The vehicle speed measurement method provided by this invention uses the lane divider as a reference to calculate the average speed of a vehicle passing through each segment area and blank area of ​​the dashed lane divider. This invention selects a camera for data collection, and the camera is fixed in front of the vehicle, so there is no need to calibrate any parameters of the camera.

[0049] Advantages of this invention:

[0050] 1. This invention discloses a vehicle speed measurement method based on road marking semantic segmentation, which uses a deep learning semantic segmentation model combined with the relationship between lane lines and detection lines to realize vehicle speed measurement by an on-board camera.

[0051] 2. This invention discloses a vehicle speed measurement method based on road marking semantic segmentation. Based on the positions of lane lines and detection lines in adjacent frames, it realizes "non-integer frame counting" and improves the accuracy of vehicle speed measurement.

[0052] 3. This invention discloses a vehicle speed measurement method based on road marking semantic segmentation. Based on the positions of lane lines and detection lines in adjacent frames, it realizes cyclic speed measurement of "blank areas" and "line areas", shortens the speed measurement time window, and makes the measured vehicle speed closer to the instantaneous vehicle speed. Attached image description:

[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 This is a schematic diagram of the overall structure of Embodiment 1 of the present invention.

[0055] Figure 2 This is a flowchart of vehicle speed measurement according to Embodiment 1 of the present invention.

[0056] Figure 3 The following is an example diagram of Case 1 of Embodiment 1 of the present invention, wherein (a) is the previous frame diagram and (b) is the current frame diagram.

[0057] Figure 4 The following is an example diagram of case 2 of embodiment 1 of the present invention, wherein (a) is the previous frame diagram and (b) is the current frame diagram.

[0058] Figure 5 The following is an example diagram of case 3 of embodiment 1 of the present invention, wherein (a) is the previous frame diagram and (b) is the current frame diagram.

[0059] Figure 6 The following is an example diagram of case 4 of embodiment 1 of the present invention, wherein (a) is the previous frame diagram and (b) is the current frame diagram.

[0060] Figure 7 The following is an example diagram of case 5 of embodiment 1 of the present invention, wherein (a) is the previous frame diagram and (b) is the current frame diagram.

[0061] Figure 8 The following is an example diagram of case 6 of embodiment 1 of the present invention, wherein (a) is the previous frame diagram and (b) is the current frame diagram. Detailed implementation method:

[0062] The present invention will be further described in detail below through embodiments.

[0063] Example 1: As Figure 1-2As shown, a vehicle speed measurement method based on road marking semantic segmentation includes the following steps: S1: training a semantic segmentation model; S2: lane line detection; S3: determining lane line contours; S4: determining the position of the detection line; S5: calculating the number of vehicle passing frames; S6: calculating vehicle speed.

[0064] S1: Training the semantic segmentation model

[0065] S11: Data acquisition. Extract one image every 50 frames from the driving video and mark the lane boundaries. The marked lane lines are the lane lines with the largest area in the lower half of the image. Because the lane lines in the upper part are smaller, they cannot be directly used for speed measurement, and marking them is not very meaningful. Instead, it will affect the subsequent recognition and form a dataset.

[0066] S12: Build a semantic segmentation model by replacing the backbone network of the Deeplabv3 plus model with MobileNetV2 to lighten the overall model and meet real-time requirements; add a CBAM attention module after the ASPP module of Deeplabv3 plus to optimize the accuracy of the model segmentation boundary.

[0067] S13: Train the semantic segmentation model. Using the semantic segmentation model built in step S12, train the model using the dataset from step S11 so that the model can recognize lane lines.

[0068] S2: Lane detection. Using the semantic segmentation model obtained in step S1, lane detection is performed frame by frame on the image captured by the camera fixed in front of the vehicle to obtain the lane detection image.

[0069] S3: Define the lane line outline

[0070] S31: Find all lane line contours, perform grayscale processing on the lane line detection image obtained in step S2, and then use the maximum inter-class variance method to binarize the image data to obtain a binary image; extract the boundary contours in the binary image, increase the connectivity of the contours through closing operation, and then obtain the lane line contours.

[0071] S32: Find the target lane line contour. In step S31, the center point of the lane line contour is located in the lower half of the lane line detection image, and the area of ​​the lane line contour is calculated by the function cv2.contourArea() provided by OpenCV. The lane line contour with an area greater than or equal to 100 is selected as the lane line contour set. Within the above set, the lane line contour with the smallest Euclidean distance from the center point of the lane line contour to the left endpoint of the lower edge of the lane line detection image is selected as the target lane line contour.

[0072] S33: Output the extreme values ​​of the target lane line contour coordinates; output the v of the highest point of the target lane line contour in the v direction of the image coordinate system. MAX Value and the lowest point v MIN value.

[0073] S4: Determine the position of the detection line. In the lane detection image where the target lane line contour was determined in step S3, the detection line is marked along the u direction. The distance between the detection line and the lower edge of the lane detection image is one-sixth of the height of the lane detection image.

[0074] When the detection line is too high, the following problems will occur: 1. The identified lane dividing line is too small, the timing error increases, and the vehicle speed calculation error increases; 2. It will not conform to the set calculation rules.

[0075] When the detection line is too low, the target lane line outline of the previous frame has not completely passed through the detection line, while the target lane line outline of the current frame has completely disappeared and a new target lane line outline has been identified. At this time, the detection conditions set by the present invention are not met, which affects the speed measurement accuracy.

[0076] S5: Calculate the number of frames the vehicle passes through.

[0077] S51: Divide the area into lines, and divide the positions of the lane markings in the dashed lane markings into line areas, and divide the blank areas between the markings into blank areas.

[0078] S52: Determine the area where the detection line is located. Based on the position between the highest and lowest points of the target lane line contour in two consecutive frames of lane line detection images and the detection line, determine whether the detection line is located in the line area or blank area divided in step S51.

[0079] Case 1: such as Figure 3 As shown, the highest and lowest points of the target lane line contour in two adjacent frames of lane line detection images do not cross the detection line, indicating that the detection line is in the blank area for two consecutive frames.

[0080] Scenario 2: such as Figure 4 As shown, in two adjacent frames of lane detection images, the highest and lowest points of the target lane line contour in the previous frame are both outside the detection line, while the highest point of the target lane line contour in the current frame is outside the detection line and the lowest point is outside the detection line. This indicates that in the previous frame, the detection line was in the blank area, and in the current frame, the detection line is in the line area. This means that speed measurement starts in the line area and ends in the blank area.

[0081] Scenario 3: such as Figure 5 As shown, the highest point of the target lane line contour in two adjacent frames of lane line detection images both cross the detection line, while the lowest point does not cross the detection line, indicating that the detection line is located in the line region for two consecutive frames.

[0082] Case 4: Figure 6 As shown, in two adjacent frames of lane line detection images, the highest point of the target lane line contour in the previous frame passes through the detection line, while the lowest point does not. In the current frame, both the highest and lowest points of the target lane line contour pass through the detection line, indicating that in the previous frame, the detection line was located in the line area, and in the current frame, the detection line is located in the blank area. This means that speed measurement in the line area has ended, and speed measurement in the blank area has begun.

[0083] Case 5: Figure 7 As shown, the highest and lowest points of the target lane line contour in two adjacent frames of lane line detection images both pass through the detection line, indicating that the detection line is located in the blank area for two consecutive frames.

[0084] Case 6: For example Figure 8 As shown, in two adjacent frames of lane line detection images, the highest and lowest points of the target lane line contour in the previous frame both pass through the detection line, while the highest and lowest points of the target lane line contour in the current frame do not pass through the detection line, indicating that the detection line is in the blank area for two consecutive frames; at the same time, it indicates the transformation of the identified target lane line contour.

[0085] S53: Calculate the number of frames the detection line passes through the corresponding region.

[0086] In step S52, if the detection line is located in the blank area in cases 1, 5, and 6, it is recorded as 1 and entered into the blank area detection list; if the detection line is located in the line area in case 3, it is recorded as 1 and entered into the line area detection list.

[0087] In case 2, the blank area is a missing frame F 空白区域1 The result is obtained by formula (1) and input into the blank area detection list. Line region missing frame F 线区域1 The result is obtained by formula (2) and entered into the line area detection list;

[0088] F 空白区域1 =(mv MAX ) / (v' MAX -v MAX (1)

[0089] F 线区域1 =1-F 空白区域1 (2)

[0090] In the formula v MAX v' is the coordinate v value of the highest point in the previous frame. MAX v is the coordinate value of the highest point in the current frame, and m is the coordinate value of the detection line in the v direction of the image coordinate system;

[0091] In case 4, the line region is missing frame F 线区域2The result is obtained by formula (3) and input into the line region detection list. The blank area missing frame F 空白区域2 The result is obtained by formula (4) and entered into the blank area detection list;

[0092] F 线区域2 =(mv MIN ) / (v' MIN -v MIN (3)

[0093] F 空白区域2 =1-F 线区域2 (4)

[0094] In the formula v MIN v' is the coordinate v value of the lowest point in the previous frame. MIN v is the coordinate value of the lowest point in the current frame, and m is the coordinate value of the detection line in the v direction of the image coordinate system.

[0095] The total number of frames where the detection line passes through the blank area is F. 空白区域 The total number of frames in the line region, F, is calculated using formula (5). 线区域 Calculations are performed using formula (6);

[0096] F 空白区域 =F 空白区域1 +F 空白区域i +F 空白区域2 (5)

[0097] F 线区域 =F 线区域1 +F 线区域i +F 线区域2 (6).

[0098] In the formula F 空白区域i F represents the sum of the number of times situation 1, situation 5, and / or situation 6 occur. 线区域i This represents the sum of the number of times condition 3 occurs;

[0099] When scenario 2 occurs, first clear the previous data in the line region detection list to avoid errors during previous runs. Then calculate the incomplete frame. After calculation, add the incomplete frame to the corresponding blank region detection list and the cleared line region detection list. After calculating the blank region speed, clear the data in the blank region detection list. Start inputting the next round of values ​​to avoid errors in subsequent runs.

[0100] When scenario 4 occurs, first clear the previous data in the blank area detection list to avoid errors during previous runs. Then calculate the incomplete frame. After calculation, add the incomplete frame to the corresponding line area detection list and the cleared blank area detection list. After calculating the line area speed, clear the data in the line area detection list. Start inputting the next round of values ​​to avoid errors in subsequent runs.

[0101] Since the above calculations of blank area fragmented frames and line area fragmented frames have been added to the corresponding lists, a complete line area or blank area will have fragmented frames at both the beginning and the end. If it does not start or end with fragmented frames, it indicates that a complete line area or blank area has not been passed, and the speed will not be calculated in this case.

[0102] S6: Calculate vehicle speed

[0103] S61: The speed V of the vehicle as it passes through the blank area D Calculated using formula (7);

[0104]

[0105] In the formula D B The blank area represents the actual length of the blank area, and fps represents the camera's frame rate. 空白区域 This represents the total number of frames in the blank areas of step S53.

[0106] S62: Vehicle speed V in the area crossing the line L Calculated using formula (8);

[0107]

[0108] In the formula D L This indicates the actual length of the line area, and fps represents the camera's frame rate. 线区域 This is the total number of frames in the line region in step S53.

[0109] Experiment: Speed ​​measuring devices were installed at both ends of the blank area of ​​the dashed lane dividing line on a 150m road. The blank area was 6m long, and the line area was 4m long. Vehicles passed the first speed measuring device (origin), the second speed measuring device (end of the blank area, 6m), and so on until the last speed measuring device. The displayed vehicle speed of each speed measuring device, the vehicle speed measured by Embodiment 1 of this invention, and the vehicle speed measured by the existing public safety industry standard GA / T 1133-2014 are shown in Table 1 below:

[0110] Table 1 Vehicle Speed ​​Detection Results

[0111]

[0112]

[0113] As can be seen from the table above, the vehicle speed measured using the method disclosed in Embodiment 1 of this invention is closer to the actual vehicle speed measured by the speed measuring instrument than the vehicle speed measured by the speed measuring method disclosed in standard GA / T 1133-2014. Therefore, the speed measuring method disclosed in Embodiment 1 of this invention realizes "non-integer frame counting", which improves the accuracy of vehicle speed measurement and makes the measured vehicle speed closer to the instantaneous vehicle speed.

[0114] The above are preferred embodiments of the present invention. For those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A vehicle speed measurement method based on road marking semantic segmentation, characterized in that, It includes the following steps: S1: Train the semantic segmentation model; S2: Lane line detection; S3: Determine the lane line outline; S4: Determine the location of the detection line; S5: Calculate the number of frames the vehicle passes through; S6: Calculate vehicle speed; Specifically, step S5, which calculates the number of frames the vehicle passes through, includes the following steps: S51: Divide the area, divide the position of the lane markings in the dashed lane markings into line areas, and divide the blank space between the markings into blank areas; S52: Determine the area where the detection line is located. Based on the position between the highest and lowest points of the target lane line contour in two consecutive frames of lane line detection images and the detection line, determine whether the detection line is located in the line area or blank area divided in step S51. S53: Calculate the number of frames the detection line passes through the corresponding region. In step S52, the detection line in cases 1, 5, and 6 is located in the blank area, and is recorded as 1 respectively; in case 3, the detection line is located in the line area, and is recorded as 1. In case 2, the blank area is a missing frame F 空白区域1 The line region missing frame F is calculated using formula (1). 线区域1 Calculations are performed using formula (2); F 空白区域1 =(m-v MAX ) / (v' MAX -v MAX ) (1) F 线区域1 =1-F 空白区域1 (2) In the formula v MAX v' is the coordinate v value of the highest point in the previous frame. MAX v is the coordinate value of the highest point in the current frame, and m is the coordinate value of the detection line in the v direction of the image coordinate system; In case 4, the line region is missing frame F 线区域2 The blank area fragment frame F is calculated using formula (3). 空白区域2 Calculations are performed using formula (4); F 线区域2 =(m-v MIN ) / (v' MIN -v MIN ) (3) F 空白区域2 =1-F 线区域2 (4) In the formula v MIN v' is the coordinate v value of the lowest point in the previous frame. MIN v is the coordinate value of the lowest point in the current frame, and m is the coordinate value of the detection line in the v direction of the image coordinate system; The total number of frames where the detection line passes through the blank area is F. 空白区域 The total number of frames in the line region, F, is calculated using formula (5). 线区域 Calculations are performed using formula (6); F 空白区域 =F 空白区域1 +F 空白区域i +F 空白区域2 (5) F 线区域 =F 线区域1 +F 线区域i +F 线区域2 (6) In the formula F 空白区域i F represents the sum of the number of times situation 1, situation 5, and / or situation 6 occur. 线区域i This represents the sum of the number of times condition 3 occurs.

2. The vehicle speed measurement method based on road marking semantic segmentation according to claim 1, characterized in that, The step S52, which involves determining the specific conditions of the area where the detection line is located, includes: Case 1: The highest and lowest points of the target lane line contour in two adjacent frames of lane line detection images do not pass through the detection line, indicating that the detection line is in the blank area for two consecutive frames; Case 2: In two adjacent frames of lane line detection images, the highest and lowest points of the target lane line contour in the previous frame are both outside the detection line, while the highest point of the target lane line contour in the current frame is outside the detection line but the lowest point is outside the detection line. This indicates that in the previous frame, the detection line was located in a blank area, while in the current frame, the detection line is located in a line area. Case 3: The highest point of the target lane line contour in two adjacent frames of lane line detection images both cross the detection line, while the lowest point does not cross the detection line, indicating that the detection line is located in the line region for two consecutive frames. Case 4: In two adjacent frames of lane line detection images, the highest point of the target lane line contour in the previous frame passes through the detection line, but the lowest point does not. In the current frame, both the highest and lowest points of the target lane line contour pass through the detection line, indicating that in the previous frame, the detection line was located in the line area, and in the current frame, the detection line is located in the blank area. Case 5: The highest and lowest points of the target lane line contour in two adjacent frames of lane line detection images both pass through the detection line, indicating that the detection line is located in the blank area of ​​two consecutive frames; Case 6: In two adjacent frames of lane line detection images, the highest and lowest points of the target lane line contour in the previous frame both pass through the detection line, while the highest and lowest points of the target lane line contour in the current frame do not pass through the detection line, indicating that the detection line is in the blank area for two consecutive frames.

3. The vehicle speed measurement method based on road marking semantic segmentation according to claim 1, characterized in that, Step S1, training the semantic segmentation model, specifically includes: S11: Data acquisition, extracting one image every 50 frames from the driving video to form a dataset; S12: Build a semantic segmentation model by replacing the backbone network of the Deeplabv3 plus model with MobileNetV2 to lighten the overall model and meet real-time requirements; add a CBAM attention module after the ASPP module of Deeplabv3 plus to optimize the accuracy of the model segmentation boundary. S13: Train the semantic segmentation model. Using the semantic segmentation model built in step S12, train the model using the dataset from step S11 so that the model can recognize lane lines.

4. The vehicle speed measurement method based on road marking semantic segmentation according to claim 3, characterized in that, The lane detection step S2 specifically includes: using the semantic segmentation model obtained in step S1, performing lane detection frame by frame on the image captured by the camera fixed in front of the vehicle to obtain a lane detection image.

5. A vehicle speed measurement method based on road marking semantic segmentation according to claim 4, characterized in that, Step S3, which determines the lane line outline, specifically includes: S31: Find all lane line contours, perform grayscale processing on the lane line detection image obtained in step S2, and then use the maximum inter-class variance method to binarize the image data to obtain a binary image; extract the boundary contours in the binary image, increase the connectivity of the contours through closing operation, and then obtain the lane line contours. S32: Find the target lane line contour. In step S31, the center point of the lane line contour is located in the lower half of the lane line detection image, and the area of ​​the lane line contour is calculated by the function cv2.contourArea() provided by OpenCV. The lane line contour with an area greater than or equal to 100 is selected as the lane line contour set. Within the above set, the lane line contour with the smallest Euclidean distance from the center point of the lane line contour to one of the endpoints of the lower edge of the lane line detection image is selected as the target lane line contour. S33: Output the extreme values ​​of the target lane line contour coordinates; output the v of the highest point of the target lane line contour in the v direction of the image coordinate system. MAX Value and the lowest point v MIN value.

6. A vehicle speed measurement method based on road marking semantic segmentation according to claim 5, characterized in that, Specifically, step S4, determining the position of the detection line, includes: marking a detection line along the u direction in the lane line detection image where the target lane line contour was determined in step S3, wherein the distance between the detection line and the lower edge of the lane line detection image is one-sixth of the height of the lane line detection image.

7. A vehicle speed measurement method based on road marking semantic segmentation according to any one of claims 1-6, characterized in that, Step S6, which calculates the vehicle speed, specifically includes: S61: The speed V of the vehicle as it passes through the blank area D , calculated using formula (7); In the formula D B The blank area represents the actual length of the blank area, and fps represents the camera's frame rate. 空白区域 This represents the total number of frames in the blank areas of step S53. S62: Vehicle speed V in the area crossing the line L Calculated using formula (8); In the formula D L This indicates the actual length of the line area, and fps represents the camera's frame rate. 线区域 This is the total number of frames in the line region in step S53.