A control method and storage medium for vehicle forward collision

By using a preset isosceles triangle in the vehicle forward collision warning system to select the target vehicle in front and calculate the collision value, the problem of unnecessary early warning triggered by misjudgment in the traditional system is solved, and the accuracy of early warning and driving experience are improved .

CN119160178BActive Publication Date: 2025-02-11SHENZHEN MAPGOO TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411660476.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-02-11
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

When selecting a vehicle ahead, traditional vehicle forward collision warning system is prone to misjudgment caused by distant stationary objects or roadside signs, which trigger unnecessary early warnings.

Method used

By obtaining video data from the current driving vehicle, selecting the target front vehicle in the preset isosceles triangle based on the video data, and calculating its collision threshold with the current driving vehicle, and determining whether the triggering condition of forward collision warning is met.

Benefits of technology

It improves the accuracy of target vehicle selection, reduces unnecessary early warnings, and improves the accuracy of vehicle forward collision control, thereby improving the driver's driving experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119160178B_ABST
    Figure CN119160178B_ABST
Patent Text Reader

Abstract

The present application relates to a control method for a vehicle forward collision and a storage medium, the method comprising: obtaining video data to be processed from a currently driven vehicle; based on the video data to be processed, selecting a target front vehicle within a preset isosceles triangle; obtaining a collision threshold between the target front vehicle and the currently driven vehicle; determining whether the collision threshold satisfies a trigger condition for a forward collision warning, and if the collision threshold satisfies the trigger condition for a forward collision warning, triggering a forward collision warning instruction. The present application can improve the accuracy of target vehicle selection, thereby improving the accuracy of vehicle forward collision control, and thus improving the driver's driving experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent driving technology, and in particular to a vehicle forward collision control method and a storage medium. Background Art

[0002] In modern traffic, the Forward Collision Warning System (FCWS) has become an important means to improve road safety. Traditional FCWS usually obtains information about the vehicle in front through sensors such as cameras and radars, and calculates the collision risk through algorithms.

[0003] However, traditional FCWS often relies on all targets in the entire field of view when selecting the vehicle ahead, which may lead to misjudgment. For example, a stationary object in the distance or a roadside sign may be mistaken for the vehicle ahead, triggering unnecessary warnings. In other words, due to the problem of inaccurate target vehicle selection, unnecessary warnings are triggered, thus affecting the driver's driving experience. Summary of the invention

[0004] The embodiments of the present application provide a vehicle forward collision control method and a storage medium, which are intended to solve the problem of inaccurate target vehicle selection leading to unnecessary warnings being triggered.

[0005] In a first aspect, an embodiment of the present application provides a method for controlling a forward collision of a vehicle, the method comprising:

[0006] Obtaining video data to be processed from the currently driven vehicle;

[0007] Based on the video data to be processed, selecting a target front vehicle within a preset isosceles triangle;

[0008] Obtaining a collision threshold between the target front vehicle and the currently driven vehicle;

[0009] It is determined whether the collision threshold value satisfies a triggering condition of a forward collision warning. If the collision threshold value satisfies the triggering condition of the forward collision warning, an instruction of the forward collision warning is triggered.

[0010] In some implementations, selecting a target front vehicle within a preset isosceles triangle based on the video data to be processed includes:

[0011] Inputting the video data to be processed into a preset model for vehicle identification, and obtaining a data structure type set output by the preset model, wherein the data structure type set includes data coordinate information of all front vehicles and corresponding vehicle type values;

[0012] Based on the vehicle type value, obtaining a preset isosceles triangle;

[0013] Obtaining the detection center point of each of the front vehicles based on the data coordinate information of the front vehicles in sequence;

[0014] Determining in sequence whether the detection center point of each of the front vehicles is within the preset isosceles triangle;

[0015] If the detection center point of the front vehicle is located within the preset isosceles triangle, the front vehicle is regarded as the front vehicle within the preset isosceles triangle;

[0016] Based on the front vehicle within the preset isosceles triangle, a target front vehicle within the preset isosceles triangle is obtained.

[0017] In some implementations, obtaining a preset isosceles triangle based on the vehicle type value includes:

[0018] If the vehicle type value does not include both the left lane line and the right lane line, obtaining a preset isosceles triangle from a local database;

[0019] If the vehicle type value includes both the left lane line and the right lane line, then obtain the left lane rectangular frame and the right lane rectangular frame;

[0020] Obtaining a diagonal intersection point of the left lane rectangular frame and the right lane rectangular frame, and using the diagonal intersection point as a first vertex of the preset isosceles triangle;

[0021] Obtain the ordinate value of the lower left corner of the left lane line from the left lane rectangular frame, and obtain the ordinate value of the lower right corner of the right lane line from the right lane rectangular frame;

[0022] Based on the ordinate value of the lower left corner of the left lane line and the ordinate value of the lower right corner of the right lane line, the second vertex and the third vertex of the preset isosceles triangle are obtained.

[0023] In some implementations, obtaining the second vertex and the third vertex of the preset isosceles triangle based on the ordinate value of the lower left corner of the left lane line and the ordinate value of the lower right corner of the right lane line includes:

[0024] Determine the magnitude relationship between the lower left corner ordinate value of the left lane line and the lower right corner ordinate value of the right lane line;

[0025] If the ordinate value of the lower left corner of the left lane line is greater than the ordinate value of the lower right corner of the right lane line, the lower left corner of the left lane line is used as the second vertex of the preset isosceles triangle;

[0026] and extending the lower right corner of the right lane line to obtain an extended vertex, wherein the ordinate value of the extended vertex is equal to the ordinate value of the lower left corner of the left lane line;

[0027] The extended vertex is used as the third vertex of the preset isosceles triangle.

[0028] In some implementations, determining the magnitude relationship between the lower left corner ordinate value of the left lane line and the lower right corner ordinate value of the right lane line further includes:

[0029] If the ordinate value of the lower left corner of the left lane line is smaller than the ordinate value of the lower right corner of the right lane line, the lower right corner of the right lane line is used as the second vertex of the preset isosceles triangle;

[0030] and extending the lower left corner of the left lane line to obtain an extended vertex, wherein the ordinate value of the extended vertex is equal to the ordinate value of the lower right corner of the right lane line;

[0031] The extended vertex is used as the third vertex of the preset isosceles triangle.

[0032] In some embodiments, the number of the front vehicles within the preset isosceles triangle is one or more;

[0033] The method of obtaining a target front vehicle within the preset isosceles triangle based on the front vehicle within the preset isosceles triangle comprises:

[0034] If the number of the front vehicles in the preset isosceles triangle is 1, the front vehicle in the preset isosceles triangle is used as the target front vehicle in the preset isosceles triangle;

[0035] If there are multiple front vehicles in the preset isosceles triangle, then the distance between the front vehicle in each preset isosceles triangle and the current driving vehicle is obtained in sequence;

[0036] The front vehicle corresponding to the shortest distance is selected as the target front vehicle within the preset isosceles triangle.

[0037] In some implementations, sequentially obtaining the distance between the front vehicle and the current driving vehicle within each preset isosceles triangle includes:

[0038] Determine the type of the front vehicle in each preset isosceles triangle in turn;

[0039] If the type of the front vehicle in the preset isosceles triangle is the first vehicle type, then based on the upper left corner ordinate value, the lower right corner ordinate value, the preset standard distance, the first standard length ratio and the image resolution of the front vehicle in the preset isosceles triangle, the distance between the front vehicle in the preset isosceles triangle and the current driving vehicle is obtained;

[0040] If the type of the front vehicle within the preset isosceles triangle is the second type of vehicle, the distance between the front vehicle within the preset isosceles triangle and the current driving vehicle is obtained based on the upper left corner ordinate value, the lower right corner ordinate value, the preset standard distance, the second standard length ratio and the image resolution of the front vehicle within the preset isosceles triangle.

[0041] In some implementations, before obtaining the collision threshold between the target front vehicle and the currently driven vehicle, the method further includes:

[0042] storing a current frame including the target front vehicle and a previous frame adjacent to the current frame;

[0043] Get the first bounding box area of ​​the current frame and the second bounding box area of ​​the previous frame;

[0044] Obtaining an intersection-over-union ratio based on the first bounding box area and the second bounding box area;

[0045] When the intersection-and-joint ratio is greater than or equal to an intersection-and-joint ratio threshold, a collision critical value between the target front vehicle and the currently driven vehicle is obtained.

[0046] In some implementations, obtaining the collision threshold between the target front vehicle and the currently driven vehicle includes:

[0047] Storing 5 frames of real-time arrays of the target front vehicle and the current driving vehicle, the real-time array includes a distance array and a timestamp array;

[0048] Selecting a current frame and a previous frame from the 5-frame real-time array, wherein the previous frame and the current frame are separated by two frames;

[0049] Obtaining a relative distance based on a distance difference between the current frame and the previous frame;

[0050] Obtaining a relative time based on a time difference between the current frame and the previous frame;

[0051] Based on the relative distance and the relative time, obtaining the relative speed between the target front vehicle and the current driving vehicle;

[0052] Based on the distance of the current frame and the relative speed, a collision threshold between the target front vehicle and the current driving vehicle is obtained.

[0053] In a second aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.

[0054] The embodiment of the present application provides a control method and storage medium for forward collision of a vehicle. The method includes: obtaining video data to be processed from the currently driven vehicle; based on the video data to be processed, selecting the target front vehicle within a preset isosceles triangle; obtaining the collision threshold between the target front vehicle and the currently driven vehicle; judging whether the collision threshold satisfies the triggering condition of the forward collision warning, and if the collision threshold satisfies the triggering condition of the forward collision warning, triggering the instruction of the forward collision warning. Since the two legs of the isosceles triangle are equal and symmetrical, the embodiment of the present application can better cover the area in front of the vehicle by selecting the target front vehicle within the preset isosceles triangle, avoiding missing the target vehicle, and at the same time, the target vehicle can be concentrated within the preset isosceles triangle, thereby effectively eliminating interfering targets such as distant stationary objects and roadside signs, improving the accuracy of target vehicle selection, and then improving the accuracy of vehicle forward collision control, thereby improving the driving experience of the driver. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0056] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0057] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0058] Figure 1 A schematic flow chart of a first embodiment of a method for controlling a forward collision of a vehicle provided in an embodiment of the present application;

[0059] Figure 2 A schematic diagram of an isosceles triangle provided in an embodiment of the present application;

[0060] Figure 3 This is a schematic diagram of an extension of an isosceles triangle provided in an embodiment of the present application;

[0061] Figure 4 A schematic diagram of a target preceding vehicle provided in an embodiment of the present application being located within an isosceles triangle;

[0062] Figure 5 A schematic diagram of a 5-frame real-time array provided in an embodiment of the present application;

[0063] Figure 6 A flow chart of another embodiment of a method for controlling a forward collision of a vehicle provided in an embodiment of the present application;

[0064] Figure 7 A schematic diagram of the structure of an embodiment of a control system for a vehicle forward collision provided by an embodiment of the present application;

[0065] Figure 8 A schematic diagram of the structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0067] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0068] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0069] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0070] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0071] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0072] In order to solve the technical problem in the prior art that inaccurate target vehicle selection leads to the triggering of unnecessary warnings, the present application provides a vehicle forward collision control method that can improve the accuracy of target vehicle selection, thereby improving the accuracy of vehicle forward collision control.

[0073] Figure 1 This is a flow chart of a first embodiment of a method for controlling a vehicle forward collision provided by the present application. The method may include the following steps:

[0074] Step 110: Obtain video data to be processed from the currently driven vehicle.

[0075] Step 120: Based on the video data to be processed, select a target front vehicle within a preset isosceles triangle.

[0076] Step 130: Obtain a collision threshold between the target front vehicle and the current driving vehicle.

[0077] Step 140: Determine whether the collision threshold value satisfies the triggering condition of the forward collision warning. If the collision threshold value satisfies the triggering condition of the forward collision warning, trigger the instruction of the forward collision warning.

[0078] Since the two sides of an isosceles triangle are equal and symmetrical, by selecting the target front vehicle within the preset isosceles triangle, the area in front of the vehicle can be better covered to avoid missing the target vehicle. At the same time, the target vehicle can be concentrated inside the preset isosceles triangle, thereby effectively eliminating interference targets such as distant stationary objects and roadside signs, thereby improving the accuracy of target vehicle selection, and then improving the accuracy of vehicle forward collision control, thereby improving the driver's driving experience.

[0079] Referring to the second embodiment of a vehicle forward collision control method provided by the present application, the second embodiment includes the following steps:

[0080] Step 210: Obtain video data to be processed from the currently driven vehicle.

[0081] Step 220: Input the video data to be processed into a preset model for vehicle recognition, and obtain a data structure type set output by the preset model.

[0082] The preset model can be YOLO, SSD, Faster R-CNN or RetinaNet. The appropriate model can be selected according to the actual situation, and this application does not limit it here.

[0083] The data structure type set includes data coordinate information of all front vehicles and corresponding vehicle type values.

[0084] For example, the data structure type set may include the following: struct BOX{

[0085] Int x1=0; / / x coordinate point of the upper left corner of the front vehicle

[0086] Int y1=0; / / y coordinate point of the upper left corner of the front vehicle

[0087] Int x2=0; / / x coordinate point of the lower right corner of the front vehicle

[0088] Int y2=0; / / y coordinate point of the lower right corner of the front vehicle

[0089] Float conf=0; / / Accuracy of the vehicle ahead

[0090] Int type=0; / / Type

[0091] };

[0092] Among them, struct BOX is the defined structure type, int x1, int y1 represent the coordinate point of the upper left corner of the vehicle in front, int x2, int y2 represent the coordinate point of the lower right corner of the vehicle in front, float conf represents the accuracy of vehicle recognition, and int type represents the type of vehicle recognized (large vehicle, small vehicle, left lane line, right lane line).

[0093] The vehicle type value output by int type can be 0, 1, 2, or 3. When int type outputs 0, it indicates that the identified vehicle is a small car; when int type outputs 1, it indicates that the identified vehicle is a large car; when int type outputs 2, it indicates that the left lane line of the vehicle is identified; when int type outputs 3, it indicates that the right lane line of the vehicle is identified.

[0094] It should be noted that int type can output multiple values, such as 1, 2, 3, indicating that the identified vehicle is a large vehicle type and the left and right lane lines of the vehicle are identified; or output 0, 2, 3, indicating that the identified vehicle is a small vehicle type and the left and right lane lines of the vehicle are identified.

[0095] Step 230: Based on the vehicle type value, obtain a preset isosceles triangle.

[0096] Wherein, step 230 may include the following steps:

[0097] Step 231: If the vehicle type value does not include both the left lane line and the right lane line, a preset isosceles triangle is obtained from a local database.

[0098] Taking the vehicle type values ​​0, 1, 2, and 3 listed in the above step 220 as an example, for example, the output vehicle type value is 0; or the output vehicle type value is 1; or the output vehicle type value is 0, 2; or the output vehicle type value is 0, 3; or the output vehicle type value is 1, 2; or the output vehicle type value is 1, 3, it means that the vehicle type value does not include both the left lane line and the right lane line. Based on this, the previously saved preset isosceles triangle can be obtained from the local database.

[0099] Step 232: If the vehicle type value includes both the left lane line and the right lane line, obtain the left lane rectangular box and the right lane rectangular box.

[0100] For example, the output vehicle type values ​​are 0, 2, 3; or the output vehicle type values ​​are 1, 2, 3, which may indicate that the vehicle type values ​​include both the left lane line and the right lane line.

[0101] Step 233: Obtain the intersection of the diagonals of the left lane rectangular frame and the right lane rectangular frame, and use the intersection of the diagonals as the first vertex of the preset isosceles triangle.

[0102] See also Figure 2 , the rectangular box enclosed by PL1 and PL2 is the left lane rectangular box, the rectangular box enclosed by PR1 and PR2 is the right lane rectangular box, the straight lines PL1 PL2 are the diagonals of the left lane rectangular box, the straight lines PR1 PR2 are the diagonals of the right lane rectangular box, and PT is the intersection of the diagonals of the left lane rectangular box and the right lane rectangular box, i.e., the first vertex of the preset isosceles triangle.

[0103] Step 234: Obtain the ordinate value of the lower left corner of the left lane line from the left lane rectangular frame, and obtain the ordinate value of the lower right corner of the right lane line from the right lane rectangular frame.

[0104] See also Figure 2 and Figure 3 , Figure 2 and Figure 3 The y2 in the figure is the ordinate value of the lower left corner of the left lane line, and the y2' is the ordinate value of the lower right corner of the right lane line.

[0105] Step 235: Based on the ordinate value of the lower left corner of the left lane line and the ordinate value of the lower right corner of the right lane line, obtain the second vertex and the third vertex of the preset isosceles triangle.

[0106] Among them, step 235 can obtain the following two situations by judging the magnitude relationship between the lower left corner ordinate value of the left lane line and the lower right corner ordinate value of the right lane line:

[0107] The first case: if the ordinate value of the lower left corner of the left lane line is greater than the ordinate value of the lower right corner of the right lane line, the lower left corner of the left lane line is used as the second vertex of the preset isosceles triangle; and the lower right corner of the right lane line is extended to obtain an extended vertex, wherein the ordinate value of the extended vertex is equal to the ordinate value of the lower left corner of the left lane line; and the extended vertex is used as the third vertex of the preset isosceles triangle.

[0108] For example, see Figure 2 and Figure 3 , Figure 2 and Figure 3 The coordinate of the middle point 0 is at the starting point of the upper left corner of the figure. The y value increases as it goes down. Figure 3 If the ordinate value y2 of the lower left corner of the left lane line is greater than the ordinate value y2' of the lower right corner of the right lane line, then PL2 is used as the second vertex of the preset isosceles triangle, and the lower right corner PR2 of the right lane line is extended to obtain the extended vertex PR3, where y3=y2, and the extended vertex PR3 is used as the third vertex of the preset isosceles triangle.

[0109] Specifically, the coordinates of the extended vertex PR3 may be calculated in the following manner.

[0110] The length of the left line segment PL2 PT 2 =|PL2.x1-PT.x| 2 +|PL2.y2-PT.y| 2 ;

[0111] The length of the right line segment PR3 PT 2 =|PT.y-PR3.y3| 2 +|PT.x-PR3.x3| 2 ;

[0112] Among them, it is necessary to satisfy that the length of the right line segment PR3 PT = the length of the left line segment PL2 PT, then PR3.x3 can be obtained, that is, the three vertices of the preset isosceles triangle obtained are PT(x, y), PL2(x1, y2), and PR3(x3, y3).

[0113] For example, PL1(x2, y1) = (214, 363), PL2(x1, y2) = (100, 533), PR1(x1’, y1’) = (447, 320), PR2(x2’, y2’) = (510, 477), then after the extension process, the three vertices of the preset isosceles triangle obtained are PT(370, 129), PL2(100, 533), and PR3(532, 533).

[0114] The second case: If the ordinate value of the lower left corner of the left lane line is less than the ordinate value of the lower right corner of the right lane line, then take the lower right corner of the right lane line as the second vertex of the preset isosceles triangle; and extend the lower left corner of the left lane line to obtain an extended vertex, where the ordinate value of the extended vertex is equal to the ordinate value of the lower right corner of the right lane line; take the extended vertex as the third vertex of the preset isosceles triangle.

[0115] If PL2.y2 < PR2.y2, then it is necessary to extend PL2.y2 to obtain the extended vertex PL3(x3, y3), where PL3.y3 = PR2.y2. Specifically, the following method can be used to calculate the coordinates of the extended vertex PR3.

[0116] The length of the right line segment PR2 PT 2 = |PR2.x2’ - PT.x| 2 + |PR2.y2’ - PT.y| 2 ;

[0117] The length of the left line segment PL3 PT 2 = |PT.y - PL3.y3| 2 + |PT.x - PL3.x3| 2 ;

[0118] Among them, it is necessary to satisfy that the length of the left line segment PL3 PT = the length of the right line segment PR2 PT, then PL3.x3 can be obtained, that is, the three vertices of the preset isosceles triangle obtained are PT(x, y), PR2(x2’, y2’), and PL3(x3, y3).

[0119] For example, PL1(x2, y1) = (265, 134), PL2(x1, y2) = (225, 296),

[0120] PR1(x1',y1')=(340,160), PR2(x2',y2')=(464,320), then after extension, the three vertices of the preset isosceles triangle are PT(278,80), PR2(464,320), PL3(94,320).

[0121] Step 240: Obtain the detection center point of each of the front vehicles based on the data coordinate information of the front vehicles in sequence.

[0122] Step 250: Determine in turn whether the detection center point of each of the front vehicles is within the preset isosceles triangle.

[0123] Step 260: If the detection center point of the front vehicle is located within the preset isosceles triangle, the front vehicle is regarded as the front vehicle within the preset isosceles triangle.

[0124] For steps 240 to 260, the list of all vehicles within the preset isosceles triangle may be selected in the following manner:

[0125] For example, if the identified vehicle is (x1, y1), (x2, y2), then the detection center point of the vehicle is redefined as p_center(x, y), where x=(x1+x2) / 2, which is the center point of the vehicle width, and y=(y2-y1)*0.75+y1, which is 3 / 4 of the vehicle height.

[0126] See also Figure 4 , the coordinates of the three vertices of the preset isosceles triangle are A, B, and C. A, B, and C correspond to p_top(x,y), p_left(x,y), and p_right(x,y), respectively. Figure 4 The p_center(x,y) in is the detection center point of the vehicle.

[0127] doubleAB=(p_right.x-p_left.x)*(p_center.y-p_left.y)-(p_right.y-p_left.y)*(p_center.x-p_left.x);

[0128] doubleBC=(p_top.x-p_right.x)*(p_center.y-p_right.y)-(p_top.y-p_right.y)*(p_center.x-p_right.x);

[0129] doubleCA=(p_left.x-p_top.x)*(p_center.y-p_top.y)-(p_left.y-p_top.y)*(p_center.x-p_top.x).

[0130] If AB>0&&BC>0&&CA>0, or AB<0&&BC<0&&CA<0, it means that the detection center points of the vehicles are all on the same side of the three sides of the preset isosceles triangle. At this time, it can be determined that the identified vehicle is within the preset isosceles triangle.

[0131] Step 270: Based on the front vehicle within the preset isosceles triangle, obtain the target front vehicle within the preset isosceles triangle.

[0132] The number of front vehicles within the preset isosceles triangle is one or more.

[0133] If the number of the front vehicle in the preset isosceles triangle is 1, the front vehicle in the preset isosceles triangle is used as the target front vehicle in the preset isosceles triangle, and the distance between the target front vehicle and the current driving vehicle is calculated. 2) If the number of the front vehicles in the preset isosceles triangle is multiple, the distance between the front vehicle in each preset isosceles triangle and the current driving vehicle is obtained in turn; the front vehicle corresponding to the smallest distance is selected as the target front vehicle in the preset isosceles triangle.

[0134] Since the sizes of vehicles are different, in order to accurately calculate the distance between the vehicle driven by the owner (i.e. the current driving vehicle) and the vehicle in front (i.e. the vehicle in front within the preset isosceles triangle), the distance between the vehicle in front and the current driving vehicle can be calculated according to the size type of the vehicle in front. For details, please refer to the following:

[0135] 2-1) Determine the type of the vehicle ahead in each preset isosceles triangle in turn.

[0136] The type of the vehicle ahead can be determined based on the output vehicle type value. For example, a vehicle type value of 0 indicates that the identified vehicle is a small car type; a vehicle type value of 1 indicates that the identified vehicle is a large car type.

[0137] 2-2) If the type of the front vehicle within the preset isosceles triangle is the first type of vehicle, then based on the upper left corner ordinate value, the lower right corner ordinate value, the preset standard distance, the first standard length ratio and the image resolution of the front vehicle within the preset isosceles triangle, the distance between the front vehicle within the preset isosceles triangle and the current driving vehicle is obtained.

[0138] Among them, the first vehicle type can be a small car type, and the small car type can include a sedan and a van, and the first standard length ratio corresponds to the standard length ratio of the small car.

[0139] Specifically, floatstandard_distance=6.0 is defined as the preset standard distance.

[0140] floatheight_proportion_small=0.15 is defined as the standard length ratio of the trolley in meters.

[0141] intrgb_width=640, the RGB image resolution used by the preset model is the preset image resolution.

[0142] Then for the small car, Distance=standard_distance / (y2-y1)*1.0 / (height_proportion_small*rgb_width)=6.0 / (y2-y1)*1.0 / 0.15*640.

[0143] 2-3) If the type of the front vehicle within the preset isosceles triangle is the second type of vehicle, then based on the upper left corner ordinate value, the lower right corner ordinate value, the preset standard distance, the second standard length ratio and the image resolution of the front vehicle within the preset isosceles triangle, the distance between the front vehicle within the preset isosceles triangle and the current driving vehicle is obtained.

[0144] Among them, the second vehicle type can be a large vehicle type, which can include buses and trucks, and the second standard length ratio corresponds to the standard length ratio of large vehicles.

[0145] Specifically, floatstandard_distance=6.0 is defined as the preset standard distance.

[0146] floatheight_proportion_big=0.35 is defined as the standard length ratio of a large vehicle, in meters.

[0147] intrgb_width=640, the RGB image resolution used by the preset model is the preset image resolution.

[0148] For large vehicles, Distance=standard_distance / (y2-y1)*1.0 / (height_proportion_big*rgb_width)=6.0 / (y2-y1)*1.0 / 0.35*640.

[0149] Among them, 1.0 is a floating point number, which is used to ensure that the division operation in the calculation process is a floating point division, thereby avoiding the loss of precision caused by integer division.

[0150] It should be noted that when there are multiple front vehicles within the preset isosceles triangle, the distance between the front vehicle within each preset isosceles triangle and the current driving vehicle is obtained in turn according to the above-mentioned distance calculation method; and the front vehicle corresponding to the smallest distance is selected as the target front vehicle within the preset isosceles triangle.

[0151] Step 280: Obtain a collision threshold between the target front vehicle and the current driving vehicle.

[0152] Step 290: Determine whether the collision threshold value satisfies the triggering condition of the forward collision warning. If the collision threshold value satisfies the triggering condition of the forward collision warning, trigger the instruction of the forward collision warning.

[0153] Referring to the third embodiment of a vehicle forward collision control method provided by the present application, the third embodiment includes the following steps:

[0154] Step 310: Obtain video data to be processed from the currently driven vehicle.

[0155] Step 320: Based on the video data to be processed, select a target front vehicle within a preset isosceles triangle.

[0156] Step 330: Store the current frame including the target front vehicle and the previous frame adjacent to the current frame.

[0157] Step 340: Obtain the first bounding box area of ​​the current frame and the second bounding box area of ​​the previous frame.

[0158] Step 350: Obtain an intersection-over-union ratio based on the first bounding box area and the second bounding box area.

[0159] Among them, the x1, y1, x2, y2 of the two boxes of the current frame and the previous frame can be taken out to calculate the IOU intersection-union ratio, and then determine whether the vehicles in the current frame and the previous frame are the same vehicle.

[0160] Step 360: When the intersection-and-merge ratio is greater than or equal to an intersection-and-merge ratio threshold, a collision threshold between the target front vehicle and the currently driven vehicle is obtained.

[0161] The value range of the intersection-over-union ratio is between 0 and 1. The larger the value, the higher the overlap between the two bounding boxes. When the IOU is 1, it means that the two bounding boxes completely overlap; when the IOU is 0, it means that the two bounding boxes do not overlap at all.

[0162] In some embodiments, the intersection-over-union threshold may be 0.6.

[0163] For example, when the intersection-over-union ratio (IOU)>=0.6, it can be determined that the vehicles in the current frame and the previous frame are the same vehicle. At this time, the next step of collision judgment can be entered. That is, when the intersection-over-union ratio (IOU)>=0.6, the collision critical value between the target front vehicle and the current driving vehicle can be obtained for subsequent collision judgment.

[0164] Wherein, obtaining the collision threshold between the target front vehicle and the current driving vehicle in step 360 may include the following steps:

[0165] Step 361: Store 5 frames of real-time arrays of the target front vehicle and the current driving vehicle, wherein the real-time array includes a distance array and a timestamp array.

[0166] Step 362: Select a current frame and a previous frame from the 5-frame real-time array, wherein the previous frame is spaced two frames from the current frame.

[0167] For example, if the 5-frame real-time array is frame 1, frame 2, frame 3, frame 4 and frame 5, then the current frame is frame 1 and the previous frame is frame 4.

[0168] It should be noted that the 5-frame real-time array is updated in real time, that is, the latter data is moved forward, and the first data is directly discarded. For example, the initial 5-frame real-time array is the 1st frame, 2nd frame, 3rd frame, 4th frame and 5th frame mentioned above, then the 0th frame is added, the 1st frame, 2nd frame, 3rd frame and 4th frame are moved up in turn, and the 5th frame is directly discarded. Therefore, the updated 5-frame real-time array is Figure 5 As shown are the 0th frame, the 1st frame, the 2nd frame, the 3rd frame and the 4th frame, the current frame in the updated 5-frame real-time array is the 0th frame, and the previous frame is the 3rd frame.

[0169] Step 363: Obtain a relative distance based on the distance difference between the current frame and the previous frame.

[0170] Step 364: Obtain relative time based on the time difference between the current frame and the previous frame.

[0171] Step 365: Based on the relative distance and the relative time, the relative speed between the target front vehicle and the current driving vehicle is obtained.

[0172] For step 363 to step 365, taking the updated current frame as frame 0 and the previous frame as frame 3 as an example, the relative speed can be obtained by using the following formula.

[0173] Relative distance ΔR = distance of previous frame - distance of current frame = distance_arr[3] - distance_arr[0], formula 1.

[0174] Wherein, distance_arr[3] is the distance between the target vehicle in front and the current driving vehicle in the 3rd frame, and distance_arr[0] is the distance between the target vehicle in front and the current driving vehicle in the 0th frame.

[0175] Relative time ΔT = timestamp corresponding to the previous frame - timestamp corresponding to the current frame = (time_arr[3] - time_arr[0]) / 1000 (unit: s), formula 2.

[0176] Among them, time_arr[3] is the timestamp corresponding to the 3rd frame, and time_arr[0] is the timestamp corresponding to the 0th frame.

[0177] Relative speed ΔV = relative distance ΔR / relative time ΔT (unit: m / s), formula 3.

[0178] Step 366: Based on the distance of the current frame and the relative speed, a collision threshold between the target front vehicle and the current driving vehicle is obtained.

[0179] The collision critical value can be calculated using the following formula 4.

[0180] TTC_CODE=D / ΔV, Formula 4.

[0181] Among them, TTC_CODE is the collision threshold, D is the current distance and is also the distance updated in real time. Taking the above steps 363 to 365 as an example, the current distance D can be distance_arr[0].

[0182] If ΔV is a negative number, it may indicate that the current vehicle is being driven too fast and there is a possibility of a forward collision.

[0183] Step 370: Determine whether the collision threshold value satisfies the triggering condition of the forward collision warning. If the collision threshold value satisfies the triggering condition of the forward collision warning, trigger the instruction of the forward collision warning.

[0184] Among them, if ΔV is a negative number, the collision threshold value TTC_CODE can be converted into a positive number by taking the absolute value, and then judging whether the subsequent forward collision warning is triggered.

[0185] In some embodiments, a collision threshold may be set, such as but not limited to 0.2, 0.21, and 0.22.

[0186] At the same time, the sensitivity value TTC_SENSITIVE can also be set as needed, where the sensitivity value is the shortest time that the owner can react to driving the vehicle. The sensitivity value TTC_SENSITIVE may include but is not limited to 2.4, 2.41, and 2.42.

[0187] It should be noted that the collision threshold and sensitivity value can be changed according to specific circumstances. The larger the sensitivity value, the more sensitive it is, and the smaller the sensitivity value, the less sensitive it is.

[0188] For example, in this embodiment, the collision threshold is set to 0.2 and the sensitivity value is 2.4. Then, it can be determined whether the collision critical value is greater than the collision threshold and whether the collision critical value is less than or equal to the sensitivity value. If the collision critical value is greater than the collision threshold and the collision critical value is less than or equal to the sensitivity value (that is, TTC_CODE>0.2&&TTC_CODE<=2.4), it can be determined that the collision critical value meets the triggering condition of the forward collision warning, thereby triggering the forward collision warning instruction.

[0189] In some embodiments, the "collision warning" can be broadcasted on the vehicle-mounted device through voice broadcast, and the device can retain a warning picture before and after the warning moment for inspection.

[0190] Based on the above embodiments, combined with Figure 6 The vehicle forward collision control method provided in this application may include the following process:

[0191] Step 101: Receive video data.

[0192] The video data may be collected using a visual video data module, for example, real-time video recorded by a vehicle recorder device, that is, video data to be processed is obtained from the current driving vehicle.

[0193] The received video data may be in the format of YUVI420, NV12, NV21, etc.

[0194] Since the YUV format video stream has a resolution limit, videos with high resolutions such as 1080P and 720P cannot be directly transferred to the large model for processing. Therefore, after receiving the video data, it is necessary to convert the video data into a resolution that the large model can handle and a video frame rate that the large model can handle. For example, the video data is uniformly processed into a video stream with a resolution of 640*640 and a frame rate of 5 frames, and the YUV format is converted into a video stream in the RGB888 format.

[0195] Step 102: RGB data is input into the model.

[0196] That is, the video stream in RGB888 format is input into the preset model for vehicle recognition.

[0197] Step 103: Output data struct BOX.

[0198] That is, the preset model output data structure type set struct BOX. Among them, struct BOX includes data coordinate information of all front vehicles and corresponding vehicle type values, that is, struct BOX stores a lot of types, and each vehicle and each lane corresponds to a type.

[0199] For example, the value of type can be 0, 1, 2, and 3, where 0 and 1 represent vehicles, and 2 and 3 represent left and right lanes.

[0200] Step 104: Make a judgment based on the identification type type.

[0201] If the vehicle type values ​​type=2 and type=3 and type=0 or type=1 are simultaneously identified in a frame of data, step 105-step 110 is executed; if only the vehicle type value type=0 or type=1 is identified, step 201-step 202 is executed.

[0202] Step 105: Identify the left and right lanes.

[0203] Step 106: Calculate the vertices according to the left and right lanes.

[0204] Step 107: Set the triangle to an isosceles triangle.

[0205] That is, a preset isosceles triangle is set. How to set the isosceles triangle in step 106 and step 107 has the same or similar technical solutions as those in the above embodiment. For details, please refer to the relevant statements in the above embodiment.

[0206] Step 108: Determine whether the local database has isosceles triangle data.

[0207] If yes, execute step 109 , if no, execute step 110 .

[0208] Step 109: Update the set isosceles triangle to the local database.

[0209] Step 110: Store the set isosceles triangle in the local database.

[0210] Step 201: Determine whether type=0 or type=1.

[0211] If yes, execute step 202 , if no, return to step 101 .

[0212] Step 202: Determine whether the local database has isosceles triangle data.

[0213] If yes, execute step 203 , if no, return to step 101 .

[0214] Step 203: Filter out the vehicles in the isosceles triangle according to the isosceles triangle and the vehicles.

[0215] The vehicles within the preset isosceles triangle can be screened out by judging whether the detection center point of each of the front vehicles is within the preset isosceles triangle.

[0216] For specific methods of screening, please refer to the relevant statements in the above embodiments.

[0217] Step 204: Calculate the vehicle distance.

[0218] When the number of the front vehicle in the preset isosceles triangle is 1, the distance between the front vehicle and the current driving vehicle is directly calculated;

[0219] When there are multiple front vehicles within the preset isosceles triangle, the distance between each front vehicle and the current driving vehicle is calculated in turn, and the front vehicle with the smallest distance is retained.

[0220] Step 205: Store distance_arr[5] and time_arr[5].

[0221] That is, a 5-frame real-time array of the target front vehicle and the current driving vehicle is stored. The real-time array includes a distance array and a timestamp array. Among them, distance_arr[5] is a 5-frame distance array, distance_time[5] is a 5-frame timestamp array, and the real-time distance and real-time are in a one-to-one correspondence.

[0222] Step 206: Store Box[2].

[0223] That is, the array Box[2] consists of the current frame BOX_A and the previous frame data BOX_B.

[0224] Step 207: Calculate IOU and TTC_CODE.

[0225] Among them, the IOU can be calculated through the stored Box[2]. When IOU>=0.6, it is judged to be the same vehicle. If the premise of the same vehicle is met, the next step of collision judgment is entered.

[0226] When determining a collision, the collision threshold TTC_CODE can be calculated using the stored distance_arr[5] and time_arr[5].

[0227] For the specific calculation of IOU and TTC_CODE, please refer to the relevant statements in the above embodiments, and this application will not go into details here.

[0228] Step 208: Determine whether TTC_CODE meets the collision condition.

[0229] Step 209: If the conditions are met, a forward collision warning instruction is triggered.

[0230] For example, if TTC_CODE>collision threshold 0.2&&TTC_CODE<=TTC_SENSITIVE, the forward collision warning condition is triggered.

[0231] In addition, see Figure 7 The present application also provides a vehicle forward collision control system 01, which is divided into three large modules, namely, a visual video data module 10, a large model processing module 20, and a large model post-processing module 30. Among them, the visual video data module 10 collects video data and performs pre-processing, such as video resolution adjustment, video frame rate filtering, etc.; the large model processing module 20 mainly recognizes video data; the large model post-processing module 30 processes the structured data output by the large model, and performs forward collision algorithm logic processing through the corresponding structured data.

[0232] Among them, after the RGB video data enters the large model processing module 20, it will be divided into three threads, thread A, thread B, and thread C. Thread A is responsible for storing the RGB video in the queue, thread B is responsible for taking out the RGB video for vehicle identification, and thread C is responsible for processing the specific post-processing algorithm logic (the steps that thread C is responsible for are executed in the large model post-processing module 30). In addition, when the forward collision warning is triggered, thread C can broadcast "collision warning" on the vehicle-mounted device end through voice broadcast. At the same time, the device end will retain a warning picture before and after the warning moment, a total of three pictures for inspection.

[0233] The visualization video data module 10 may include a vehicle recorder 11 and a video collector 12 to obtain video data, and the large model processing module 20 may include a large model recognition unit 21 to perform recognition processing on the input video data.

[0234] The large model post-processing module 30 includes a data post-processing logic unit 31 and a forward collision warning unit 32 .

[0235] Since traditional vehicle collision algorithms are almost all based on various sensors of the device, such as Gsensor, GPS, etc. This application combines data big models and visual video data. Since the visualized big data can be converted into a big model in any environment, the big model can be deployed on the terminal vehicle-mounted device or on the cloud to achieve cloudification. Therefore, the vehicle forward collision control method provided by this application has strong scalability and can be used for visual detection of pedestrians, blind spot vision, etc.

[0236] like Figure 8 As shown, the embodiment of the present application provides a computer device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0237] Memory 113, used for storing computer programs;

[0238] In one embodiment of the present application, the processor 111 is used to execute the program stored in the memory 113 to implement the vehicle forward collision control method provided by any of the aforementioned method embodiments, including: obtaining video data to be processed from the currently driven vehicle;

[0239] Based on the video data to be processed, selecting a target front vehicle within a preset isosceles triangle;

[0240] Obtaining a collision threshold between the target front vehicle and the currently driven vehicle;

[0241] It is determined whether the collision threshold value satisfies a triggering condition of a forward collision warning. If the collision threshold value satisfies the triggering condition of the forward collision warning, an instruction of the forward collision warning is triggered.

[0242] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0243] Therefore, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the vehicle forward collision control method provided in any of the aforementioned method embodiments are implemented.

[0244] The storage medium is a physical, non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which can store program codes. The computer-readable storage medium can be non-volatile or volatile.

[0245] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0246] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0247] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0248] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.

[0249] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

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

[0251] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for controlling a vehicle forward collision, characterized in that: The method comprises: Obtaining video data to be processed from the currently driven vehicle; Based on the video data to be processed, selecting a target front vehicle within a preset isosceles triangle; Obtaining a collision threshold between the target front vehicle and the currently driven vehicle; Determining whether the collision threshold value satisfies a triggering condition of a forward collision warning, and if the collision threshold value satisfies the triggering condition of the forward collision warning, triggering an instruction of a forward collision warning; The step of selecting a target front vehicle within a preset isosceles triangle based on the video data to be processed includes: Inputting the video data to be processed into a preset model for vehicle identification, and obtaining a data structure type set output by the preset model, wherein the data structure type set includes data coordinate information of all front vehicles and corresponding vehicle type values; Based on the vehicle type value, obtaining a preset isosceles triangle; Obtaining the detection center point of each of the front vehicles based on the data coordinate information of the front vehicles in sequence; Determining in sequence whether the detection center point of each of the front vehicles is within the preset isosceles triangle; If the detection center point of the front vehicle is located within the preset isosceles triangle, the front vehicle is regarded as the front vehicle within the preset isosceles triangle; Based on the front vehicle within the preset isosceles triangle, a target front vehicle within the preset isosceles triangle is obtained.

2. The method according to claim 1, characterized in that The step of obtaining a preset isosceles triangle based on the vehicle type value includes: If the vehicle type value does not include both the left lane line and the right lane line, obtaining a preset isosceles triangle from a local database; If the vehicle type value includes both the left lane line and the right lane line, then obtain the left lane rectangular frame and the right lane rectangular frame; Obtaining a diagonal intersection point of the left lane rectangular frame and the right lane rectangular frame, and using the diagonal intersection point as a first vertex of the preset isosceles triangle; Obtain the ordinate value of the lower left corner of the left lane line from the left lane rectangular frame, and obtain the ordinate value of the lower right corner of the right lane line from the right lane rectangular frame; Based on the ordinate value of the lower left corner of the left lane line and the ordinate value of the lower right corner of the right lane line, the second vertex and the third vertex of the preset isosceles triangle are obtained.

3. The method according to claim 2, characterized in that The obtaining of the second vertex and the third vertex of the preset isosceles triangle based on the ordinate value of the lower left corner of the left lane line and the ordinate value of the lower right corner of the right lane line comprises: Determine the magnitude relationship between the lower left corner ordinate value of the left lane line and the lower right corner ordinate value of the right lane line; If the ordinate value of the lower left corner of the left lane line is greater than the ordinate value of the lower right corner of the right lane line, the lower left corner of the left lane line is used as the second vertex of the preset isosceles triangle; and extending the lower right corner of the right lane line to obtain an extended vertex, wherein the ordinate value of the extended vertex is equal to the ordinate value of the lower left corner of the left lane line; The extended vertex is used as the third vertex of the preset isosceles triangle.

4. The method according to claim 3, characterized in that The determining of the magnitude relationship between the lower left corner ordinate value of the left lane line and the lower right corner ordinate value of the right lane line further includes: If the ordinate value of the lower left corner of the left lane line is smaller than the ordinate value of the lower right corner of the right lane line, the lower right corner of the right lane line is used as the second vertex of the preset isosceles triangle; and extending the lower left corner of the left lane line to obtain an extended vertex, wherein the ordinate value of the extended vertex is equal to the ordinate value of the lower right corner of the right lane line; The extended vertex is used as the third vertex of the preset isosceles triangle.

5. The method according to claim 1, characterized in that The number of the front vehicles within the preset isosceles triangle is one or more; The method of obtaining a target front vehicle within the preset isosceles triangle based on the front vehicle within the preset isosceles triangle comprises: If the number of the front vehicles in the preset isosceles triangle is 1, the front vehicle in the preset isosceles triangle is used as the target front vehicle in the preset isosceles triangle; If there are multiple front vehicles in the preset isosceles triangle, then the distance between the front vehicle in each preset isosceles triangle and the current driving vehicle is obtained in sequence; The front vehicle corresponding to the shortest distance is selected as the target front vehicle within the preset isosceles triangle.

6. The method according to claim 5, characterized in that The step of sequentially obtaining the distance between the front vehicle and the current driving vehicle within each preset isosceles triangle includes: Determine the type of the front vehicle in each preset isosceles triangle in turn; If the type of the front vehicle in the preset isosceles triangle is the first vehicle type, then based on the upper left corner ordinate value, the lower right corner ordinate value, the preset standard distance, the first standard length ratio and the image resolution of the front vehicle in the preset isosceles triangle, the distance between the front vehicle in the preset isosceles triangle and the current driving vehicle is obtained; If the type of the front vehicle within the preset isosceles triangle is the second vehicle type, then based on the upper left corner ordinate value, the lower right corner ordinate value, the preset standard distance, the second standard length ratio and the image resolution of the front vehicle within the preset isosceles triangle, the distance between the front vehicle within the preset isosceles triangle and the current driving vehicle is obtained, wherein the first vehicle type is a small car model and the second vehicle type is a large car model.

7. The method according to any one of claims 1 to 6, characterized in that: Before obtaining the collision threshold between the target front vehicle and the currently driven vehicle, the method further includes: storing a current frame including the target front vehicle and a previous frame adjacent to the current frame; Get the first bounding box area of ​​the current frame and the second bounding box area of ​​the previous frame; Obtaining an intersection-over-union ratio based on the first bounding box area and the second bounding box area; When the intersection-and-joint ratio is greater than or equal to an intersection-and-joint ratio threshold, a collision critical value between the target front vehicle and the currently driven vehicle is obtained.

8. The method according to claim 7, characterized in that The obtaining of the collision threshold between the target front vehicle and the current driving vehicle comprises: Storing 5 frames of real-time arrays of the target front vehicle and the current driving vehicle, the real-time array includes a distance array and a timestamp array; Selecting a current frame and a previous frame from the 5-frame real-time array, wherein the previous frame and the current frame are separated by two frames; Obtaining a relative distance based on a distance difference between the current frame and the previous frame; Obtaining a relative time based on a time difference between the current frame and the previous frame; Based on the relative distance and the relative time, obtaining the relative speed between the target front vehicle and the current driving vehicle; Based on the distance of the current frame and the relative speed, a collision threshold between the target front vehicle and the current driving vehicle is obtained.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 can be implemented.

Citation Information

Patent Citations

  • Vehicle collision early warning method and system based on monocular vision

    CN112349144A