Personnel gathering event detection method and device, electronic equipment and storage medium

By performing slow-distance object detection and analysis of the area to be determined on the target image sequence, combined with the survival time of the area where the personnel gathering is occupied, the problem of low accuracy of personnel gathering detection in the prior art is solved, and higher detection accuracy and reliability.

CN119445466APending Publication Date: 2025-02-14SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411310780.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The existing machine vision-based personnel gathering detection has the problem of low accuracy, especially when dealing with mobile personnel and blocked human bodies, it is easy to generate false alarms.

Method used

By performing slow-moving target detection on the target image sequence, the slow-moving target and its corresponding areas to be determined are determined, the effective number of slow-moving targets in the area to be determined and the total number of personnel is determined to determine the area of ​​gathering, and the area of ​​gathering is collected through the area of ​​gathering judging whether there is a gathering incident.

Benefits of technology

It improves the accuracy of personnel gathering detection, reduces the impact of human beings being blocked in a short period of time, and enhances the reliability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445466A_ABST
    Figure CN119445466A_ABST
Patent Text Reader

Abstract

The invention provides a method for detecting a personnel gathering event, and the method comprises the steps: carrying out the slow-moving target detection of a target image sequence, and obtaining at least one slow-moving target; in the target image sequence, at least one to-be-determined area is determined with the slow moving target as the center, and the to-be-determined area is in one-to-one correspondence with the slow moving target; determining a personnel gathering area in at least one to-be-determined area based on the total number of personnel in the to-be-determined area and the effective number of the slow-moving targets; and determining whether a personnel gathering event exists based on the survival time of the personnel gathering area. According to the method, whether the personnel gathering event exists is determined through the survival time of the personnel gathering area, and the judgment of the personnel gathering area is dynamic judgment with time span, so that the influence degree of shielding of a human body in a short time is reduced, and the personnel gathering detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a method, device, electronic device and storage medium for detecting a gathering of people event. Background Art

[0002] There are usually two traditional ways to detect crowd gatherings. One is to manually check real-time video to determine whether there are crowds. Although this method has a high readiness rate, it is extremely inefficient and labor-intensive, and is only suitable for scenes with a small number of cameras. The other method is to periodically perform human body detection on images based on machine vision, and calculate the number and area of ​​people in the image to determine whether a crowd has occurred. Although this method uses few resources and is efficient, it only processes static image information, and will also count normal passing mobile people, and will not count obscured people, which will result in a large number of false alarms. Therefore, the existing crowd gathering detection based on machine vision has the problem of low accuracy. Summary of the invention

[0003] The embodiment of the present invention provides a method for detecting crowd gathering events, aiming to solve the problem of low accuracy of existing crowd gathering detection based on machine vision. Slow-moving target detection is performed on a target image sequence to detect slow-moving targets and the area to be determined corresponding to the slow-moving targets. The crowd gathering area is determined by using the effective number of slow-moving targets and the total number of people in the area to be determined. Whether there is a crowd gathering event is determined by the survival time of the crowd gathering area. Since the determination of the crowd gathering area is a dynamic determination with a time span, the influence of short-term human body occlusion is reduced, thereby improving the accuracy of crowd gathering detection.

[0004] In a first aspect, an embodiment of the present invention provides a method for detecting a gathering of people event, the method comprising the following steps:

[0005] Performing slow-moving target detection on the target image sequence to obtain at least one slow-moving target, wherein the moving speed of the slow-moving target is less than a preset moving speed threshold or the moving distance of the slow-moving target is less than a preset moving distance threshold;

[0006] In the target image sequence, at least one to-be-confirmed area is determined with the slow-moving target as the center, and the to-be-confirmed area corresponds to the slow-moving target one by one;

[0007] Based on the total number of people in the to-be-determined area and the effective number of the slow-moving targets, determining a people gathering area in at least one of the to-be-determined areas;

[0008] Based on the survival time of the personnel gathering area, determine whether there is a personnel gathering event.

[0009] Optionally, the performing slow-moving target detection on the target image sequence to obtain at least one slow-moving target includes:

[0010] Obtain target image sequence;

[0011] Performing target detection and tracking processing on the target image sequence according to a preset output period to obtain at least one human target and at least one motion track within the output period, wherein the human target corresponds to the motion track in a one-to-one manner;

[0012] Based on the motion trajectory, determining a motion speed of the human target within the output period, or a motion distance of the human target within the output period;

[0013] The human target whose movement speed is less than the movement speed threshold is determined as a slow-moving target, or the human target whose movement distance is less than the movement distance threshold is determined as a slow-moving target.

[0014] Optionally, determining at least one area to be confirmed in the target image sequence with the slow-moving target as the center includes:

[0015] Determining a target image in the target image sequence, the target image including a first target frame corresponding to a current slow-moving target and a second target frame corresponding to a person to be confirmed, the current slow-moving target being one of the slow-moving targets, and the person to be confirmed being other persons in the target image other than the current slow-moving target;

[0016] Taking the first target frame as the center, determining the second target frame having a connectivity relationship with the first target frame as a third target frame, wherein the connectivity relationship is that a direct area intersection-and-union ratio or an indirect area intersection-and-union ratio with the first target frame is greater than a preset intersection-and-union ratio threshold;

[0017] The first target frame and the third target frame are merged to obtain a region to be determined, and the region to be determined corresponds one-to-one to the current slow-moving target.

[0018] Optionally, the determining of a personnel gathering area in at least one of the to-be-determined areas based on the total number of personnel in the to-be-determined areas and the effective number of the slow-moving targets includes:

[0019] Determine the total number of people in the to-be-determined area and the effective number of the slow-moving targets;

[0020] If the total number of personnel is greater than or equal to a preset first number threshold, and the number of slow-moving targets is greater than or equal to a preset second number threshold, determining that the area to be determined is a determined area;

[0021] In at least one of the determined areas, the personnel gathering area is determined.

[0022] Optionally, determining the total number of people in the to-be-determined area includes:

[0023] Performing head detection on the image in the to-be-determined area to obtain a head detection frame;

[0024] Matching the head detection frame with the first target frame or the second target frame in the to-be-determined area respectively, and determining an additional head detection frame, where the additional head detection frame is the unsuccessful head detection frame between the first target frame and the second target frame;

[0025] Based on the number of the first target frames, the number of the second target frames, and the number of the additional head detection frames, the total number of people in the to-be-determined area is determined.

[0026] Optionally, the determining the effective number of the slow-moving targets in the to-be-determined area includes:

[0027] Obtaining a target timestamp corresponding to the target image;

[0028] The number of the slow-moving targets having the target timestamp is determined as the effective number of the slow-moving targets.

[0029] Optionally, determining the personnel gathering area in at least one of the determined areas includes:

[0030] Acquire a gathering area set, wherein the gathering area set includes historical gathering areas;

[0031] The historical gathering area in the gathering area set is updated by using the determined area to obtain the updated gathering area set;

[0032] In the updated gathering area set, the personnel gathering area is determined.

[0033] Optionally, the determining whether there is a gathering event of people based on the survival time of the gathering area of ​​people includes:

[0034] Determine the time length of each sequence of the personnel gathering areas;

[0035] If the time length is greater than or equal to a preset time length threshold, it is determined that the personnel gathering event exists in the personnel gathering area;

[0036] If the time length is less than a preset time length threshold, it is determined that the personnel gathering event does not exist in the personnel gathering area.

[0037] In a second aspect, an embodiment of the present invention further provides a device for detecting a gathering of people event, the device for detecting a gathering of people event comprising:

[0038] A detection module, configured to perform slow-moving target detection on a target image sequence to obtain at least one slow-moving target, wherein the moving speed of the slow-moving target is less than a preset moving speed threshold or the moving distance of the slow-moving target is less than a preset moving distance threshold;

[0039] A first processing module is used to determine at least one to-be-confirmed area in the target image sequence with the slow-moving target as the center, wherein the to-be-confirmed area corresponds to the slow-moving target one by one;

[0040] A second processing module is used to determine a personnel gathering area in at least one of the to-be-determined areas based on the total number of personnel in the to-be-determined areas and the effective number of the slow-moving targets;

[0041] The third processing module is used to determine whether there is a gathering of people event based on the survival time of the gathering area of ​​the people.

[0042] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the method for detecting a gathering of people event provided in an embodiment of the present invention when executing the computer program.

[0043] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method for detecting a gathering of people event provided in an embodiment of the invention are implemented.

[0044] In an embodiment of the present invention, a slow-moving target detection is performed on a target image sequence to obtain at least one slow-moving target, the moving speed of the slow-moving target is less than a preset moving speed threshold or the moving distance is less than a preset moving distance threshold; in the target image sequence, at least one area to be confirmed is determined with the slow-moving target as the center, and the area to be confirmed corresponds to the slow-moving target one by one; based on the total number of people in the area to be confirmed and the effective number of slow-moving targets, a gathering area of ​​people is determined in at least one area to be confirmed; based on the survival time of the gathering area of ​​people, it is determined whether there is a gathering event of people. By performing slow-moving target detection on a target image sequence, a slow-moving target and the area to be confirmed corresponding to the slow-moving target are detected, the gathering area of ​​people is determined by using the effective number of slow-moving targets in the area to be confirmed and the total number of people, and the survival time of the gathering area of ​​people is used to determine whether there is a gathering event of people. Since the determination of the gathering area of ​​people is a dynamic determination with a time span, the influence of human body occlusion in a short time is reduced, and the accuracy of the detection of the gathering of people is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 is a flow chart of a method for detecting a gathering of people event provided by an embodiment of the present invention;

[0047] Figure 2 is a schematic diagram of a target frame expansion provided by an embodiment of the present invention;

[0048] Figure 3 is a schematic diagram of target frame merging provided by an embodiment of the present invention;

[0049] Figure 4 is a schematic diagram of a result after a target frame is merged provided by an embodiment of the present invention;

[0050] Figure 5 It is a structural schematic diagram of a detection device for a gathering of people event provided by an embodiment of the present invention;

[0051] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] like Figure 1 As shown, Figure 1 1 is a flow chart of a method for detecting a gathering of people event provided by an embodiment of the present invention, the method for detecting a gathering of people event comprising the steps of:

[0054] 101. Perform slow-moving target detection on a target image sequence to obtain at least one slow-moving target.

[0055] In an embodiment of the present invention, the above-mentioned method for detecting crowd gathering events can be applied to an event detection platform, and the above-mentioned event detection platform can be constructed based on a server or a distributed server, and the above-mentioned event detection platform includes an image device interface and a detection program for crowd gathering events. The above-mentioned image device interface can be used to obtain image data collected by the image device, and the above-mentioned image data can be continuous frame images or video stream data. The detection program for crowd gathering events can be used to implement each step of the detection method for crowd gathering events. The above-mentioned image device can be deployed in various areas where crowd gathering event detection is required, such as parks, industrial parks, government buildings, commercial centers and other areas.

[0056] The target image sequence is a continuous image or video frame captured by an image device. In a possible embodiment, if multiple adjacent areas that need to detect gatherings of people are stored, the target image sequence can be obtained by splicing images or video frames captured by multiple image devices.

[0057] In the above target image sequence, each frame image has a corresponding time stamp, and the time stamp is used to indicate the acquisition time of the corresponding frame image.

[0058] The above-mentioned slow-moving target detection can be to first perform human target detection on each frame of the target image sequence, obtain the human target frame in each frame, match the human target frames between different frames, use the successfully matched human target frame as the human target frame of the same person, and arrange the positions of the human target frames of the same person in time sequence, so as to obtain the position information of the person in the current detection cycle, and determine the movement speed of the person based on the position information and the time length of the current detection cycle (or the time length of the person appearing in the target image sequence). Then, it can be determined whether the person is a slow-moving target based on the person and the preset movement speed threshold, and the movement speed of the slow-moving target is less than the preset movement speed threshold.

[0059] The above-mentioned slow-moving target can also be called a slow-moving person. Slow-moving target detection is a detection process of determining whether the person corresponding to the human target is a slow-moving person after detecting and tracking the human target. The above-mentioned slow-moving target can be one or more. In a possible embodiment, the above-mentioned slow-moving target is multiple, so that it can be more accurately determined whether there is a gathering of people event.

[0060] 102. In the target image sequence, at least one area to be confirmed is determined with the slow-moving target as the center.

[0061] In the embodiment of the present invention, the image sequence collected by the image device in the current detection cycle can be obtained through the image device interface, and the image sequence is the target image sequence.

[0062] When performing slow-moving target detection, all people in each frame of the image will be detected. Therefore, for each frame of the image, all human targets of the people in it can be obtained. After the slow-moving target is determined, the slow-moving target is used as the center to diffuse outward, and the human targets that directly or indirectly intersect with the slow-moving target are merged, and the merged area is determined as the area to be confirmed. The area to be confirmed corresponds to the slow-moving target one by one.

[0063] Specifically, when performing slow-moving target detection, all persons in each frame of the image will be detected, so for each frame of the image, the human target frames of all persons in the image can be obtained. After the slow-moving target is determined, for each frame of the image, the human target frame corresponding to the slow-moving target can be determined as the first target frame, and the human target frames of other persons can be determined as the second target frame.

[0064] Targets that are spatially associated with the slow-moving target are determined as associated targets, such as people within a certain range of the slow-moving person. More specifically, the associated targets of the slow-moving target in each frame of the image can be determined based on the connectivity relationship between the first target frame and the second target frame, that is, the second target frame of the associated target has a connectivity relationship with the first target frame of the corresponding slow-moving target. The above connectivity relationship can be direct connectivity and indirect connectivity. If two target frames have an intersecting part, it can be considered as a direct connection. If two target frames both have an intersecting part with one or more other target frames, it can be considered as an indirect connection.

[0065] 103. Based on the total number of people in the area to be determined and the effective number of slow-moving targets, determine a people gathering area in at least one area to be determined.

[0066] In the embodiment of the present invention, the number of the slow-moving target may be one or more. When there are multiple slow-moving targets, there are also multiple areas to be determined. When there is only one slow-moving target, there is also only one area to be determined.

[0067] The effective number of slow-moving targets is used to indicate that an effective number of slow-moving targets appear simultaneously in the area to be determined.

[0068] When there are multiple areas to be determined, the area to be determined with the largest total number of people can be determined as the people gathering area, or the area to be determined with the largest effective number can be determined as the people gathering area, or the area to be determined with the largest sum of the effective number and the total number of people can be determined as the people gathering area, or the area to be determined with the largest image area can be determined as the people gathering area.

[0069] After determining the effective number of slow-moving targets and the total number of people, if the effective number of slow-moving targets is large, it means that there are multiple people wandering in the area corresponding to the target image sequence. If the total number of people is large, it means that there are multiple people appearing around the slow-moving targets. The area to be determined can be determined as a gathering area for people. If the effective number of slow-moving targets is small, it means that there are not many people wandering in the area corresponding to the target image sequence. If the number of associated targets is small, it means that there are not multiple people appearing around the slow-moving targets. In this case, the area to be determined is not determined as a gathering area for people.

[0070] 104. Determine whether there is a gathering of people event based on the survival time of the gathering area.

[0071] In an embodiment of the present invention, after determining the area where people gather, the survival time of the area where people gather can be further determined. If the survival time is greater than or equal to a preset survival time threshold, it can be determined that there is a people gathering event. If the survival time is less than the preset survival time threshold, it can be determined that there is no people gathering event at present, and the area where people gather can be retained for subsequent determination of people gathering events.

[0072] In a possible embodiment, the above-mentioned personnel gathering area is the personnel gathering area of ​​the current detection cycle, and the personnel gathering area of ​​the historical detection cycle can be obtained, and the personnel gathering area of ​​the current detection cycle is matched with the personnel gathering area of ​​the historical detection cycle. If the match is successful, they can be spliced ​​into an overall personnel gathering area, and the survival time of the overall personnel gathering area is determined. If the survival time is greater than or equal to the preset survival time threshold, it can be determined that there is a personnel gathering event. If the survival time is less than the preset survival time threshold, it can be determined that there is no personnel gathering event at present.

[0073] In an embodiment of the present invention, a slow-moving target detection is performed on a target image sequence to obtain at least one slow-moving target, the moving speed of the slow-moving target is less than a preset moving speed threshold or the moving distance is less than a preset moving distance threshold; in the target image sequence, at least one area to be confirmed is determined with the slow-moving target as the center, and the area to be confirmed corresponds to the slow-moving target one by one; based on the total number of people in the area to be confirmed and the effective number of slow-moving targets, a gathering area of ​​people is determined in at least one area to be confirmed; based on the survival time of the gathering area of ​​people, it is determined whether there is a gathering event of people. By performing slow-moving target detection on a target image sequence, a slow-moving target and the area to be confirmed corresponding to the slow-moving target are detected, the gathering area of ​​people is determined by using the effective number of slow-moving targets in the area to be confirmed and the total number of people, and the survival time of the gathering area of ​​people is used to determine whether there is a gathering event of people. Since the determination of the gathering area of ​​people is a dynamic determination with a time span, the influence of human body occlusion in a short time is reduced, and the accuracy of the detection of the gathering of people is improved.

[0074] It is understandable that in the specific implementation of this application, video data, image data, personnel data and other related data are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data, as well as the training, deployment and calling of algorithm models, must comply with relevant laws, regulations and standards of relevant countries and regions.

[0075] Optionally, in the step of performing slow-moving target detection on a target image sequence to obtain at least one slow-moving target, a target image sequence can be obtained; target detection and tracking processing is performed on the target image sequence according to a preset output period to obtain at least one human target and at least one motion trajectory within the output period, and the human target corresponds to the motion trajectory one by one; based on the motion trajectory, the movement speed of the corresponding human target within the output period, or the movement distance of the human target within the output period is determined; a human target whose movement speed is less than a movement speed threshold is determined as a slow-moving target, or the human target whose movement distance is less than a movement distance threshold is determined as a slow-moving target.

[0076] In the embodiment of the present invention, the image sequence collected by the image device in the current detection cycle can be obtained through the image device interface, and the image sequence is the target image sequence.

[0077] After obtaining the target image sequence, the target image sequence can be subjected to target detection and tracking processing by a human target tracker to obtain at least one human target and at least one motion track. It is understandable that the number of human targets detected is related to the number of people appearing in the target image sequence. Considering occlusion and algorithm errors, in general, the number of human targets detected is less than or equal to the number of people appearing in the target image sequence.

[0078] The above-mentioned human target tracker can be a human target tracker based on a deep neural network, for example, a human target tracker based on the Lucas-Kanade optical flow target tracking algorithm or the YOLO-v7 target tracking algorithm. The optical flow tracking (Optical Flow Track) uses the Lucas-Kanade optical flow method based on the image pyramid to track the detection targets of continuous frames. In the process of human target detection and tracking, each target considered by the human target tracker to be the same target will have a system-wide unique id number, namely the target tracking number (Target Track id). That is, each person has a unique Track id. Arrange the positions of the targets with the same Track id in time to obtain the motion trajectory.

[0079] Specifically, the target image sequence is input into the human target tracker, which detects human targets every N frames of the input image in sequence. The optical flow tracking algorithm is used to track and record the motion trajectory of the human target. The motion position of the tracked target is judged every S seconds of the track output period (Track Output Period). If the motion distance is less than a certain threshold, the tracked target can be considered as a slow-moving target. At the same time, the tracking sequence number Track id of the current slow-moving target, the current output period batch, the target appearance time BeginTime and the last time LastTime of the slow-moving target information are packaged and output. The above-mentioned tracking output period is the time for how often the tracked target in the target image sequence (video) is output. The above-mentioned tracking target is a human target, and N and S are both values ​​greater than 0, where N is an integer, such as 10, and S can be an integer or a decimal, such as 5.

[0080] By performing target detection and tracking processing on the target image sequence, the slow-moving target can be determined more accurately. After the slow-moving target is determined, the current slow-moving target information can be stored in a slow-moving target set. The slow-moving target information can include the tracking number Track id of the slow-moving target, the current output cycle batch to which it belongs, the slow-moving target appearance time BeginTime and the last time LastTime, the human target frame corresponding to the slow-moving target, and other information. The slow-moving target set can regularly clear out the slow-moving targets whose last time LastTime plus the preset time period is less than the current time. The above current time is the time corresponding to the target image. In this way, the slow-moving targets that have disappeared for a long time can be cleared out.

[0081] Optionally, in the step of determining at least one area to be confirmed with the slow-moving target as the center in the target image sequence, a target image can be determined in the target image sequence, the target image including a first target frame corresponding to the current slow-moving target and a second target frame corresponding to the person to be confirmed, the current slow-moving target being one of the slow-moving targets, and the person to be confirmed being other persons other than the current slow-moving target in the target image; with the first target frame as the center, a second target frame having a connectivity relationship with the first target frame is determined as a third target frame, the connectivity relationship being that a direct area intersection-and-union ratio or an indirect area intersection-and-union ratio with the first target frame is greater than a preset intersection-and-union ratio threshold; the first target frame and the third target frame are merged to obtain an area to be determined, and the area to be determined corresponds one-to-one to the current slow-moving target.

[0082] The target image may be the current frame image in the target image sequence, or the target image output at the end of the tracking output cycle, or the frame image corresponding to when a slow-moving target is determined.

[0083] After target detection and tracking processing, the target image may include a first target frame corresponding to the current slow-moving target and a second target frame corresponding to the person to be confirmed.

[0084] Specifically, the first target frame based on the current tracking output cycle is diffusely associated with the second target frame in the whole image. First, the first target frame is taken as the center, and the surrounding second target frames are judged in turn. When the area IOU (intersection-over-union ratio) of the target frame reaches 0.2 or more, the second target frame is considered to be associated with the first target frame, and the second target frame is recorded and determined as the third target frame. After finding all the second target frames associated with the first target frame for the first time, the scan line algorithm is used to efficiently merge the first target frame and all the third target frames (the second target frames associated with the first target frame) to obtain a minimum polygonal frame containing the first target frame and all the third target frames. Then, the polygonal frame is used as the starting frame to continue to associate the remaining second target frames, and the scan line algorithm is repeatedly used to continue to merge to obtain a larger outward-expanding polygon, and this is repeated until it can no longer be associated or all the second target frames are associated. At this point, a to-be-determined area can be obtained, which can also be called a suspicious personnel gathering area or a suspicious gathering area.

[0085] The information corresponding to an area to be determined can be recorded as (P, C, Q, E1, E2), where P represents the set of coordinate points constituting the area to be determined, C represents the output cycle batch of the area to be determined, Q represents the number of people in the area to be determined, which may specifically include the total number of people N and the effective number of slow-moving targets S, E1 represents the timestamp of the beginning of the appearance of the area to be determined, and E2 represents the current latest timestamp of the area to be determined.

[0086] Further, such as Figure 2 , Figure 3 , Figure 4 As shown, Figure 2 is a schematic diagram of a target frame expansion provided by an embodiment of the present invention. Figure 3 is a schematic diagram of target frame merging provided by an embodiment of the present invention, Figure 4 1 is a schematic diagram of the result of merging a target frame provided by an embodiment of the present invention. Specifically, first, a slow-moving target 1 is used as the starting target, and the rectangular frame of the slow-moving target is expanded, with the width expanded by 1 / 2 of the original width on the left and right, and the height expanded by 1 / 3 of the original height on the top and bottom, so as to obtain an enlarged rectangular target frame, as shown in FIG. Figure 2 As shown by the dotted line in the figure. Then, the dotted rectangle and the surrounding target rectangles 2, 3, 4, 5 are used to calculate the area intersection and union ratio (IOU):

[0087] IOU=IntersectionArea / MinArea

[0088] IntersectionArea is the intersection area of ​​rectangle rect1 and the rectangle to be judged, and MinArea is the rectangle with the smallest area between rectangle rect1 and the rectangle to be judged. Here, all rectangles whose IOU calculation reaches the specified threshold (default 0.2) are taken out, which is rect2, rect3, and rect4. Then use the scan line algorithm to find the smallest polygon polygon1 so that it is the smallest polygon containing rect1, rect2, rect3, and rect4. Figure 3 As shown, each blue point is the connected coordinate point of the minimum polygon polygon1 found by the scan line algorithm.

[0089] The polygon1 obtained is the suspicious gathering area obtained in the first iteration. Then, polygon1 is used as the starting target frame to perform the second round of target area IOU judgment. Here, rect5 is associated with it. Then, the scan line algorithm is used to extract the minimum polygon of polygon1 and rect5 to obtain the further diffused gathering area polygon2. The result is as follows Figure 4 .

[0090] Based on picture 2 to Figure 4 Based on the principle of diffusion association, the diffusion association can be recursively performed until the association is completed or the human body frame can no longer be associated, and the diffusion association can be stopped, and the suspicious gathering area polygon associated with the current slow-moving target can be obtained.

[0091] Optionally, in the step of determining a personnel gathering area in at least one area to be determined based on the total number of personnel in the area to be determined and the effective number of slow-moving targets, the total number of personnel in the area to be determined and the effective number of slow-moving targets can be determined; if the total number of personnel is greater than or equal to a preset first number threshold, and the number of slow-moving targets is greater than or equal to a preset second number threshold, the area to be determined is determined to be a determined area; and in at least one determined area, a personnel gathering area is determined.

[0092] In the embodiment of the present invention, for a to-be-determined area, the corresponding information is (P, C, Q, E1, E2), and the total number of personnel N and the effective number S of slow-moving targets can be obtained according to Q.

[0093] When there are multiple areas to be determined, the area to be determined with the largest total number of people N can be determined as the area where people gather, or the area to be determined with the largest effective number S can be determined as the area where people gather, or the area to be determined with the largest sum of the effective number N and the total number S can be determined as the area where people gather, or the area to be determined with the largest image area can be determined as the determined area, and the area where people gather can be determined through the determined areas.

[0094] After determining the effective number of slow-moving targets and the total number of people, if the effective number S of slow-moving targets is greater than or equal to the preset second number threshold, it means that there are multiple people wandering in the area corresponding to the target image sequence, and if the total number N of people is greater than or equal to the preset first number threshold, it means that there are multiple people appearing around the slow-moving targets, and the area to be determined can be determined as a personnel gathering area. If the effective number of slow-moving targets is less than the preset second number threshold, it means that there are not many people wandering in the area corresponding to the target image sequence, and if the total number N of people is less than the preset first number threshold, it means that there are not multiple people appearing around the slow-moving targets, and at this time, the area to be determined is not determined as a personnel gathering area.

[0095] In a possible embodiment, based on the diffusion association processing of slow-moving targets, a suspicious gathering area (area to be determined) in each tracking detection output cycle is obtained. For each suspicious gathering area, the coordinate point P of the suspicious gathering area, the number of people N in the area, and the current output cycle batch C to which it belongs are recorded (this is used to solve the problem that when multiple slow-moving targets are output simultaneously in the same cycle output batch, multiple suspicious gathering areas will be obtained at the same time. At this time, the suspicious gathering area with the largest area should be taken as the final suspicious gathering area in this cycle). At the same time, the start time E1 when the suspicious gathering area is first recorded and the last update time E2 of the suspicious gathering area are recorded.

[0096] The obtained suspicious clustering area M carrying the above information is subjected to threshold check and judgment. Once the threshold condition is met, the confidence of the suspicious clustering area will be improved, and it will be converted into a true clustering area (confirmed area) and updated and put into the clustering area object set. The threshold judgment has the following two key conditions:

[0097] ① The number of people N in the suspicious gathering area M is greater than or equal to the gathering number threshold n;

[0098] ② The number of slow-moving people S in the suspicious gathering area M is greater than or equal to the slow-moving number threshold s;

[0099] How to judge the number of slow-moving people in the suspicious gathering area M is to use the slow-moving target set obtained from the tracker. If the last update time E2 of the suspicious gathering area M is within the survival time period of a slow-moving target, and the slow-moving target frame is within the gathering area M, it can be concluded that the slow-moving target belongs to the gathering area M.

[0100] Optionally, in the step of determining the total number of people in the area to be determined, head detection can be performed on the image in the area to be determined to obtain a head detection frame; the head detection frame is matched with the first target frame or the second target frame in the area to be determined, and an additional head detection frame is determined, and the additional head detection frame is an unsuccessful head detection frame between the first target frame and the second target frame; based on the number of the first target frames, the number of the second target frames and the number of additional head detection frames, the total number of people in the area to be determined is determined.

[0101] In the embodiment of the present invention, it is understandable that the gathering of people will inevitably cause occlusion. In order to obtain the number of people in the suspicious gathering area, the total number of people in the area to be determined can be corrected twice. Specifically, the head target in the area to be determined can be detected to obtain the head detection frame of the area to be determined, and the total number of people can be corrected once through the head detection frame, so that the number of people in the area to be determined is more accurate.

[0102] Specifically, the head detection frame detected in the area to be determined can be matched with the first target frame and the second target frame respectively. For example, if the head detection frame r / b is within the first target frame or the second target frame, and the head detection frame is at the top of the corresponding first target frame or the second target frame, it can be determined that the head detection frame matches the corresponding first target frame or the second target frame successfully, otherwise the match fails. The head detection frames that fail to match are determined as additional head detection frames, that is, the number of head detection frames that cannot match the first target frame or the second target frame is determined as the number of additional head detection frames H, and the corrected number of people is equal to the new value N=N1+H. N1 is the sum of the first target frame and the second target frame in the area to be determined, r and b are both positive values, and r is less than b.

[0103] Optionally, in the step of determining the effective number of slow-moving targets in the area to be determined, a target timestamp corresponding to the target image may be obtained; and the number of slow-moving targets having the target timestamp may be determined as the effective number of slow-moving targets.

[0104] In the embodiment of the present invention, for a to-be-determined area, the corresponding information is (P, C, Q, E1, E2), and the total number of personnel N and the effective number S of slow-moving targets can be obtained according to Q.

[0105] The target timestamp is the timestamp corresponding to the target image, that is, E2. The number of all slow-moving targets including the target timestamp E2 is determined as the effective number of slow-moving targets.

[0106] If the total number of people N in the area to be determined is greater than the first threshold number of people, and the number S of all slow-moving targets that have survived the target timestamp E2 is greater than the second threshold number of people, the area to be determined can be converted into a gathering area.

[0107] Through the target timestamp, the slow-moving targets that appear in the area to be determined at the same time can be accurately determined, and then the effective number of slow-moving targets can be accurately determined.

[0108] Optionally, in the step of determining the personnel gathering area in at least one of the determined areas, a gathering area set can be obtained, the gathering area set including historical gathering areas; the historical gathering areas in the gathering area set are updated through the determined areas to obtain an updated gathering area set; and the personnel gathering area is determined in the updated gathering area set.

[0109] In an embodiment of the present invention, for each newly obtained determined area, the area IOU is calculated between it and the existing historical aggregation area, and the historical aggregation area corresponding to the maximum area IOU is taken as the aggregation area to be analyzed. If the area IOU is greater than 0.3, it can be determined that the determined area and the aggregation area to be analyzed are the same aggregation area, and then the latest timestamp E2 of the aggregation area is updated. If the output cycle batch C of the determined area is equal to the output cycle batch of the aggregation area to be analyzed, then the information (P, C, Q) of the largest aggregation area in the determined area and the aggregation area to be analyzed is taken for update. If the output cycle batch C of the determined area is not equal to the output cycle batch of the aggregation area to be analyzed, otherwise the information (P, C, Q) of the determined area is used for information update. During the update process, E1 of the aggregation area to be analyzed is used, and E2 of the determined area is used, and E2-E1 can represent the survival time of the aggregation area.

[0110] In the updated gathering area set, the gathering areas can be traversed, and the current gathering area traversed can be determined as the personnel gathering area. In this way, the separation of the same gathering areas can be avoided, thereby improving the accuracy of the personnel gathering area.

[0111] The above-mentioned personnel gathering area can also be called a real gathering area, and the above-mentioned gathering area set can also be called a real gathering area set.

[0112] In a possible embodiment, once the real gathering area is obtained, the set of real gathering areas can be updated. The purpose of recording and updating the real gathering area is mainly to obtain how long a gathering area lasts in the video from the perspective of spatial position plus time. What needs to be updated to update the gathering area are the coordinate point P of the current area, the number of people N in the area, the output cycle batch C, and the last update time E2 of the area. In the set of real gathering areas, it is judged whether the newly updated gathering area and the old gathering area are in the same output cycle batch C. If they are in the same output cycle batch, the data of the gathering area with the largest area is taken for the latest update, otherwise the new one is used as the main one. As for how to judge whether a new gathering area is the future of the old gathering area, the polygon IOU ratio method is also used to judge. Normally, the gathering range of the same gathering area for a short output cycle does not change much.

[0113] Optionally, in the step of determining whether there is a gathering event of people based on the survival time of the gathering area of ​​people, the time length of each gathering area of ​​people can be determined; if the time length is greater than or equal to a preset time length threshold, it is determined that there is a gathering event of people in the gathering area; if the time length is less than the preset time length threshold, it is determined that there is no gathering event of people in the gathering area of ​​people.

[0114] In an embodiment of the present invention, the gathering area can be traversed, and the current gathering area can be determined as the personnel gathering area. According to the information of the personnel gathering area (P, C, Q, E1, E2), E2-E1 is calculated, and E2-E1 is used as the time length of the personnel gathering area, that is, the survival time.

[0115] The above-mentioned time length threshold T can be set according to needs. If the time length is greater than or equal to the preset time length threshold T, it is determined that there is a gathering event of people in the gathering area; if the time length is less than the preset time length threshold T, it is determined that there is no gathering event of people in the gathering area.

[0116] In a possible embodiment, when the time length is greater than or equal to a preset time length threshold T, a personnel gathering alarm event may be generated, and the polygonal box and picture information corresponding to the personnel gathering area may be returned to the user.

[0117] In a possible embodiment, the real gathering area set can be traversed according to the time timing processing strategy of every two tracking output cycles. If the last update time E2 of the real gathering area plus the time of three tracking output cycles is less than the current video processing time, it can be considered that the gathering area has disappeared, and the recorded information of the area is deleted. If the existence time E2-E1 of the gathering area is greater than the specified duration T of the gathering of people, a gathering alarm can be generated for the area.

[0118] Optionally, an embodiment of the present invention also provides another method for detecting crowd gathering events, which performs human target tracking processing on continuous images and periodically outputs the tracked human target trajectory to extract the slow-moving target information. The tracked slow-moving human target data is subjected to diffusion association processing to find suspicious crowd gathering areas, and finally the crowd threshold and the slow-moving crowd threshold are used to determine the accurate crowd gathering area, and finally whether to generate an alarm time is determined based on whether the gathering duration is reached. It mainly includes the following process queues or modules:

[0119] Input module: continuous video decoding picture frame data.

[0120] Human target detection and tracker: perform human target detection, target optical flow tracking, target trajectory data period output (1. Output will be given when the target reaches the tracking period of 5 seconds; 2. Output will be given when the target disappears), target movement trajectory and time period, and whether it is a slow-moving target calculation.

[0121] Slow-moving target information: 1. Target Track Id; 2. The target's current output cycle batch (which tracking output cycle it belongs to); 3. The time when the target begins to exist, BeginTime; 4. The time when the target last appeared, LastTime.

[0122] Slow-moving target diffusion association to find suspicious clustering areas: 1. Perform full-image human body detection on the current image to obtain all human rectangular target frames; 2. Take the slow-moving target frame as the starting point and find the human target frame whose intersection area with the slow-moving target frame reaches the specified value; 3. Use the scan line algorithm to process all the target frames in the current step 2 to obtain the smallest polygonal area that contains these target models; 4. Use the polygonal area obtained in 3 to continue to calculate the intersection area with the remaining target frames in step 2 to continue to find related targets; 5. Repeat steps 3 and 4 until the diffusion association can no longer continue, then stop. At this time, the suspicious clustering area M and the current image timestamp E where the area is located can be obtained.

[0123] Second correction of the number of people in the suspicious gathering area: 1. Detect the number of heads in the area; 2. Traverse the head frame and the human body frame in turn for matching, calculate the number of head frames H that do not match the human body frame, and the corrected number of people is equal to the new value N1+H.

[0124] The conditions for converting a suspicious gathering area into a gathering area are: 1. The number of people N is greater than the gathering number threshold n; 2. The number of slow-moving targets S is greater than the slow-moving number threshold s.

[0125] Slow-moving target collection: used to store the current slow-moving human targets. At the same time, it will periodically clear out targets whose last time LastTime plus the specified human gathering duration t is less than the current time.

[0126] After obtaining a set of slow-moving targets that intersect with the suspicious gathering area time E2, the suspicious gathering area to gathering area transfer operation is performed according to the suspicious gathering area to gathering area transfer conditions.

[0127] Update the target set of clustered areas: 1. Intersect and compare the newly obtained clustered area with the existing clustered area to find the new area that matches the previous area, and update the current latest time E2; 2. For the clustered areas in the same output cycle batch, select the P, C, Q data of the area with the largest area; 3. For the clustered areas that are not in the same output cycle batch, take the P, C, Q data of the current new area.

[0128] Gathering area collection timing processor: 1. Perform timing processing every 2 tracking cycles; 2. Clear the gathering areas that have not been updated in two tracking cycles; 3. When the E2-E1 duration of the suspicious gathering area is greater than or equal to the specified gathering duration T, a gathering alarm event is generated.

[0129] Optionally, an embodiment of the present invention further provides another method for detecting a gathering of people event, comprising the following steps:

[0130] S1: Read external configuration, read the slow-moving threshold n, the default is 3. Read the gathering threshold s, the default is 10. Read the gathering duration t threshold, t is 3 times the tracking output cycle by default, that is, the default value is 15 seconds. If the configuration value is not enough, the minimum multiple alignment is performed internally.

[0131] S2: Pull the video stream, obtain the video frame rate, decode the video, put the decoded image data into the human tracking processing queue, and output the human targets judged as slow-moving targets within the specified tracking output period.

[0132] S3: Cache the slow-moving target into the slow-moving target set, and start the slow-moving target cache timeout deletion timer to regularly delete the targets within the duration t of the gathering of people.

[0133] S4: Perform target association diffusion processing on the current slow-moving target to obtain the optimal suspicious person gathering area.

[0134] S5: Use the head correction strategy to correct the actual number of people N in the suspicious gathering area obtained in step 4.

[0135] S6: If the number of people and the number of slow-moving targets in the suspicious gathering area meet the external configuration requirements, the suspicious gathering area is converted into a real gathering area and continuously updated to the real gathering area set.

[0136] S7: In the two tracking output cycles, the aggregation areas that meet the specified continuous aggregation time t in the real aggregation area set are regularly checked and reported as alarm targets.

[0137] like Figure 5 As shown, an embodiment of the present invention provides a device for detecting a gathering of people event, and the device for detecting a gathering of people event includes:

[0138] A detection module 501 is used to perform slow-moving target detection on a target image sequence to obtain at least one slow-moving target, wherein the moving speed of the slow-moving target is less than a preset moving speed threshold or the moving distance of the slow-moving target is less than a preset moving distance threshold;

[0139] A first processing module 502 is used to determine at least one to-be-confirmed area in the target image sequence with the slow-moving target as the center, wherein the to-be-confirmed area corresponds to the slow-moving target one by one;

[0140] The second processing module 503 is used to determine a personnel gathering area in at least one of the to-be-determined areas based on the total number of personnel in the to-be-determined areas and the effective number of the slow-moving targets;

[0141] The third processing module 504 is used to determine whether there is a gathering of people event based on the survival time of the gathering area of ​​people.

[0142] Optionally, the detection module 501 is also used to obtain a target image sequence; perform target detection and tracking processing on the target image sequence according to a preset output period to obtain at least one human target and at least one motion trajectory within the output period, and the human target corresponds to the motion trajectory one by one; based on the motion trajectory, determine the movement speed of the human target within the output period, or the movement distance of the human target within the output period; determine the human target whose movement speed is less than the movement speed threshold as a slow-moving target, or determine the human target whose movement distance is less than the movement distance threshold as a slow-moving target.

[0143] Optionally, the first processing module 502 is also used to determine a target image in the target image sequence, the target image including a first target frame corresponding to the current slow-moving target and a second target frame corresponding to the person to be confirmed, the current slow-moving target is one of the slow-moving targets, and the person to be confirmed is other person other than the current slow-moving target in the target image; with the first target frame as the center, the second target frame having a connectivity relationship with the first target frame is determined as a third target frame, the connectivity relationship being that the direct area intersection and union ratio or the indirect area intersection and union ratio with the first target frame is greater than a preset intersection and union ratio threshold; the first target frame and the third target frame are merged to obtain a to-be-determined area, and the to-be-determined area corresponds one-to-one to the current slow-moving target.

[0144] Optionally, the second processing module 503 is also used to determine the total number of people in the area to be determined and the effective number of the slow-moving targets; if the total number of people is greater than or equal to a preset first number threshold, and the number of slow-moving targets is greater than or equal to a preset second number threshold, the area to be determined is determined to be a determined area; in at least one of the determined areas, the personnel gathering area is determined.

[0145] Optionally, the second processing module 503 is also used to perform head detection on the image in the area to be determined to obtain a head detection frame; match the head detection frame with the first target frame or the second target frame in the area to be determined, respectively, to determine an additional head detection frame, wherein the additional head detection frame is an unsuccessful head detection frame between the first target frame and the second target frame; based on the number of the first target frames, the number of the second target frames and the number of the additional head detection frames, determine the total number of people in the area to be determined.

[0146] Optionally, the second processing module 503 is further configured to obtain a target timestamp corresponding to the target image; and determine the number of the slow-moving targets having the target timestamp as the effective number of the slow-moving targets.

[0147] Optionally, the second processing module 503 is also used to obtain a gathering area set, which includes historical gathering areas; update the historical gathering areas in the gathering area set through the determined areas to obtain an updated gathering area set; and determine the personnel gathering areas in the updated gathering area set.

[0148] Optionally, the third processing module 504 is also used to determine the time length of each sequence of the personnel gathering area; if the time length is greater than or equal to a preset time length threshold, it is determined that the personnel gathering event exists in the personnel gathering area; if the time length is less than the preset time length threshold, it is determined that the personnel gathering event does not exist in the personnel gathering area.

[0149] like Figure 6 As shown, an embodiment of the present invention further provides an electronic device, including a processor, and the processor can execute any of the above-mentioned methods for detecting a gathering of people event.

[0150] Specifically, it includes a processor 601 and a memory 602, and a computer program for executing a method for detecting a gathering of people event, which is stored in the memory 602 and can be run on the processor 601, wherein:

[0151] The processor 601 runs the computer program of the method for detecting a gathering of people event stored in the memory 602, and performs the following steps:

[0152] Performing slow-moving target detection on the target image sequence to obtain at least one slow-moving target, wherein the moving speed of the slow-moving target is less than a preset moving speed threshold or the moving distance of the slow-moving target is less than a preset moving distance threshold;

[0153] In the target image sequence, at least one to-be-confirmed area is determined with the slow-moving target as the center, and the to-be-confirmed area corresponds to the slow-moving target one by one;

[0154] Based on the total number of people in the to-be-determined area and the effective number of the slow-moving targets, determining a people gathering area in at least one of the to-be-determined areas;

[0155] Based on the survival time of the personnel gathering area, determine whether there is a personnel gathering event.

[0156] Optionally, the processor 601 performs the slow-moving target detection on the target image sequence to obtain at least one slow-moving target, including:

[0157] Obtain target image sequence;

[0158] Performing target detection and tracking processing on the target image sequence according to a preset output period to obtain at least one human target and at least one motion track within the output period, wherein the human target corresponds to the motion track in a one-to-one manner;

[0159] Based on the motion trajectory, determining a motion speed of the human target within the output period, or a motion distance of the human target within the output period;

[0160] The human target whose movement speed is less than the movement speed threshold is determined as a slow-moving target, or the human target whose movement distance is less than the movement distance threshold is determined as a slow-moving target.

[0161] Optionally, the processor 601 determines, in the target image sequence, at least one area to be confirmed with the slow-moving target as the center, including:

[0162] Determining a target image in the target image sequence, the target image including a first target frame corresponding to a current slow-moving target and a second target frame corresponding to a person to be confirmed, the current slow-moving target being one of the slow-moving targets, and the person to be confirmed being other persons in the target image other than the current slow-moving target;

[0163] Taking the first target frame as the center, determining the second target frame having a connectivity relationship with the first target frame as a third target frame, wherein the connectivity relationship is that a direct area intersection-and-union ratio or an indirect area intersection-and-union ratio with the first target frame is greater than a preset intersection-and-union ratio threshold;

[0164] The first target frame and the third target frame are merged to obtain a region to be determined, and the region to be determined corresponds one-to-one to the current slow-moving target.

[0165] Optionally, the processor 601 determines, based on the total number of people in the to-be-determined area and the effective number of the slow-moving targets, a personnel gathering area in at least one of the to-be-determined areas, including:

[0166] Determine the total number of people in the to-be-determined area and the effective number of the slow-moving targets;

[0167] If the total number of personnel is greater than or equal to a preset first number threshold, and the number of slow-moving targets is greater than or equal to a preset second number threshold, determining that the area to be determined is a determined area;

[0168] In at least one of the determined areas, the personnel gathering area is determined.

[0169] Optionally, the determining of the total number of persons in the to-be-determined area performed by the processor 601 includes:

[0170] Performing head detection on the image in the to-be-determined area to obtain a head detection frame;

[0171] Matching the head detection frame with the first target frame or the second target frame in the to-be-determined area respectively, and determining an additional head detection frame, where the additional head detection frame is the unsuccessful head detection frame between the first target frame and the second target frame;

[0172] Based on the number of the first target frames, the number of the second target frames, and the number of the additional head detection frames, the total number of people in the to-be-determined area is determined.

[0173] Optionally, the determining, performed by the processor 601, of the effective number of the slow-moving targets in the to-be-determined area includes:

[0174] Obtaining a target timestamp corresponding to the target image;

[0175] The number of the slow-moving targets having the target timestamp is determined as the effective number of the slow-moving targets.

[0176] Optionally, the determining of the personnel gathering area in at least one of the determined areas performed by the processor 601 includes:

[0177] Acquire a gathering area set, wherein the gathering area set includes historical gathering areas;

[0178] The historical gathering area in the gathering area set is updated by using the determined area to obtain the updated gathering area set;

[0179] In the updated gathering area set, the personnel gathering area is determined.

[0180] Optionally, the determining whether there is a personnel gathering event based on the survival time of the personnel gathering area performed by the processor 601 includes:

[0181] Determine the time length of each sequence of the personnel gathering areas;

[0182] If the time length is greater than or equal to a preset time length threshold, it is determined that the personnel gathering event exists in the personnel gathering area;

[0183] If the time length is less than a preset time length threshold, it is determined that the personnel gathering event does not exist in the personnel gathering area.

[0184] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the method for detecting personnel gathering events provided by the embodiment of the present invention are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0185] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0186] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A method for detecting a gathering of people event, characterized in that: The method comprises the following steps: Performing slow-moving target detection on the target image sequence to obtain at least one slow-moving target, wherein the moving speed of the slow-moving target is less than a preset moving speed threshold or the moving distance of the slow-moving target is less than a preset moving distance threshold; In the target image sequence, at least one to-be-confirmed area is determined with the slow-moving target as the center, and the to-be-confirmed area corresponds to the slow-moving target one by one; Based on the total number of people in the to-be-determined area and the effective number of the slow-moving targets, determining a people gathering area in at least one of the to-be-determined areas; Based on the survival time of the personnel gathering area, determine whether there is a personnel gathering event.

2. The method for detecting a gathering of people event as claimed in claim 1, characterized in that: The step of performing slow-moving target detection on the target image sequence to obtain at least one slow-moving target includes: Obtain target image sequence; Performing target detection and tracking processing on the target image sequence according to a preset output period to obtain at least one human target and at least one motion track within the output period, wherein the human target corresponds to the motion track in a one-to-one manner; Based on the motion trajectory, determining a motion speed of the human target within the output period, or a motion distance of the human target within the output period; The human target whose movement speed is less than the movement speed threshold is determined as a slow-moving target, or the human target whose movement distance is less than the movement distance threshold is determined as a slow-moving target.

3. The method for detecting a gathering of people event as claimed in claim 1, characterized in that: The step of determining at least one area to be confirmed in the target image sequence with the slow-moving target as the center includes: Determine a target image in the target image sequence, wherein the target image includes a first target frame corresponding to a current slow-moving target and a second target frame corresponding to a person to be confirmed, wherein the current slow-moving target is one of the slow-moving targets, and the person to be confirmed is a person other than the current slow-moving target in the target image; Taking the first target frame as the center, determining the second target frame having a connectivity relationship with the first target frame as a third target frame, wherein the connectivity relationship is that a direct area intersection-and-union ratio or an indirect area intersection-and-union ratio with the first target frame is greater than a preset intersection-and-union ratio threshold; The first target frame and the third target frame are merged to obtain a region to be determined, and the region to be determined corresponds one-to-one to the current slow-moving target.

4. The method for detecting a gathering of people event as claimed in claim 3, characterized in that: The determining of a personnel gathering area in at least one of the to-be-determined areas based on the total number of personnel in the to-be-determined areas and the effective number of the slow-moving targets comprises: Determine the total number of people in the to-be-determined area and the effective number of the slow-moving targets; If the total number of personnel is greater than or equal to a preset first number threshold, and the number of slow-moving targets is greater than or equal to a preset second number threshold, determining that the area to be determined is a determined area; In at least one of the determined areas, the personnel gathering area is determined.

5. The method for detecting a gathering of people event as claimed in claim 4, characterized in that: Determining the total number of people in the to-be-determined area includes: Performing head detection on the image in the to-be-determined area to obtain a head detection frame; Matching the head detection frame with the first target frame or the second target frame in the to-be-determined area respectively, and determining an additional head detection frame, where the additional head detection frame is the unsuccessful head detection frame between the first target frame and the second target frame; Based on the number of the first target frames, the number of the second target frames, and the number of the additional head detection frames, the total number of people in the to-be-determined area is determined.

6. The method for detecting a gathering of people event as claimed in claim 4, characterized in that: The determining the effective number of the slow-moving targets in the to-be-determined area includes: Obtaining a target timestamp corresponding to the target image; The number of the slow-moving targets having the target timestamp is determined as the effective number of the slow-moving targets.

7. The method for detecting a gathering of people event as claimed in claim 4, characterized in that: Determining the personnel gathering area in at least one of the determined areas includes: Acquire a gathering area set, wherein the gathering area set includes historical gathering areas; The historical gathering area in the gathering area set is updated by using the determined area to obtain the updated gathering area set; In the updated gathering area set, the personnel gathering area is determined.

8. The method for detecting a gathering of people event according to any one of claims 1 to 7, characterized in that: The determining whether there is a gathering of people event based on the survival time of the gathering of people area includes: Determine the time length of each sequence of the personnel gathering areas; If the time length is greater than or equal to a preset time length threshold, it is determined that the personnel gathering event exists in the personnel gathering area; If the time length is less than a preset time length threshold, it is determined that the personnel gathering event does not exist in the personnel gathering area.

9. A device for detecting a gathering of people, characterized in that: The detection device for the personnel gathering event comprises: A detection module, configured to perform slow-moving target detection on a target image sequence to obtain at least one slow-moving target, wherein the moving speed of the slow-moving target is less than a preset moving speed threshold or the moving distance of the slow-moving target is less than a preset moving distance threshold; A first processing module is used to determine at least one to-be-confirmed area in the target image sequence with the slow-moving target as the center, wherein the to-be-confirmed area corresponds to the slow-moving target one by one; A second processing module is used to determine a personnel gathering area in at least one of the to-be-determined areas based on the total number of personnel in the to-be-determined areas and the effective number of the slow-moving targets; The third processing module is used to determine whether there is a gathering of people event based on the survival time of the gathering area of ​​the people.

10. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the method for detecting a gathering of people event as described in any one of claims 1 to 8 when executing the computer program.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method for detecting a gathering of people event as described in any one of claims 1 to 8 are implemented.