A computer vision-based engineering vehicle collision detection and warning system and method

Through the engineering vehicle collision detection and early warning system based on computer vision, it uses video image splitting and target vehicle recognition to calculate the driving trajectory and speed, combined with the inter-vehicle distance and historical data, to solve the problem of vehicle collision detection in the complex environment of the construction site and achieve real-time Risk warning and accident avoidance.

CN118053322BActive Publication Date: 2024-09-20TIANJIN UNIV +2
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202410156051.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-04
Publication Date
2024-09-20
Estimated Expiration
2044-02-04

AI Technical Summary

Technical Problem

Existing engineering vehicle collision detection and early warning technologies are mainly suitable for urban road environments, and are difficult to effectively identify and provide early warning in complex construction environments, resulting in frequent collision accidents at construction sites.

Method used

An engineering vehicle collision detection and warning system based on computer vision is used to generate collision warnings through video image splitting, target vehicle identification and numbering, driving trajectory calculation, speed detection, and inter-vehicle distance and historical data analysis to achieve real-time tracking and risk warnings. .

Benefits of technology

Real-time tracking of construction vehicles and accurate identification of collision risks are achieved, and early warnings are generated in advance to effectively avoid collision accidents at the construction site.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118053322B
    Figure CN118053322B
Patent Text Reader

Abstract

The present invention discloses a computer vision-based engineering vehicle collision detection and early warning system and method, which belongs to the field of image recognition technology, and includes step S1: obtaining a static image of a construction site, using a first model for recognition, and obtaining the outline of a target vehicle; step S2: numbering the target vehicle, and generating the driving track and actual distance of the target vehicle based on the position of the target vehicle in the first image; step S3: obtaining the time interval between the first images and the actual distance of the target vehicle, and calculating the driving speed; step S4: synthesizing a second image, setting a first threshold and a second threshold, and if the vehicle-to-vehicle distance of the target vehicle is less than the first threshold, the target vehicle is highlighted in a first color and a first warning is generated, and the target vehicle whose driving speed is greater than the second threshold is highlighted in a second color and a second warning is generated. The present invention solves the problem of collision detection and early warning of engineering vehicles in a complex and changeable engineering construction environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image recognition, and in particular relates to a computer vision-based engineering vehicle collision detection and warning system and method. Background Art

[0002] In the construction environment, the investment in engineering vehicles is large, the construction environment is complex and changeable, and it has the characteristics of large flow of mechanical equipment and multiple cross-operations. In addition, engineering vehicles are affected by factors such as large vehicle models, high dead weight, and poor stability during load operation. Collision accidents of engineering vehicles at construction sites occur frequently. At present, the safety control of engineering vehicles mainly includes on-site inspections by management personnel and viewing surveillance videos. There are problems such as time-consuming and labor-intensive, high labor costs, and low detection efficiency. In addition, engineering vehicles are highly dynamic during operation, and the constantly changing workspace and complex and changeable construction environment increase the difficulty of identifying collision risks. If the possible collision risks can be accurately judged and early warnings can be given in advance, the occurrence of collision accidents can be avoided to a large extent. Therefore, real-time collision detection and early warning of engineering vehicles during construction are of great significance.

[0003] In recent years, the use of artificial intelligence technology for intelligent identification of target objects has developed rapidly, and unmanned intelligent detection methods have attracted attention due to their low cost and high efficiency. Deep Learning (DL) is a high-level and complex machine learning algorithm in the field of artificial intelligence. This method uses end-to-end learning to extract richer and deeper feature information through deep neural networks. It has shown high robustness in various computer vision tasks and provides a new perspective for collision detection and warning of engineering vehicles.

[0004] At present, the research results of vehicle identification, tracking and warning based on computer vision and deep learning are rich and diverse, but these methods are basically carried out in urban road environments. There has been no in-depth research on the warning strategy of engineering vehicles in the construction environment of engineering and construction. The roads in the construction environment are very different from urban roads. The construction roads are more closed and complex, and most of them are temporary roads with poor road surface flatness and many slopes. The traditional road marking recognition and positioning and distance measurement methods are difficult to implement on construction roads. Therefore, the existing urban road collision detection and warning technology solutions cannot be directly used. Summary of the invention

[0005] To solve the above problems, the present invention provides a computer vision-based engineering vehicle collision detection and warning system and method to solve the problem that the prior art cannot provide warning for engineering vehicle collisions.

[0006] In order to achieve the above-mentioned invention object, the present invention proposes a computer vision-based engineering vehicle collision detection and early warning method, comprising the following steps:

[0007] Acquire a first video acquired by different image acquisition modules at a first time interval, wherein the first video is a monitoring video of the construction site, split the first video into a plurality of static images, train and establish a first model, and use the first model to identify each of the static images to obtain a target vehicle in each of the static images;

[0008] The target vehicles in each of the static images are numbered, each of the target vehicles having a unique number. If the same target vehicle appears in multiple static images, the static image in which the target vehicle with the same number appears is defined as a first image, a driving track of the target vehicle is generated in the first image, and an actual distance traveled by the target vehicle is calculated through the driving track and coordinate transformation;

[0009] Acquire a time interval between the first images, and calculate a travel speed of the target vehicle based on the actual distance and the time interval between the first images;

[0010] The static images extracted from different first videos are synthesized into a second image, where the second image is a panoramic bird's-eye view. A first threshold and a second threshold are set. If the vehicle-to-vehicle distance between the center of mass of two target vehicles with different numbers is less than the first threshold, the two target vehicles are highlighted in a first color and a first warning is generated, and the target vehicle whose driving speed is greater than the second threshold is highlighted in a second color and a second warning is generated.

[0011] Furthermore, if the inter-vehicle distance between the centroids of two target vehicles with different numbers is greater than or equal to a first threshold, the following steps are further included:

[0012] Determine a driving direction of each of the target vehicles in the second image based on the driving trajectory, and generate a first route based on the driving direction, wherein the first route is parallel to the driving direction;

[0013] A judgment area is selected on each of the first routes, and the distance between the target vehicle and the judgment area is defined as a first distance. Based on the driving speed and the first distance, a first time required for each of the target vehicles to reach the judgment area is calculated, and the first times of different target vehicles are subtracted to obtain a time difference for each of the target vehicles to reach the judgment area. A third threshold and a fourth threshold are set. If the time difference is less than the third threshold, a first probability of the target vehicle colliding in the judgment area is calculated. If the first probability is greater than the fourth threshold, a third warning is generated.

[0014] Furthermore, in the steps, calculating the first probability includes the following steps:

[0015] A second distance is set, where the second distance is smaller than the first distance, and multiple base points are selected at intervals of the second distance on the first route. Two first monitoring areas are generated in the second image with each base point as the center and the second distance as the radius. If the target vehicles overlap each other in the area, the two first monitoring areas are defined as judgment areas, and the base points of the first monitoring areas where the overlap occurs are defined as target points. A second probability of the target vehicle reaching the target point is calculated, and the second probabilities of different target points are accumulated to obtain the first probability. If the first probability exceeds the fourth threshold, it is determined that each of the target vehicles has a collision risk in the judgment area.

[0016] Further, obtaining the second probability that the target vehicle arrives at the target point includes the following steps:

[0017] The second image is divided into m grid areas, each grid area is numbered, and first feature data of the target vehicle is obtained, wherein the first feature data includes the number of the grid area at the current position of the target vehicle, the driving speed and the driving direction, and the driving direction is parallel to the driving trajectory. Historical data identical to the first feature data of the target vehicle is obtained, and a third probability P of the target vehicle moving from the current position to the grid area numbered n is calculated based on the historical data and the first formula. n , the grid area numbered n is the grid area where the target point is located, and the first formula is: Among them, a n is the number of times each of the target vehicles in the historical data passes through the grid area numbered n, and A is the number of the historical data;

[0018] The grid area that satisfies the second formula is retained, and the rest of the grid areas are deleted. The second formula is: n >max(αT, M%), where α is a first preset value, T is the time required for the target vehicle to travel from the current position to the grid area numbered n, M is a second preset value, and max(x, y) is the maximum value of the output values ​​x and y;

[0019] A second monitoring area is generated with the base point as the center, the third probability of each of the grid areas in the second monitoring area is obtained, and the second probability of the target vehicle moving from the current position to the grid area numbered n is calculated based on a third formula, where the third formula is: Wherein, Pn is the probability of the grid area that the target vehicle passes through in the first route direction, and U is the sum of the third probabilities of all grid areas in the second monitoring area.

[0020] The present invention also provides an engineering vehicle collision detection and warning system based on computer vision, which mainly includes:

[0021] An acquisition module, which acquires a first video acquired by different image acquisition modules at each first time interval, wherein the first video is a monitoring video of the construction site, splits the first video into a plurality of static images at preset time intervals, trains and establishes a first model, and uses the first model to identify each of the static images to obtain a target vehicle in each of the static images;

[0022] An analysis module is used to number the target vehicles in each of the static images, wherein if the same target vehicle appears in multiple static images, the target vehicle has a unique number, and the static image in which the target vehicle with the same number appears is defined as a first image, and a driving trajectory of the target vehicle is generated based on a connecting line of the centroids of the contours of each of the target vehicles in the first image, and an actual distance traveled by the target vehicle is calculated through the driving trajectory and coordinate transformation;

[0023] a speed calculation module, configured to obtain a time interval between the first images, and calculate a travel speed of the target vehicle based on the actual distance and the time interval between the first images;

[0024] The early warning module is used to synthesize the static images extracted from different first videos into a second image, where the second image is a panoramic bird's-eye view, and set a first threshold and a second threshold. If the vehicle-to-vehicle distance between the centers of mass of two target vehicles with different numbers is less than the first threshold, the two target vehicles are highlighted in a first color and a first warning is generated, and the target vehicle whose driving speed is greater than the second threshold is highlighted in a second color and a second warning is generated.

[0025] Compared with the prior art, the beneficial effects of the present invention are at least as follows:

[0026] The present invention firstly recognizes the static image obtained by splitting the obtained video image through the first model, obtains the outline and center of mass positioning of the engineering vehicle, numbers the engineering vehicles and realizes real-time tracking through the automatic detection and tracking algorithm, generates the driving trajectory of the vehicle based on the vehicle position, and then calculates the actual distance traveled by the vehicle; generates the first warning and the second warning through the speed detection and the vehicle-to-vehicle distance detection of the engineering vehicle, realizes the speed warning, the vehicle-to-vehicle distance warning and the thermal map collision warning based on the speed and the vehicle-to-vehicle distance; at the same time, based on the first characteristic data of the engineering vehicle in the area, obtains the historical probability statistical data of the engineering vehicle on the grid of the area, combines the driving trajectory of the engineering vehicle, analyzes its historical data, and then obtains the collision probability of the engineering vehicle on the current driving trajectory, and generates the third warning; realizes the real-time acquisition of video frame images according to the construction site image information, generates risk warning information after detection, evaluation and analysis, and feeds back to the system monitor and the driver and passengers, so as to make risk avoidance in advance and effectively avoid the occurrence of collision accidents. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A flowchart of the steps of a computer vision-based engineering vehicle collision detection and early warning method of the present invention;

[0028] Figure 2 A schematic diagram of the principle of obtaining a first probability according to the present invention;

[0029] Figure 3 A schematic diagram of the principle of obtaining the second probability of the present invention;

[0030] Figure 4 The present invention is a structural diagram of the composition of an engineering vehicle collision detection and warning system based on computer vision. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0032] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.

[0033] like Figure 1 As shown, the present invention provides an engineering vehicle collision detection and early warning method based on computer vision, the method comprising the following steps:

[0034] Step S1: acquiring a first video captured by different image acquisition modules at a first time interval, the first video being a monitoring video of the construction site, splitting the first video into a plurality of static images, training and establishing a first model, and using the first model to identify each static image to obtain a target vehicle in each static image;

[0035] Specifically, the first video is obtained by a surveillance camera set up at the construction site. The first video is a video image obtained from different monitoring angles, different lighting conditions, different construction environments and different construction progresses; the first video is split into multiple static images. In order to improve the robustness of the training results, the video images are randomly selected at different time points in this embodiment to split; then the static images are labeled specifically as two categories, Engineering vehicle and Person; the first model preferably uses the YOLO v7 algorithm to intelligently identify engineering vehicles. Before training, the original data is first expanded, wherein the expansion method includes but is not limited to using random brightness, random contrast, random scaling, random flipping and Mosaic-4. The processed data is trained by pre-training weights, and the set experimental hyperparameters include learning rate, Batch-size, Epochs, Workers, and adaptive image scaling size. In this embodiment, the learning rate is 0.001, the Batch-size is 32, the Epochs is 150, the Workers is 4, and the adaptive image scaling size is 640×640. The engineering vehicles detected and identified by YOLO v7 are marked with green boxes.

[0036] Step S2: numbering the target vehicles in each static image, each target vehicle having a unique number. If the same target vehicle appears in multiple static images, the static image in which the target vehicle with the same number appears is defined as the first image, and a driving track of the target vehicle is generated in the first image. The actual distance traveled by the target vehicle is calculated through the driving track and coordinate transformation;

[0037] This embodiment uses the DeepSORT multi-target tracking algorithm, and combines it with the residual neural network calculation to assign a target vehicle number and calculate the driving trajectory. Specifically, the DeepSORT algorithm is used to perform data association across frames to form a vehicle motion trajectory, so as to realize real-time tracking of multiple targets of engineering vehicles. In addition, the residual convolutional neural network is used to extract the appearance features and motion features of each engineering vehicle to calculate the similarity. That is, on the basis of target tracking, if it is considered that the same vehicle exists in two static images, the similarity is calculated based on the appearance features and motion features. If the similarity is extremely large, it is considered that the vehicles appearing in the two static images are the same vehicle, and therefore the same ID number is assigned to them. This method can avoid the phenomenon of ID jumping, thereby further ensuring the accuracy of subsequent predictions.

[0038] In step S2, the step of calculating the actual distance traveled by the target vehicle includes:

[0039] Step S21: matching the contour centroid of the target vehicle with the same number in the first image, and performing data association across frames to form an extended line segment of the centroid, which is the driving trajectory;

[0040] Step S22: calibrating the longitude and latitude coordinates and the image pixel coordinates on the first image to obtain the transformation matrix of the two coordinate systems;

[0041] Step S23: According to the conversion matrix, the longitude and latitude coordinates of the target vehicle in the image are obtained, and then the actual distance traveled by the target vehicle is calculated.

[0042] Step S3: acquiring the time interval between the first images, and calculating the travel speed of the target vehicle based on the actual distance and the time interval between the first images;

[0043] Step S4: Synthesize static images extracted from different first videos into a second image, where the second image is a panoramic bird's-eye view. Set a first threshold and a second threshold. If the vehicle-to-vehicle distance between the center of mass of two target vehicles with different numbers is less than the first threshold, the two target vehicles are highlighted in a first color and a first warning is generated, and the target vehicle whose driving speed is greater than the second threshold is highlighted in a second color and a second warning is generated.

[0044] Specifically, the center of mass of the engineering vehicle is used as a reference point, and the original monitoring image is converted into a panoramic bird's-eye view in the 3D world coordinate system through inverse perspective mapping. In the bird's-eye view space, the vehicle-to-vehicle distance L can be calculated, which is consistent with the first threshold L S In comparison, when L ≥ L S When L <L SWhen , the first color red is displayed above the two target vehicles, indicating a high risk of collision. At the same time, the V of the current engineering vehicle is obtained, and the second threshold is the value including V 1 and V 2 , where V 1 >V 2 , when V>V 1 When the vehicle speed is displayed in the second color, dark red, it indicates a high risk of collision. The number of vehicles that meet this speed condition is N. 1 ; When V 2 <V≤V 1 The speed is displayed in yellow, indicating that the risk of collision is moderate. The number of vehicles that meet this speed condition is N. 2 ; When V≤V 2 When the speed is displayed in green, it means the risk of collision is low, and the number of vehicles that meet this speed condition is N. 3 At the same time, this embodiment will also calculate the number of engineering vehicles N and the number of vehicles N at different speeds. 1 、N 2 、N 3 In addition, based on the speed of the target vehicle and the distance between vehicles, a heat map can also be used to display collision warnings. The higher the speed of the target vehicle and the smaller the distance between vehicles, the higher the risk of collision, and the darker the red color; the lower the speed of the target vehicle and the larger the distance between vehicles, the darker the green color, and the lower the risk of collision.

[0045] Furthermore, if the inter-vehicle distance between the centroids of two target vehicles with different numbers is greater than or equal to a first threshold, the following steps are also included:

[0046] Determine the driving direction of each target vehicle in the second image based on the driving trajectory, and generate a first route based on the driving direction, wherein the first route is parallel to the driving direction;

[0047] A judgment area is selected on each first route, and the distance between the target vehicle and the judgment area is defined as the first distance. Based on the driving speed and the first distance, the first time required for each target vehicle to reach the judgment area is calculated, and the first times of different target vehicles are subtracted to obtain the time difference for each target vehicle to reach the judgment area. A third threshold and a fourth threshold are set. If there is a time difference less than the third threshold, the first probability of the target vehicle colliding in the judgment area is calculated. If the first probability is greater than the fourth threshold, a third warning is generated.

[0048] Specifically, Figure 2 This is a schematic diagram of the principle of obtaining the first probability of the present invention. Assuming that there are target vehicles A and B, L 1 is the first route generated based on the driving direction of the target vehicle A, L 2is the first route generated based on the driving direction of the target vehicle B. The judgment area is the area p1 generated with the center of the circle a' in the figure, and the area p2 generated with the center of the circle b' in the figure; the distance between point a and point a' is the first distance L from the target vehicle A to the judgment area a , the distance between point b and point b' is the first distance L of the target vehicle B to the judgment area b According to the driving speed and the first distance, the time difference T between the target vehicles A and B arriving at the judgment area can be calculated. 差 =|T a -T b |, where T a is the time when the target vehicle A arrives at the judgment area, T b is the time when the target vehicle B arrives at the judgment area. If the time difference T 差 If the first probability is 85% and the fourth threshold is 80%, a third warning is generated, indicating that if target vehicle A and target vehicle B continue to travel at the current speed and direction, there may be a risk of collision in the future.

[0049] Further, in the step, calculating the first probability includes the following steps:

[0050] A second distance is set, which is smaller than the first distance. Multiple base points are selected at intervals of the second distance on the first route. Two first monitoring areas are generated in the second image with each base point as the center and the second distance as the radius. If the target vehicles overlap each other in the area, the two first monitoring areas are defined as judgment areas, and the base points of the first monitoring areas where the overlap occurs are defined as target points. The second probability of the target vehicle reaching the target point is calculated, and the second probabilities of different target points are accumulated to obtain the first probability. If the first probability exceeds a fourth threshold, it is determined that each target vehicle has a collision risk in the judgment area.

[0051] Specifically, to calculate the first probability of a target vehicle colliding, it is necessary to first determine a judgment area where the target vehicle may collide, and select multiple base points at a second distance interval along the first route of the target vehicle, wherein the second distance is smaller than the first distance, such as Figure 2 The distance L between point a and point a1 is aa1 is the second distance of the target vehicle A on the first route, the distance L between point b and point b1 bb1 is the second distance of the target vehicle B on the first route, with base points a' and b' as the center of the circle, and the second distance L aa1 , L bb1is the radius, and the generated circular area is the first monitoring area at the base point. If the target vehicles overlap each other in this area, the two first monitoring areas are defined as judgment areas. After that, the second probability u1 of the target vehicle A traveling to a' and the second probability u2 of the target vehicle B traveling to b' are calculated. The collision probability of the two target vehicles in the judgment area is the sum of the second probability u1 and the second probability u2.

[0052] Further, obtaining the second probability that the target vehicle reaches the target point includes the following steps:

[0053] The second image is divided into m grid areas, each grid area is numbered, and the first characteristic data of the target vehicle is obtained. The first characteristic data includes the number of the grid area at the current position of the target vehicle, the driving speed and the driving direction, and the driving direction is parallel to the driving trajectory. The historical data identical to the first characteristic data of the target vehicle is obtained, and the third probability P of the target vehicle going from the current position to the grid area numbered n is calculated based on the historical data and the first formula. n , the grid area numbered n is the grid area where the target point is located, and the first formula is: Among them, a n is the number of times each target vehicle passes through the grid area numbered n in the historical data, and A is the number of historical data;

[0054] Specifically, for the convenience of explanation, this embodiment divides the second image into 4*4 grids, that is, 16 grid areas are divided, and then the grid areas are numbered from left to right and from top to bottom; then the first characteristic data of the target vehicle is obtained, and the historical data is searched based on the first characteristic data. For example, the speed of the target vehicle A is 20km / h, traveling in the direction L1, and the position is in the grid area 5, then the historical data is searched for vehicles that are also in the grid area 5, with a speed of 20km / h and traveling in the direction of L1; in particular, the speed value range can also be set, and the vehicles with a speed of 15-25km / h are searched; then the actual driving trajectory of such vehicles in the historical data is obtained, and the driving trajectory is converted into the number of the grid area, and then the probability of the current target vehicle going to each grid is calculated by the third formula. For example, for grid area 7, 10 historical data are retrieved, among which 5 engineering vehicles pass through grid area 7, then the probability of the target vehicle passing through grid area 7 is 5 / 10*100%=50%.

[0055] The grid area that satisfies the second formula is retained, and the rest of the grid area is deleted. The second formula is: P n >max(αT, M%), where α is a first preset value, T is the time required for the target vehicle to travel from the current position to the grid area numbered n, M is a second preset value, and max(x, y) is the maximum value of the output values ​​x and y;

[0056] After that, some grid areas are deleted through this step. For example, the probability of the target vehicle going to grid area 3 is calculated to be 20%, M is set to 30, and α is set to 1%. When the target vehicle travels from the center point of grid area 5 at a speed of 25 km / h, it takes 40 minutes to reach the center point of grid area 3. This means that the third probability of grid area 3 does not satisfy the second formula and needs to be eliminated. Its meaning is that for grid areas with long distances, when the time for the target vehicle to go to the grid area is long, the grid area will be retained only when the third probability calculated by historical data is very high. For grid areas with short distances, even if the calculated third probability is small, because the distance is very close and the direction of the vehicle has been determined, the grid area may be retained even if the time is short.

[0057] Generate a second monitoring area with the base point as the center, obtain the third probability of each grid area in the second monitoring area, and calculate the second probability of the target vehicle going from the current position to the grid area numbered n based on the third formula. The third formula is: Wherein, Pn is the probability of the grid area that the target vehicle passes through in the first route direction, and U is the sum of the third probabilities of all grid areas in the second monitoring area.

[0058] Specifically, in this implementation, the second monitoring area is set as a rectangular area. For example, to calculate the probability of going to numbered area 7, grid area 7 is used as the starting point, and one grid area is detected upward and downward, such as Figure 3 As shown, grid area 3 and grid area 11 will be detected, and in the above calculation, grid area 3 is deleted, so only grid area 11 is obtained here, and then the probability of going to grid area 7 is obtained; the significance of the third formula is that if grid area 11 is monitored, it indicates that target vehicle A also has the probability of going to grid area 11, so the probability of it going to grid area 7 is calculated, and the ratio of the two to the total probability is obtained, and the probability of target vehicle A going to grid area 7 can be obtained.

[0059] The present invention also provides an engineering vehicle collision detection and warning system based on computer vision, such as Figure 4 As shown, the system is used to implement the above-mentioned engineering vehicle collision detection and early warning method based on computer vision, and the system mainly includes:

[0060] The acquisition module acquires a first video acquired by different image acquisition modules at each first time interval, the first video being a monitoring video of the construction site, splits the first video into a plurality of static images at preset time intervals, trains and establishes a first model, and uses the first model to identify each static image to obtain a target vehicle in each static image;

[0061] The analysis module is used to number the target vehicles in each static image, wherein if the same target vehicle appears in multiple static images, the target vehicle has a unique number, and the static image in which the target vehicle with the same number appears is defined as the first image. Based on the centroid connection line of the contours of each target vehicle in the first image, the driving trajectory of the target vehicle is generated, and the actual distance traveled by the target vehicle is calculated through the driving trajectory and coordinate transformation;

[0062] The speed calculation module is used to obtain the time interval between the first images, and calculate the driving speed of the target vehicle based on the actual distance and the time interval between the first images;

[0063] The early warning module is used to synthesize static images extracted from different first videos into a second image, where the second image is a panoramic bird's-eye view. A first threshold and a second threshold are set. If the vehicle-to-vehicle distance between the center of mass of two target vehicles with different numbers is less than the first threshold, the two target vehicles are highlighted in a first color and a first warning is generated, and the target vehicle whose driving speed is greater than the second threshold is highlighted in a second color and a second warning is generated.

[0064] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0065] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0066] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for those of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

[0067] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A computer vision-based engineering vehicle collision detection and early warning method, characterized in that: The steps include: Acquire a first video acquired by different image acquisition modules at a first time interval, wherein the first video is a monitoring video of the construction site, split the first video into a plurality of static images, train and establish a first model, and use the first model to identify each of the static images to obtain a target vehicle in each of the static images; The target vehicles in each of the static images are numbered, each of the target vehicles having a unique number. If the same target vehicle appears in multiple static images, the static image in which the target vehicle with the same number appears is defined as a first image, a driving track of the target vehicle is generated in the first image, and an actual distance traveled by the target vehicle is calculated through the driving track and coordinate transformation; Acquire a time interval between the first images, and calculate a travel speed of the target vehicle based on the actual distance and the time interval between the first images; The static images extracted from different first videos are synthesized into a second image, wherein the second image is a panoramic bird's-eye view, and a first threshold and a second threshold are set. If the vehicle-to-vehicle distance between the centroids of two target vehicles with different numbers is less than the first threshold, the two target vehicles are highlighted in a first color and a first warning is generated, and the target vehicle whose driving speed is greater than a second threshold is highlighted in a second color and a second warning is generated; Wherein, if the inter-vehicle distance between the mass centers of two target vehicles with different numbers is greater than or equal to a first threshold, the following steps are also included: Determine a driving direction of each of the target vehicles in the second image based on the driving trajectory, and generate a first route based on the driving direction, wherein the first route is parallel to the driving direction; Selecting a judgment area on each of the first routes, defining the distance between the target vehicle and the judgment area as a first distance, calculating a first time required for each of the target vehicles to reach the judgment area based on the driving speed and the first distance, subtracting the first times of different target vehicles from each other to obtain a time difference for each of the target vehicles to reach the judgment area, setting a third threshold and a fourth threshold, calculating a first probability of the target vehicle colliding in the judgment area if the time difference is less than the third threshold, and generating a third warning if the first probability is greater than the fourth threshold; Calculating the first probability includes the following steps: A second distance is set, the second distance is smaller than the first distance, a plurality of base points are selected at intervals of the second distance on the first route, each of the base points is used as a circle center, and the second distance is used as a radius, two first monitoring areas are generated in the second image, if the target vehicles overlap each other in the area, the two first monitoring areas are defined as judgment areas, the base points of the first monitoring areas where the overlap occurs are defined as target points, a second probability of the target vehicle reaching the target point is calculated, the second probabilities of different target points are accumulated to obtain the first probability, and if the first probability exceeds the fourth threshold, it is determined that each of the target vehicles has a collision risk in the judgment area; Wherein, obtaining the second probability that the target vehicle arrives at the target point comprises the following steps: The second image is divided into m grid areas, each grid area is numbered, and first feature data of the target vehicle is obtained, wherein the first feature data includes the number of the grid area at the current position of the target vehicle, the driving speed and the driving direction, and the driving direction is parallel to the driving trajectory; historical data identical to the first feature data of the target vehicle is obtained, and a third probability of the target vehicle moving from the current position to the grid area numbered n is calculated based on the historical data and the first formula. , the grid area numbered n is the grid area where the target point is located, and the first formula is: , where a n is the number of times each target vehicle in the historical data passes through the grid area numbered n, and A is the number of the historical data; The grid areas satisfying the second formula are retained, and the rest of the grid areas are deleted. The second formula is: ,in, is the first preset value, is the time required for the target vehicle to travel from the current position to the grid area numbered n, is the second preset value, To output the maximum value of x and y; A second monitoring area is generated with the base point as the center, the third probability of each grid area in the second monitoring area is obtained, and the second probability of the target vehicle moving from the current position to the grid area numbered n is calculated based on a third formula, where the third formula is: , where Pn is the probability of the target vehicle passing through the grid area in the first route direction, is the sum of the third probabilities of all grid areas in the second monitoring area.

2. A computer vision-based engineering vehicle collision detection and warning system, used to implement the method as claimed in claim 1, characterized in that: include: The acquisition module acquires a first video acquired by different image acquisition modules at each first time interval, wherein the first video is a monitoring video of the construction site, splits the first video into a plurality of static images at a preset time interval, trains and establishes a first model, and uses the first model to identify each of the static images to obtain a target vehicle in each of the static images; The analysis module is used to number the target vehicles in each of the static images, wherein if the same target vehicle appears in multiple static images, the target vehicle has a unique number, and the static image in which the target vehicle with the same number appears is defined as the first image, and based on the centroid connection line of the contours of each of the target vehicles in the first image, the driving trajectory of the target vehicle is generated, and the actual distance traveled by the target vehicle is calculated through the driving trajectory and coordinate transformation; The speed calculation module is used to obtain the time interval between the first images, and calculate the travel speed of the target vehicle based on the actual distance and the time interval between the first images; The early warning module is used to synthesize the static images extracted from different first videos into a second image, wherein the second image is a panoramic bird's-eye view, and set a first threshold and a second threshold. If the vehicle-to-vehicle distance between the centroids of two target vehicles with different numbers is less than the first threshold, the two target vehicles are highlighted in a first color and a first warning is generated, and the target vehicle whose driving speed is greater than a second threshold is highlighted in a second color and a second warning is generated; Wherein, if the inter-vehicle distance between the mass centers of two target vehicles with different numbers is greater than or equal to a first threshold, the following steps are also included: Determine a driving direction of each of the target vehicles in the second image based on the driving trajectory, and generate a first route based on the driving direction, wherein the first route is parallel to the driving direction; Selecting a judgment area on each of the first routes, defining the distance between the target vehicle and the judgment area as a first distance, calculating a first time required for each of the target vehicles to reach the judgment area based on the driving speed and the first distance, subtracting the first times of different target vehicles from each other to obtain a time difference for each of the target vehicles to reach the judgment area, setting a third threshold and a fourth threshold, calculating a first probability of the target vehicle colliding in the judgment area if the time difference is less than the third threshold, and generating a third warning if the first probability is greater than the fourth threshold; Calculating the first probability includes the following steps: A second distance is set, the second distance is smaller than the first distance, a plurality of base points are selected at intervals of the second distance on the first route, each of the base points is used as a circle center, and the second distance is used as a radius, two first monitoring areas are generated in the second image, if the target vehicles overlap each other in the area, the two first monitoring areas are defined as judgment areas, the base points of the first monitoring areas where the overlap occurs are defined as target points, a second probability of the target vehicle reaching the target point is calculated, the second probabilities of different target points are accumulated to obtain the first probability, and if the first probability exceeds the fourth threshold, it is determined that each of the target vehicles has a collision risk in the judgment area; Wherein, obtaining the second probability that the target vehicle arrives at the target point comprises the following steps: The second image is divided into m grid areas, each grid area is numbered, and first feature data of the target vehicle is obtained, wherein the first feature data includes the number of the grid area at the current position of the target vehicle, the driving speed and the driving direction, and the driving direction is parallel to the driving trajectory; historical data identical to the first feature data of the target vehicle is obtained, and a third probability of the target vehicle moving from the current position to the grid area numbered n is calculated based on the historical data and the first formula. , the grid area numbered n is the grid area where the target point is located, and the first formula is: , where a n is the number of times each target vehicle in the historical data passes through the grid area numbered n, and A is the number of the historical data; The grid areas satisfying the second formula are retained, and the rest of the grid areas are deleted. The second formula is: ,in, is the first preset value, is the time required for the target vehicle to travel from the current position to the grid area numbered n, is the second preset value, To output the maximum value of x and y; A second monitoring area is generated with the base point as the center, the third probability of each grid area in the second monitoring area is obtained, and the second probability of the target vehicle moving from the current position to the grid area numbered n is calculated based on a third formula, where the third formula is: , where Pn is the probability of the target vehicle passing through the grid area in the first route direction, is the sum of the third probabilities of all grid areas in the second monitoring area.

Citation Information

Patent Citations

  • Vehicle and pedestrian collision preventing method and system

    CN108674413A

  • Conflict area invasion and occupation degree-based intersection internal conflict resolution simulation method

    CN108710719A

  • Travel safety early warning method, device, unmanned aerial vehicle and computer readable storage medium

    CN109345871A

  • Automatic driving vehicle entrance and exit ramp driving decision-making method based on dynamic game

    CN110111605A

  • Vehicle driving route determination method and device, equipment and medium

    CN112185153A