Vehicle speed measurement method based on road marking semantic segmentation
By using a method based on semantic segmentation of road markings, combined with a deep learning model and the relationship between lane line detection lines, the problem of high price and large frame error of traditional vehicle speed measurement equipment is solved, and high-precision vehicle speed measurement is achieved, and the equipment is simple and easy to use. .
Patent Information
- Application Number
- CN202410713973.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-04
AI Technical Summary
Traditional vehicle-mounted speed measuring equipment is expensive and has great usage restrictions. The number of frames in the existing vehicle speed calculation method is an integer, resulting in large errors and making it impossible to accurately calculate non-integer vehicle speeds.
Using a method based on semantic segmentation of road markings, the deep learning semantic segmentation model is combined with the relationship between lane lines and detection lines to achieve non-integer frame counting, calculate the number of vehicle passing frames, improve the accuracy of vehicle speed measurement, and shorten the speed measurement time window.
It achieves high accuracy of vehicle speed measurement, makes the measured vehicle speed closer to the instantaneous vehicle speed, reduces the speed measurement error, and the equipment is simple to use and convenient to operate.
Smart Images

Figure CN118570279A
Abstract
Description
Technical field:
[0001] The patent of this invention belongs to the field of vehicle speed measurement technology, and specifically relates to a vehicle speed measurement method based on semantic segmentation of road markings. Background technology:
[0002] Vehicle speed is an important factor in analyzing the process of traffic accidents, determining the facts of accidents, and determining the causes of accidents. In addition, vehicle speed is also an important parameter in the research of technologies such as following models and overtaking models. Traditional on-board speed measuring equipment is expensive and has large usage restrictions. With the advancement of technology, relying on on-board vision systems to calculate vehicle speed has become a key technology. Cameras are not only low-priced, but also provide more abundant road information. As the resolution of cameras continues to improve, the accuracy of the technical processing they rely on is also constantly improving.
[0003] The public safety industry standard GA / T 1133-2014 proposes a method for calculating vehicle speed from vehicle-mounted video images, which is to select a reference object and calculate the vehicle speed by the number of frames when the vehicle passes the reference object. However, the number of frames recorded in this specification is an integer, which will result in a large error.
[0004] The present invention proposes a counting scheme that can calculate non-whole frames and a speed measurement rule based on the position relationship between lane lines and detection lines in adjacent frames, thereby improving the accuracy of vehicle speed measurement, and the device is simple to use and easy to operate. Summary of the invention:
[0005] In view of this, the object of the present invention is to provide a vehicle speed measurement method based on semantic segmentation of road markings. The vehicle speed measurement method based on semantic segmentation of road markings provided by the present invention is based on a deep learning semantic segmentation model combined with the relationship between lane lines and detection lines, to realize vehicle speed measurement by a vehicle-mounted camera, and based on the positions of lane lines and detection lines in adjacent frames, to realize "non-integer frame counting", thereby improving the accuracy of vehicle speed measurement, realizing cyclic speed measurement of "blank areas" and "line areas", shortening the time window of speed measurement, and making the measured vehicle speed closer to the instantaneous vehicle speed.
[0006] The technical solution of the present invention discloses a vehicle speed measurement method based on semantic segmentation of road markings, which comprises the following steps: S1: training a semantic segmentation model; S2: lane line detection; S3: determining the lane line contour; S4: determining the position of the detection line; S5: calculating the number of vehicle passing frames; S6: calculating the vehicle speed;
[0007] The step S5 of calculating the number of frames passed by the vehicle specifically includes the following steps:
[0008] S51: dividing the area, dividing the marking position of the lane line in the dotted line style into a line area, and dividing the blank position between the marking lines into a blank area;
[0009] S52: Determine the area where the detection line is located, and determine whether the detection line is located in the line area divided in step S51 or a blank area according to the position between the highest point and the lowest point of the target lane line contour in two consecutive lane line detection images and the detection line;
[0010] S53: Calculate the number of frames where the detection line passes through the corresponding area
[0011] In case 1, case 5 and case 6 determined in step S52, the detection line is located in the blank area, which is recorded as 1 respectively; in case 3, the detection line is located in the line area, which is recorded as 1;
[0012] In case 2, the blank area is missing frame F 空白区域1 Calculated by formula (1), the line area defect frame F 线区域1 Calculate using formula (2);
[0013] F 空白区域1 =(mv MAX ) / (v' MAX -v MAX ) (1)
[0014] F 线区域1 =1-F 空白区域1 (2)
[0015] Where v MAX is the coordinate v value of the highest point in the previous frame, v' MAX is the coordinate v 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 area is missing frame F 线区域2 Calculated by formula (3), the blank area defect frame F 空白区域2 Calculate using formula (4);
[0017] F 线区域2 =(mv MIN ) / (v' MIN -v MIN ) (3)
[0018] F 空白区域2 =1-F 线区域2 (4)
[0019] Where v MIN is the coordinate v value of the lowest point in the previous frame, v' MIN is the coordinate v 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空白区域 Calculated by formula (5), the total number of frames in the line area F 线区域 Calculate using formula (6);
[0021] F 空白区域 =F 空白区域1 +F 空白区域i +F 空白区域2 (5)
[0022] F 线区域 =F 线区域1 +F 线区域i +F 线区域2 (6)
[0023] Where F 空白区域i represents the sum of the number of occurrences of case 1, case 5, and / or case 6, F 线区域i Represents the sum of the number of occurrences of situation 3.
[0024] Furthermore, the step S52 of determining the specific situation of the area where the detection line is located includes:
[0025] Case 1: The highest point and the lowest point of the target lane line contour in two adjacent lane line detection images do not cross the detection line, indicating that the detection line is located in the blank area for two consecutive frames;
[0026] Case 2: In two adjacent lane line detection images, the highest point and the lowest point of the target lane line contour in the previous frame do not cross the detection line, while the highest point of the target lane line contour in the current frame crosses the detection line but the lowest point does not cross the detection line. This means that in the previous frame, the detection line is located in the blank area, while in the current frame, the detection line is located in the line area.
[0027] Case 3: The highest points of the target lane line contours in two adjacent lane line detection images are both across the detection line, while the lowest points are both below the detection line, indicating that the detection line is located in the line area for two consecutive frames;
[0028] Case 4: In the lane line detection images of two adjacent frames, the highest point of the target lane line contour in the previous frame passes through the detection line, but the lowest point does not. The highest point and the lowest point of the target lane line contour in the current frame both 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 point and the lowest point of the target lane line contour in two adjacent 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 lane line detection images, the highest point and the lowest point of the target lane line contour in the previous frame both pass the detection line, while the highest point and the lowest point of the target lane line contour in the current frame do not pass the detection line, indicating that the detection line is located in the blank area for two consecutive frames.
[0031] Furthermore, step S1 of training the semantic segmentation model specifically includes:
[0032] S11: Data collection, extracting a picture every 50 frames from the driving video to form a data set;
[0033] S12: Build a semantic segmentation model, replace the backbone network of the Deeplabv3 plus model with MobileNetV2, and make the overall model lightweight to meet real-time requirements; add the CBAM attention module after the ASPP module of Deeplabv3plus to optimize the accuracy of the model segmentation boundary;
[0034] S13: Train the semantic segmentation model. Use the semantic segmentation model built in step S12 and the data set in step S11 to train the model so that the model can recognize lane lines.
[0035] Furthermore, the lane line detection in step S2 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 of determining the lane line contour specifically includes:
[0037] S31: Find all lane line contours, grayscale 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 contour in the binary image, increase the connectivity of the contour through a closing operation, and then obtain the lane line contour;
[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 lane line contour area is calculated by the function cv2.contourArea() provided by OpenCV. The lane line contour area is greater than or equal to 100 as the lane line contour set. In 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 target lane line contour coordinate extreme value, output the highest point v of the target lane line contour in the v direction of the image coordinate system MAX Value and lowest point v MIN value.
[0040] Furthermore, step S4 of determining the position of the detection line specifically includes: calibrating the detection line along the u direction in the lane line detection image of the target lane line contour determined in step S3, and 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] Further, step S6 of calculating the vehicle speed specifically includes:
[0042] S61: Speed V of the vehicle passing through the blank area D , calculated by formula (7);
[0043]
[0044] Where D B Indicates the actual length of the blank area, fps indicates the frame rate of the camera, F 空白区域 is the total number of frames of the blank area in step S53;
[0045] S62: The speed V of the vehicle in the crossing area L , calculated by formula (8);
[0046]
[0047] Where D L Indicates the actual length of the line area, fps indicates the frame rate of the camera, F 线区域 is the total number of frames of the line area in step S53.
[0048] The vehicle speed measurement method provided by the present invention uses the lane dividing line as a reference to calculate the average speed of the vehicle passing through each line segment area and the blank area of the dashed lane dividing line. The present invention selects a camera for data collection, and the camera is fixed in front of the vehicle, and there is no need to calibrate any parameters of the camera.
[0049] Advantages of the present invention:
[0050] 1. The present invention discloses a vehicle speed measurement method based on semantic segmentation of road markings, which realizes vehicle speed measurement by a vehicle-mounted camera based on a deep learning semantic segmentation model combined with the relationship between lane lines and detection lines.
[0051] 2. The present invention discloses a vehicle speed measurement method based on semantic segmentation of road markings, which realizes "non-whole frame counting" based on the positions of lane lines and detection lines in adjacent frames, thereby improving the accuracy of vehicle speed measurement.
[0052] 3. The present invention discloses a vehicle speed measurement method based on semantic segmentation of road markings. Based on the positions of lane lines and detection lines in adjacent frames, the method realizes cyclic speed measurement of "blank areas" and "line areas", shortens the time window for speed measurement, and makes the measured vehicle speed closer to the instantaneous vehicle speed. Description of the drawings:
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 It is a schematic diagram of the overall structure of Example 1 of the present invention.
[0055] Figure 2 This is a vehicle speed measurement flow chart of Example 1 of the present invention.
[0056] Figure 3 This is a sample diagram of situation 1 of embodiment 1 of the present invention, wherein (a) is the previous frame image, and (b) is the current frame image.
[0057] Figure 4 This is a sample diagram of situation 2 of embodiment 1 of the present invention, wherein (a) is the previous frame image, and (b) is the current frame image.
[0058] Figure 5 This is a sample diagram of situation 3 of embodiment 1 of the present invention, wherein (a) is the previous frame image, and (b) is the current frame image.
[0059] Figure 6 This is a sample diagram of situation 4 of embodiment 1 of the present invention, wherein (a) is the previous frame image, and (b) is the current frame image.
[0060] Figure 7 This is a sample diagram of situation 5 of embodiment 1 of the present invention, wherein (a) is the previous frame image, and (b) is the current frame image.
[0061] Figure 8 This is a sample diagram of Case 6 of Embodiment 1 of the present invention, wherein (a) is the previous frame image, and (b) is the current frame image. Specific implementation method:
[0062] The present invention is further described in detail below by way of examples.
[0063] Example 1: Figure 1-2As shown, a vehicle speed measurement method based on semantic segmentation of road markings includes the following steps: S1: training a semantic segmentation model; S2: lane line detection; S3: determining the lane line contour; S4: determining the position of the detection line; S5: calculating the number of vehicle passing frames; S6: calculating the vehicle speed.
[0064] S1: Training semantic segmentation model
[0065] S11: Data collection: extract a picture from the driving video every 50 frames and mark the lane dividing lines. 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 small, they cannot be directly used for speed measurement. The marking is also meaningless and will affect the subsequent recognition, forming a data set.
[0066] S12: Build a semantic segmentation model, replace the backbone network of the Deeplabv3 plus model with MobileNetV2, and make the overall model lightweight to meet real-time requirements; add the CBAM attention module after the ASPP module of Deeplabv3plus to optimize the accuracy of the model segmentation boundary;
[0067] S13: Train the semantic segmentation model. Use the semantic segmentation model built in step S12 and the data set in step S11 to train the model so that the model can recognize lane lines.
[0068] S2: Lane line detection: using the semantic segmentation model obtained in step S1, lane line detection is performed frame by frame on the images captured by the camera fixed in front of the vehicle to obtain a lane line detection image.
[0069] S3: Determine lane outline
[0070] S31: Find all lane line contours, grayscale 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 contour in the binary image, increase the connectivity of the contour through a closing operation, and then obtain the lane line contour;
[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 lane line contour area is calculated by the function cv2.contourArea() provided by OpenCV. The lane line contour area is greater than or equal to 100 as the lane line contour set. In the above set, the lane line contour with the smallest Euclidean distance from the center point of the lane line contour to the left end point of the lower edge of the lane line detection image is selected as the target lane line contour.
[0072] S33: Output the target lane line contour coordinate extreme value, output the highest point v of the target lane line contour in the v direction of the image coordinate system MAX Value and lowest point v MIN value.
[0073] S4: Determine the position of the detection line, calibrate the detection line along the u direction in the lane line detection image of the target lane line contour determined in step S3, and 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.
[0074] When the detection line is too high, the following problems will occur: 1. The identified lane dividing line is smaller, the timing error increases, and the speed calculation error increases; 2. It will not comply with the set calculation rules.
[0075] When the detection line is too low, the target lane line contour of the previous frame has not completely passed the detection line, while the target lane line contour of the current frame has completely disappeared, and a new target lane line contour is identified. At this time, the detection conditions set by the present invention are not met, affecting the speed measurement accuracy.
[0076] S5: Calculate the number of frames the vehicle passes
[0077] S51: dividing the area, dividing the marking position of the lane line in the dotted line style into a line area, and dividing the blank position between the marking lines into a blank area;
[0078] S52: Determine the area where the detection line is located, and determine whether the detection line is located in the line area divided in step S51 or a blank area according to the position between the highest point and the lowest point of the target lane line contour in two consecutive lane line detection images and the detection line;
[0079] Case 1: If Figure 3 As shown in the figure, the highest point and the lowest point of the target lane line contour in the two adjacent lane line detection images do not pass through the detection line, indicating that the detection line is located in the blank area for two consecutive frames;
[0080] Case 2: If Figure 4 As shown, in the lane line detection images of two adjacent frames, the highest point and the lowest point of the target lane line profile in the previous frame are both not crossing the detection line, and the highest point of the target lane line profile in the current frame crosses the detection line but the lowest point does not cross the detection line, indicating that in the previous frame, the detection line is located in the blank area, and the detection line in the current frame is located in the line area, which means that the speed measurement in the line area starts and the speed measurement in the blank area ends;
[0081] Case 3: If Figure 5 As shown in the figure, the highest points of the target lane line contours in two adjacent lane line detection images all cross the detection line, while the lowest points do not cross the detection line, indicating that the detection line is located in the line area for two consecutive frames;
[0082] Case 4: If Figure 6 As shown, in the lane line detection images of two adjacent frames, the highest point of the target lane line profile in the previous frame passes through the detection line, while the lowest point does not pass through the detection line. The highest point and the lowest point of the target lane line profile in the current frame both pass through the detection line, indicating that in the previous frame, the detection line is located in the line area, and in the current frame, the detection line is located in the blank area, which means that the speed measurement in the line area ends and the speed measurement in the blank area begins.
[0083] Case 5: If Figure 7 As shown in the figure, the highest point and the lowest point of the target lane line contour in two adjacent lane line detection images pass through the detection line, indicating that the detection line is located in the blank area for two consecutive frames;
[0084] Case 6: If Figure 8 As shown in the figure, in the two adjacent lane line detection images, the highest point and the lowest point of the target lane line contour in the previous frame both pass the detection line, while the highest point and the lowest point of the target lane line contour in the current frame do not pass the detection line, indicating that the detection line is located in the blank area for two consecutive frames; at the same time, it indicates the change of the identified target lane line contour.
[0085] S53: Calculate the number of frames where the detection line passes through the corresponding area
[0086] In case 1, case 5 and case 6 judged in step S52, the detection line is located in the blank area, which is recorded as 1 and input into the blank area detection list; in case 3, the detection line is located in the line area, which is recorded as 1 and input into the line area detection list;
[0087] In case 2, the blank area is missing frame F 空白区域1 Calculated by formula (1) and input into the blank area detection list, the line area defect frame F 线区域1 Calculated by formula (2) and input into the line area detection list;
[0088] F 空白区域1 =(mv MAX ) / (v' MAX -v MAX ) (1)
[0089] F 线区域1 =1-F 空白区域1 (2)
[0090] Where v MAX is the coordinate v value of the highest point in the previous frame, v' MAX is the coordinate v 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 area is missing frame F 线区域2Calculated by formula (3) and input into the line area detection list, the blank area defect frame F 空白区域2 Calculated by formula (4) and input into the blank area detection list;
[0092] F 线区域2 =(mv MIN ) / (v' MIN -v MIN ) (3)
[0093] F 空白区域2 =1-F 线区域2 (4)
[0094] Where v MIN is the coordinate v value of the lowest point in the previous frame, v' MIN is the coordinate v 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 空白区域 Calculated by formula (5), the total number of frames in the line area F 线区域 Calculate using formula (6);
[0096] F 空白区域 =F 空白区域1 +F 空白区域i +F 空白区域2 (5)
[0097] F 线区域 =F 线区域1 +F 线区域i +F 线区域2 (6).
[0098] Where F 空白区域i represents the sum of the number of occurrences of case 1, case 5, and / or case 6, F 线区域i Indicates the sum of the number of occurrences of situation 3;
[0099] When situation 2 occurs, first clear the previous data in the line area detection list to avoid errors in the previous run. Then calculate the incomplete frame, add the incomplete frame to the corresponding blank area detection list and the cleared line area detection list after the calculation is completed. After calculating the blank area speed, clear the data in the blank area detection list. Start entering the next round of values to avoid errors in subsequent runs.
[0100] When situation 4 occurs, first clear the previous data in the blank area detection list to avoid errors in the previous run. Then calculate the incomplete frame, add the incomplete frame to the corresponding line area detection list and the cleared blank area detection list after the calculation is completed. After calculating the line area speed, clear the data in the line area detection list. Start entering the next round of values to avoid errors in subsequent runs.
[0101] Since the blank area incomplete frames and line area incomplete frames are calculated above and added to the corresponding lists, a complete line area or blank area starts and ends with incomplete frames. When it does not start and end with incomplete frames, it indicates that a complete line area or blank area has not been passed, and the speed will not be calculated at this time.
[0102] S6: Calculate vehicle speed
[0103] S61: Speed V of the vehicle passing through the blank area D , calculated by formula (7);
[0104]
[0105] Where D B Indicates the actual length of the blank area, fps indicates the frame rate of the camera, F 空白区域 is the total number of frames of the blank area in step S53;
[0106] S62: The speed V of the vehicle in the crossing area L , calculated by formula (8);
[0107]
[0108] Where D L Indicates the actual length of the line area, fps indicates the frame rate of the camera, F 线区域 is the total number of frames of the line area in step S53.
[0109] Experiment: Speedometers are respectively set at both ends of the blank area of the dashed line of the lane dividing line on a 150m road, wherein the length of the blank area is 6m, and the length of the line area is 4m. The moving vehicle passes through the first speedometer (i.e., the origin), the second speedometer (i.e., the end position of the blank area, i.e., 6m), and so on until the vehicle passes through the last speedometer. The displayed speed of each speedometer, the speed measured by Embodiment 1 of the present invention, and the speed measured by the prior art public safety industry standard GA / T 1133-2014 are shown in Table 1 below:
[0110] Table 1 Vehicle speed detection results
[0111]
[0112]
[0113] It can be seen from the above table that the speed of a vehicle measured by the method disclosed in Example 1 of the present invention is closer to the actual speed measured by the speedometer than the speed measured by the speed measurement method disclosed in the standard GA / T 1133-2014. Therefore, the speed measurement method disclosed in Example 1 of the present invention realizes "non-integer frame counting", improves the accuracy of speed measurement, and makes the measured speed closer to the instantaneous speed.
[0114] The above are preferred embodiments of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as 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: training semantic segmentation model; S2: lane line detection; S3: determining lane line contour; S4: Determine the position of the detection line; S5: Calculate the number of frames passed by the vehicle; S6: Calculate vehicle speed; The step S5 of calculating the number of frames passed by the vehicle specifically includes the following steps: S51: dividing the area, dividing the marking position of the lane line in the dotted line style into a line area, and dividing the blank position between the marking lines into a blank area; S52: Determine the area where the detection line is located, and determine whether the detection line is located in the line area divided in step S51 or a blank area according to the position between the highest point and the lowest point of the target lane line contour in two consecutive lane line detection images and the detection line; S53: Calculate the number of frames where the detection line passes through the corresponding area In case 1, case 5 and case 6 determined in step S52, the detection line is located in the blank area, which is recorded as 1 respectively; in case 3, the detection line is located in the line area, which is recorded as 1; In case 2, the blank area is missing frame F 空白区域1 Calculated by formula (1), the line area defect frame F 线区域1 Calculate using formula (2); F 空白区域1 =(m-v MAX ) / (v' MAX -v MAX ) (1) F 线区域1 =1-F 空白区域1 (2) Where v MAX is the coordinate v value of the highest point in the previous frame, v' MAX is the coordinate v 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 area is missing frame F 线区域2 Calculated by formula (3), the blank area defect frame F 空白区域2 Calculate using formula (4); F 线区域2 =(m-v MIN ) / (v' MIN -v MIN ) (3) F 空白区域2 =1-F 线区域2 (4) Where v MIN is the coordinate v value of the lowest point in the previous frame, v' MIN is the coordinate v 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 空白区域 Calculated by formula (5), the total number of frames in the line area F 线区域 Calculate using formula (6); F 空白区域 =F 空白区域1 +F 空白区域i +F 空白区域2 (5) F 线区域 =F 线区域1 +F 线区域i +F 线区域2 (6) Where F 空白区域i represents the sum of the number of occurrences of case 1, case 5, and / or case 6, F 线区域i Represents the sum of the number of occurrences of situation 3.
2. The vehicle speed measurement method based on road marking semantic segmentation according to claim 1, characterized in that: The specific situation of the area where the detection line is located in step S52 includes: Case 1: The highest point and the lowest point of the target lane line contour in two adjacent lane line detection images do not cross the detection line, indicating that the detection line is located in the blank area for two consecutive frames; Case 2: In two adjacent lane line detection images, the highest point and the lowest point of the target lane line contour in the previous frame do not cross the detection line, while the highest point of the target lane line contour in the current frame crosses the detection line but the lowest point does not cross the detection line. This means that in the previous frame, the detection line is located in the blank area, while in the current frame, the detection line is located in the line area. Case 3: The highest points of the target lane line contours in two adjacent lane line detection images are both across the detection line, while the lowest points are both below the detection line, indicating that the detection line is located in the line area for two consecutive frames; Case 4: In the lane line detection images of two adjacent frames, the highest point of the target lane line contour in the previous frame passes through the detection line, but the lowest point does not. The highest point and the lowest point of the target lane line contour in the current frame both 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 point and the lowest point of the target lane line contour in two adjacent 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 lane line detection images, the highest point and the lowest point of the target lane line contour in the previous frame both pass the detection line, while the highest point and the lowest point of the target lane line contour in the current frame do not pass the detection line, indicating that the detection line is located 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: The step S1 of training the semantic segmentation model specifically includes: S11: Data collection, extracting a picture every 50 frames from the driving video to form a data set; S12: Build a semantic segmentation model, replace the backbone network of the Deeplabv3 plus model with MobileNetV2, and make the overall model lightweight to meet real-time requirements; add the CBAM attention module after the ASPP module of Deeplabv3plus to optimize the accuracy of the model segmentation boundary; S13: Train the semantic segmentation model. Use the semantic segmentation model built in step S12 and the data set in step S11 to train the model so that the model can recognize lane lines.
4. The vehicle speed measurement method based on road marking semantic segmentation according to claim 3 is characterized in that: The lane line detection in step S2 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.
5. The vehicle speed measurement method based on road marking semantic segmentation according to claim 4, characterized in that: Wherein step S3 of determining the lane line contour specifically includes: S31: Find all lane line contours, grayscale 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 contour in the binary image, increase the connectivity of the contour through a closing operation, and then obtain the lane line contour; 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 lane line contour area is calculated by the function cv2.contourArea() provided by OpenCV. The lane line contour area is greater than or equal to 100 as the lane line contour set. In 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 target lane line contour coordinate extreme value, output the highest point v of the target lane line contour in the v direction of the image coordinate system MAX Value and lowest point v MIN value.
6. The vehicle speed measurement method based on road marking semantic segmentation according to claim 5, characterized in that: Wherein step S4 determines the position of the detection line and specifically includes: calibrating the detection line along the u direction in the lane line detection image of the target lane line contour determined in step S3, and 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 to 6, characterized in that: Wherein step S6 of calculating the vehicle speed specifically includes: S61: Speed V of the vehicle passing through the blank area D , calculated by formula (7); Where D B Indicates the actual length of the blank area, fps indicates the frame rate of the camera, F 空白区域 is the total number of frames of the blank area in step S53; S62: The speed V of the vehicle in the crossing area L , calculated by formula (8); Where D L Indicates the actual length of the line area, fps indicates the frame rate of the camera, F 线区域 is the total number of frames of the line area in step S53.
Citation Information
Patent Citations
Method for detecting illegal line pressing of vehicle
CN110298300A
Lane line network identification model establishment and vehicle speed detection method based on DeepLabv3+
CN112861700A
Monitoring alarm device, monitoring alarm method, and program
JP2023074913A
