AI-based driving scene recognition method

Through AI technology, deep learning algorithms and data analysis are used to perform automatic driving scene recognition and data slicing on real vehicle videos, solving the problems of low efficiency and low accuracy of traditional methods, achieving efficient and accurate extraction of driving scene recognition, and supporting Requirements for autonomous driving simulation testing.

CN118537767APending Publication Date: 2024-08-23NANJING GUANGTING INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410438569.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-12
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Traditional real vehicle data scene extraction methods are inefficient and inaccurate, and cannot effectively support the needs of autonomous driving simulation testing.

Method used

It adopts AI-based deep learning algorithms and data analysis methods to automatically identify and slice real vehicle videos through target tracking algorithms and lane line recognition algorithms to achieve automatic identification of driving scenes and data shearing, improving the speed and accuracy of scene extraction. sex.

Benefits of technology

It significantly improves the efficiency and accuracy of driving scene recognition, provides an efficient scene extraction method, and supports the needs of autonomous driving simulation testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537767A
    Figure CN118537767A
Patent Text Reader

Abstract

The invention relates to a driving scene recognition method based on AI, and the method comprises the steps: 1, carrying out the tracking recognition of a target vehicle in a to-be-recognized video through a target tracking algorithm, obtaining the position information of the target vehicle, and carrying out the recognition of a lane line in the to-be-recognized video through a lane line recognition algorithm, and obtaining the position information of the lane line; based on the change relationship between the target vehicle position information and the lane line position information, performing driving scene identification; slicing real vehicle csv format data corresponding to the real vehicle video and the video corresponding to the driving scene according to the starting frame and the ending frame of the driving scene, and building a simulation scene based on the video data of scene slices; according to the invention, automatic identification of the driving scene in the real vehicle video and cutting of the real vehicle data are realized by means of a deep learning algorithm, data analysis and the like, and the efficiency and accuracy of driving scene identification are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of autonomous driving technology, and in particular to an AI-based driving scene recognition method. Background Art

[0002] With the development of autonomous driving technology, the development of L3 autonomous driving functions has become a trend today, and autonomous driving simulation testing is becoming more and more important. Simulation scenes are the basis of simulation testing. Scene extraction based on real vehicle data and then simulation scene conversion is an important application of simulation scene sources. The traditional real vehicle data scene extraction method is to manually watch real vehicle videos or process the collected data through scene rules to achieve scene extraction. This method is inefficient and has low accuracy. If there is an AI method to directly process real vehicle videos, automatically identify scenes, automatically mark scene types on images, and realize slicing processing of real vehicle data, then it will achieve a qualitative leap in the speed and accuracy of scene extraction. Summary of the invention

[0003] In view of the technical problems existing in the prior art, the present invention provides an AI-based driving scene recognition method, which adopts deep learning algorithms and data analysis to realize automatic recognition of driving scenes in real vehicle videos and cut real vehicle data, thereby improving the efficiency and accuracy of driving scene recognition.

[0004] According to a first aspect of the present invention, there is provided an AI-based driving scene recognition method, comprising:

[0005] Step 1: Use a target tracking algorithm to track and identify the target vehicle in the video to be identified to obtain the target vehicle position information, and use a lane line recognition algorithm to identify the lane line in the video to be identified to obtain the lane line position information;

[0006] Step 2, performing driving scene recognition based on the change relationship between the target vehicle position information and the lane line position information;

[0007] Step 3: Slice the data in CSV format corresponding to the real vehicle video and the video corresponding to the driving scene according to the start and end frames of the driving scene, and build a simulation scene based on the video data of the scene slices.

[0008] Based on the above technical solution, the present invention can also make the following improvements.

[0009] Optionally, the target vehicle location information obtained in step 1 includes the ID and identification frame coordinate information of the target vehicle;

[0010] The lane line position information includes coordinate information of each lane line;

[0011] The step 1 also includes: saving the IDs and identification frame coordinate information of all target vehicles and the lane line coordinate information frame by frame into corresponding txt files.

[0012] Optionally, the driving scene in step 2 includes: a lane change scene; and the method for identifying that the driving scene is a lane change scene includes:

[0013] The three closest lane lines are named as left lane line, middle lane line and right lane line from left to right;

[0014] Calculate the slopes k1, k2 and k3 of the left lane line, the middle lane line and the right lane line respectively based on the coordinates of the starting point and the ending point of each lane line;

[0015] When the rate of change of the values ​​of k1, k2 and k3 is greater than the set value, it indicates that the vehicle starts to change lanes; when the rate of change of the values ​​of k1, k2 and k3 changes from greater than the set value to not greater than the set value, it indicates that the vehicle ends the lane change.

[0016] Optionally, the driving scene in step 2 includes: a target vehicle cut-in / cut-out scene; and the method for identifying the driving scene as a target vehicle cut-in / cut-out scene includes:

[0017] The distance l1 between the target vehicle and the left sideline and the proportion of the lane width f1 occupied by the target vehicle are calculated as follows: l1 = x3-xa and f1 = l1 / (xb-xa); the distance l2 between the target vehicle and the right sideline and the proportion of the lane width f2 occupied by the target vehicle are calculated as follows: l2 = xb-x3 and f2 = l2 / (xb-xa);

[0018] Among them, x3 = (x1 + x2) / 2 is the horizontal coordinate of the midpoint of the target vehicle; x1 and x2 are the horizontal coordinates of the left and right lanes of the identification frame of the target vehicle respectively; xa and xb are the horizontal coordinates of the left and right lanes at the same vertical coordinate as the target vehicle respectively;

[0019] When the rate of change of the values ​​of f1 and f2 is greater than the set value, it indicates that the target vehicle is cutting in / out of the scene.

[0020] Optionally, the driving scene in step 2 includes: a straight-line driving scene; and the method for identifying that the driving scene is a straight-line driving scene includes:

[0021] The slope of the lane line is calculated based on the coordinates of two adjacent points of the lane line. When the rate of change of the slope of the lane line exceeds the set time and is within the set range, it indicates that the driving scene is a straight-line driving scene.

[0022] Optionally, the driving scene in step 2 includes: a curved driving scene; and the method for identifying that the driving scene is a curved driving scene includes:

[0023] According to the coordinates of the start and end points of the lane line, p1(x1,y1) and p2(x2,y2), the coordinates of the midpoint of p1 and p2 are calculated as p4((x1+x2) / 2,(y1+y2) / 2), and the coordinates of the center point of the lane line are p3(x3,y3);

[0024] When x3<(x1+x2) / 2, the driving scene is determined to be a lane line curving right; when x3>(x1+x2) / 2, the driving scene is determined to be a lane line curving left.

[0025] Optionally, the driving scene in step 2 includes: a stable following scene; and the method for identifying the driving scene as a stable following scene includes:

[0026] Calculate the target area area = (x2-x1)*(y2-y1) according to the upper left corner coordinate p1(x1,y1) and the lower right corner coordinate p2(x2,y2) of the target vehicle's identification frame;

[0027] Calculate the distances l1 and l2 between the target vehicle and the left and right lane lines at the same horizontal position;

[0028] When the values ​​of area, l1 and l2 vary by less than a set threshold between a set number of adjacent frames, the driving scene is determined to be a stable following scene.

[0029] Optionally, the driving scene in step 2 includes: a following vehicle acceleration / following vehicle deceleration scene; and the method for identifying the driving scene as a following vehicle acceleration / following vehicle deceleration scene includes:

[0030] Calculate the target area area = (x2-x1)*(y2-y1) according to the upper left corner coordinate p1(x1,y1) and the lower right corner coordinate p2(x2,y2) of the target vehicle's identification frame;

[0031] Calculate the distances l1 and l2 between the target vehicle and the left and right lane lines at the same horizontal position;

[0032] When the values ​​of area, l1 and l2 decrease rapidly between adjacent frames exceeding a set number and the rate of change of decrease is increasing, the driving scene is determined to be a vehicle-following acceleration scene;

[0033] When the values ​​of area, l1, and l2 increase rapidly between adjacent frames exceeding a set number and the rate of increase is increasing, the driving scene is determined to be a vehicle-following deceleration scene.

[0034] Optionally, the driving scene in step 2 includes: an overtaking scene; and the method for identifying that the driving scene is an overtaking scene includes:

[0035] It is determined that the target vehicle is in front of the vehicle before the first lane change and behind the vehicle after the second lane change, and the ID of the target vehicle remains unchanged, and the driving scene is determined to be an overtaking scene.

[0036] Optionally, the driving scene in step 2 includes: a congestion scene; and the method for identifying that the driving scene is a congestion scene includes:

[0037] The target vehicle ID, frame coordinates and lane line coordinate information are obtained in the video frames of adjacent set times. If it is detected that the target frame and lane line coordinates in the adjacent image frames with an interval of set time are completely consistent for more than two times, it means that the self-vehicle and the target vehicle have stopped twice in the gap between movements, and the driving scene is determined to be a congested scene.

[0038] The present invention provides an AI-based driving scene recognition method, which extracts scenes based on an AI method that has a good recognition effect on targets and lane lines in images, and has high efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A flowchart of a driving scene recognition method based on AI provided by the present invention;

[0040] FIG2( a ) is a schematic diagram of a vehicle in the right lane provided by an embodiment of the present invention;

[0041] FIG2( b ) is a schematic diagram of a vehicle in the left lane provided by an embodiment of the present invention;

[0042] Figure 3 A schematic diagram of a scene recognition start frame provided by an embodiment of the present invention;

[0043] Figure 4 A schematic diagram of a scene recognition end frame provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0045] Figure 1 A flowchart of a driving scene recognition method based on AI provided by the present invention is as follows: Figure 1 As shown, the method includes:

[0046] Step 1: Use a target tracking algorithm to track and identify the target vehicle in the video to be identified to obtain the target vehicle position information, and use a lane line recognition algorithm to identify the lane line in the video to be identified to obtain the lane line position information.

[0047] In specific implementation, the open source target tracking algorithm deepsort can be used to track and identify the target vehicle in the video.

[0048] Step 2: Based on the changing relationship between the target vehicle position information and the lane line position information, driving scene recognition is performed.

[0049] Step 3: Slice the data in CSV format corresponding to the real vehicle video and the video corresponding to the driving scene according to the start and end frames of the driving scene, and build a simulation scene based on the video data of the scene slices.

[0050] The present invention provides an AI-based driving scene recognition method, which uses deep learning algorithms and data analysis to automatically recognize driving scenes in real vehicle videos and cut real vehicle data, thereby improving the efficiency and accuracy of driving scene recognition.

[0051] Example 1

[0052] Embodiment 1 provided by the present invention is an embodiment of a method for AI-based driving scene recognition provided by the present invention, combined with Figure 1 It can be seen that the embodiment of the identification method includes:

[0053] Data preparation: prepare the real vehicle video and the corresponding real vehicle data in csv format.

[0054] Step 1: Use a target tracking algorithm to track and identify the target vehicle in the video to be identified to obtain the target vehicle position information, and use a lane line recognition algorithm to identify the lane line in the video to be identified to obtain the lane line position information.

[0055] In specific implementation, the open source target tracking algorithm deepsort can be used to track and identify the target vehicle in the video.

[0056] In a possible embodiment, the target vehicle position information acquired in step 1 includes the ID and identification frame coordinate information of the target vehicle.

[0057] The lane line position information includes the coordinate information of each lane line.

[0058] Step 1 also includes: saving the IDs and identification frame coordinate information of all target vehicles and the lane line coordinate information frame by frame into corresponding txt files.

[0059] In the specific implementation process, the ID and identification frame coordinate information of each target vehicle can be saved as a line, and saved frame by frame in a txt text file; the lane lines are named 1, 2, 3, etc. from left to right, and each lane line coordinate is saved as a line in the text, and the txt file name is named according to the frame number. After the entire video to be identified is identified, the ID and identification frame coordinate information of all target vehicles and the lane line coordinate information are saved frame by frame in the corresponding txt file.

[0060] Step 2: Based on the changing relationship between the target vehicle position information and the lane line position information, driving scene recognition is performed.

[0061] In the specific implementation, a Python script can be used to read the txt file in frame order, match the rule characteristics of each driving scenario, and realize the recognition of driving scenarios. Common scenarios include: lane changing, cutting in, cutting out, overtaking, following vehicle acceleration, following vehicle deceleration, stable following, congestion, etc.

[0062] In a possible embodiment, the method for identifying a lane change scene may be:

[0063] The starting and ending coordinates of the lane line are (x1, y1) and (x2, y2) respectively, then the lane line slope k = (y2-y1) / (x2-x1), the two lanes are named left lane, middle lane, right lane from left to right, and the slopes are k1, k2, k3 respectively. When the absolute value of the left lane line slope k1 changes from greater than the absolute value of the right lane line slope k3 to less than the absolute value of the right lane line slope, and the middle lane line slope k2 changes from a finite value to infinity and then to a finite value, it means that the vehicle has changed lanes to the right. This is because the slope of the lane line close to the vehicle is greater than that of the lane line far away from the vehicle. The slope of the lane line is large, as shown in Figure 2(a) and Figure 2(b). The inclination angle of the lane line on the side close to the vehicle is greater than the inclination angle of the lane line on the side away from the vehicle. When the vehicle crosses the middle lane line, the vehicle and the middle lane line remain perpendicular. At this time, the slope of the middle lane line is infinite. For the judgment of the starting point and the ending point in the lane change process, the change in the slope of the lane line is judged. When the values ​​of k1, k2, and k3 change from a constant value to a changing value, it means that the vehicle starts to change lanes. When the values ​​of k1, k2, and k3 change from a changing value to a constant value, it means that the vehicle ends the lane change. The corresponding frame number can be converted into the start and end time points of the scene. Otherwise, the vehicle changes lanes to the left.

[0064] In a possible embodiment, the method for identifying the target vehicle entering and exiting a scene includes:

[0065] When the midpoint of the target vehicle frame coordinates changes from the position coincident with the midpoint of the horizontal coordinates of the left and right lane lines of the target vehicle to the position coincident with the midpoint of the horizontal coordinates of the left and right lane lines of the vehicle, specifically, assuming that the coordinates of the lower left corner and the upper right corner of the target recognition frame are (x1, y1) and (x2, y2) respectively, then the horizontal coordinate of the midpoint of the target vehicle is x3 = (x1 + x2) / 2, and the vertical coordinate is y3 = (y1 + y2) / 2. Assuming that the horizontal coordinates of the left and right lane lines at the same vertical coordinates as the target vehicle are If the coordinates of the target vehicle are outside the left and right lane lines of the vehicle, when f1 gradually decreases to 0 and then suddenly increases to 1 and then gradually decreases, and f2 gradually changes to When f1 and f2 change from a constant value to a constant value, this frame is taken as the cut-in start time point. When f1 and f2 change from a changing value to a constant value, this frame is taken as the cut-in end time point. In between, f1 and f2 must jump from 1 to 0 or from 0 to 1. If the target vehicle coordinates are located inside the left and right lane line coordinates of the vehicle, when f1 When f1 and f2 gradually decrease to 0 and then suddenly change to 1 and then gradually decrease, and f2 gradually increase to 1 and then suddenly change to 0 and then gradually increase, it means that the target vehicle cuts out of the lane to the left lane, vice versa, the target vehicle cuts out of the lane to the right lane. When f1 and f2 start to change from constant values, this frame is taken as the cut-out start time point, and when f1 and f2 change from changing values ​​to constant values, this frame is taken as the cut-out end time point, and the time points between these must show a jump from f1 and f2 from 1 to 0 or from 0 to 1.

[0066] The reason why the change in the ratio of the distance from the target vehicle to the lane line is used instead of the change in distance directly is that when the distance between the vehicle and the target vehicle changes significantly, the change in the distance between the target position and the lane line will be affected, while the ratio of the distance from the target vehicle to the lane line will not be affected.

[0067] In a possible embodiment, the method for identifying a straight-line driving scene includes:

[0068] Based on whether the lane line coordinates are on a straight line, the slope k of all adjacent coordinate points in the lane line coordinates is calculated. When the slope is equal everywhere, the lane line is straight. At the same time, it is calculated whether the slopes of the left and right lane lines of the vehicle change. When they remain constant, it means that the vehicle is traveling in a straight line without swinging in the lane. When the slope remains constant, it is used as the starting condition of the straight line scene, and when the slope changes significantly, it is used as the ending condition of the straight line scene.

[0069] In a possible embodiment, the method for identifying a curved driving scene includes:

[0070] According to the coordinates of the lane line coordinate points, calculate the slope of adjacent coordinate points. When the slope changes continuously, the lane line is a curve. Assuming that the coordinates of the start and end points of the lane line are p1(x1,y1) and p2(x2,y2), and the coordinates of the center point of the lane line are p3(x3,y3), then the coordinates of the midpoints of p1 and p2 are p4((x1+x2) / 2,(y1+y2) / 2). When x3<(x1+x2) / 2, the lane line bends to the right. When x3>(x1+x2) / 2, the lane line bends to the left. According to the coordinates of points p1, p2, and p3 on the arc, the equation can be solved to obtain the curvature radius of the curve, and the curvature of the curve can be obtained. When the curvature radius suddenly changes from approaching infinity to a finite value, it is used as the starting condition of the curve scene. When the curvature radius suddenly changes from a finite value to an infinite value, it is used as the ending condition of the curve scene.

[0071] In a possible embodiment, the method for identifying a stable vehicle following scene includes:

[0072] The target area area = (x2-x1)*(y2-y1) is calculated according to the coordinates of the upper left corner p1(x1,y1) and the lower right corner frame coordinates p2(x2,y2) of the target object. At the same time, the distances l1 and l2 between the target object and the left and right lane lines at the same horizontal position are calculated. When the three values ​​of area, l1, and l2 remain stable between the frames corresponding to the adjacent few seconds of video, it means that the longitudinal and lateral distances between the vehicle and the target vehicle remain unchanged. This means that the scene is a stable following scene. The three values ​​of area, l1, and l2 change from changing to stabilizing as the starting condition of the stable following scene, and change from stabilizing to changing as the ending condition of the stable following scene.

[0073] In a possible embodiment, the method for identifying the following vehicle acceleration and following vehicle deceleration scenarios includes:

[0074] According to the coordinates of the upper left corner p1(x1,y1) and the lower right corner frame coordinates p2(x2,y2) of the target object, the area of ​​the target region is calculated as area = (x2-x1)*(y2-y1). At the same time, the distances l1 and l2 between the target object and the left and right lane lines at the same horizontal position are calculated. When the three values ​​of area, l1, and l2 decrease rapidly between the frames corresponding to the adjacent seconds of video and the rate of change of decrease is increasing, it means that the target vehicle is moving away from the ego vehicle. This is a following vehicle acceleration scene. The start and end of this phenomenon are respectively used as the start frame and end frame of the following vehicle acceleration scene. The following vehicle deceleration scene is the opposite. When the three values ​​of area, l1, and l2 increase rapidly between the frames corresponding to the adjacent seconds of video and the rate of change of increase is increasing, it means that the target vehicle is approaching the ego vehicle. This is a following vehicle deceleration scene. The start and end of this phenomenon are respectively used as the start frame and end frame of the following vehicle deceleration scene.

[0075] In a possible embodiment, the method for identifying an overtaking scene includes:

[0076] Overtaking is a behavior in which the ego vehicle changes lanes twice in opposite directions to overtake the target vehicle and return to the original lane. The identification of lane change has been described in step a above. The target vehicle is in front of the ego vehicle before the first lane change and behind the ego vehicle after the second lane change. During this process, the target vehicle ID remains unchanged. The starting point of the first lane change is used as the starting point of the overtaking scene, and the ending point of the second lane change is used as the ending point of the overtaking scene.

[0077] In a possible embodiment, the method for identifying a congestion scene includes:

[0078] A congestion scene is a behavior in which the ego vehicle and the target vehicle start and stop more than twice in a row. The target vehicle ID, frame coordinates, and lane line coordinate information are obtained in adjacent video frames of several seconds. If the target frame and lane line coordinates in adjacent image frames with an interval of several seconds are detected to be completely consistent for more than two times, it means that the ego vehicle and the target vehicle have stopped twice in the gap between movements, which is a congestion scene. The first time the target frame and lane line coordinates are detected to change from unchanged to changed is taken as the starting time point of the congestion scene, and the last time the target frame and lane line coordinates are detected to change from unchanged to changed is taken as the ending time point of the congestion scene. Convert the video frame by frame to images, annotate the scene name and target ID on all frame images between the corresponding start and end frames of the recognized scene with plt.text, and then synthesize the images into a video frame by frame, so that the scene recognition results can be observed from the video. Figure 3 and Figure 4 After the scene recognition is completed, the scene recognition results of the start and end frame images of the scene are listed, including the scene name and the target vehicle ID.

[0079] Step 3: Slice the data in CSV format corresponding to the real vehicle video and the video corresponding to the driving scene according to the start and end frames of the driving scene, and build a simulation scene based on the video data of the scene slices.

[0080] In the specific implementation, the real vehicle data is sliced, and the real vehicle CSV format data corresponding to the real vehicle video and the video corresponding to the scene are sliced ​​according to the start and end frames of the scene. Then the scene slice data and video are extracted. The slice data and video correspond one to one. The slice files are named after the start and end time of the scene. These scene slice data are used to build simulation scenes, and the slice videos are used to verify the accuracy of scene extraction and simulation scene construction.

[0081] The traditional method of manually watching the video to record the start and end time points of the scene and then extracting the scene is inefficient, or using scene rules to extract the scene from csv data. This method is limited by the accuracy of the csv data itself and the limitations of the scene rules, and the accuracy of this method is poor. An AI-based driving scene recognition method provided by an embodiment of the present invention extracts scenes based on an AI method that has a good recognition effect on targets and lane lines in images, and has high efficiency and accuracy.

[0082] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0083] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0084] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0085] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0086] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0087] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0088] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A driving scene recognition method based on AI, characterized in that: The scene recognition method comprises: Step 1: Use a target tracking algorithm to track and identify the target vehicle in the video to be identified to obtain the target vehicle position information, and use a lane line recognition algorithm to identify the lane line in the video to be identified to obtain the lane line position information; Step 2, performing driving scene recognition based on the change relationship between the target vehicle position information and the lane line position information; Step 3: Slice the data in CSV format corresponding to the real vehicle video and the video corresponding to the driving scene according to the start and end frames of the driving scene, and build a simulation scene based on the video data of the scene slices.

2. The scene recognition method according to claim 1, characterized in that: The target vehicle location information obtained in step 1 includes the target vehicle ID and identification frame coordinate information; The lane line position information includes coordinate information of each lane line; The step 1 also includes: saving the IDs and identification frame coordinate information of all target vehicles and the lane line coordinate information frame by frame into corresponding txt files.

3. The scene recognition method according to claim 1, characterized in that: The driving scene in step 2 includes: a lane change scene; and the method for identifying that the driving scene is a lane change scene includes: The three closest lane lines are named as left lane line, middle lane line and right lane line from left to right; Calculate the slopes k1, k2 and k3 of the left lane line, the middle lane line and the right lane line respectively based on the coordinates of the starting point and the ending point of each lane line; When the rate of change of the values ​​of k1, k2 and k3 is greater than the set value, it indicates that the vehicle starts to change lanes; when the rate of change of the values ​​of k1, k2 and k3 changes from greater than the set value to not greater than the set value, it indicates that the vehicle ends the lane change.

4. The scene recognition method according to claim 1, characterized in that: The driving scene in step 2 includes: a target vehicle cut-in / cut-out scene; and the method for identifying the driving scene as a target vehicle cut-in / cut-out scene includes: The distance l1 between the target vehicle and the left sideline and the proportion of the lane width f1 occupied by the target vehicle are calculated as follows: l1 = x3-xa and f1 = l1 / (xb-xa); the distance l2 between the target vehicle and the right sideline and the proportion of the lane width f2 occupied by the target vehicle are calculated as follows: l2 = xb-x3 and f2 = l2 / (xb-xa); Among them, x3 = (x1 + x2) / 2 is the horizontal coordinate of the midpoint of the target vehicle; x1 and x2 are the horizontal coordinates of the left and right lanes of the identification frame of the target vehicle respectively; xa and xb are the horizontal coordinates of the left and right lanes at the same vertical coordinate as the target vehicle respectively; When the rate of change of the values ​​of f1 and f2 is greater than the set value, it indicates that the target vehicle is cutting in / out of the scene.

5. The scene recognition method according to claim 1, characterized in that: The driving scene in step 2 includes: a straight-line driving scene; and the method for identifying that the driving scene is a straight-line driving scene includes: The slope of the lane line is calculated based on the coordinates of two adjacent points of the lane line. When the rate of change of the slope of the lane line exceeds the set time and is within the set range, it indicates that the driving scene is a straight-line driving scene.

6. The scene recognition method according to claim 1, characterized in that: The driving scene in step 2 includes: a curved driving scene; and the method for identifying that the driving scene is a curved driving scene includes: According to the coordinates of the start and end points of the lane line, p1(x1,y1) and p2(x2,y2), the coordinates of the midpoint of p1 and p2 are calculated as p4((x1+x2) / 2,(y1+y2) / 2), and the coordinates of the center point of the lane line are p3(x3,y3); When x3<(x1+x2) / 2, the driving scene is determined to be a lane line that is curving right; when x3>(x1+x2) / 2, the driving scene is determined to be a lane line that is curving left.

7. The scene recognition method according to claim 1, characterized in that: The driving scene in step 2 includes: a stable following scene; and the method for identifying the driving scene as a stable following scene includes: Calculate the target area area = (x2-x1)*(y2-y1) according to the upper left corner coordinate p1(x1,y1) and the lower right corner coordinate p2(x2,y2) of the target vehicle's identification frame; Calculate the distances l1 and l2 between the target vehicle and the left and right lane lines at the same horizontal position; When the values ​​of area, l1 and l2 vary by less than a set threshold between a set number of adjacent frames, the driving scene is determined to be a stable following scene.

8. The scene recognition method according to claim 1, characterized in that: The driving scene in step 2 includes: a following vehicle acceleration / following vehicle deceleration scene; and the method for identifying the driving scene as a following vehicle acceleration / following vehicle deceleration scene includes: Calculate the target area area = (x2-x1)*(y2-y1) according to the upper left corner coordinate p1(x1,y1) and the lower right corner coordinate p2(x2,y2) of the target vehicle's identification frame; Calculate the distances l1 and l2 between the target vehicle and the left and right lane lines at the same horizontal position; When the values ​​of area, l1 and l2 decrease rapidly between adjacent frames exceeding a set number and the rate of change of decrease is increasing, the driving scene is determined to be a vehicle-following acceleration scene; When the values ​​of area, l1, and l2 increase rapidly between adjacent frames exceeding a set number and the rate of increase is increasing, the driving scene is determined to be a vehicle-following deceleration scene.

9. The scene recognition method according to claim 3, characterized in that: The driving scene in step 2 includes: an overtaking scene; and the method for identifying that the driving scene is an overtaking scene includes: It is determined that the target vehicle is in front of the vehicle before the first lane change and behind the vehicle after the second lane change, and the ID of the target vehicle remains unchanged, and the driving scene is determined to be an overtaking scene.

10. The scene recognition method according to claim 1, characterized in that: The driving scene in step 2 includes: a congestion scene; and the method for identifying the driving scene as a congestion scene includes: The target vehicle ID, frame coordinates and lane line coordinate information are obtained in the video frames of adjacent set times. If it is detected that the target frame and lane line coordinates in the adjacent image frames with an interval of set time are completely consistent for more than two times, it means that the self-vehicle and the target vehicle have stopped twice in the gap between movements, and the driving scene is determined to be a congested scene.