Traffic event detection method, image detection method, and computing device
By acquiring paths using path acquisition devices and predicting waypoints using pre-trained models, the problem of low efficiency in traffic incident detection in existing technologies is solved, achieving efficient and accurate traffic incident detection.
Patent Information
- Application Number
- CN202210505111.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2042-05-10
AI Technical Summary
In existing technologies, using video acquisition equipment to acquire road monitoring videos for traffic incident detection is inefficient and cannot effectively prevent traffic accidents or ensure smooth traffic flow.
The path to be detected is acquired using a path acquisition device, a set of similar paths is determined using a pre-trained path model, path point prediction is performed based on the target path points, and detection indicators are calculated to determine the traffic event detection results, thus avoiding manual analysis of the entire image content.
It has improved the efficiency of traffic incident detection, reduced detection costs, and enhanced the accuracy and timeliness of detection.
Smart Images

Figure CN114998847B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present specification relate to the technical field of traffic monitoring, in particular to a traffic event detection method. BACKGROUND
[0002] With the development of Internet technology, timely abnormal judgment of traffic events can avoid serious traffic accidents and better monitor road conditions to ensure smooth traffic.
[0003] In the prior art, a road monitoring video is obtained by a video acquisition device, and the monitoring video is analyzed to determine whether a traffic event in the monitoring video is an abnormal event. The traffic event is divided into a normal event and an abnormal event. The abnormal event is an event that affects the smoothness or safety of traffic operation, including vehicle congestion, vehicle collision, vehicle reverse, vehicle illegal occupation of lane, etc. The normal event is an event that does not affect the smoothness and safety of traffic operation.
[0004] However, such manual analysis of the monitoring video has low detection efficiency and is deficient in timeliness in avoiding serious traffic accidents and ensuring smooth traffic. Therefore, there is an urgent need for a timely and efficient traffic event detection method. SUMMARY
[0005] Therefore, the embodiments of the present specification provide a traffic event detection method. One or more embodiments of the present specification also relate to a traffic event detection device, an image detection method, an image detection device, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects in the prior art.
[0006] According to a first aspect of the embodiments of the present specification, a traffic event detection method is provided, comprising:
[0007] acquiring a to-be-detected path collected by a path acquisition device;
[0008] determining a similar path set of the to-be-detected path from a pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by the path acquisition device;
[0009] performing path point prediction in the similar path set based on a target path point of the to-be-detected path to obtain a predicted path point set, and calculating a detection index of the to-be-detected path according to the predicted path point set;
[0010] determining a traffic event detection result according to the detection index.
[0011] According to a second aspect of the embodiments of the present specification, an image detection method is provided, comprising:
[0012] acquire a to-be-detected image collected by an image collection device;
[0013] extract a to-be-detected path from the to-be-detected image;
[0014] determine, from a pre-trained path model, a similar path set of the to-be-detected path, wherein the path model is trained based on a plurality of historical paths collected by a path collection device;
[0015] perform path point prediction in the similar path set based on a target path point of the to-be-detected path, to obtain a predicted path point set, and calculate a detection index of the to-be-detected path according to the predicted path point set;
[0016] determine an image detection result of the to-be-detected image according to the detection index.
[0017] According to a third aspect of an embodiment of the present specification, a traffic event detection apparatus is provided, comprising:
[0018] a first acquisition module configured to acquire a to-be-detected path collected by a path collection device;
[0019] a first similar path set determination module configured to determine, from a pre-trained path model, a similar path set of the to-be-detected path, wherein the path model is trained based on a plurality of historical paths collected by a path collection device;
[0020] a first calculation module configured to perform path point prediction in the similar path set based on a target path point of the to-be-detected path, to obtain a predicted path point set, and calculate a detection index of the to-be-detected path according to the predicted path point set;
[0021] a first determination module configured to determine a traffic event detection result according to the detection index.
[0022] According to a fourth method of an embodiment of the present specification, an image detection apparatus is provided, comprising:
[0023] a second acquisition module configured to acquire a to-be-detected image collected by an image collection device;
[0024] an extraction module configured to extract a to-be-detected path from the to-be-detected image;
[0025] a second similar path set determination module configured to determine, from a pre-trained path model, a similar path set of the to-be-detected path, wherein the path model is trained based on a plurality of historical paths collected by a path collection device;
[0026] a second calculation module configured to perform path point prediction in the similar path set based on a target path point of the to-be-detected path, to obtain a predicted path point set, and calculate a detection index of the to-be-detected path according to the predicted path point set;
[0027] The second determining module is configured to determine an image detection result of the to-be-detected image according to the detection index.
[0028] According to a fifth aspect of an embodiment of the present specification, a computing device is provided, comprising:
[0029] a memory and a processor;
[0030] The memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the traffic event detection method or the image detection method.
[0031] According to a sixth aspect of an embodiment of the present specification, a computer-readable storage medium is provided, which stores computer-executable instructions, which, when executed by a processor, implement the steps of the traffic event detection method or the image detection method.
[0032] According to a seventh aspect of an embodiment of the present specification, a computer program is provided, which, when executed in a computer, causes the computer to perform the steps of the traffic event detection method or the image detection method.
[0033] In one embodiment of the present specification, a to-be-detected path collected by a path collection device is obtained, a similar path set of the to-be-detected path is determined from a pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by the path collection device, a target path point of the to-be-detected path is used to perform path point prediction in the similar path set to obtain a predicted path point set, a detection index of the to-be-detected path is calculated according to the predicted path point set, and a traffic event detection result is determined according to the detection index. By using the path point features of the to-be-detected path collected by the path collection device to perform the predicted path point set to calculate the detection index, the traffic event detection result is obtained, without manually analyzing the image content of the entire image where the to-be-detected path is located, thereby improving the detection efficiency and reducing the detection cost. BRIEF DESCRIPTION OF DRAWINGS
[0034] Figure 1 is a flowchart of a traffic event detection method provided by one embodiment of the present specification;
[0035] Figure 2 is a flowchart of an image detection method provided by one embodiment of the present specification;
[0036] Figure 3 is a flowchart of a traffic event detection method applied to vehicle path detection provided by one embodiment of the present specification;
[0037] Figure 4is a process flow diagram of a traffic event detection method provided by an embodiment of the present specification;
[0038] Figure 5 is a data processing flow diagram of a traffic event detection method provided by an embodiment of the present specification;
[0039] Figure 6 is a structural schematic diagram of a traffic event detection device provided by an embodiment of the present specification;
[0040] Figure 7 is a structural schematic diagram of an image detection device provided by an embodiment of the present specification;
[0041] Figure 8 is a structural block diagram of a computing device provided by an embodiment of the present specification. DETAILED DESCRIPTION
[0042] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present specification. However, the present specification can be practiced without the specific details, other than in the examples, set forth in this description. Those skilled in the art, in light of the description, can implement the present specification without limiting to the specific details disclosed in this description.
[0043] The terminology used in one or more embodiments of the present specification is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present specification. As used in one or more embodiments of the present specification and the accompanying claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in one or more embodiments of the present specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0044] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. Rather, these terms are used solely to distinguish one from another only. For example, without departing from the scope of one or more embodiments of the present specification, first can be termed second, and similarly, second can be termed first. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining" or "in response to a determination."
[0045] First, the noun terms related to one or more embodiments of the present specification are explained.
[0046] Discrete Fréchet Distance: a way to describe the similarity of spatial paths, considering the spatial distance of the path, and evaluating the similarity of the path through discrete path points, so that the efficiency of the path similarity evaluation for a certain spatial time sequence is higher.
[0047] Kernel Density Estimation (KDE): also known as Parzen Window, used to estimate the density function of unknown probability.
[0048] P-value: in hypothesis testing, the probability of assuming that the null hypothesis is true and observing at least as extreme a sample as the actual observed sample.
[0049] Density Based Spatial Clustering of Applications with Noise (DBSCAN): a clustering algorithm that can divide points in a low-density and above distribution area into a group and mark outliers in a low-density distribution area after a set of points in a space is given.
[0050] Currently, the detection of traffic events mainly uses the following two methods:
[0051] First, set traffic event judgment logic for video content in the monitoring video in advance, for example, when a vehicle is found to stay for too long and there are pedestrians walking around, it is determined that an abnormal event has occurred. However, such a simple logic setting cannot cope with the actual complex road traffic situation, and will produce a large number of false detection results. Moreover, since the detection logic often requires the superposition of multiple factors, the detection time is too long, resulting in untimely detection.
[0052] Second, set multiple target object motion state acquisition devices to restore the motion state of the target object to detect traffic events. However, such a multi-collection device restoration method will cause the problem of high detection cost.
[0053] Therefore, in the present specification, a traffic event detection method is provided, and the present specification also relates to a traffic event detection device, an image detection method, an image detection device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0054] Reference Figure 1 , Figure 1 A flowchart of a traffic event detection method according to one embodiment of the present specification is shown, which specifically includes the following steps.
[0055] Step 102: obtaining a to-be-detected path collected by a path collection device.
[0056] The path collection device can be a video collection device collecting road traffic video, such as a road monitoring camera, a road monitoring camera set, a road monitoring satellite, etc., can be a positioning device collecting a motion path of a vehicle or a pedestrian, such as a mobile terminal positioning device, a GPS positioning system, a Beidou positioning system, etc., and can also be a sound wave electromagnetic wave collection device collecting a motion path of a vehicle, such as an ultrasonic vehicle driving collection device, an infrared vehicle driving collection device, etc.
[0057] The to-be-detected path is a motion path of a target object to be detected, and the to-be-detected path includes a plurality of path points. The path point is a sampling path point obtained by discretely sampling the path in road traffic by the path collection device according to a set collection frequency. Each path point contains position information and time information of the path point. The position information of the path point can be a picture position of the target object in the road traffic video, can be latitude and longitude coordinates of the target object, or can be relative position information of the target object relative to other road feature points. The time information of the path point can be time information of the road traffic video, such as the 4th second of the road traffic video, or can be the time of collecting the to-be-detected path. For example, the position information (latitude and longitude coordinates) of a plurality of path points of a certain pedestrian motion path is (116.1399E, 39.8746N), (116.1402E, 39.8752N), (116.1409E, 39.8755N), etc., and the time information (the time of collecting the to-be-detected path) is from 2020-01-01-8:00:00 to 2020-01-01-8:01:15. The to-be-detected path can be represented as {(116.1399E, 39.8746N), (116.1402E, 39.8752N), (116.1409E, 39.8755N), etc.; 2020-01-01-8:00:00 to 2020-01-01-8:01:15}.
[0058] In actual application, the manner of obtaining the to-be-detected path collected by the path collection device can be screening a plurality of historical paths collected by the path collection device according to a screening condition to obtain the to-be-detected path. For example, the path collection device collects a plurality of paths of different vehicles, and the screening condition can be vehicle information (vehicle color, vehicle brand, license plate number, etc.), vehicle motion state information (entering and leaving road entrances and exits, vehicle motion speed, vehicle driving lane, vehicle surrounding environment, etc.), and / or vehicle quantity, etc. The to-be-detected path is obtained from the plurality of paths by the determined screening condition. The to-be-detected path obtained by screening can be one or more.
[0059] Specifically, the path acquisition device collects a plurality of historical paths, and one or more to-be-detected paths are filtered from the plurality of historical paths according to a filtering condition.
[0060] Exemplarily, the path acquisition device collects a plurality of historical paths T1, T2, T3, T4, and T5, the historical paths are paths of a plurality of vehicles, and the filtering condition is a license plate number: XXXXX. T2 is filtered from the plurality of vehicle paths as a to-be-detected path.
[0061] By acquiring the to-be-detected path collected by the path acquisition device, instead of analyzing the entire video content of the monitoring video, the amount of reference information for traffic event detection is reduced, and a reference basis is provided for subsequent determination of a similar path set of the to-be-detected path.
[0062] Step 104: determining, from a pre-trained path model, a similar path set of the to-be-detected path, wherein the path model is trained based on a plurality of historical paths collected by the path acquisition device.
[0063] The pre-trained path model is a model obtained by unsupervised training according to a plurality of historical paths collected by the path acquisition device.
[0064] The similar path set of the to-be-detected path is a set of a plurality of historical paths with similar position information of path points in the path model, which is determined according to position information of path points in the to-be-detected path.
[0065] Specifically, a plurality of historical paths with similar position information of path points in the pre-trained path model are determined according to position information of path points in the to-be-detected path, as the similar path set of the to-be-detected path.
[0066] Exemplarily, according to position information of path points in the to-be-detected path T2: (116.1399E, 39.8746N), (116.1402E, 39.8752N), (116.1409E, 39.8755N),..., a plurality of historical paths T1', T2', and T3' with similar position information of path points in the pre-trained path model are determined as the similar path set T' {T1', T2', T3'} of the to-be-detected path T2.
[0067] The similar path set of the to-be-detected path is determined from the pre-trained path model, which improves the efficiency of determining the similar path set of the to-be-detected path, and further improves the overall detection efficiency, and provides a path reference for subsequent path point detection.
[0068] Step 106: performing path point prediction in the similar path set based on a target path point of the to-be-detected path, obtaining a predicted path point set, and calculating a detection index of the to-be-detected path according to the predicted path point set.
[0069] The target path point of the to-be-detected path is one or more path points of the to-be-detected path for path point prediction at a certain moment. The target path point can be the last path point of the to-be-detected path at a certain moment, or one or more path points of the to-be-detected path at a certain moment with different position information, which is not limited herein.
[0070] The detection index is an index data calculated based on the target path point, the predicted path point, and the similar path set of the to-be-detected path, and is used to indicate the abnormal situation of the to-be-detected path.
[0071] In actual application, the target path point of the to-be-detected path at a certain moment is used to predict the path point at the next moment in the similar path set, and a set of predicted path points is obtained. The target path point of the to-be-detected path at a certain moment is compared with the path points of the historical paths in the similar path set at the corresponding moment, and a plurality of similar path points at the next moment of the target path point are predicted, and the plurality of similar path points are obtained as the set of predicted path points. Because the sampling frequency of the plurality of historical paths in the similar path set is the same as the sampling frequency of the to-be-detected path, there is a time correspondence, and the same moment comparison can be used for prediction.
[0072] In actual application, the target path point, the set of predicted path points, and the similar path set of the to-be-detected path are used for calculation to obtain the detection index of the to-be-detected path.
[0073] Specifically, based on the position information of the target path point of the to-be-detected path at a certain moment, the plurality of similar path points at the next moment of the target path point are predicted according to the position information of the plurality of path points of the historical paths in the similar path set at the corresponding moment and the position information of the target path point, the plurality of similar path points at the next moment are determined as the set of predicted path points, and the target path point, the set of predicted path points, and the similar path set of the to-be-detected path are used for calculation to obtain the detection index of the to-be-detected path at a certain moment.
[0074] Exemplarily, based on the target path point T2i of the i-th moment of the to-be-detected path T2, the position information is (116.1402E, 39.8752N), according to the position information of the plurality of path points T1'i, T2'i, T3'i of the plurality of historical paths T1', T2', T3' corresponding to the i-th moment in the similar path set T'{T1', T2', T3'}, a plurality of similar path points T2'(i+1)', T2'(i+1)", T2'(i+1)"'of the next moment i+1 of the target path point are predicted, the plurality of similar path points of the i+1-th moment are determined as the predicted path point set T2'(i+1), based on the target path point T2i of the to-be-detected path, the predicted path point set T2'(i+1), and the similar path set T'{T1', T2', T3'}, the detection index F(T2)i of the to-be-detected path T2 at the i-th moment is obtained by calculation.
[0075] Based on the target path point of the to-be-detected path, the path point is predicted in the similar path set, the predicted path point set is obtained, and the detection index of the to-be-detected path is calculated according to the predicted path point set. The detection index of the to-be-detected path can be obtained, which ensures the accuracy of the traffic event detection and lays a data foundation for subsequent determination of the detection result.
[0076] Step 108: determining the traffic event detection result according to the detection index.
[0077] The traffic event detection result is the judgment result obtained after judging whether the to-be-detected path is an abnormal path.
[0078] The abnormal path is a path representing that a traffic event may occur on the to-be-detected path. For example, the position information of a plurality of path points of a vehicle motion path is a specific position of an emergency lane, and the time information is more than 5 minutes, which indicates that an abnormal event may occur on the vehicle motion path.
[0079] In actual application, the detection index of the to-be-detected path at a plurality of moments can be calculated according to the calculation method of the detection index of the to-be-detected path at a moment calculated in step 106. The detection index of the to-be-detected path at a plurality of moments is compared with a preset threshold, and then the traffic event detection result is determined.
[0080] The detection index can be a plurality of detection indexes obtained by calculating the detection index at a plurality of moments, or a detection statistical index obtained by calculating the detection index at a plurality of moments, for example, a detection statistical index obtained by calculating the average of the detection index at a plurality of moments. The average calculation can be arithmetic average calculation or weighted average calculation. For another example, a detection statistical index obtained by recursively calculating the detection index at a plurality of moments.
[0081] The threshold value can be a threshold value set for a plurality of time instants, or a threshold value set for one detection statistical index, which is not limited herein.
[0082] In actual application, the manner of comparing the preset threshold value to determine the traffic event detection result can be that if the detection indexes of a plurality of time periods exceed the threshold values of the plurality of time periods within a period of time or a certain number of times, it is determined that an abnormal event occurs, or can be that if the detection statistical index is greater than the corresponding detection statistical index threshold value, it is determined that an abnormal event occurs.
[0083] Specifically, the detection index of the to-be-detected path is compared with the preset threshold value to determine the image detection result.
[0084] For example, the detection index F(T2) of the to-be-detected path T2 at a plurality of time instants is compared with the preset threshold value F(T), and if the detection index F(T2) is greater than the preset threshold value F(T), it is determined that an abnormal event occurs.
[0085] In the embodiments of the present specification, the to-be-detected path collected by the path collection device is obtained, and a similar path set of the to-be-detected path is determined from a pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by the path collection device, path point prediction is performed in the similar path set based on a target path point of the to-be-detected path, a predicted path point set is obtained, a detection index of the to-be-detected path is calculated according to the predicted path point set, and a traffic event detection result is determined according to the detection index. The path point features of the to-be-detected path collected by the path collection device are used to perform the predicted path point set to calculate the detection index, so as to obtain the traffic event detection result, without manually analyzing the image content of the entire image where the to-be-detected path is located, thereby improving the detection efficiency and reducing the detection cost.
[0086] Optionally, before step 104, the following specific steps are further included:
[0087] The to-be-detected path is compressed to obtain a compressed to-be-detected path.
[0088] Since the path collection device is sampled at a certain sampling frequency, there is a problem that the path points of the to-be-detected path are too concentrated in space. Therefore, the to-be-detected path needs to be compressed. For example, a vehicle waits for a red light at a certain intersection, that is, the vehicle movement path does not move within a certain period of time, and the vehicle movement path collected by the path collection device at a certain sampling frequency will have a plurality of path points that are too concentrated in space.
[0089] In actual application, the spatial distribution of the path points of the to-be-detected path is evaluated based on the position information of the path points of the to-be-detected path, the path points with too concentrated spatial distribution are removed, and the compressed to-be-detected path is obtained.
[0090] Specifically, the to-be-detected path is compressed according to the position information of the path points of the to-be-detected path, and the compressed to-be-detected path is obtained.
[0091] For example, the to-be-detected path T2 is compressed according to the position information {……Ti-4(119.5620E, 39.4277E), Ti-3(119.5620E, 39.4277E), Ti-2(119.5620E, 39.4277E), Ti-1(119.5620E, 39.4277E), Ti(119.5620E, 39.4277E)} of the path points of the to-be-detected path T2, and the compressed to-be-detected path T2 {……Ti-4(119.5620E, 39.4277E), Ti-1(119.5620E, 39.4277E), Ti(119.5620E, 39.4277E)} is obtained.
[0092] In the embodiments of the present specification, the to-be-detected path is compressed to obtain the compressed to-be-detected path. The information amount of the to-be-detected path is reduced, and the detection efficiency of the traffic event detection is improved.
[0093] Optionally, the step of compressing the to-be-detected path comprises the following specific steps:
[0094] The position information of each path point in the to-be-detected path is obtained.
[0095] The first distance between the first path point and the reference path point corresponding to the first path point is calculated according to the position information of the first path point, wherein the first path point is any one of the path points.
[0096] If the first distance is greater than the first distance threshold, the first path point is deleted.
[0097] The position information of each path point is the coordinate of each path point in space. The space can be a rectangular coordinate multidimensional space or a polar coordinate multidimensional space, which is not limited herein. The space can be a one-dimensional space, a two-dimensional space or a three-dimensional space composed of longitude, latitude or altitude, which is not limited herein. The space can also be a one-dimensional space, a two-dimensional space or a three-dimensional space artificially set, which is not limited herein.
[0098] The first path point is any one of the path points, that is, the first distance of each path point and the corresponding reference path point in the to-be-detected path is calculated, and the compressed to-be-detected path is obtained after comparison with the first distance threshold.
[0099] The reference path point corresponding to the first path point can be any one of the path points within a certain preset distance range except the first path point, or can be the path point with the shortest distance from the coordinates of the first path point.
[0100] The first distance is an Euclidean distance in a rectangular coordinate multi-dimensional space, or can be a vector distance in a polar coordinate multi-dimensional space, which is not limited herein.
[0101] The first distance threshold is a distance threshold preset to determine whether the spatial distribution of two path points is too concentrated.
[0102] In actual application, the first distance between the first path point and the reference path point corresponding to the first path point is calculated according to the coordinates of the first path point and the reference path point, and the Euclidean distance between the two is calculated. The calculation formula of the Euclidean distance d is as follows:
[0103]
[0104] The coordinates of the first path point are (x1, y1, z1), and the coordinates of the reference path point are (x2, y2, z2).
[0105] Specifically, the coordinates of each path point in the to-be-detected path are obtained, the first distance between the first path point and the reference path point corresponding to the first path point is calculated according to the coordinates of the first path point and the reference path point, and if the first distance is greater than the first distance threshold, the first path point is deleted.
[0106] For example, the coordinates (x1, y1, z1), (x2, y2, z2), (x3, y3, z3) of each path point in the to-be-detected path are obtained, the first distance d between the first path point and the reference path point corresponding to the first path point is calculated according to the coordinates (x1, y1, z1) of the first path point and the coordinates (x2, y2, z2) of the reference path point, and if the first distance d is greater than the first distance threshold D, the first path point is deleted.
[0107] In the embodiments of the present specification, the position information of each path point in the to-be-detected path is obtained, the first distance between the first path point and the reference path point corresponding to the first path point is calculated according to the position information of the first path point, wherein the first path point is any one of the path points, and if the first distance is greater than the first distance threshold, the first path point is deleted. The first path point is deleted by comparing the first distance with the first distance threshold, which ensures the accuracy of deleting the first path point, that is, ensures the accuracy of the compressed to-be-detected path, reduces the information amount of the to-be-detected path, and improves the traffic event detection efficiency.
[0108] Optionally, step 104 comprises the following specific steps:
[0109] calculating a first path distance between the to-be-detected path and each historical path in the pre-trained path model;
[0110] determining the historical path with the first path distance less than a second distance threshold as a similar path, and constructing a similar path set according to a plurality of similar paths.
[0111] The similarity of two paths is determined by the position information in the two path spaces. For example, the vehicle motion paths of two vehicles on a certain expressway fast lane have small differences in the position information in the two path spaces, and thus the two vehicle motion paths are determined to have the similarity.
[0112] The first path distance is the Euclidean distance in a straight coordinate multi-dimensional space, or the vector distance in a polar coordinate multi-dimensional space, which is not limited herein.
[0113] The second distance threshold is a distance threshold for judging whether there is spatial similarity between two paths.
[0114] In actual application, the first path distance between the to-be-detected path and each historical path in the pre-trained path model can be calculated by calculating the path point distances between a plurality of path points of the to-be-detected path and a plurality of corresponding path points of each historical path in the pre-trained path model, and then performing average number calculation according to the plurality of path point distances to obtain the first path distance between the to-be-detected path and each historical path. Alternatively, the first path distance between the to-be-detected path and each historical path can be calculated by calculating the regression function of the to-be-detected path according to the plurality of path points of the to-be-detected path, calculating the regression function of each historical path according to the plurality of path points of each historical path in the pre-trained path model, and then calculating the function distance between the two regression functions to obtain the first path distance between the to-be-detected path and each historical path. The distance calculation formula between the functions is:
[0115]
[0116] f(y) and f(x) are two regression functions, f(y)-f(x) represents the difference between the two, t is an arbitrary time, and the distance between the two is obtained by time integration of the difference from 0 time to an arbitrary time.
[0117] Specifically, the first path distance between the to-be-detected path and each historical path is calculated based on the plurality of path points of the to-be-detected path and the plurality of path points of each historical path in the pre-trained path model, the historical path with the first path distance less than the second distance threshold is determined as a similar path, and a similar path set is constructed according to a plurality of similar paths.
[0118] Exemplarily, based on the plurality of path points ti of the to-be-detected path t and the plurality of path points Ti of each historical path T (T1, T2, T3,...) in the pre-trained path model, the path point distance di between the plurality of path points of the to-be-detected path and the corresponding plurality of path points of each historical path is calculated, and the first path distance Di between the to-be-detected path and each historical path is obtained by performing mean calculation ∑di according to the plurality of path point distances di. The historical paths (T2, T4, T8) with the first path distance Di less than the second distance threshold D' are determined as similar paths, and the similar path set T' (T2, T4, T8) is constructed according to the plurality of similar paths.
[0119] In the embodiments of the present specification, the first path distance between the to-be-detected path and each historical path in the pre-trained path model is calculated, the historical path with the first path distance less than the second distance threshold is determined as a similar path, and the similar path set is constructed according to the plurality of similar paths. By calculating the first path distance between the to-be-detected path and each historical path, and then determining the similar path to construct the similar path set, the accuracy of the determined similar path is ensured, the accuracy of the constructed similar path set is ensured, and the accuracy of the subsequent path point prediction is further ensured.
[0120] Optionally, constructing the similar path set according to the plurality of similar paths comprises the following specific steps:
[0121] Obtaining the category label of the plurality of similar paths;
[0122] The similar paths with the category label being the specified category label constitute the similar path set.
[0123] The category label of the similar path is a label representing the motion category of the target object corresponding to the similar path, which can be a category representing the motion route of the target object. For example, the target object is a person, and the motion routes of a plurality of persons are all on the right sidewalk of the road, so the motion paths of the plurality of persons can be determined as the same category, and the same category label is set. It can also be a category representing the motion state of a vehicle or a person. For example, the target object is a vehicle, and the motion states of a plurality of vehicles are all straight ahead at a speed of 60 km / h, so the motion paths of the plurality of vehicles can be determined as the same category, and the same category label is set.
[0124] The category label of the plurality of similar paths can be obtained by clustering processing of the plurality of similar paths, and the category label of the plurality of similar paths can also be obtained by dichotomous classification processing of the plurality of similar paths, the category label of the plurality of similar paths can also be obtained by decision tree classification processing of the plurality of similar paths, the category label of the plurality of similar paths can also be obtained by Bayesian classification processing of the plurality of similar paths, and the category label of the plurality of similar paths can also be obtained by inputting the plurality of similar paths into a pre-trained path classification model. In the embodiments of the present application, the clustering processing is taken as an example for description.
[0125] The clustering processing can be a Kmeans clustering algorithm or a DBSCAN clustering algorithm.
[0126] In actual application, the Kmeans clustering processing of the plurality of similar paths includes: vector encoding of the plurality of similar paths to obtain path vectors of the plurality of similar paths, first determining K categories, selecting any K path vectors, then calculating the similarity of another path vector with the K path vectors, determining the path vectors with high similarity and another path vector as the same category, then calculating the center vector of the path vectors with high similarity and another path vector, and continuing to calculate the similarity of other path vectors with the center vector and K-1 path vectors, until the clustering of the path vectors of all similar paths is completed, and the category label of the plurality of similar paths is obtained.
[0127] In actual application, the DBSCAN clustering processing of the plurality of similar paths includes: calculating the distribution density of the path point position information of the plurality of similar paths, comparing the distribution density with a pre-set distribution density threshold, determining the similar paths corresponding to the path points with the distribution density greater than the distribution density threshold as the same category label, and marking the similar paths corresponding to the path points without the category label as an abnormal path category.
[0128] Specifically, the clustering processing of the plurality of similar paths obtains the category label of the plurality of similar paths, and the similar paths with the category label as a specified category label constitute a similar path set.
[0129] For example, the clustering processing of the plurality of similar paths Tn’ (T1’, T2’, T3’…Tn’) obtains the category label (a1, a2, a3, …) of the plurality of similar paths Tn’, and the similar paths (T2’, T19’, T33’) with the category label as a specified category label a2 constitute a similar path set T’ (T2’, T19’, T33’).
[0130] In the embodiments of the present specification, the category labels of the plurality of similar paths are obtained, and the similar paths with the category labels as specified category labels constitute a similar path set. By classifying the similar paths and selecting the similar paths with the specified category labels to constitute the similar path set, the similarity accuracy of the similar paths and the to-be-detected path is ensured, the number of similar paths is reduced, the efficiency of subsequent path point prediction is improved, and the category label labeling is performed based on the similar paths instead of manual labeling of the video content of the monitoring video, thereby reducing the cost and improving the efficiency.
[0131] Optionally, the step of performing path point prediction in the similar path set based on the target path point of the to-be-detected path to obtain a predicted path point set in step 106 comprises the following specific steps:
[0132] Removing the target path point in the to-be-detected path to obtain a first path;
[0133] Based on the second path point, determining the reference path point corresponding to the second path point on each similar path in the similar path set, wherein the second path point is the last path point on the first path;
[0134] Based on the reference path point, calculating the next time path point of the reference path point in each similar path to constitute a predicted path point set.
[0135] Since the to-be-detected path can be the motion path of the target object in any time period, the to-be-detected path can be divided according to the time sequence to obtain a plurality of to-be-detected paths, and the plurality of to-be-detected paths can be arranged in time sequence, so that the next to-be-detected path is obtained by adding one or more path points to the previous to-be-detected path.
[0136] The target path point is the last path point in the path points arranged in time sequence according to the time information in the to-be-detected path. Since the to-be-detected path is multiple, the target path point is multiple.
[0137] The second path point is the second last path point in the path points arranged in time sequence according to the time information in the to-be-detected path. Since the to-be-detected path is multiple, the second path point is multiple.
[0138] In actual application, the specific manner of determining the reference path point corresponding to the second path point on each similar path in the similar path set based on the second path point is: based on the position information of the second path point, determining the path point with the shortest distance to the path point calculated based on the position information of the second path point on each similar path in the similar path set, and determining the path point as the reference path point. For example, there are N path points on a similar path in the similar path set, and the shortest path point distance is determined as the reference path point based on the position information of the second path point and the position information of the N path points.
[0139] In actual application, the specific manner of calculating the next time path point of the reference path point in each similar path based on the reference path point is: according to the time interval between the second path point and the target path point, calculating the path point of each similar path after the same time interval after the reference path point, determining as the predicted path point, and combining the predicted path points of each similar path into a predicted path point set.
[0140] Specifically, the target path point in the to-be-detected path is removed to obtain a first path, a reference path point corresponding to the second path point is determined based on the position information of the second path point and the position information of a plurality of path points on each similar path in the similar path set, and the next time path point of the reference path point in each similar path is calculated based on the time information of the second path point, the time information of the target path point and the time information of the reference path point, to form a predicted path point set.
[0141] Exemplarily, the to-be-detected path is T, the target path point Ti in the to-be-detected path T is removed to obtain a first path T-Ti, a reference path point Ti-1 corresponding to the second path point Ti-1 is determined based on the position information of the second path point Ti-1 and the position information of a plurality of path points (T1’, T2’, T3’…) on each similar path T’ in the similar path set, and the next time path point Ti’ of the reference path point in each similar path is calculated based on the time information i-1 of the second path point Ti-1, the time information i of the target path point Ti and the time information i-1 of the reference path point Ti-1, to form a predicted path point set {Ti’}.
[0142] In the embodiments of the present specification, the target path point in the to-be-detected path is removed to obtain a first path, a reference path point corresponding to the second path point in each similar path in the similar path set is determined based on the second path point, wherein the second path point is the last path point on the first path, the next time path point of the reference path point in each similar path is calculated based on the reference path point, to form a predicted path point set. The corresponding reference path point is determined through the second path point of the first path, and the next time path point is calculated based on the reference path point to obtain the predicted path point set, so that the obtained predicted path point can correspond to the path point time information of the to-be-detected path, ensuring the accuracy of the predicted path point and providing data reference for subsequent calculation of detection indicators.
[0143] Optionally, the step of calculating the detection indicators of the to-be-detected path according to the predicted path point set in step 106 comprises the following specific steps:
[0144] According to the number of predicted path points in the predicted path point set, the probability density of each predicted path point in the predicted path point set in the similar path set is calculated.
[0145] According to the probability density, a probability value of the target path point under the similar path set is calculated.
[0146] According to the probability value, a detection index of the to-be-detected path is calculated.
[0147] Since the similar path set can be constructed based on the category labels of multiple similar paths, calculating the probability density of each predicted path point in the predicted path point set under the similar path set can be used to calculate the probability density of each predicted path point corresponding to the similar path of a certain category label in the predicted path point set.
[0148] In actual applications, according to the number of predicted path points in the predicted path point set, the specific way of calculating the probability density of each predicted path point in the predicted path point set under the similar path set is: according to the number of predicted path points in the predicted path point set, the predicted path points and the similar path set, the probability density of each predicted path point is calculated by using the KDE algorithm.
[0149] In actual applications, according to the probability density, the specific way of calculating the probability value of the target path point under the similar path set is: the probability density of each predicted probability point is discretely summed to obtain the probability value of the target path point under the similar path set.
[0150] In actual applications, according to the probability value, the specific way of calculating the detection index of the to-be-detected path is: according to the probability value of the similar path set corresponding to the target path point of each to-be-detected path, the detection index of the to-be-detected path is recursively calculated in the time order of each to-be-detected path, and the detection index of the last to-be-detected path is determined as the detection index of the to-be-detected path.
[0151] Specifically, according to the number of predicted path points in the predicted path point set, the predicted path points and the similar path set, the probability density of each predicted path point in the predicted path point set under the similar path set is calculated, the probability density of each predicted probability point is discretely summed, the probability value of the target path point under the similar path set is calculated, and according to the probability value, the detection index of the to-be-detected path is calculated.
[0152] Exemplarily, according to the number NT of predicted path points in the predicted path point set {Ti’}, the predicted path points Ti’ and the similar path set T’, the probability density q of each predicted path point Ti’ in the predicted path point set {Ti’} under the similar path set T’ is calculated, the probability density q of each predicted probability point Ti’ is discretely summed, the probability value P of the target path point under the similar path set is calculated, and according to the probability value P, the detection index F(T) of the to-be-detected path T is calculated.
[0153] In the embodiments of the present specification, the probability density of each predicted path point in the predicted path point set in the similar path set is calculated according to the number of predicted path points in the predicted path point set, the probability value of the target path point in the similar path set is calculated according to the probability density, and the detection index of the to-be-detected path is calculated according to the probability value. The probability value is calculated according to the probability density, and then the detection index is calculated according to the probability value. The detection index is a standard for judging a traffic event, which improves the accuracy of traffic event judgment and further improves the accuracy of image detection.
[0154] Optionally, step 108 comprises the following specific steps:
[0155] If the detection index is greater than the preset threshold, it is determined that an abnormal event occurs.
[0156] In actual application, the detection index of the to-be-detected path at multiple time points can be calculated according to the calculation method of the detection index of the to-be-detected path at a time point calculated in step 106.
[0157] The detection index is a detection statistical index calculated by averaging the detection indexes calculated at multiple time points. The average calculation can be arithmetic average calculation or weighted average calculation.
[0158] The threshold is a threshold set for one detection statistical index.
[0159] In actual application, if the detection index is greater than the preset threshold, the way to determine that an abnormal event occurs is that if the detection statistical index is greater than the corresponding detection statistical index threshold, it is determined that an abnormal event occurs.
[0160] Specifically, if the detection index is greater than the corresponding detection statistical index threshold, it is determined that an abnormal event occurs, and a traffic event detection result is obtained, wherein the detection index is an abnormal statistical index calculated by averaging the detection indexes calculated at multiple time points.
[0161] For example, a detection statistical index E[F(Ti)] is calculated by averaging the detection indexes F(Ti) calculated at multiple time points. If the detection statistical index E[F(Ti)] is greater than the corresponding threshold F(T), it is determined that an abnormal event occurs, and a traffic event detection result is obtained.
[0162] In the embodiments of the present specification, if the detection index is greater than the preset threshold, it is determined that an abnormal event occurs. That is, by comparing the detection index with the preset threshold, flexible and accurate traffic event detection is realized, and the obtained traffic event detection result is flexible and accurate.
[0163] Optionally, before step 104, the following specific steps are further included:
[0164] acquire a plurality of historical paths of target objects collected by a path acquisition device;
[0165] calculate a second path distance between each historical path, cluster each historical path based on the second path distance, and obtain a category label of each historical path;
[0166] generate a path model according to each historical path and the category label of each historical path.
[0167] At present, after pre-acquired monitoring videos are manually annotated for video content, an initial traffic event judgment model for video content is trained using the annotated samples to obtain a trained traffic event judgment model for judging traffic events of the acquired monitoring videos. However, such a model training method based on manual sample annotation of video content has a low probability of abnormal events, and a large amount of watching and annotation are required by manual work, which is high in model training cost and low in efficiency.
[0168] The second path distance is an Euclidean distance in a rectangular coordinate multi-dimensional space, or a vector distance in a polar coordinate multi-dimensional space, which is not limited herein.
[0169] In actual application, the second path distance between each historical path can be calculated as a path point distance between corresponding multiple path points of each historical path, and the second path distance between each historical path is obtained by averaging the multiple path point distances. Alternatively, a regression function of each historical path is calculated according to multiple path points of each historical path, and the second path distance between each historical path is obtained by calculating a function distance between two regression functions of two historical paths.
[0170] The clustering process can be a Kmeans clustering algorithm or a DBSCAN clustering algorithm.
[0171] In actual application, the Kmeans clustering process of the second path distance of each historical path includes: vector encoding each historical path to obtain the second path distance of each historical path, first determining K categories, selecting any K second path distances, then calculating the similarity of another second path distance with each of the K second path distances, determining the second path distance with high similarity and the other second path distance as the same category, then calculating the center vector of the second path distance with high similarity and the other second path distance, and continuing to calculate the similarity of other second path distances with the center vector and K-1 second path distances until the clustering of all historical paths is completed, and the category label of each historical path is obtained.
[0172] In actual application, the DBSCAN clustering processing of the second path distance of each historical path includes: calculating the distribution density of the second path distance between each historical path, comparing the distribution density with a pre-set distribution density threshold, determining that the historical path corresponding to the second path distance with the distribution density greater than the distribution density threshold is of the same category label, and marking that the two historical paths corresponding to the second path distance without the category label are of an abnormal path category.
[0173] Specifically, historical paths of a plurality of target objects collected by a path collection device are acquired, second path distances between the historical paths are calculated, clustering is performed on the historical paths based on the probability distribution density of the second path distances, category labels of the historical paths are obtained, and a path model is generated according to the historical paths and the category labels of the historical paths.
[0174] Exemplarily, historical paths Tn of a plurality of target objects collected by a path collection device are acquired, second path distances d2 between the historical paths Tn are calculated, clustering is performed on the historical paths based on the probability distribution density pdf of the second path distances d2, category labels Label_Tn of the historical paths are obtained, and a path model is generated according to the historical paths Tn and the category labels Label_Tn of the historical paths.
[0175] Optionally, the step of acquiring the historical paths of the plurality of target objects collected by the path collection device includes the following specific steps:
[0176] According to a preset period, historical paths of a plurality of target objects collected by the path collection device in a target time period are acquired.
[0177] In the embodiments of the present specification, historical paths of a plurality of target objects collected by a path collection device are acquired, second path distances between the historical paths are calculated, clustering is performed on the historical paths based on the second path distances, category labels of the historical paths are obtained, and a path model is generated according to the historical paths and the category labels of the historical paths. By clustering the historical paths of a plurality of targets to obtain the labels of the historical paths, and then generating a path model according to the historical paths and the category labels of the historical paths, unsupervised generation of the path model is realized, the problem of a large number of manual sample annotations is solved, the cost of model generation is reduced, and the efficiency of model generation is improved.
[0178] Optionally, after the step of acquiring the historical paths of the plurality of target objects collected by the path collection device, the following specific steps are further included:
[0179] The historical paths are compressed to obtain compressed historical paths.
[0180] Since the path collection device samples according to a certain sampling frequency, the path points of the historical path are prone to be overly concentrated in space. Therefore, the historical path needs to be compressed.
[0181] In actual applications, the spatial distribution of the path points of the historical path is evaluated based on the position information of each path point of the historical path, the path points with overly concentrated spatial distribution are removed, and the compressed historical path is obtained.
[0182] Specifically, the historical path is compressed according to the position information of each path point of the historical path, and the compressed historical path is obtained.
[0183] For example, the historical path T2 is compressed according to the position information {……Ti-4(119.5620E, 39.4277E), Ti-3(119.5620E, 39.4277E), Ti-2(119.5620E, 39.4277E), Ti-1(119.5620E, 39.4277E), Ti(119.5620E, 39.4277E)} of each path point of the historical path T3, and the compressed historical path T2 {……Ti-4(119.5620E, 39.4277E), Ti-1(119.5620E, 39.4277E), Ti(119.5620E, 39.4277E)} is obtained.
[0184] In the embodiments of the present specification, the historical path is compressed to obtain the compressed historical path. The information amount of the historical path is reduced, and the generation efficiency of the path model is improved.
[0185] Optionally, the step of compressing the historical path comprises the following specific steps:
[0186] Obtaining the position information of each path point in the historical path;
[0187] According to the position information of the third path point, a third distance between the third path point and a reference path point corresponding to the third path point is calculated, wherein the third path point is any one of the path points;
[0188] If the third distance is greater than a third distance threshold, the third path point is deleted.
[0189] The position information of each path point is the coordinate of each path point in space. The space can be a rectangular coordinate multidimensional space or a polar coordinate multidimensional space, which is not limited herein. The space can be a one-dimensional space, a two-dimensional space or a three-dimensional space composed of longitude, latitude or altitude, which is not limited herein. The space can also be a one-dimensional space, a two-dimensional space or a three-dimensional space artificially set, which is not limited herein.
[0190] The third path point is any one of the path points, and the third distance of each path point in the historical path and the corresponding reference path point is calculated, compared with the third distance threshold, and the compressed historical path is obtained.
[0191] The reference path point corresponding to the third path point can be any one of the path points within a certain preset distance range except the third path point, or the path point with the shortest relative distance to the coordinates of the third path point.
[0192] The third distance is the Euclidean distance in the rectangular coordinate multi-dimensional space, or the vector distance in the polar coordinate multi-dimensional space, which is not limited here.
[0193] The third distance threshold is a distance threshold for judging whether the spatial distribution between two path points is too concentrated.
[0194] In actual application, the third distance between the third path point and the reference path point corresponding to the third path point is calculated according to the coordinates of the third path point and the reference path point.
[0195] Specifically, the coordinates of the path points in the historical path are obtained, the third distance between the third path point and the reference path point corresponding to the third path point is calculated according to the coordinates of the third path point and the reference path point, and if the third distance is greater than the third distance threshold, the third path point is deleted.
[0196] Exemplarily, the coordinates of the path points in the historical path are obtained (x1, y1, z1), (x2, y2, z2), (x3, y3, z3)…, the third distance d between the third path point and the reference path point corresponding to the third path point is calculated according to the coordinates (x1, y1, z1) of the third path point and the coordinates (x2, y2, z2) of the reference path point corresponding to the third path point, and if the third distance d is greater than the third distance threshold D, the third path point is deleted.
[0197] In the embodiments of the present specification, the position information of the path points in the historical path is obtained, the third distance between the third path point and the reference path point corresponding to the third path point is calculated according to the position information of the third path point, wherein the third path point is any one of the path points, and if the third distance is greater than the third distance threshold, the third path point is deleted. The third path point is deleted by calculating and comparing the third distance and the third distance threshold, which ensures the accuracy of deleting the third path point, that is, ensures the accuracy of the compressed historical path while reducing the information amount of the historical path and improving the generation efficiency of the path model.
[0198] Referring to Figure 2 , Figure 2A flowchart of an image detection method according to one embodiment of the present specification is shown, which specifically includes the following steps.
[0199] Step 202: Obtain an image to be detected collected by an image collection device.
[0200] The image collection device is a video collection device or a picture collection device that can collect road traffic videos or pictures, for example, a road monitoring camera, a road monitoring camera group, a road monitoring satellite, etc.
[0201] The image to be detected is an image containing multiple historical paths collected by the path collection device, which can be a picture or a video. The multiple historical paths can be filtered according to the filtering conditions to obtain the path to be detected. For example, the path collection device collects multiple paths of different vehicles, and the filtering conditions can be vehicle information (vehicle color, vehicle brand, license plate number, etc.), vehicle motion state information (up and down road entrances and exits, vehicle motion speed, vehicle lane, vehicle surrounding environment, etc.), and / or vehicle quantity, etc. The path to be detected is obtained from the multiple paths by the determined filtering conditions. The path to be detected obtained by filtering is one or more.
[0202] Specifically, multiple road traffic pictures or at least one road traffic video collected by the image collection device are obtained.
[0203] For example, 100 road traffic pictures collected by a road monitoring camera at a crossroads within 30s are obtained.
[0204] By obtaining the image to be detected collected by the image collection device, an image basis is laid for subsequent extraction of the path to be detected,
[0205] Step 204: Extract the path to be detected from the image to be detected.
[0206] The path to be detected can be extracted by inputting the image to be detected into a pre-trained path extraction model, or the image to be detected can be image-recognized to obtain multiple paths to be detected of vehicles or pedestrians.
[0207] Specifically, the multiple vehicles or pedestrians in the image to be detected are image-recognized to obtain feature points of each vehicle or pedestrian, and the paths to be detected of the multiple vehicles or pedestrians are obtained based on the feature points of the vehicles or pedestrians.
[0208] Exemplarily, image recognition is performed on 20 vehicles in 100 road traffic pictures to obtain feature points {A1}, {A2}, …, {A100} of the 20 vehicles, wherein {Ai} is {a1(x1, y1), a2(x2, y2), …, a20(x20, y20)}, path construction is performed based on the feature points {A1}, {A2}, …, {A100} of the 20 vehicles in the 100 road traffic pictures based on time sequence to obtain 20 vehicle detection paths.
[0209] The detection path is obtained by path extraction on the to-be-detected image, which lays a data foundation for subsequent confirmation of the similar path set.
[0210] Step 206: determining the similar path set of the to-be-detected path from the pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by a path collection device.
[0211] The specific implementation of step 206 has been specifically described in the Figure 1 embodiment, which will not be repeated here.
[0212] Step 208: performing path point prediction in the similar path set based on the target path point of the to-be-detected path to obtain a predicted path point set, and calculating a detection index of the to-be-detected path according to the predicted path point set.
[0213] The specific implementation of step 208 has been specifically described in the Figure 1 embodiment, which will not be repeated here.
[0214] Step 210: determining the image detection result of the to-be-detected image according to the detection index.
[0215] The image detection result is a judgment result obtained after judging whether an abnormal event occurs in the to-be-detected image.
[0216] Specifically, the detection index is determined based on a comparison result obtained by comparing the detection index with a pre-set threshold.
[0217] The image detection index is an index further determined by performing statistics on the detection index obtained by judging whether an abnormal event occurs in the to-be-detected image. It can be the proportion of the to-be-detected path in which the abnormal event occurs in the total to-be-detected path, or it can be set that if an abnormal event occurs in a to-be-detected path, the to-be-detected image has an abnormal event.
[0218] Exemplarily, the detection indexes of 20 to-be-detected paths contained in the to-be-detected image are F(T1)-F(T20), after comparison with the preset threshold, it is determined that 3 to-be-detected paths have abnormal events, the proportion is 15%, the image detection index is 15%, the preset image detection threshold is 10%, and it is determined that the image detection result of the to-be-detected image is that the abnormal event occurs.
[0219] In the embodiments of the present specification, the to-be-detected image collected by the image collection device is acquired, the to-be-detected path is extracted from the to-be-detected image, and the similar path set of the to-be-detected path is determined from the pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by the path collection device, the target path point of the to-be-detected path is used for path point prediction in the similar path set, a set of predicted path points is obtained, the detection index of the to-be-detected path is calculated according to the set of predicted path points, and the image detection result of the to-be-detected image is determined according to the detection index. Based on the path point features of the to-be-detected path in the to-be-detected image, the set of predicted path points is obtained, the detection index is calculated based on the set of path points, and thus the image detection result is obtained. The image content recorded by the image is further mined, the to-be-detected path of the image is extracted for analysis, and multiple image collection devices do not need to be established to enrich the collected image content for comparison, thereby reducing the detection cost.
[0220] The following describes the traffic event detection method provided in the present specification in combination with the accompanying Figure 3 The traffic event detection method provided in the present specification is further described by taking the application of the traffic event detection method in vehicle path detection as an example. Wherein, Figure 3 A flowchart of a traffic event detection method applied in vehicle path detection is shown, and the method specifically includes the following steps.
[0221] Step 302: According to a preset period, a plurality of vehicle historical paths collected by the path collection device in a target time period are acquired.
[0222] Step 304: The vehicle historical paths are compressed to obtain compressed vehicle historical paths.
[0223] Step 306: If the third distance is greater than the third distance threshold, the third path point is deleted.
[0224] Step 308: The second path distance between each vehicle historical path is calculated, and each vehicle historical path is clustered based on the second path distance to obtain a category label of each vehicle historical path.
[0225] Step 310: A vehicle path model is generated according to each vehicle historical path and the category label of each vehicle historical path.
[0226] Step 312: Obtain the vehicle to-be-detected path collected by the path collection device.
[0227] Step 314: Compress the vehicle to-be-detected path to obtain a compressed vehicle to-be-detected path.
[0228] Step 316: Calculate the first path distance between the vehicle to-be-detected path and each vehicle historical path in the pre-trained vehicle path model, and determine the vehicle historical path with a first path distance less than a second distance threshold as a vehicle similar path.
[0229] Step 318: Obtain the category labels of the plurality of vehicle similar paths.
[0230] Step 320: Determine the vehicle similar paths with a category label as a specified category label as a vehicle similar path set.
[0231] Step 322: Perform path point prediction in the vehicle similar path set based on a target path point of the vehicle to-be-detected path, obtain a predicted path point set, and calculate a detection index of the vehicle to-be-detected path according to the predicted path point set.
[0232] Step 324: If the detection index is greater than a preset threshold, determine that the traffic event is an abnormal event, and obtain a traffic event detection result.
[0233] In the application scenario of vehicle path detection, the historical paths of a plurality of vehicles are collected, and after compression and clustering processing, the category labels of the vehicle historical paths are obtained to generate a vehicle path model, without manually annotating a large amount of collected video content, thereby reducing the training cost of the vehicle path model and improving the training efficiency of the vehicle path model. Furthermore, the model generated according to the collected vehicle historical paths is used to judge the vehicle to-be-detected path, and then determine whether the traffic event is an abnormal event or a normal event. Such a traffic event detection method based only on vehicle paths avoids collecting a large amount of vehicle motion information for comprehensive analysis, reduces the detection cost, solves the problems of high error rate and low efficiency of logical judgment based on monitored video content, and improves the accuracy and efficiency of traffic event detection.
[0234] Figure 4 A processing process flowchart of a traffic event detection method provided by one embodiment of the present specification is shown.
[0235] The path collection device collects a plurality of historical paths and a plurality of to-be-detected paths, compresses the plurality of historical paths, and then performs clustering processing on the plurality of historical paths to obtain a path model. The detection index of the to-be-detected path is calculated according to the to-be-detected path and the path model data. When the detection index is greater than a preset threshold, it is determined that an abnormal event occurs, and when the detection index is not greater than the threshold, the detection index of another to-be-detected path is calculated according to the to-be-detected path and the path model data.
[0236] Figure 5 A data processing flowchart of a traffic event detection method provided by one embodiment of the present specification is shown.
[0237] The to-be-detected path and the path model data are obtained, the to-be-detected path is compressed to obtain a plurality of similar paths in the path model, a plurality of predicted path points of the to-be-detected path in the similar paths are calculated, and the detection index is calculated based on KDE according to the plurality of predicted path points. Specifically, the probability density of the predicted path point is first calculated, then the probability value of the predicted path point is calculated according to the probability density, and finally the detection index of the to-be-detected path is calculated according to the probability value.
[0238] Corresponding to the above-mentioned traffic event detection method embodiment, the present specification also provides a traffic event detection device embodiment, Figure 6 A structural schematic diagram of a traffic event detection device provided by one embodiment of the present specification is shown. As shown in the figure, Figure 6 The device comprises:
[0239] The first acquisition module 602 is configured to acquire a to-be-detected path collected by a path collection device;
[0240] The first similar path set determination module 604 is configured to determine a similar path set of the to-be-detected path from a pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by the path collection device;
[0241] The first calculation module 606 is configured to perform path point prediction in the similar path set based on a target path point of the to-be-detected path to obtain a predicted path point set, and calculate a detection index of the to-be-detected path according to the predicted path point set;
[0242] The first determination module 608 is configured to determine a traffic event detection result according to the detection index.
[0243] Optionally, the device further comprises:
[0244] The path compression module is configured to compress the to-be-detected path to obtain a compressed to-be-detected path.
[0245] Optionally, the path compression module can be further configured to:
[0246] obtain position information of each path point in the to-be-detected path, calculate a first distance between a first path point and a reference path point corresponding to the first path point according to the position information of the first path point, wherein the first path point is any one of the path points, and if the first distance is greater than a first distance threshold, the first path point is deleted.
[0247] Optionally, the first similar path set determination module 604 can be further configured to:
[0248] calculate a first path distance between the to-be-detected path and each historical path in the pre-trained path model, determine a historical path with a first path distance less than a second distance threshold as a similar path, and construct a similar path set according to a plurality of similar paths.
[0249] Optionally, the first similar path set determination module 604 can be further configured to:
[0250] obtain a category label of a plurality of similar paths, and determine a similar path with a specified category label as a similar path set.
[0251] Optionally, the first calculation module 606 can be further configured to:
[0252] remove a target path point in the to-be-detected path to obtain a first path, determine a reference path point corresponding to a second path point on each similar path in the similar path set based on the second path point, wherein the second path point is the last path point on the first path, calculate a next time path point of the reference path point in each similar path based on the reference path point, and form a predicted path point set.
[0253] Optionally, the first calculation module 606 can be further configured to:
[0254] calculate a probability density of each predicted path point in the predicted path point set in the similar path set according to the number of predicted path points in the predicted path point set, calculate a probability value of the target path point in the similar path set according to the probability density, and calculate a detection index of the to-be-detected path according to the probability value.
[0255] Optionally, the apparatus further comprises:
[0256] a path model generation module configured to obtain historical paths of a plurality of target objects collected by a path collection device, calculate a second path distance between each historical path, cluster each historical path based on the second path distance to obtain a category label of each historical path, and generate a path model according to each historical path and the category label of each historical path.
[0257] Optionally, the apparatus further comprises:
[0258] a historical path compression module configured to compress the historical path to obtain a compressed historical path.
[0259] Optionally, the historical path compression module is further configured to:
[0260] acquire position information of each path point in the historical path, and calculate a third distance between a third path point and a reference path point corresponding to the third path point according to the position information of the third path point, wherein the third path point is any one of the path points, and if the third distance is greater than a third distance threshold, the third path point is deleted.
[0261] Optionally, the path model generation module can be further configured to:
[0262] acquire, according to a preset period, historical paths of a plurality of target objects collected by a path collection device in a target time period.
[0263] In the embodiments of the present specification, a to-be-detected path collected by a path collection device is acquired, and a similar path set of the to-be-detected path is determined from a pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by the path collection device, a target path point of the to-be-detected path is used for path point prediction in the similar path set to obtain a predicted path point set, a detection index of the to-be-detected path is calculated according to the predicted path point set, and a traffic event detection result is determined according to the detection index. The path point features of the to-be-detected path collected by the path collection device are used to calculate the detection index by predicting the path point set, so as to obtain the traffic event detection result, without manually analyzing the image content of the entire image where the to-be-detected path is located, thereby improving the detection efficiency and reducing the detection cost.
[0264] The above is a schematic scheme of the traffic event detection apparatus of the present embodiment. It should be noted that the technical scheme of the traffic event detection apparatus belongs to the same concept as the technical scheme of the traffic event detection method described above, and the details of the technical scheme of the traffic event detection apparatus that are not described in detail can be referred to the description of the technical scheme of the traffic event detection method.
[0265] Corresponding to the image detection method embodiments described above, the present specification also provides image detection apparatus embodiments, Figure 7 a structural schematic diagram of an image detection apparatus provided by one embodiment of the present specification is shown. As shown in the figure, Figure 7 the apparatus comprises:
[0266] a second acquisition module 702 configured to acquire a to-be-detected image collected by an image collection device;
[0267] The extraction module 704 is configured to extract a to-be-detected path from the to-be-detected image;
[0268] The second similar path set determination module 706 is configured to determine a similar path set of the to-be-detected path from a pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by a path collection device;
[0269] The second calculation module 708 is configured to perform path point prediction in the similar path set based on a target path point of the to-be-detected path, to obtain a predicted path point set, and to calculate a detection index of the to-be-detected path according to the predicted path point set.
[0270] The second determination module 710 is configured to determine an image detection result of the to-be-detected image according to the detection index.
[0271] In the embodiments of the present specification, the to-be-detected image collected by the image collection device is obtained, the to-be-detected path is extracted from the to-be-detected image, the similar path set of the to-be-detected path is determined from the pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by a path collection device, the path point prediction is performed in the similar path set based on the target path point of the to-be-detected path, the predicted path point set is obtained, the detection index of the to-be-detected path is calculated according to the predicted path point set, and the image detection result of the to-be-detected image is determined according to the detection index. The path point features of the to-be-detected path in the to-be-detected image are predicted to obtain the predicted path point set, and the detection index is calculated based on the path point set, so as to obtain the image detection result. The image content recorded by the image is further mined, the to-be-detected path of the image is extracted for analysis, and multiple image collection devices do not need to be established to enrich the collected image content for comparison, thereby reducing the detection cost.
[0272] The above is a schematic scheme of the image detection device according to the embodiment. It should be noted that the technical scheme of the image detection device belongs to the same concept as the technical scheme of the image detection method described above, and the details of the technical scheme of the image detection device that are not described in detail can be referred to the description of the technical scheme of the image detection method.
[0273] Figure 8 A structural block diagram of a computing device according to an embodiment of the present specification is shown. The components of the computing device 800 include but are not limited to a memory 810 and a processor 820. The processor 820 is connected with the memory 810 through a bus 830, and a database 850 is used to save data.
[0274] The computing device 800 also includes an access device 840 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or combinations of these and / or other types of networks that are known in the art. The access device 840 can include one or more of any type of network interface (for example, a network interface card (NIC)) of either wired or wireless nature, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and / or the like.
[0275] In one embodiment of the present specification, the above-mentioned components of the computing device 800 and other components not shown in the Figure 8 may be connected to each other, for example, through a bus. It should be understood that Figure 8 The computing device structure diagram shown is merely for the purpose of example, and is not a limitation on the scope of the present specification. Those skilled in the art can add or replace other components as needed.
[0276] The computing device 800 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (for example, a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, and the like), a mobile phone (for example, a smartphone), a wearable computing device (for example, a smart watch, smart glasses, and the like), or other types of mobile devices, or a stationary computing device such as a desktop computer or a PC. The computing device 800 can also be a mobile or stationary server.
[0277] Among them, the processor 820 is used to execute the following computer executable instructions, which are executed by the processor to implement the steps of the above traffic event detection method and image detection method.
[0278] The above is a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the traffic event detection method and the image detection method belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the traffic event detection method and the image detection method.
[0279] An embodiment of the present specification further provides a computer readable storage medium, which stores computer executable instructions. The computer executable instructions are executed by a processor to implement the steps of the traffic event detection method and the image detection method.
[0280] The above is a schematic scheme of the computer readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the traffic event detection method and the image detection method belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the traffic event detection method and the image detection method.
[0281] An embodiment of the present specification further provides a computer program, which causes a computer to execute the steps of the traffic event detection method and the image detection method when the computer program is executed in the computer.
[0282] The above is a schematic scheme of the computer program of the embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the traffic event detection method and the image detection method belong to the same concept, and the details of the technical scheme of the computer program that are not described in detail can be referred to the description of the technical scheme of the traffic event detection method and the image detection method.
[0283] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order in which they are recited and still accomplish desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.
[0284] The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc.
[0285] It should be noted that, for the foregoing method embodiments, in order to facilitate description, they are all expressed as a combination of a series of actions, but those skilled in the art should know that the embodiments of the present specification are not limited by the order of the described actions, because according to the embodiments of the present specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of the present specification.
[0286] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0287] The preferred embodiments of the present specification disclosed above are only used to help explain the present specification. The alternative embodiments do not describe all the details and limit the invention to the specific embodiments described. Obviously, according to the content of the embodiments of the present specification, many modifications and changes can be made. The present specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present specification, so that those skilled in the art can well understand and use the present specification. The present specification is limited by the claims and their entire scope and equivalents.
Claims
1. A traffic event detection method, comprising: obtaining a to-be-detected path collected by a path collection device; determining a similar path set of the to-be-detected path from a pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by the path collection device; performing path point prediction in the similar path set based on a target path point of the to-be-detected path to obtain a predicted path point set, and calculating a detection index of the to-be-detected path according to the target path point, the predicted path point set, and the similar path set, wherein the detection index is index data of an abnormal condition of the to-be-detected path; determining a traffic event detection result according to the detection index. 2.The method of claim 1, before the determining the similar path set of the to-be-detected path from the pre-trained path model, further comprising: compressing the to-be-detected path to obtain a compressed to-be-detected path. 3.The method of claim 2, wherein the compressing the to-be-detected path comprises: obtaining position information of each path point in the to-be-detected path; calculating a first distance between a first path point and a reference path point corresponding to the first path point according to the position information of the first path point, wherein the first path point is any one of the path points; if the first distance is greater than a first distance threshold, deleting the first path point. 4.The method of any one of claims 1-3, wherein the determining the similar path set of the to-be-detected path from the pre-trained path model comprises: calculating a first path distance between the to-be-detected path and each historical path in the pre-trained path model; determining a historical path with a first path distance less than a second distance threshold as a similar path, and constructing a similar path set according to a plurality of similar paths. 5.The method of claim 4, wherein the constructing the similar path set according to the plurality of similar paths comprises: obtaining category labels of the plurality of similar paths; determining similar paths with a category label as a specified category label to form the similar path set. 6.The method of claim 1, wherein the performing path point prediction in the similar path set based on the target path point of the to-be-detected path to obtain the predicted path point set comprises: removing the target path point in the to-be-detected path to obtain a first path; determining reference path points corresponding to a second path point in each similar path in the similar path set based on the second path point, wherein the second path point is the last path point on the first path; calculating next time path points of the reference path points in the each similar path based on the reference path points to form the predicted path point set. 7.The method of claim 1 or 6, wherein the calculating the detection index of the to-be-detected path according to the predicted path point set comprises: calculating a probability density of each predicted path point in the predicted path point set in the similar path set according to a number of predicted path points in the predicted path point set. According to the probability density, a probability value of the target path point in the similar path set is calculated; According to the probability value, a detection index of the to-be-detected path is calculated.
8. The method of claim 1 or 5, before the determining the similar path set of the to-be-detected path from the pre-trained path model, further comprising: obtaining historical paths of a plurality of target objects collected by the path collection device; calculating a second path distance between each historical path, clustering the historical paths based on the second path distance to obtain a category label of the historical paths; generating a path model according to the historical paths and the category label of the historical paths.
9. The method of claim 8, after the obtaining the historical paths of a plurality of target objects collected by the path collection device, further comprising: compressing the historical paths to obtain compressed historical paths.
10. The method of claim 9, the compressing the historical paths comprises: obtaining position information of each path point in the historical paths; calculating a third distance between a third path point and a reference path point corresponding to the third path point according to the position information of the third path point, wherein the third path point is any one of the path points; if the third distance is greater than a third distance threshold, deleting the third path point.
11. The method of claim 8, the obtaining the historical paths of a plurality of target objects collected by the path collection device comprises: obtaining historical paths of a plurality of target objects collected by the path collection device in a target time period according to a preset period.
12. An image detection method, comprising: obtaining a to-be-detected image collected by an image collection device; extracting a to-be-detected path from the to-be-detected image; determining a similar path set of the to-be-detected path from a pre-trained path model, wherein the path model is trained based on a plurality of historical paths collected by a path collection device; performing path point prediction in the similar path set based on a target path point of the to-be-detected path to obtain a predicted path point set, and calculating a detection index of the to-be-detected path according to the target path point, the predicted path point set, and the similar path set, wherein the detection index refers to index data of an abnormal situation of the to-be-detected path; determining an image detection result of the to-be-detected image according to the detection index.
13. A computing device, comprising: a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, and the computer executable instructions, when executed by the processor, implement the steps of the traffic event detection method of any one of claims 1 to 11 or the image detection method of claim 12.
14. A computer readable storage medium storing computer executable instructions, and the computer executable instructions, when executed by a processor, implement the steps of the traffic event detection method of any one of claims 1 to 11 or the image detection method of claim 12.
Citation Information
Patent Citations
Method for predicting space-time traveling track of blacklisted vehicle
CN103325245A
Detector, detection method, and detection program
JP2018180601A