An event detection method, device, system, electronic device, and storage medium

By acquiring images and their environmental information and using pre-established correspondences to determine the target detection method, the problem of event detection accuracy under the influence of environmental factors is solved, and higher detection accuracy is achieved.

CN114241430BActive Publication Date: 2025-11-07HANGZHOU HIKVISION SYST TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111580157.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2025-11-07
Estimated Expiration
2041-12-22

Smart Images

  • Figure CN114241430B_ABST
    Figure CN114241430B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an event detection method, device, system, electronic equipment and storage medium, the method comprises: acquiring a to-be-detected image and target environment information when the to-be-detected image is collected, determining a target event detection method based on the target environment information and a pre-established corresponding relationship between environment information and event detection methods, performing event detection on the to-be-detected image based on the target event detection method, and obtaining an event detection result. In this way, the electronic equipment can select a target event detection method suitable for different target environment information when collecting a to-be-detected image based on the pre-established corresponding relationship between environment information and event detection methods, thereby reducing the influence of environmental factors on event detection and improving the accuracy of event detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of event detection, and in particular to an event detection method, device, system, electronic device and storage medium. BACKGROUND

[0002] Event detection can determine the occurrence of an event and timely handle the event. For example, event detection can detect traffic events, crowd events, etc. Currently, the event detection method usually uses an event detection algorithm to perform event detection on event videos collected by a camera, so as to determine whether an event has occurred.

[0003] However, the collected videos are affected by various environmental factors, such as weather factors, road condition factors, etc., which can result in low accuracy of event detection. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide an event detection method, device, system, electronic device and storage medium to improve the accuracy of event detection. The specific technical solutions are as follows:

[0005] In a first aspect, the embodiments of the present application provide an event detection method, which comprises:

[0006] obtaining a to-be-detected image and target environment information when the to-be-detected image is collected;

[0007] determining a target event detection method based on the target environment information and a pre-established correspondence between environment information and event detection methods;

[0008] performing event detection on the to-be-detected image based on the target event detection method to obtain an event detection result.

[0009] Optionally, the target environment information comprises at least one of the following:

[0010] installation angle information of an image collection device that collects the to-be-detected image, road surface information, and weather information.

[0011] Optionally, the target event detection method comprises one or more target event detection algorithms, and each target event detection algorithm corresponds to an event type.

[0012] The step of performing event detection on the to-be-detected image based on the target event detection method comprises:

[0013] determining a target calibration rule corresponding to each target event detection algorithm from a pre-established calibration rule package, wherein the calibration rule package comprises pre-determined calibration rules corresponding to each event detection algorithm.

[0014] labeling the to-be-detected image according to the target labeling rule, to obtain labeling information, wherein the target labeling rule is used to indicate a labeling manner of auxiliary information required for event detection in the to-be-detected image by using the target event detection algorithm;

[0015] detecting events in the to-be-detected image by using each target event detection algorithm and the corresponding labeling information.

[0016] Optionally, the establishing manner of the correspondence between the environmental information and the traffic event detection manner comprises:

[0017] obtaining image samples of multiple event types corresponding to each environmental information sample in multiple environmental information samples;

[0018] training, by using the image samples of multiple event types corresponding to each environmental information sample and initial detection models of each event type, multiple event detection algorithms corresponding to each environmental information sample, wherein each event detection algorithm corresponds to one event type respectively;

[0019] recording the environmental information corresponding to each environmental information sample and the event detection algorithms corresponding to various event types corresponding to the environmental information, to obtain the correspondence between the environmental information and the event detection manner.

[0020] Optionally, the step of training, by using the image samples of multiple event types corresponding to each environmental information sample and initial detection models of each event type, multiple event detection algorithms corresponding to each environmental information sample comprises:

[0021] labeling each image sample of each event type corresponding to each environmental information sample, to obtain a labeling label;

[0022] for the same event type corresponding to the same environmental information sample, inputting each image sample corresponding to the event type into the initial detection model corresponding to the event type, to obtain a prediction result;

[0023] adjusting model parameters of the initial detection model corresponding to the event type corresponding to each image sample based on a difference between the labeling label corresponding to the image sample and the prediction result, until the initial detection model converges, to obtain the event detection algorithm corresponding to the environmental information sample and the event type corresponding to the image sample.

[0024] Optionally, the step of training, by using the image samples of multiple event types corresponding to each environmental information sample and initial detection models of each event type, multiple event detection algorithms corresponding to each environmental information sample further comprises:

[0025] For each image sample corresponding to each event type of each environment information sample, auxiliary information is labeled according to an initial labeling rule, and auxiliary information is obtained;

[0026] For the same event type corresponding to the same environment information sample, after an initial detection model corresponding to the event type detects each image sample corresponding to the event type based on the auxiliary information to obtain a prediction result, the initial labeling rule is adjusted based on the prediction result until the initial detection model converges, and a labeling rule corresponding to the event type is obtained.

[0027] For each environment information sample, a corresponding relationship between event detection algorithms and labeling rules corresponding to various event types of the environment information sample is recorded, and a labeling rule corresponding to the environment information sample is generated into a labeling rule package.

[0028] In a second aspect, an embodiment of the present application provides an event detection device, and the device comprises:

[0029] An acquisition module is configured to acquire a to-be-detected image and target environment information collected when the to-be-detected image is collected.

[0030] A determination module is configured to determine a target event detection method based on the target environment information and a pre-established corresponding relationship between environment information and event detection methods.

[0031] A detection module is configured to perform event detection on the to-be-detected image based on the target event detection method to obtain an event detection result.

[0032] Optionally, the target environment information comprises at least one of the following:

[0033] Installation angle information of an image acquisition device used to collect the to-be-detected image, road surface information, and weather information.

[0034] The target event detection method comprises one or more target event detection algorithms, and each target event detection algorithm corresponds to an event type.

[0035] The detection module comprises:

[0036] A determination unit is configured to determine, based on each target event detection algorithm, a target labeling rule corresponding to the target event detection algorithm from a pre-established labeling rule package, wherein the labeling rule package comprises pre-determined labeling rules corresponding to each event detection algorithm.

[0037] a calibration unit, configured to calibrate the to-be-detected image according to the target calibration rule, to obtain calibration information, wherein the target calibration rule is used to indicate a calibration manner of auxiliary information required for event detection in the to-be-detected image by using the target event detection algorithm;

[0038] a detection unit, configured to perform event detection on the to-be-detected image by using each target event detection algorithm and the corresponding calibration information thereof;

[0039] The correspondence between the environmental information and the traffic event detection manner is pre-established by an establishing module, and the establishing module comprises:

[0040] an acquisition unit, configured to acquire image samples of multiple event types corresponding to each environmental information sample in multiple environmental information samples;

[0041] a training unit, configured to train multiple event detection algorithms corresponding to each environmental information sample by using the image samples of multiple event types corresponding to each environmental information sample and initial detection models of each event type, wherein each event detection algorithm corresponds to one event type respectively;

[0042] a recording unit, configured to record the environmental information corresponding to each environmental information sample and the event detection algorithms corresponding to various event types corresponding to the environmental information, to obtain the correspondence between the environmental information and the event detection manner;

[0043] The training unit comprises:

[0044] a first calibration subunit, configured to calibrate each image sample of each event type corresponding to each environmental information sample, to obtain a calibration label;

[0045] a prediction subunit, configured to input each image sample corresponding to one event type to an initial detection model corresponding to the event type, to obtain a prediction result, for the same event type corresponding to the same environmental information sample;

[0046] a first adjustment subunit, configured to adjust model parameters of the initial detection model corresponding to the event type corresponding to each image sample, based on a difference between the calibration label corresponding to the image sample and the prediction result, until the initial detection model converges, to obtain an event detection algorithm corresponding to the environmental information sample and the event type corresponding to the image sample;

[0047] The training unit further comprises:

[0048] a second calibration unit, configured to calibrate each image sample of each event type corresponding to each environmental information sample according to an initial calibration rule, to obtain auxiliary information;

[0049] The second adjustment subunit is configured to, for a same event type corresponding to a same environment information sample, adjust the initial calibration rule based on a prediction result obtained by the initial detection model corresponding to the event type detecting each image sample corresponding to the event type based on the auxiliary information until the initial detection model converges, to obtain a calibration rule corresponding to the event type.

[0050] The recording subunit is configured to, for each environment information sample, record a correspondence between an event detection algorithm of each event type corresponding to the environment information sample and a calibration rule, and generate a calibration rule package of the calibration rule corresponding to the environment information sample.

[0051] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus.

[0052] The memory is configured to store a computer program.

[0053] The processor is configured to execute the program stored on the memory, and implement the method steps of any one of the first aspect.

[0054] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method steps of any one of the first aspect.

[0055] In a fifth aspect, an embodiment of the present application provides an event detection system, and the system includes the electronic device of the third aspect, an image acquisition device and an environment detection device, wherein:

[0056] The environment detection device is configured to detect target environment information when the image to be detected is acquired, and send the target environment information to the electronic device.

[0057] The image acquisition device is configured to acquire the image to be detected, and send the image to be detected to the electronic device.

[0058] Embodiments of the present application have the following beneficial effects:

[0059] In the solution provided by this invention, the electronic device can acquire the image to be detected and the target environment information at the time of image acquisition. Based on the target environment information and a pre-established correspondence between environment information and event detection methods, a target event detection method is determined. Based on the target event detection method, event detection is performed on the image to be detected to obtain the event detection result. Through the above solution, the electronic device can select a suitable target event detection method for different target environment information at the time of image acquisition, based on the pre-established correspondence between environment information and event detection methods, to process the image to be detected, reducing the influence of environmental factors on event detection and thus improving the accuracy of event detection. Of course, implementing any product or method of this invention does not necessarily require achieving all the advantages described above simultaneously. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0061] Figure 1 A flowchart of an event detection method provided in an embodiment of the present invention;

[0062] Figure 2 for Figure 1 A specific flowchart of step S103 in the illustrated embodiment;

[0063] Figure 3 For based on Figure 1 A flowchart illustrating a method for establishing the correspondence between environmental information and event detection methods in the illustrated embodiment;

[0064] Figure 4 for Figure 3 A specific flowchart of step S302 in the illustrated embodiment;

[0065] Figure 5 for Figure 3 Another specific flowchart of step S302 in the illustrated embodiment;

[0066] Figure 6 This is a schematic diagram of the structure of an event detection device provided in an embodiment of the present invention;

[0067] Figure 7 for Figure 6 A schematic diagram of a specific structure of the detection module 630 in the illustrated embodiment;

[0068] Figure 8A structural schematic diagram of an electronic device provided by an embodiment of the present application;

[0069] Figure 9 A structural schematic diagram of an event detection system provided by an embodiment of the present application. DETAILED DESCRIPTION

[0070] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application belong to the scope of protection of the present application.

[0071] In order to improve the accuracy of event detection, an event detection method, device, system, electronic device, computer readable storage medium and computer program product are provided in the embodiments of the present application. First, an event detection method provided by the embodiments of the present application will be introduced.

[0072] The event detection method provided by the embodiments of the present application can be applied to any electronic device that needs to perform event detection, for example, can be a server or a terminal, which is not limited here. In order to describe clearly, the electronic device is called electronic device hereinafter.

[0073] As shown in Figure 1 An event detection method, which can include:

[0074] S101, acquiring a to-be-detected image and target environment information when the to-be-detected image is collected;

[0075] S102, determining a target event detection method based on the target environment information and a pre-established corresponding relationship between environment information and event detection methods;

[0076] S103, performing event detection on the to-be-detected image based on the target event detection method to obtain an event detection result.

[0077] It can be seen that in the scheme provided by the embodiment of the application, the electronic device can acquire a to-be-detected image and target environment information when the to-be-detected image is collected, determine a target event detection manner based on the target environment information and a pre-established correspondence between environment information and event detection manners, perform event detection on the to-be-detected image based on the target event detection manner, and obtain an event detection result. Through the above scheme, the electronic device can select a target event detection manner suitable for different target environment information when the to-be-detected image is collected, and process the to-be-detected image based on the pre-established correspondence between environment information and event detection manners, thereby reducing the influence of environmental factors on event detection and improving the accuracy of event detection.

[0078] When event detection is required, the electronic device can acquire a to-be-detected image and target environment information when the to-be-detected image is collected. The to-be-detected image can be an image captured by an image collection device, or a video frame image included in a video collected by the image collection device, and the like. The to-be-detected image can be a real-time video image, or an image stored in the electronic device or another device, which is reasonable.

[0079] In an implementation, the event can be a traffic event, and in the step S101, the electronic device can acquire a to-be-detected image required for traffic event detection and target environment information when the to-be-detected image is collected. For example, the image collection device can send a traffic video collected by the image collection device to the electronic device in real time, and the electronic device can perform real-time traffic event detection on each frame image in the traffic video as a to-be-detected image, or the image collection device can collect a traffic video, and each frame image in the traffic video can be a to-be-detected image, and then real-time traffic event detection is performed.

[0080] For another example, when a user wants to check whether a traffic accident occurs at a certain time and a certain place, the user can select a traffic video corresponding to the time and the place, and the electronic device can acquire the traffic video selected by the user, and each frame image in the traffic video can be a to-be-detected image.

[0081] The target environment information is environment information of a real scene corresponding to the to-be-detected image when the to-be-detected image is collected. The environment information can include road-related information, weather-related information, image collection device-related information, and various information related to the real scene when the to-be-detected image is collected, which is reasonable. For example, a to-be-detected image A is a traffic image collected at an a intersection at time 1, and the target environment information corresponding to the to-be-detected image A is environment information at the a intersection at time 1.

[0082] After obtaining the to-be-detected image and the target environment information collected when the to-be-detected image is collected, the electronic device can perform the step S102 described above, that is, determining the target event detection manner based on the target environment information and the pre-established correspondence between the environment information and the event detection manner.

[0083] To facilitate the determination of the target event detection manner, the correspondence between the environment information and the event detection manner can be pre-established, and the event detection manner corresponding to each environment information is the event detection manner with better detection effect corresponding to the environment information.

[0084] In this way, the electronic device can determine the environment information matched with the target environment information from the pre-established correspondence between the environment information and the event detection manner based on the target environment information, and further determine the event detection manner corresponding to the environment information as the target event detection manner. The target event detection manner can correspond to one target event detection algorithm or multiple target event detection algorithms, and each target event detection algorithm corresponds to one event type.

[0085] For example, the event is a traffic event, and the pre-established correspondence between the environment information and the traffic event detection manner is shown in the following table:

[0086]

[0087]

[0088] Then, if the target environment information is cement pavement-dry-strong light-3000 meters, the electronic device can determine that the environment information matched with the target environment information is the environment information 2, and further determine the traffic event detection manner 2 corresponding to the environment information 2 as the target traffic event detection manner.

[0089] Since the environment information corresponding to the target event detection manner is the environment information matched with the target environment information collected when the to-be-detected image is collected, the target event detection manner determined based on the target environment information is suitable for the target environment information collected when the to-be-detected image is collected, and the event detection on the to-be-detected image using the target event detection manner can reduce the influence of environmental factors on the event detection result.

[0090] Therefore, after obtaining the target event detection manner, the electronic device can perform the step S103 described above, that is, performing event detection on the to-be-detected image based on the target event detection manner to obtain an event detection result. For the traffic event, the detection result can be the area of the to-be-detected image where an obstacle, a traffic accident, a litter, a reverse driving, a vehicle congestion, an overspeed, or an emergency road occupation occurs, which is not limited here.

[0091] In an implementation, after the event region in the image to be detected is determined, further detection can be performed to determine more detailed event information. For example, for a traffic event, after the region in the image to be detected occupied by the emergency road event is determined, license plate number detection can be performed on the vehicle in the region to determine the license plate number of the vehicle occupying the emergency road, facilitating processing by the staff.

[0092] The event detection method provided by the embodiment of the present application is described below in combination with examples. For an event of which only one event type needs to be detected, for example, the event type is an obstacle, the electronic device acquires the image to be detected and target environment information when the image to be detected is collected, for example, asphalt pavement-dry-normal light-1000 meters, and a correspondence between the pre-established environment information and obstacle detection algorithms is as follows:

[0093] Environmental information Road surface material Road surface condition Light intensity Visibility Obstacle detection algorithm Environmental information 1 Cement road surface Wet Normal light 500 meters Obstacle detection algorithm A Environmental information 2 Cement road surface Dry Strong light 3000 meters Obstacle detection algorithm B … … Environmental information n Asphalt road surface Dry Normal light 1000 meters Obstacle detection algorithm C

[0094] Then, the electronic device can determine that the obstacle detection algorithm to be used is specifically the obstacle detection algorithm C, and the electronic device can then perform obstacle detection on the image to be detected by using the obstacle detection algorithm C to obtain the region of the obstacle in the image to be detected, i.e., the event detection result.

[0095] For an event of which multiple event types need to be detected, for example, the event types include an obstacle, a litter, and a pressure line, the electronic device acquires the image to be detected and target environment information when the image to be detected is collected, for example, asphalt pavement-dry-normal light-1000 meters, and a correspondence between the pre-established environment information and obstacle detection algorithms is as follows:

[0096]

[0097] Then, the electronic device can determine that the detection algorithms to be used are specifically the obstacle detection algorithm C, the litter detection algorithm C, and the pressure line detection algorithm C according to the correspondence between the pre-established environment information and obstacle detection algorithms, and the electronic device can then perform detection on the image to be detected by using the obstacle detection algorithm C, the litter detection algorithm C, and the pressure line detection algorithm C respectively to obtain one or more of the region of the obstacle, the region of the litter, and the region of the pressure line in the image to be detected, i.e., the event detection result.

[0098] It can be seen that in the embodiment, the electronic device can adopt a target event detection manner, i.e., an event detection manner adapted to target environment information when collecting the image to be detected, to perform event detection on the image to be collected, and thus the event detection result can be obtained. In this way, the electronic device can select a target event detection manner suitable for the target environment information based on the pre-established correspondence between the environment information and the event detection manner to process the image to be detected, thereby reducing the influence of environmental factors on event detection and improving the accuracy of event detection.

[0099] As an implementation manner of the embodiment of the present application, the target environment information can include at least one of the following: installation angle information of an image collection device collecting the image to be detected, road surface information, and weather information. The road surface information can include road surface material information and road surface condition information, etc. The weather information can include visibility information and illumination information, etc.

[0100] Since the installation angle of the image collection device, the road surface material, whether the road surface has rainwater, icing, etc., the visibility, and the illumination intensity, etc. can all have an impact on the detection of traffic events, in order to improve the accuracy of the traffic event detection result, the target environment information can include at least one of the installation angle information of the image collection device collecting the image to be detected, the road surface material information, the road surface condition information, the visibility information, and the illumination information. As an implementation manner, in order to improve the accuracy of the traffic event detection result as much as possible, the target environment information can include the installation angle information of the image collection device collecting the image to be detected, the road surface material information, the road surface condition information, the visibility information, and the illumination information.

[0101] Since the angle of the installation position of the image collection device relative to the road is different, it will lead to different picture contents in the collected image to be detected, and will have an impact on the detection of traffic events, so the installation angle information of the image collection device can include the angle of the installation position of the image collection device relative to the road, for example, the image collection device is installed on the left side of the road, i.e., left installation; the image collection device is installed on the right side of the road, i.e., right installation; and the image collection device is installed in the center of the road, i.e., front installation.

[0102] The road surface material information can be the material type of the road surface, for example, it can be land road surface, cement road surface, and asphalt road surface, etc. The road surface condition information can be the condition presented by the road surface due to weather or human reasons, for example, it can be icing, water accumulation, snow accumulation, dryness, or wetness, etc. The visibility information is the maximum distance at which a person with normal vision can identify a target object from the background, and weather such as fog, haze, and sandstorm will affect the visibility. For example, the visibility information can be 50 meters, 100 meters, 200 meters, 500 meters, 1000 meters, 3000 meters, etc.

[0103] Since the illumination intensity has a great influence on the definition of the to-be-detected image, the illumination information can be information capable of identifying the illumination intensity, where the illumination intensity is the energy of visible light received per unit area, and the illumination intensity can be classified, and the classified illumination category is taken as the illumination information. For example, the ambient illumination intensity can be classified into strong illumination, normal illumination, and weak illumination, which are not limited herein. Therefore, the illumination information can include strong illumination, normal illumination, weak illumination, and the like.

[0104] As can be seen, in the embodiment, the target environment information can include at least one of the installation angle information of the image acquisition device for acquiring the to-be-detected image, the road surface information, and the weather information. Since these information can accurately represent the environment when the to-be-detected image is acquired, the target traffic event detection manner determined based on these target environment information is more suitable for the traffic event detection of the to-be-detected image, thereby improving the accuracy of the traffic event detection.

[0105] As an implementation of the embodiment of the present application, the target event detection manner can include one or more target event detection algorithms, and each target event detection algorithm corresponds to an event type, such as Figure 2 As shown in the figure, the step of performing event detection on the to-be-detected image based on the target event detection manner can include:

[0106] S201, determining the target calibration rule corresponding to the target event detection algorithm from a pre-established calibration rule package based on the target event detection algorithm;

[0107] When the to-be-detected image is detected by the target event detection manner, in order to accurately detect whether an event occurs, the electronic device can calibrate the auxiliary information required for event detection on the to-be-detected image, and then perform event detection on the to-be-detected image based on the auxiliary information. Therefore, the electronic device can pre-establish a calibration rule package, where the calibration rule package can include the calibration rule of each event detection algorithm corresponding to the pre-determined calibration rule, i.e., the calibration rule of the auxiliary information required for each event detection. The calibration rule is used to indicate the calibration manner of the auxiliary information required for event detection in the to-be-detected image.

[0108] In this way, after the target event detection algorithm is determined, the electronic device can determine the target calibration rule corresponding to the target event detection algorithm from the pre-established calibration rule package based on the target event detection algorithm, i.e., obtain the calibration manner of the auxiliary information required for event detection on the to-be-detected image by using the target event detection algorithm.

[0109] The calibration rules corresponding to different event detection algorithms can be the same or different, which is not specifically limited here. For example, when the event detection is traffic event detection, in the reverse driving event detection algorithm and the lane-pressing driving event detection algorithm, the lane lines in the to-be-detected image need to be calibrated, so the calibration rules corresponding to the reverse driving event detection algorithm and the lane-pressing driving event detection algorithm can include the calibration rule of calibrating the lane lines in the image.

[0110] S202, calibrating the to-be-detected image according to the target calibration rule to obtain calibration information;

[0111] After the target calibration rule is determined, since the target calibration rule can be used to indicate the calibration manner of the auxiliary information required for event detection in the to-be-detected image by using the target event detection algorithm, the electronic device can calibrate the to-be-detected image according to the target calibration rule to obtain calibration information, and then the to-be-detected image in which the auxiliary information is calibrated can be obtained. When the event detection is traffic event detection, the auxiliary information can include a region of interest, a railing, a auxiliary line, and a lane line in the to-be-detected image, which is not specifically limited here.

[0112] For example, for detection of a traffic event occupying an emergency road, the target traffic event detection algorithm is an emergency road occupation detection algorithm, and the target calibration rule corresponding thereto is calibration rule 1. Then, the electronic device can calibrate the emergency road region in the to-be-detected image A based on calibration rule 1 to obtain calibration information 1 of the to-be-detected image A.

[0113] S203, using each of the target event detection algorithms and the calibration information corresponding thereto to perform event detection on the to-be-detected image.

[0114] After obtaining the calibration information, the electronic device can use the target event detection algorithm and the calibration information corresponding thereto to perform event detection on the to-be-detected image, and then determine whether an event occurs and the region in which the event occurs.

[0115] For example, as an example of step S202, after obtaining the calibration information 1, the electronic device can use the emergency road occupation detection algorithm and the calibration information 1 to perform vehicle detection on the emergency road region in the to-be-detected image A, determine whether there is a vehicle in the emergency road region, and then determine whether an emergency road occupation event occurs and the region in which the emergency road occupation event occurs, as a traffic event detection result.

[0116] It can be seen that in the embodiment, the electronic device can determine the target calibration rule corresponding to each target event detection algorithm from the pre-established calibration rule package based on the target event detection algorithm, calibrate the to-be-detected image according to the target calibration rule to obtain calibration information, and then perform event detection on the to-be-detected image by using each target event detection algorithm and the calibration information corresponding thereto. Since the target calibration rule can indicate the calibration manner of the auxiliary information required for event detection in the to-be-detected image, the electronic device can obtain accurate calibration information by calibrating the to-be-detected image by using the target calibration rule, and thus the accuracy of the event detection result can be further improved when the to-be-detected image is detected based on the calibration information.

[0117] As an embodiment of the present application, as shown in Figure 3 The establishment manner of the correspondence between the above-mentioned environmental information and the event detection manner can include:

[0118] S301, acquiring image samples of multiple event types corresponding to each environmental information sample in multiple environmental information samples;

[0119] In order to determine the suitable event detection manner in various different environmental scenes, image samples of multiple event types corresponding to each environmental information sample in multiple environmental information samples can be acquired in advance.

[0120] The environmental information sample is a parameter value that can represent different environmental information, which can include at least one of the following: installation angle information of an image acquisition device for acquiring each image sample, road surface information corresponding to each image sample, and weather information. The image sample is an image sample including various types of events acquired under the environmental condition corresponding to each environmental information sample.

[0121] For different types of events, multiple initial detection models can be acquired, wherein each initial detection model corresponds to an event type and is used for detecting events of the event type. When the event is a traffic event, the traffic event type can include traffic accidents, littering, reverse driving, vehicle congestion, overspeed, and occupation of emergency roads, etc., which are not limited herein. Then, each initial detection model can correspond to a traffic event type and be used for traffic event detection of the traffic event type.

[0122] For example, if the traffic event types to be detected include four types of litter, reverse, vehicle congestion, and overspeed, the electronic device can obtain four initial detection models, and for each traffic event type, the electronic device can obtain traffic image samples of the traffic event type collected under the corresponding environment information of each environment information sample. For example, for the litter traffic event type, 100 traffic image samples including litter events collected under the corresponding environment information of each environment information sample can be obtained.

[0123] S302, training to obtain a plurality of event detection algorithms corresponding to each environment information sample using the image samples of a plurality of event types corresponding to each environment information sample and the initial detection model of each event type;

[0124] After obtaining the image samples of a plurality of event types corresponding to each environment information sample in a plurality of environment information samples, since each environment information sample corresponds to image samples of a plurality of event types, and the event detection algorithm is different for different event types, each environment information sample can correspond to a plurality of event detection algorithms, and each event detection algorithm corresponds to an event type.

[0125] The electronic device can train to obtain a plurality of event detection models corresponding to each environment information sample using the image samples of a plurality of event types corresponding to each environment information sample and the initial detection model of each event type, as a plurality of event detection algorithms corresponding to each environment information sample.

[0126] For example, as an example of step S301, for weather environment information sample 1, the electronic device can train to obtain a litter detection model corresponding to environment information sample 1 using 100 traffic image samples of litter events corresponding to environment information sample 1 and the initial detection model corresponding to the litter event type, as a litter detection algorithm corresponding to environment information sample 1. In the same way, the reverse detection algorithm, vehicle congestion detection algorithm, and overspeed detection algorithm corresponding to environment information sample 1 can be trained.

[0127] S303, record the environment information corresponding to each environment information sample and the event detection algorithm corresponding to each event type corresponding thereto to obtain the correspondence between the environment information and the event detection method.

[0128] After determining the plurality of event detection algorithms corresponding to each environment information sample, the electronic device can record the environment information corresponding to each environment information sample and the event detection algorithm corresponding to each event type corresponding thereto, and further obtain the correspondence between the environment information and the traffic event detection method.

[0129] For example, the electronic device determines that the event detection algorithms corresponding to various event types corresponding to the environment information sample 1 are the litter detection algorithm 1, the reverse driving detection algorithm 1, the vehicle congestion detection algorithm 1, and the overspeed detection algorithm 1; the event detection algorithms corresponding to various event types corresponding to the environment information sample 2 are the litter detection algorithm 2, the reverse driving detection algorithm 2, the vehicle congestion detection algorithm 2, and the overspeed detection algorithm 2; and the event detection algorithms corresponding to various event types corresponding to the environment information sample 3 are the litter detection algorithm 3, the reverse driving detection algorithm 3, the vehicle congestion detection algorithm 3, and the overspeed detection algorithm 3. Then, the electronic device can record the environment information 1, the environment information 2, and the environment information 3 corresponding to the environment information samples and the corresponding event detection algorithms, respectively, to obtain the corresponding relationship shown in the following table:

[0130]

[0131] In an embodiment, the electronic device can generate an event detection algorithm package from the plurality of event detection algorithms, to facilitate loading and use by a server or a front-end camera or the like. In an embodiment, the electronic device can record the corresponding relationship between the environment information corresponding to each environment information sample and the event detection algorithms corresponding to various event types corresponding to the environment information, in a table, to obtain a correspondence set of environment information and event detection methods.

[0132] As can be seen, in the present embodiment, the electronic device can obtain image samples of various event types corresponding to each of the plurality of environment information samples, train a plurality of event detection algorithms corresponding to each of the environment information samples by using the image samples of various event types corresponding to each of the environment information samples and an initial detection model of each event type, record the environment information corresponding to each of the environment information samples and the event detection algorithms corresponding to various event types corresponding to the environment information, and obtain a corresponding relationship between the environment information and the event detection methods. Through the above method, the electronic device can establish the corresponding relationship between the environment information and the event detection methods, so as to subsequently select a target event detection method suitable for target environment information based on target environment information to process a to-be-detected image, reduce the influence of environmental factors on event detection, and further improve the accuracy of event detection.

[0133] As an embodiment of the present application, as shown in Figure 4 The step of training the plurality of event detection algorithms corresponding to each of the environment information samples by using the image samples of various event types corresponding to each of the environment information samples and an initial detection model of each event type can include:

[0134] S401, labeling each image sample of each event type corresponding to each environment information sample to obtain a labeling label;

[0135] After obtaining the image samples of the multiple event types corresponding to each environment information sample, the electronic device labels each image sample of each event type corresponding to each environment information sample to obtain a labeling label. In an embodiment, the labeling of each image sample can be performed on the event region, that is, the region in which the event occurs in the image sample is labeled as the labeling label.

[0136] S402, for the same event type corresponding to the same environment information sample, each image sample corresponding to the event type is input into the initial detection model corresponding to the event type to obtain a prediction result;

[0137] Further, for the same event type corresponding to the same environment information sample, each image sample corresponding to the event type can be input into the initial detection model corresponding to the event type to obtain a prediction result. In an embodiment, the initial detection model can perform event region prediction based on the image features of the image sample, and the predicted event region output as the prediction result.

[0138] S403, based on the difference between the labeling label corresponding to each image sample and the prediction result, adjusting the model parameters of the initial detection model corresponding to the event type corresponding to the image sample until the initial detection model converges, obtaining the event detection algorithm corresponding to the environment information sample and the event type corresponding to the image sample.

[0139] Further, the electronic device can adjust the model parameters of the initial detection model corresponding to the event type corresponding to each image sample based on the difference between the labeling label corresponding to each image sample and the prediction result until the initial model converges to obtain the event detection model corresponding to the event type. Gradient descent algorithm, stochastic gradient descent algorithm, etc. can be used to adjust the parameters of the initial detection model, which is not limited here.

[0140] For example, for the initial detection model corresponding to the vehicle congestion event type corresponding to the environment information sample a, each image sample collected in the environment condition corresponding to the environment information sample a can be input into the initial detection model, and then the difference between the vehicle congestion prediction region output by the initial detection model and the labeled vehicle congestion region is used to adjust the parameters of the initial detection model until the initial detection model converges, that is, the detection model for detecting the vehicle congestion event in the environment condition corresponding to the environment information sample a can be obtained.

[0141] It can be seen that in the present embodiment, the electronic device can calibrate each image sample of each event type corresponding to each environment information sample to obtain a calibration label, and then for the same event type corresponding to the same environment information sample, input each image sample corresponding to the event type into the initial detection model corresponding to the event type to obtain a prediction result, and then based on the difference between the calibration label corresponding to each image sample and the prediction result, adjust the model parameters of the initial detection model corresponding to the event type of the image sample until the initial detection model converges, to obtain the event detection algorithm corresponding to the environment information sample and the event type of the image sample. In this way, the electronic device can train to obtain a plurality of event detection algorithms corresponding to each environment information sample, so as to subsequently select a target event detection method suitable for target environment information based on the target environment information to process the to-be-detected image, reduce the influence of environmental factors on event detection, and thus improve the accuracy of event detection.

[0142] As an embodiment of the present application, as shown in Figure 5 The step of training the plurality of event detection algorithms corresponding to each environment information sample using the image samples of the plurality of event types corresponding to each environment information sample and the initial detection model of each event type can further include:

[0143] S501, for each image sample of each event type corresponding to each environment information sample, auxiliary information is labeled according to an initial labeling rule to obtain auxiliary information;

[0144] Since the related auxiliary information in the to-be-detected image can be used for event detection when performing event detection, during the training of the event detection algorithm corresponding to each environment information sample, for each image sample, the electronic device can label the auxiliary information in the image sample based on the current labeling rule, and perform traffic event detection on the image sample based on the auxiliary information to obtain a detection result. Furthermore, the labeling rule corresponding to the environment information sample is adjusted according to the accuracy of the detection result to obtain a labeling rule more suitable for the environment scene corresponding to the environment information sample.

[0145] For example, the environment information sample 1 is asphalt pavement-icing-weak light-500 meters-ascending, the traffic image sample 1 corresponding to the environment information sample 1 is a rear-end collision event occurring at an intersection, the current calibration rule is calibration rule 1, and the electronic device can calibrate auxiliary information 1 in the traffic image sample 1 based on the calibration rule 1. Based on the auxiliary information 1, the traffic image sample 1 is subjected to traffic event detection to obtain a detection result 1, the detection result 1 is compared with the rear-end collision event to obtain the accuracy of the detection result 1, and then the calibration rule corresponding to the environment information sample 1 is adjusted according to the accuracy of the detection result 1 to obtain a calibration rule 2. By analogy, the calibration rule is continuously adjusted to obtain a more accurate calibration rule.

[0146] Specifically, in the process of training the plurality of event detection algorithms corresponding to each environment information sample, for each image sample, the electronic device can calibrate auxiliary information for each image sample of each event type corresponding to each environment information sample according to an initial calibration rule. The initial calibration rule can be the auxiliary information required according to the actual event type and the manually preset calibration rule.

[0147] S502, for the same event type corresponding to the same environment information sample, after the initial detection model corresponding to the event type detects each image sample corresponding to the event type based on the auxiliary information to obtain a prediction result, the initial calibration rule is adjusted based on the prediction result until the initial detection model converges to obtain the calibration rule corresponding to the event type;

[0148] In the training process of the event detection model, for the same event type corresponding to the same environment information sample, the initial detection model corresponding to the event type can detect each image sample corresponding to the event type based on the auxiliary information to obtain a prediction result. Since the prediction result is obtained based on the auxiliary information, the accuracy of the auxiliary information is also reflected, and the accuracy of the initial calibration rule is also reflected. Further, the electronic device can adjust the initial calibration rule based on the prediction result until the initial detection model converges to obtain the calibration rule corresponding to the event type, and a calibration rule more suitable for the environment scene corresponding to the environment information sample corresponding to the image sample can be obtained.

[0149] For example, the environment information sample 2 is asphalt pavement-icing-strong light-800 meters-right dress, the traffic image sample 2 corresponding to the environment information sample 2 includes the event of vehicle pressing the line, and the initial labeling rule is to label the lane line. Therefore, the electronic device can label the traffic image sample 2 according to the initial labeling rule to obtain auxiliary information. Further, in the training process of the event detection model, the initial detection model corresponding to the event type can detect the traffic image sample 2 based on the auxiliary information to obtain a prediction result. Further, the initial labeling rule can be adjusted based on the accuracy of the prediction result of the traffic image sample 2, for example, the length, width, etc. of the labeled lane line can be adjusted. In this way, with the iteration of the traffic image sample, the initial labeling rule can be continuously adjusted until the labeling rule that can accurately label the lane line under the condition of the environment information of asphalt pavement, icing, strong light, visibility of 800 meters, and the right dress of the image acquisition device is obtained.

[0150] In S503, for each environment information sample, the electronic device records the correspondence between the event detection algorithm and the labeling rule of each event type corresponding to the environment information sample, and generates a labeling rule package corresponding to the environment information sample.

[0151] The electronic device can record the correspondence between the event detection algorithm and the labeling rule of each event type corresponding to the environment information sample for each environment information sample, so as to subsequently select the target labeling rule corresponding to the target event detection algorithm based on the target event detection algorithm, thereby realizing event detection on the to-be-detected image, and the electronic device generates a labeling rule package corresponding to the environment information sample, and the labeling rule package includes a plurality of labeling rules, so as to be loaded and used by the server or the front-end camera.

[0152] For example, after the electronic device obtains the labeling rule 1 corresponding to the traffic type 1 in the environment information sample 3 and the traffic event detection algorithm 1, the electronic device can record the correspondence as environment information sample 1-traffic event detection algorithm 1-labeling rule 1.

[0153] As an implementation manner, the electronic device can further establish an event detection algorithm package-labeling rule package-environment information correspondence set, which can be used by the electronic device to select one or more target event detection algorithms suitable for the target environment information from the event detection algorithm package according to the target environment information after obtaining the target environment information, and further select the target labeling rule corresponding to the target event detection algorithm from the labeling rule package.

[0154] In an embodiment, the electronic device records the corresponding relationship between the environment information corresponding to each environment information sample, the corresponding event detection method thereof, and the corresponding calibration rule thereof in a table, and thus obtains a corresponding relationship mapping table of environment information-event detection method-calibration rule, which is convenient for subsequent event detection.

[0155] For example, the event detection is traffic event detection, and the corresponding relationship mapping table of environment information-traffic event detection algorithm-calibration rule can be shown in the following table:

[0156]

[0157]

[0158] It can be seen that in the embodiment, the electronic device can perform auxiliary information calibration on each image sample of each event type corresponding to each environment information sample according to the initial calibration rule to obtain auxiliary information. For the same event type corresponding to the same environment information sample, after the initial detection model corresponding to the event type detects each image sample corresponding to the event type based on the auxiliary information to obtain a prediction result, the initial calibration rule is adjusted based on the prediction result until the initial detection model converges to obtain the calibration rule corresponding to the event type. The corresponding relationship between the event detection algorithm and the calibration rule of each event type corresponding to each environment information sample is recorded, and the calibration rule corresponding to the environment information sample is generated into a calibration rule package. In this way, after the electronic device obtains the calibration rule package, it is convenient for subsequent event detection, and the efficiency of event detection is ensured.

[0159] Next, taking traffic event detection as an example, a whole flow of the event detection method provided by the embodiment of the application is exemplarily introduced.

[0160] Step 1: obtaining traffic image samples of multiple event types corresponding to each environment information sample in multiple environment information samples and multiple initial detection models;

[0161] The environment information sample can be a parameter value representing different environment information, which can specifically include: a parameter value representing road surface material information, such as parameter values representing road surface material information of land, cement, and asphalt; a parameter value representing road surface condition information, such as parameter values representing road surface condition information of icing, water accumulation, dryness, snow accumulation, and wetness; a parameter value representing illumination information, such as parameter values representing illumination information of strong light, normal light, and weak light; a parameter value representing visibility information, such as parameter values representing visibility information of 50 m, 100 m, 200 m, 500 m, 1000 m, and 3000 m; a parameter value representing installation angle information of an image collection device for collecting traffic image samples, such as parameter values representing angle information of front installation, left side installation, and right side installation; and the like. The number of accumulated environment information samples needs to meet the requirements of traffic event detection mode training.

[0162] Step 2: Using the image samples of multiple event types corresponding to each environment information sample and the initial detection model of each event type, training multiple event detection algorithms corresponding to each environment information sample is performed respectively to obtain traffic event detection algorithm packages and calibration rule packages under different environment conditions.

[0163] Each traffic event detection algorithm can correspond to a calibration rule, or can have no calibration rule. Each traffic event detection algorithm can be implemented through a traffic event detection model. The traffic event detection algorithm package includes multiple traffic event detection algorithms, and each traffic event detection algorithm corresponds to a traffic event detection model.

[0164] Step 3: Establishing a traffic event detection algorithm-environment information correspondence relationship;

[0165] For example, the traffic event detection mode includes a traffic event detection algorithm 1, and the correspondence relationship of cement road surface-dryness-strong light-3000 meters-front installation-traffic event detection algorithm 1 can be established.

[0166] Step 4: Loading the traffic event detection algorithm-calibration rule package-environment information correspondence relationship and the traffic event detection algorithm package into an electronic device.

[0167] The electronic device can be a front-end camera or an edge server, so the traffic event detection algorithm-calibration rule package-environment information correspondence relationship and the traffic event detection algorithm package can be loaded into the front-end camera or the edge server.

[0168] Step 5: Connecting an environment detection device, such as a road surface condition detector, a visibility detector, and an illumination intensity detector, to the electronic device to transmit environment information to the electronic device in real time.

[0169] Step 6: The collected traffic video of the image acquisition device is accessed to the electronic device, and the electronic device acquires the installation angle information in the configuration item of the image acquisition device;

[0170] That is, the installation angle information of the image acquisition device collecting the image to be detected is acquired. Since the image acquisition device is pre-installed, the installation information of the image acquisition device is stored in the configuration item thereof, and thus the electronic device can acquire the installation angle information from the configuration item of the image acquisition device.

[0171] Step 7: The electronic device selects a target traffic event detection algorithm adapted to the current environmental information and installation angle information from the traffic event detection algorithm-calibration rule package-environment information correspondence relationship according to the acquired environmental information and installation angle information, selects a target calibration rule corresponding to the target event detection algorithm, and detects each frame image in the traffic video based on the target traffic event detection algorithm and the target calibration rule corresponding thereto, thereby achieving traffic event detection in different meteorological environmental conditions.

[0172] It can be seen that, in the embodiment, the traffic event detection algorithm-calibration rule package-environment information correspondence relationship is obtained by training the traffic event detection method, and then the target traffic event detection algorithm adapted to the current environmental information and installation angle information is selected from the traffic event detection algorithm-calibration rule package-environment information correspondence relationship based on the environmental information and installation angle information, and the target calibration rule corresponding to the target event detection algorithm is selected. Each frame image in the traffic video is detected based on the target traffic event detection algorithm and the target calibration rule corresponding thereto. Since different target environmental information is collected when the image to be detected is collected, the target traffic event detection algorithm suitable for the target environmental information can be selected based on the pre-established correspondence relationship between the environmental information and the traffic event detection algorithm to process the image to be detected. The influence of environmental factors on traffic event detection is reduced, the accuracy of traffic event detection is improved, and compared with the target traffic event detection method, the optimization of traffic event detection in different meteorological environmental conditions is achieved.

[0173] Corresponding to the above-mentioned event detection method, the embodiment of the present application also provides an event detection device, and the event detection device provided by the embodiment of the present application will be introduced below.

[0174] As shown in Figure 6 , an event detection device can include:

[0175] The acquisition module 610 is configured to acquire an image to be detected and target environmental information when the image to be detected is collected.

[0176] The determining module 620 is configured to determine a target event detection manner based on the target environment information and a pre-established correspondence between environment information and event detection manners.

[0177] The detecting module 630 is configured to perform event detection on the to-be-detected image based on the target event detection manner, to obtain an event detection result.

[0178] It can be seen that, in the scheme provided by the embodiments of the present application, the electronic device can acquire a to-be-detected image and target environment information when the to-be-detected image is collected, determine a target event detection manner based on the target environment information and a pre-established correspondence between environment information and event detection manners, perform event detection on the to-be-detected image based on the target event detection manner, and obtain an event detection result. Through the above scheme, the electronic device can select a target event detection manner suitable for the target environment information based on the pre-established correspondence between environment information and event detection manners, to process the to-be-detected image, reduce the influence of environmental factors on event detection, and further improve the accuracy of event detection.

[0179] As an implementation manner of the embodiments of the present application, the target environment information can include at least one of the following:

[0180] installation angle information of an image acquisition device used to collect the to-be-detected image, road surface information, and weather information;

[0181] As an implementation manner of the embodiments of the present application, the target event detection manner can include one or more target event detection algorithms, and each target event detection algorithm corresponds to an event type.

[0182] As shown in FIG. 7, the detecting module 630 can include: Figure 7

[0183] The determining unit 710 is configured to determine a target calibration rule corresponding to each target event detection algorithm from a pre-established calibration rule package based on the target event detection algorithm.

[0184] The calibration rule package includes pre-determined calibration rules corresponding to each event detection algorithm.

[0185] The calibration unit 720 is configured to calibrate the to-be-detected image according to the target calibration rule, to obtain calibration information.

[0186] The target calibration rule is used to indicate a calibration manner of auxiliary information required for event detection in the to-be-detected image by using the target event detection algorithm.

[0187] ​The detection unit 730 is configured to detect events in the image to be detected by using each target event detection algorithm and the corresponding calibration information.

[0188] In an embodiment of the present application, the correspondence between the environmental information and the event detection method is pre-established by an establishing module, which can include:

[0189] The acquisition unit is configured to acquire image samples of multiple event types corresponding to each environmental information sample in multiple environmental information samples.

[0190] The training unit is configured to train multiple event detection algorithms corresponding to each environmental information sample by using the image samples of multiple event types corresponding to each environmental information sample and the initial detection model of each event type.

[0191] Each event detection algorithm corresponds to one event type.

[0192] The recording unit is configured to record the environmental information corresponding to each environmental information sample and the event detection algorithm corresponding to each event type corresponding to the environmental information, to obtain the correspondence between the environmental information and the event detection method.

[0193] In an embodiment of the present application, the training unit can include:

[0194] The first calibration sub-unit is configured to calibrate each image sample of each event type corresponding to each environmental information sample to obtain a calibration label.

[0195] The prediction sub-unit is configured to input each image sample corresponding to the same event type to the initial detection model corresponding to the event type to obtain a prediction result.

[0196] The first adjustment sub-unit is configured to adjust the model parameters of the initial detection model corresponding to the event type corresponding to each image sample based on the difference between the calibration label corresponding to the image sample and the prediction result, until the initial detection model converges, to obtain the event detection algorithm corresponding to the environmental information sample and the event type corresponding to the image sample.

[0197] In an embodiment of the present application, the training unit can further include:

[0198] The second calibration unit is configured to calibrate each image sample of each event type corresponding to each environmental information sample according to an initial calibration rule to obtain auxiliary information.

[0199] The second adjustment sub-unit is configured to, for the same event type corresponding to the same environment information sample, adjust the initial calibration rule based on a prediction result obtained by the initial detection model corresponding to the event type based on the auxiliary information after the initial detection model corresponding to the event type detects each image sample corresponding to the event type to obtain the prediction result, until the initial detection model converges, to obtain the calibration rule corresponding to the event type.

[0200] The recording sub-unit is configured to record, for each environment information sample, a corresponding relationship between the event detection algorithm of each event type corresponding to the environment information sample and the calibration rule, and generate a calibration rule package corresponding to the environment information sample.

[0201] The embodiment of the present application further provides an electronic device, as shown in the figure, comprising a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802 and the memory 803 complete mutual communication through the communication bus 804, Figure 8

[0202] The memory 803 is configured to store a computer program.

[0203] The processor 801 is configured to execute the program stored in the memory 803, and implement the event detection method steps of any of the above-mentioned embodiments.

[0204] It can be seen that, in the scheme provided by the embodiment of the present application, the electronic device can acquire a to-be-detected image and target environment information when the to-be-detected image is collected, determine a target event detection method based on the target environment information and a pre-established corresponding relationship between environment information and event detection methods, perform event detection on the to-be-detected image based on the target event detection method, and obtain an event detection result. Through the above scheme, the electronic device can select a target event detection method suitable for the target environment information to process the to-be-detected image based on the pre-established corresponding relationship between environment information and event detection methods, reduce the influence of environmental factors on event detection, and further improve the accuracy of event detection.

[0205] The communication bus mentioned above can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0206] ​The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0207] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0208] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0209] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the steps of any of the above-described event detection methods.

[0210] Corresponding to the above-mentioned event detection method, this invention also provides an event detection system, which is described below.

[0211] like Figure 9 As shown, an event detection system 910 may include an electronic device 901, an image acquisition device 903, and an environmental detection device 902, wherein:

[0212] The environmental detection device 902 is used to detect the target environmental information when acquiring the image to be detected, and send the target environmental information to the electronic device 901;

[0213] The image acquisition device 903 is used to acquire the image to be detected and send it to the electronic device 901 so that the electronic device 901 executes the event detection method described in any of the above embodiments.

[0214] It can be seen that in the scheme provided by the embodiment of the application, the image acquisition device can acquire the to-be-detected image and send it to the electronic device, the environment detection device can detect the target environment information when the to-be-detected image is acquired and send the target environment information to the electronic device, the electronic device can acquire the to-be-detected image and the target environment information when the to-be-detected image is acquired, determine the target event detection mode based on the target environment information and the pre-established correspondence between the environment information and the event detection mode, and perform event detection on the to-be-detected image based on the target event detection mode to obtain an event detection result. Through the above scheme, the image acquisition device can acquire the to-be-detected image, the environment detection device can provide real-time environment information, and the electronic device can select a target event detection mode suitable for the target environment information based on the pre-established correspondence between the environment information and the event detection mode to process the to-be-detected image, thereby reducing the influence of environmental factors on event detection. In turn, the accuracy, universality and stability of the event detection system are improved.

[0215] As an embodiment of the embodiment of the application, the above environment detection device can include at least one of the following:

[0216] a road surface condition detector for detecting road surface condition information when the to-be-detected image is acquired and sending the road surface condition information to the electronic device;

[0217] The road surface condition detector uses laser remote sensing technology, can be installed on a column on the roadside, and can accurately measure the thickness of water, ice and snow on the road surface through the back reflection intensity and the spectrum measurement principle, so that the road surface condition detector can accurately acquire the road surface condition information, and the road surface condition information is then sent to the electronic device.

[0218] a visibility detector for detecting visibility information of the environment when the to-be-detected image is acquired and sending the visibility information to the electronic device;

[0219] The visibility detector includes a perspective type and a scattering type. The perspective type visibility detector can determine the visibility distance through the atmospheric transmittance or the extinction coefficient. The scattering type visibility detector can determine the visibility distance by measuring the intensity of scattered light caused by gas molecules, aerosol particles, fog droplets, etc. in a certain volume of air, and the visibility detector can then send the visibility information to the electronic device.

[0220] a light intensity detector for detecting the ambient light intensity when the to-be-detected image is acquired as illumination information and sending the illumination information to the electronic device.

[0221] The light intensity detector is internally provided with a sensor, and the sensor is based on the hot spot effect principle. When the visible light passing through the filter irradiates the photosensitive diode, the photosensitive diode converts into an electrical signal according to the visible light intensity, and then the electrical signal enters the processor system of the sensor, so as to output the binary signal required to be obtained, that is, the light intensity is obtained, and then the light intensity detector can send the light information to the electronic device.

[0222] As an implementation manner of the embodiment of the present application, the pre-established environment information and the corresponding relationship between the event detection manner and the calibration rule package can be stored in the electronic device, and then the electronic device can process the to-be-detected image after receiving the to-be-detected image, so as to realize event detection.

[0223] In another embodiment provided by the present application, a computer program product including instructions is provided, which, when executed on a computer, causes the computer to perform any of the traffic event detection methods in the above embodiments.

[0224] In the above embodiments, the implementation can be achieved by software, hardware, firmware or any combination thereof, in whole or in part. When implemented by software, the implementation can be in the form of a computer program product, in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the flow or function described in the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, solid state disk (SSD)) and the like.

[0225] It is to be noted that, in the present text, terms such as first and second, and the like, merely mean one entity or action is distinguished from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element. The term "plurality" means two or more.

[0226] Each of the embodiments in the present specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the apparatus, system, electronic device, computer-readable storage medium, and computer program product, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.

[0227] The above only describes the preferred embodiments of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An event detection method, characterized by, The method comprises: acquiring a to-be-detected image and target environment information when the to-be-detected image is collected, wherein the target environment information comprises at least one of installation angle information of an image collection device for collecting the to-be-detected image and road surface information; determining a target event detection mode based on the target environment information and a pre-established correspondence between environment information and event detection modes, wherein the target event detection mode comprises a plurality of target event detection algorithms, and each target event detection algorithm corresponds to an event type; determining a target calibration rule corresponding to each target event detection algorithm from a pre-established calibration rule package, wherein the calibration rule package comprises pre-determined calibration rules corresponding to each event detection algorithm; calibrating the to-be-detected image according to the target calibration rule to obtain calibration information, wherein the target calibration rule is used to indicate a calibration mode of auxiliary information required for event detection in the to-be-detected image by using the target event detection algorithm; and performing event detection on the to-be-detected image by using each target event detection algorithm and the calibration information corresponding thereto. The generation mode of the calibration rule comprises: calibrating auxiliary information for each image sample of each event type corresponding to each environment information sample according to an initial calibration rule; and adjusting the initial calibration rule based on a prediction result obtained by an initial detection model corresponding to the event type after detecting each image sample corresponding to the event type based on the auxiliary information, until the initial detection model converges, to obtain a calibration rule corresponding to the event type.

2. The method of claim 1, wherein, The establishment mode of the correspondence between environment information and event detection modes comprises: acquiring image samples of a plurality of event types corresponding to each environment information sample in a plurality of environment information samples; training a plurality of event detection algorithms corresponding to each environment information sample by using the image samples of a plurality of event types corresponding to each environment information sample and an initial detection model of each event type, wherein each event detection algorithm corresponds to an event type; recording the environment information corresponding to each environment information sample and the event detection algorithms corresponding to each event type corresponding to the environment information, to obtain the correspondence between environment information and event detection modes.

3. The method of claim 2, wherein, The step of training a plurality of event detection algorithms corresponding to each environment information sample by using the image samples of a plurality of event types corresponding to each environment information sample and an initial detection model of each event type comprises: calibrating each image sample of each event type corresponding to each environment information sample to obtain a calibration label; inputting each image sample corresponding to the event type to an initial detection model corresponding to the event type to obtain a prediction result. The model parameters of the initial detection model corresponding to the event type corresponding to the image sample are adjusted based on the difference between the calibration label corresponding to each image sample and the prediction result until the initial detection model converges, so as to obtain the event detection algorithm corresponding to the environment information sample and the event type corresponding to the image sample.

4. The method of claim 1, wherein, The generation manner of the calibration rule package comprises: For each environment information sample, the correspondence between the event detection algorithm of each event type corresponding to the environment information sample and the calibration rule is recorded, and the calibration rule corresponding to the environment information sample is generated into a calibration rule package.

5. An event detection apparatus characterized by comprising: The device comprises: An acquisition module is configured to acquire a to-be-detected image and target environment information when the to-be-detected image is collected, wherein the target environment information comprises at least one of the following: installation angle information of an image collection device used to collect the to-be-detected image, road surface information; A determination module is configured to determine a target event detection manner based on the target environment information and a pre-established correspondence between environment information and event detection manners, wherein the target event detection manner comprises a plurality of target event detection algorithms, and each target event detection algorithm corresponds to an event type. A detection module is configured to determine a target calibration rule corresponding to each target event detection algorithm from a pre-established calibration rule package based on each target event detection algorithm, wherein the calibration rule package comprises pre-determined calibration rules corresponding to each event detection algorithm; calibrate the to-be-detected image according to the target calibration rule to obtain calibration information, wherein the target calibration rule is used to indicate a calibration manner of auxiliary information required for event detection in the to-be-detected image by using the target event detection algorithm; and perform event detection on the to-be-detected image by using each target event detection algorithm and the calibration information corresponding thereto. The generation manner of the calibration rule comprises: For each image sample corresponding to each event type of each environment information sample, auxiliary information is obtained by calibrating the auxiliary information according to an initial calibration rule; for the same event type corresponding to the same environment information sample, after an initial detection model corresponding to the event type detects each image sample corresponding to the event type based on the auxiliary information to obtain a prediction result, the initial calibration rule is adjusted based on the prediction result until the initial detection model converges, so as to obtain the calibration rule corresponding to the event type.

6. The apparatus of claim 5, wherein, The correspondence between the environment information and the traffic event detection manner is pre-established by an establishing module, and the establishing module comprises: An acquisition unit is configured to acquire image samples of a plurality of event types corresponding to each environment information sample in a plurality of environment information samples; A training unit is configured to train a plurality of event detection algorithms corresponding to each environment information sample by using the image samples of a plurality of event types corresponding to each environment information sample and an initial detection model of each event type, wherein each event detection algorithm corresponds to an event type. A recording unit is configured to record the environment information corresponding to each environment information sample and the event detection algorithm corresponding to each event type corresponding to the environment information, to obtain a corresponding relationship between the environment information and the event detection method. The training unit comprises: A first calibration subunit is configured to calibrate each image sample of each event type corresponding to each environment information sample, to obtain a calibration label; A prediction subunit is configured to input each image sample corresponding to an event type to an initial detection model corresponding to the event type, to obtain a prediction result; A first adjustment subunit is configured to adjust the model parameter of the initial detection model corresponding to the event type corresponding to each image sample based on the difference between the calibration label corresponding to the image sample and the prediction result, until the initial detection model converges, to obtain the event detection algorithm corresponding to the environment information sample and the event type corresponding to the image sample. The generation manner of the calibration rule package comprises: For each environment information sample, a corresponding relationship between the event detection algorithm of each event type corresponding to the environment information sample and the calibration rule is recorded, and the calibration rule corresponding to the environment information sample is generated as a calibration rule package.

7. An electronic device, comprising: The system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are in communication with each other through the communication bus; The memory is configured to store a computer program; The processor is configured to execute the program stored in the memory, to implement the method steps of any one of claims 1-4.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-4.

9. An event detection system characterized by, The system comprises the electronic device, the image acquisition device and the environment detection device according to claim 7, wherein: The environment detection device is configured to detect target environment information when the image to be detected is acquired, and send the target environment information to the electronic device; The image acquisition device is configured to acquire the image to be detected, and send the image to be detected to the electronic device.

Citation Information

Patent Citations

  • Illegal stall detection method and device

    CN110659546A

  • Management warehouse for scheduling intelligent analysis algorithm in complex scene, and scheduling method

    CN111126895A

  • Target detection method, device and equipment and storage medium

    CN112149476A