Personnel abnormal aggregation analysis method, device, equipment, medium and product
Through video stream processing and clustering analysis, abnormal aggregation areas are identified, which solves the problem that traditional surveillance cameras are difficult to identify abnormal aggregation of people, and achieves high accuracy and flexibility of abnormal aggregation analysis.
Patent Information
- Application Number
- CN202410787983.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-11-01
AI Technical Summary
In the prior art, the flexibility of the analysis method of abnormal gathering of personnel is low, and traditional fixed-view surveillance cameras are difficult to identify abnormal gathering of personnel in large-scale events.
By acquiring the video stream, extracting the target frame images, performing personnel detection and clustering analysis, determining the cluster cluster, dynamically adapting to the distribution pattern, and identifying the abnormal clustering area.
It improves the accuracy and flexibility of abnormal aggregation analysis of personnel, can accurately detect abnormal aggregation, and is suitable for complex scenarios.
Smart Images

Figure CN118887579A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device, equipment, medium and product for analyzing abnormal aggregation of personnel. Background Art
[0002] With the continuous development of the economy, the number of urban population in my country has increased exponentially, and the demand for life safety and communication security has increased day by day. Especially when large-scale events (such as concerts, exhibitions and marathon events) are held, it is easy for a large number of people to gather in key transportation hubs, scenic spots, stadiums and other key places. How to quickly identify abnormal gatherings of people and locate abnormal gathering areas is one of the tasks that relevant departments attach great importance to.
[0003] Since the area where people gather is usually large, traditional fixed-angle surveillance cameras have limited shooting angles and are difficult to detect abnormal events. With the rapid development of drone technology, there has been a major breakthrough in the analysis of abnormal gatherings of people based on artificial intelligence algorithms. The algorithms currently used in drone inspection systems mainly include target detection models. The target detection model can quickly identify the locations of people in the area, but it requires additional processing logic to calculate whether there is a gathering of people. For example, by comparing the upper limit of the number of people in the area with the real-time number of people to identify abnormal gatherings, this abnormal gathering analysis method has low flexibility. Summary of the invention
[0004] The present invention provides a method, device, equipment, medium and product for analyzing abnormal gathering of personnel, so as to solve the problem of low flexibility of the abnormal gathering of personnel analysis method in the prior art.
[0005] In a first aspect, the present invention provides a method for analyzing abnormal aggregation of personnel, comprising: Get the video stream; Extracting a first target frame image from the video stream; Performing person detection on the first target frame image to obtain target frame information of each person in the first target frame image; performing cluster analysis on multiple persons based on the target frame information of each person to obtain multiple cluster clusters; An abnormal personnel aggregation analysis is performed based on the multiple clusters to obtain an abnormal personnel aggregation analysis result of the first target frame image.
[0006] In one embodiment, cluster analysis is performed on multiple persons based on the target frame information of each person to obtain multiple clusters, including: Each person was identified as not having visited a sample point; Determine the neighborhood radius and preset the minimum number of sample points; Based on the target frame information of each unvisited sample point, determine the distance between every two unvisited sample points; Selecting a first visited sample point from a plurality of unvisited sample points; Taking the first visited sample point as the cluster center, delineating the neighborhood of the first visited sample point based on the neighborhood radius; if the number of target sample points in the neighborhood is less than the preset minimum number of sample points, returning to the step of selecting the first visited sample point from multiple unvisited sample points; the target sample point is an unvisited sample point other than the first visited sample point among the multiple unvisited sample points, and the distance between the target sample point and the first visited sample point is less than or equal to the neighborhood radius; if the number of target sample points in the neighborhood is greater than or equal to the preset minimum number of sample points, dividing the first visited sample point and the target sample point in the neighborhood into one cluster; Selecting a second access sample point from a plurality of remaining unvisited sample points; the remaining unvisited sample points refer to the remaining unvisited sample points in the plurality of unvisited sample points except the first access sample point and the target sample point; The second visited sample point is updated to the first visited sample point, and the step of taking the first visited sample point as the cluster center and defining the neighborhood based on the neighborhood radius is iteratively performed until all unvisited sample points are divided into clusters, thereby obtaining a plurality of clusters.
[0007] In one embodiment, the calculation formula of the neighborhood radius is as follows:
[0008] Among them, ε represents the neighborhood radius; Characterization staff H i The pixel area of the target frame; m represents the total number of people in the first target frame image; α represents the preset distance between people.
[0009] In one embodiment, performing abnormal personnel aggregation analysis based on the multiple clusters to obtain abnormal personnel aggregation analysis results of the first target frame image includes: Determine the number of people in each cluster; The clusters with the number of personnel exceeding the preset threshold are determined as the initial abnormal aggregation areas; Determine the center point location information of each initial abnormal aggregation area; Based on the center point position information of each initial abnormal gathering area, abnormal personnel gathering analysis is performed to obtain the abnormal personnel gathering analysis result of the first target frame image.
[0010] In one embodiment, the abnormal gathering analysis of personnel is performed based on the center point position information of each initial abnormal gathering area to obtain the abnormal gathering analysis result of personnel of the first target frame image, including: The first target frame image and the center point position information of each initial abnormal aggregation area are input into the aggregation area type recognition model to obtain the type of each initial abnormal aggregation area output by the aggregation area type recognition model; the aggregation area type recognition model is obtained by model training based on the area samples and the type labels of the area samples; the initial abnormal aggregation area that meets the preset area type is determined as the target abnormal aggregation area; The center point position information, type and number of personnel in each target abnormal gathering area are determined as the abnormal personnel gathering analysis result of the first target frame image.
[0011] In one embodiment, after performing personnel abnormal aggregation analysis based on the multiple clusters to obtain the personnel abnormal aggregation analysis result of the first target frame image, the method includes: Starting from the timestamp of the first target frame image, extracting a plurality of second target frame images from the video stream at a preset time interval; Performing personnel abnormal aggregation analysis on the plurality of second target frame images respectively to obtain a personnel abnormal aggregation analysis result of each second target frame image; The abnormal personnel gathering analysis result of the first target frame image and the abnormal personnel gathering analysis results corresponding to the multiple second target frame images are superimposed on the video stream and displayed.
[0012] In a second aspect, the present invention further provides a device for analyzing abnormal gathering of personnel, comprising: An acquisition module is used to acquire video streams; An extraction module, used for extracting a first target frame image from the video stream; A person detection module, used to perform person detection on the first target frame image to obtain target frame information of each person in the first target frame image; A clustering module is used to perform cluster analysis on multiple persons based on the target frame information of each person to obtain multiple cluster clusters; an abnormal cluster analysis module is used to perform abnormal cluster analysis of persons based on the multiple cluster clusters to obtain the abnormal cluster analysis results of persons in the first target frame image.
[0013] In a third aspect, the present invention provides a device, comprising an electronic device, wherein the electronic device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned methods for analyzing abnormal aggregation of personnel are implemented.
[0014] In a fourth aspect, the present invention further provides a medium, comprising a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods for analyzing abnormal aggregation of personnel are implemented.
[0015] In a fifth aspect, the present invention also provides a product, comprising a computer program product, wherein the computer program product comprises a computer program, wherein the computer program can be stored on a non-transitory computer-readable storage medium, and wherein when the computer program is executed by the processor, the steps of any of the above-mentioned methods for analyzing abnormal aggregation of personnel are implemented.
[0016] The abnormal personnel aggregation analysis method, device, equipment, medium and product provided by the present invention can perform personnel detection on the extracted first target frame image, and can accurately identify the target frame information of all personnel included in the first target frame image, so as to determine the location of each person. Further, through the target frame information of each person, a cluster analysis is performed on multiple personnel to obtain multiple cluster clusters, and abnormal personnel aggregation analysis is performed on the multiple cluster clusters. It can dynamically adapt to the distribution pattern scenario, accurately and specifically detect which areas have abnormal aggregation, thereby improving the accuracy of the abnormal personnel aggregation analysis and at the same time improving the flexibility of the abnormal personnel aggregation analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0018] Figure 1 This is one of the flow charts of the method for analyzing abnormal aggregation of personnel provided by the present invention.
[0019] Figure 2 This is the second flow chart of the method for analyzing abnormal aggregation of personnel provided by the present invention.
[0020] Figure 3 It is a structural schematic diagram of the abnormal personnel gathering analysis device provided by the present invention.
[0021] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0023] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein.
[0024] Combine the following Figure 1-Figure 4 The present invention describes the method, device, equipment, medium and product for analyzing abnormal gathering of people provided by the present invention.
[0025] It should be noted that the abnormal gathering of people analysis method provided in the embodiment of the present invention is implemented based on the abnormal gathering of people analysis device, and the abnormal gathering of people analysis method provided in the embodiment of the present invention is applicable to a variety of public places, such as subway stations, shopping malls, stadiums, airports, etc. The embodiment of the present invention takes the abnormal gathering of people analysis device as an example to describe the abnormal gathering of people analysis method.
[0026] Combination Figure 1 and Figure 2 , Figure 1 This is one of the flow charts of the method for analyzing abnormal gathering of personnel provided by the present invention. Figure 2 This is the second flow chart of the method for analyzing abnormal aggregation of personnel provided by the present invention.
[0027] like Figure 1 As shown, the method includes the following: Step 101: Obtain video stream; Step 102: extracting a first target frame image from the video stream; Step 103: Perform person detection on the first target frame image to obtain target frame information of each person in the first target frame image; Step 104: Based on the target frame information of each person, cluster analysis is performed on multiple persons to obtain multiple clusters; Step 105: Perform abnormal personnel aggregation analysis based on the multiple clusters to obtain abnormal personnel aggregation analysis results of the first target frame image.
[0028] Specifically, in a specific environment, a camera carried by a drone is used to take aerial photos from a high position to collect a video stream of the specific environment.
[0029] It should be noted that drones have the advantages of flexibility, speed and wide coverage. They are particularly suitable for areas with large areas or complex terrain. They can analyze abnormal gatherings of people from multiple angles, and can solve the problems of difficulty in analyzing and controlling abnormal gatherings of people from traditional video surveillance perspectives, high hardware costs and low accuracy.
[0030] Furthermore, the video stream collected by the camera carried by the drone is transmitted in real time to the abnormal personnel gathering analysis device through a wireless transmission system.
[0031] Furthermore, after acquiring the video stream, the abnormal gathering of people analysis device decodes the video stream to obtain a decoded video stream.
[0032] Furthermore, the abnormal gathering of people analysis device extracts a first target frame image from the decoded video stream.
[0033] Furthermore, the abnormal personnel gathering analysis device inputs the first target frame image into the target detection model to obtain target frames and target frame information corresponding to multiple persons included in the first target frame image output by the target detection model.
[0034] It should be noted that the target detection model is a deep learning model that aims to automatically identify and locate objects of different categories from images or videos. Since there are multiple environmental objects in a specific environment, that is, there are multiple categories of objects in the first target frame image, it is necessary to identify and locate the target frame where the person is located from the first target frame image. The target frame is a rectangular frame that is used to identify the position of the detected person in the image. Therefore, the target frame information includes the person's position information and the size of the target frame where the person is located.
[0035] In one embodiment, the target detection model can be trained by the following steps: obtaining image samples; delineating target frame samples according to the persons contained in the image samples to obtain multiple target frame samples; labeling the multiple target frame samples by type to obtain label data for each target frame sample; training the model based on the multiple target frame samples and the label data corresponding to the multiple target frame samples to obtain a trained target detection model. The application principle of the target detection model is to pre-process the image by cutting the image, divide the image into several small areas, further call the target detection algorithm for person recognition, and then output the recognition results after jigsaw puzzles.
[0036] Furthermore, the abnormal personnel aggregation analysis device determines the total number of personnel contained in the first target frame image according to the number of target frames.
[0037] Furthermore, the abnormal personnel gathering analysis device compares the total number of personnel contained in the first target frame image with the preset total number of abnormal personnel, wherein the preset total number of abnormal personnel is set according to actual conditions.
[0038] Furthermore, if the total number of people contained in the first target frame image does not exceed the preset total number of abnormal people, the abnormal people gathering analysis device determines that there is no abnormal people gathering in the first target frame image, and ends the abnormal people gathering analysis process.
[0039] Furthermore, if the total number of persons included in the first target frame image exceeds the preset total number of abnormal persons, the abnormal person gathering analysis device continues the subsequent abnormal person gathering analysis process.
[0040] Furthermore, the abnormal personnel clustering analysis device performs cluster analysis on multiple personnel based on the target frame information of each person to obtain multiple clusters.
[0041] Therefore, it can be understood that the abnormal personnel clustering analysis device performs cluster analysis on multiple personnel based on the personnel location information of each person to obtain multiple cluster clusters.
[0042] Furthermore, the abnormal personnel aggregation analysis device performs abnormal personnel aggregation analysis based on multiple clustering clusters to obtain an abnormal personnel aggregation analysis result of the first target frame image.
[0043] The abnormal personnel aggregation analysis method provided by the present invention performs personnel detection on the extracted first target frame image, and can accurately identify the target frame information of all personnel included in the first target frame image, so as to determine the location of each person. Further, through the target frame information of each person, a cluster analysis is performed on multiple personnel to obtain multiple cluster clusters, and abnormal personnel aggregation analysis is performed on the multiple cluster clusters. It can dynamically adapt to the scene of the distribution pattern, accurately and specifically detect which areas have abnormal aggregation, thereby improving the accuracy of the abnormal personnel aggregation analysis and at the same time improving the flexibility of the abnormal personnel aggregation analysis.
[0044] Further, based on step 104, cluster analysis is performed on multiple persons based on the target frame information of each person to obtain multiple clusters, including: Each person was identified as not having visited a sample point; Determine the neighborhood radius and preset the minimum number of sample points; Based on the target frame information of each unvisited sample point, determine the distance between every two unvisited sample points; Selecting a first visited sample point from a plurality of unvisited sample points; Taking the first access sample point as a cluster center, and defining a neighborhood of the first access sample point based on the neighborhood radius; If the number of target sample points in the neighborhood is less than the preset minimum number of sample points, returning to the step of selecting a first visited sample point from a plurality of unvisited sample points; the target sample point is an unvisited sample point among the plurality of unvisited sample points, except for the first visited sample point, which satisfies that the distance between the target sample point and the first visited sample point is less than or equal to the neighborhood radius; If the number of target sample points in the neighborhood is greater than or equal to the preset minimum number of sample points, dividing the first access sample points and the target sample points in the neighborhood into one cluster; Selecting a second access sample point from a plurality of remaining unvisited sample points; the remaining unvisited sample points refer to the remaining unvisited sample points in the plurality of unvisited sample points except the first access sample point and the target sample point; The second visited sample point is updated to the first visited sample point, and the step of taking the first visited sample point as the cluster center and defining the neighborhood based on the neighborhood radius is iteratively performed until all unvisited sample points are divided into clusters, thereby obtaining a plurality of clusters.
[0045] Specifically, the abnormal personnel aggregation analysis device takes each person as a sample point and initializes it to an unvisited state to obtain multiple unvisited sample points.
[0046] Furthermore, the abnormal gathering of people analysis device determines a neighborhood radius and a preset minimum number of sample points.
[0047] It should be noted that the preset minimum number of sample points is the minimum number of sample points required to be reached within the partition neighborhood, and can be set according to actual conditions.
[0048] It should be further explained that the calculation formula of the neighborhood radius is as follows:
[0049] Among them, ε represents the neighborhood radius; Characterization staff H i The pixel area of the target frame, that is, the size of the target frame, can be calculated based on the length and width of the target frame; m represents the total number of people in the first target frame image; α represents the preset distance between people, which is set according to the reasonable distance between people in a specific environment.
[0050] Furthermore, the abnormal personnel aggregation analysis device determines the distance between every two unvisited sample points based on the target frame information of each unvisited sample point.
[0051] Therefore, it can be understood that the abnormal personnel aggregation analysis device determines the distance between every two unvisited sample points based on the personnel position information of each unvisited sample point.
[0052] Furthermore, the abnormal personnel aggregation analysis device selects a first visited sample point from multiple unvisited sample points. Furthermore, the abnormal personnel aggregation analysis device uses the first visited sample point as the cluster center and defines the neighborhood of the first visited sample point based on the neighborhood radius.
[0053] Furthermore, the abnormal personnel gathering analysis device determines the unvisited sample points in the neighborhood of the first visited sample point whose distance to the first visited sample point is less than or equal to the neighborhood radius as target sample points.
[0054] Furthermore, if the number of target sample points in the neighborhood is less than the preset minimum number of sample points, the abnormal personnel aggregation analysis device returns to the step of selecting the first visited sample point from multiple unvisited sample points, selects a new first visited sample point again, and continues with subsequent steps.
[0055] Furthermore, if the number of target sample points in the neighborhood is greater than or equal to a preset minimum number of sample points, the personnel abnormal aggregation analysis device divides the first access sample point and the target sample point in the neighborhood into a cluster.
[0056] Furthermore, the abnormal personnel gathering analysis device selects a second visited sample point from a plurality of remaining unvisited sample points, wherein the remaining unvisited sample points refer to the remaining unvisited sample points in the plurality of unvisited sample points except the first visited sample point and the target sample point.
[0057] Furthermore, the abnormal personnel aggregation analysis device updates the second access sample point to the first access sample point, and iteratively executes the step of dividing the neighborhood based on the neighborhood radius with the first access sample point as the cluster center until all unvisited sample points are divided into cluster clusters, thereby obtaining multiple cluster clusters.
[0058] The embodiment of the present invention calculates the distance between samples based on the target frame information of each person, and uses the neighborhood radius and the minimum number of sample points to determine the clustering cluster, thereby achieving accurate clustering grouping of personnel and being suitable for clustering of arbitrary shapes in complex scenarios, which helps to improve the accuracy of subsequent abnormal clustering analysis of personnel.
[0059] Further, based on step 105, the abnormal personnel aggregation analysis is performed based on the multiple clusters to obtain the abnormal personnel aggregation analysis result of the first target frame image, including: Determine the number of people in each cluster; The clusters with the number of personnel exceeding the preset threshold are determined as the initial abnormal aggregation areas; Determine the center point location information of each initial abnormal aggregation area; Based on the center point position information of each initial abnormal gathering area, abnormal personnel gathering analysis is performed to obtain the abnormal personnel gathering analysis result of the first target frame image.
[0060] Specifically, the abnormal personnel clustering analysis device determines the number of personnel in each cluster according to the personnel included in each cluster.
[0061] Furthermore, the abnormal personnel aggregation analysis device compares the number of personnel in each cluster with a preset threshold, wherein the preset threshold is set according to actual conditions.
[0062] Furthermore, the abnormal personnel gathering analysis device determines the clusters whose number of personnel exceeds a preset threshold as initial abnormal gathering areas.
[0063] Furthermore, the abnormal gathering of personnel analysis device determines the center point location information of each initial abnormal gathering area.
[0064] Furthermore, the abnormal personnel gathering analysis device performs abnormal personnel gathering analysis based on the center point position information of each initial abnormal gathering area to obtain the abnormal personnel gathering analysis result of the first target frame image.
[0065] The embodiment of the present invention determines the number of people in each cluster to identify the initial abnormal aggregation area that exceeds a preset threshold, and further determines the center point location information of each initial abnormal aggregation area for further abnormal personnel aggregation analysis. It can quickly and accurately identify and locate abnormal personnel aggregation situations, thereby improving the accuracy of abnormal personnel aggregation analysis and at the same time improving the flexibility of abnormal personnel aggregation analysis.
[0066] Further, the abnormal gathering analysis of personnel is performed based on the center point position information of each initial abnormal gathering area to obtain the abnormal gathering analysis result of personnel of the first target frame image, including: The first target frame image and the center point position information of each initial abnormal aggregation area are input into the aggregation area type recognition model to obtain the type of each initial abnormal aggregation area output by the aggregation area type recognition model; the aggregation area type recognition model is obtained by model training based on the area samples and the type labels of the area samples; the initial abnormal aggregation area that meets the preset area type is determined as the target abnormal aggregation area; The center point position information, type and number of personnel in each target abnormal gathering area are determined as the abnormal personnel gathering analysis result of the first target frame image.
[0067] Specifically, the abnormal personnel gathering analysis device inputs the first target frame image and the center point position information of each initial abnormal gathering area into the area type recognition model to obtain the type of each initial abnormal gathering area output by the gathering area type recognition model.
[0068] It should be noted that the area types may include but are not limited to stadiums, grass fields, sidewalks, and bridges.
[0069] In one embodiment, the region type recognition model can be trained through the following steps: obtaining image samples; dividing the image samples into regions to obtain multiple type region samples; obtaining the center point position information samples and type labels of each type region sample; performing model training based on the image samples and the center point position information samples and type labels corresponding to the multiple type region samples, to obtain a trained region type recognition model.
[0070] Furthermore, the abnormal gathering of personnel analysis device determines whether the initial abnormal gathering area satisfies a preset area type, wherein the preset area type is set according to actual conditions.
[0071] Furthermore, the abnormal gathering of people analysis device determines the initial abnormal gathering area that does not meet the preset area type as an area where there is no abnormal gathering of people, and ends the abnormal gathering of people analysis in the area.
[0072] Furthermore, the abnormal personnel gathering analysis device determines an initial abnormal gathering area that meets a preset area type as a target abnormal gathering area.
[0073] Furthermore, the abnormal personnel gathering analysis device determines the center point position information, type and number of personnel of each target abnormal gathering area as the abnormal personnel gathering analysis result of the first target frame image.
[0074] The embodiment of the present invention identifies the type of each initial abnormal gathering area through a gathering area type recognition model, and screens out target abnormal gathering areas that meet the preset area type, and further determines the center point position information, type and number of personnel of each target abnormal gathering area as the abnormal personnel gathering analysis result of the first target frame image, thereby achieving accurate identification of abnormal gathering areas, greatly improving the anomaly detection capability of the monitoring system in complex scenarios, improving the accuracy of abnormal personnel gathering analysis, and at the same time improving the flexibility of abnormal personnel gathering analysis.
[0075] Further, after performing personnel abnormal aggregation analysis based on the multiple clusters to obtain the personnel abnormal aggregation analysis result of the first target frame image, the method includes: Starting from the timestamp of the first target frame image, extracting a plurality of second target frame images from the video stream at a preset time interval; Performing personnel abnormal aggregation analysis on the plurality of second target frame images respectively to obtain a personnel abnormal aggregation analysis result of each second target frame image; The abnormal personnel gathering analysis result of the first target frame image and the abnormal personnel gathering analysis results corresponding to the multiple second target frame images are superimposed on the video stream and displayed.
[0076] Specifically, the abnormal personnel gathering analysis device determines the timestamp of the first target frame image, and extracts multiple second target frame images in the video stream starting from the timestamp of the first target frame image at a preset time interval, wherein the preset time interval is set according to actual conditions.
[0077] Furthermore, the abnormal gathering of people analysis device performs abnormal gathering of people analysis on multiple second target frame images respectively to obtain abnormal gathering of people analysis results for each second target frame image. It should be noted that the process of determining the abnormal gathering of people analysis results for each second target frame image is consistent with the process of determining the abnormal gathering of people analysis results for the first target frame image, which will not be repeated here.
[0078] Furthermore, the abnormal personnel gathering analysis device superimposes the abnormal personnel gathering analysis results of the first target frame image and the abnormal personnel gathering analysis results corresponding to multiple second target frame images into the video stream and displays them visually.
[0079] It should be noted that, since there is a preset time interval between the first target frame image and the multiple second target frame images, the multiple frames within the preset time interval continue to use the previous abnormal personnel gathering analysis results superimposed on the video stream for visual display. For example, through the above steps, the abnormal personnel gathering analysis results of the first frame image and the abnormal personnel gathering analysis results of the third frame image are obtained, and the second frame image continues to use the abnormal personnel gathering analysis results of the first frame image for visual display in the video stream.
[0080] Furthermore, while the abnormal gathering of people analysis device is performing visual display, an alarm is triggered, wherein the alarm triggering method may be to display the alarm information or to turn on the alarm.
[0081] It should be noted that when there is an abnormal gathering of people in multiple consecutive frames of images, the abnormal time period can be calculated based on the timestamps of the multiple frames of images and displayed in the corresponding time period in the video stream.
[0082] The embodiment of the present invention periodically extracts multiple frame images from the video stream and performs analysis on abnormal gatherings of people respectively, superimposes the analysis results of each frame image into the video stream, and displays them visually, thereby achieving continuous monitoring and dynamic tracking of abnormal gatherings of people, allowing abnormal situations to be discovered and visualized in real time, thereby providing effective real-time monitoring and alarm information, and effectively improving the efficiency of public safety management and emergency response.
[0083] The abnormal personnel gathering analysis device provided by the present invention is described below. The abnormal personnel gathering analysis device described below and the abnormal personnel gathering analysis method described above can be referenced to each other.
[0084] Reference Figure 3 , Figure 3 It is a structural schematic diagram of the abnormal personnel gathering analysis device provided by the present invention.
[0085] The abnormal gathering analysis device comprises: The acquisition module 310 is used to acquire a video stream.
[0086] The extraction module 320 is used to extract the first target frame image from the video stream.
[0087] The person detection module 330 is used to perform person detection on the first target frame image to obtain target frame information of each person in the first target frame image.
[0088] The clustering module 340 is used to perform cluster analysis on multiple persons based on the target frame information of each person to obtain multiple clusters.
[0089] The abnormal aggregation analysis module 350 is used to perform abnormal aggregation analysis of personnel based on the multiple clusters to obtain an abnormal aggregation analysis result of personnel of the first target frame image.
[0090] Furthermore, the clustering module 340 is also used for: Each person was identified as not having visited a sample point; Determine the neighborhood radius and preset the minimum number of sample points; Based on the target frame information of each unvisited sample point, determine the distance between every two unvisited sample points; Selecting a first visited sample point from a plurality of unvisited sample points; Taking the first visited sample point as the cluster center, delineating the neighborhood of the first visited sample point based on the neighborhood radius; if the number of target sample points in the neighborhood is less than the preset minimum number of sample points, returning to the step of selecting the first visited sample point from multiple unvisited sample points; the target sample point is an unvisited sample point other than the first visited sample point among the multiple unvisited sample points, and the distance between the target sample point and the first visited sample point is less than or equal to the neighborhood radius; if the number of target sample points in the neighborhood is greater than or equal to the preset minimum number of sample points, dividing the first visited sample point and the target sample point in the neighborhood into one cluster; Selecting a second access sample point from a plurality of remaining unvisited sample points; the remaining unvisited sample points refer to the remaining unvisited sample points in the plurality of unvisited sample points except the first access sample point and the target sample point; The second visited sample point is updated to the first visited sample point, and the step of taking the first visited sample point as the cluster center and defining the neighborhood based on the neighborhood radius is iteratively performed until all unvisited sample points are divided into clusters, thereby obtaining a plurality of clusters.
[0091] Furthermore, the abnormal aggregation analysis module 350 is also used for: Determine the number of people in each cluster; The clusters with the number of personnel exceeding the preset threshold are determined as the initial abnormal aggregation areas; Determine the center point location information of each initial abnormal aggregation area; Based on the center point position information of each initial abnormal gathering area, abnormal personnel gathering analysis is performed to obtain the abnormal personnel gathering analysis result of the first target frame image.
[0092] Furthermore, the abnormal aggregation analysis module 350 is also used for: The first target frame image and the center point position information of each initial abnormal aggregation area are input into the aggregation area type recognition model to obtain the type of each initial abnormal aggregation area output by the aggregation area type recognition model; the aggregation area type recognition model is obtained by model training based on the area samples and the type labels of the area samples; the initial abnormal aggregation area that meets the preset area type is determined as the target abnormal aggregation area; The center point position information, type and number of personnel in each target abnormal gathering area are determined as the abnormal personnel gathering analysis result of the first target frame image.
[0093] Furthermore, the abnormal gathering analysis device is also used for: Starting from the timestamp of the first target frame image, extracting a plurality of second target frame images from the video stream at a preset time interval; Performing personnel abnormal aggregation analysis on the plurality of second target frame images respectively to obtain a personnel abnormal aggregation analysis result of each second target frame image; The abnormal personnel gathering analysis result of the first target frame image and the abnormal personnel gathering analysis results corresponding to the multiple second target frame images are superimposed on the video stream and displayed.
[0094] Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the abnormal aggregation analysis method of personnel, which includes: obtaining a video stream; extracting a first target frame image from the video stream; performing personnel detection on the first target frame image to obtain target frame information of each person in the first target frame image; performing cluster analysis on multiple persons based on the target frame information of each person to obtain multiple cluster clusters; performing abnormal aggregation analysis on personnel based on the multiple cluster clusters to obtain abnormal aggregation analysis results of personnel in the first target frame image.
[0095] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0096] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the abnormal personnel aggregation analysis method provided by the above-mentioned embodiments, and the method includes: obtaining a video stream; extracting a first target frame image in the video stream; performing personnel detection on the first target frame image to obtain target frame information of each person in the first target frame image; based on the target frame information of each person, performing cluster analysis on multiple people to obtain multiple cluster clusters; performing abnormal personnel aggregation analysis based on the multiple cluster clusters to obtain the abnormal personnel aggregation analysis results of the first target frame image.
[0097] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the abnormal personnel aggregation analysis method provided in the above-mentioned embodiments, the method comprising: acquiring a video stream; extracting a first target frame image from the video stream; performing personnel detection on the first target frame image to obtain target frame information of each person in the first target frame image; performing cluster analysis on multiple persons based on the target frame information of each person to obtain multiple cluster clusters; performing abnormal personnel aggregation analysis based on the multiple cluster clusters to obtain abnormal personnel aggregation analysis results of the first target frame image.
[0098] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.
[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for analyzing abnormal gathering of people, It is characterized in that include: Get the video stream; Extracting a first target frame image from the video stream; Performing person detection on the first target frame image to obtain target frame information of each person in the first target frame image; Based on the target frame information of each person, cluster analysis is performed on multiple persons to obtain multiple clusters; An abnormal personnel aggregation analysis is performed based on the multiple clusters to obtain an abnormal personnel aggregation analysis result of the first target frame image.
2. The method for analyzing abnormal gathering of personnel according to claim 1, It is characterized in that Based on the target frame information of each person, cluster analysis is performed on multiple persons to obtain multiple clusters, including: Each person was identified as not having visited a sample point; Determine the neighborhood radius and preset the minimum number of sample points; Based on the target frame information of each unvisited sample point, determine the distance between every two unvisited sample points; Selecting a first visited sample point from a plurality of unvisited sample points; Taking the first visited sample point as the cluster center, delineating the neighborhood of the first visited sample point based on the neighborhood radius; if the number of target sample points in the neighborhood is less than the preset minimum number of sample points, returning to the step of selecting the first visited sample point from multiple unvisited sample points; the target sample point is an unvisited sample point other than the first visited sample point among the multiple unvisited sample points, and the distance between the target sample point and the first visited sample point is less than or equal to the neighborhood radius; if the number of target sample points in the neighborhood is greater than or equal to the preset minimum number of sample points, dividing the first visited sample point and the target sample point in the neighborhood into one cluster; Selecting a second access sample point from a plurality of remaining unvisited sample points; the remaining unvisited sample points refer to the remaining unvisited sample points in the plurality of unvisited sample points except the first access sample point and the target sample point; The second visited sample point is updated to the first visited sample point, and the step of taking the first visited sample point as the cluster center and defining the neighborhood based on the neighborhood radius is iteratively performed until all unvisited sample points are divided into clusters, thereby obtaining a plurality of clusters.
3. The method for analyzing abnormal gathering of personnel according to claim 2, It is characterized in that The calculation formula of the neighborhood radius is as follows: Among them, ε represents the neighborhood radius; represents the pixel area of the target frame where the person Hi is located; m represents the total number of people in the first target frame image; α represents the preset distance between people.
4. The method for analyzing abnormal gathering of personnel according to claim 1, It is characterized in that The performing of abnormal personnel aggregation analysis based on the multiple clusters to obtain an abnormal personnel aggregation analysis result of the first target frame image includes: Determine the number of people in each cluster; The clusters with the number of personnel exceeding the preset threshold are determined as the initial abnormal aggregation areas; Determine the center point location information of each initial abnormal aggregation area; Based on the center point position information of each initial abnormal gathering area, abnormal personnel gathering analysis is performed to obtain the abnormal personnel gathering analysis result of the first target frame image.
5. The method for analyzing abnormal gathering of personnel according to claim 4, It is characterized in that The abnormal gathering analysis of personnel is performed based on the center point position information of each initial abnormal gathering area to obtain the abnormal gathering analysis result of personnel of the first target frame image, including: Inputting the first target frame image and the center point position information of each initial abnormal aggregation area into an aggregation area type recognition model, and obtaining the type of each initial abnormal aggregation area output by the aggregation area type recognition model; the aggregation area type recognition model is obtained by model training based on area samples and type labels of the area samples; Determine an initial abnormal aggregation area that meets a preset area type as a target abnormal aggregation area; The center point position information, type and number of personnel in each target abnormal gathering area are determined as the abnormal personnel gathering analysis result of the first target frame image.
6. The method for analyzing abnormal gathering of personnel according to any one of claims 1 to 5, It is characterized in that After performing personnel abnormal aggregation analysis based on the multiple clusters to obtain the personnel abnormal aggregation analysis result of the first target frame image, the method includes: Starting from the timestamp of the first target frame image, extracting a plurality of second target frame images from the video stream at a preset time interval; Performing personnel abnormal aggregation analysis on the plurality of second target frame images respectively to obtain a personnel abnormal aggregation analysis result of each second target frame image; The abnormal personnel gathering analysis result of the first target frame image and the abnormal personnel gathering analysis results corresponding to the multiple second target frame images are superimposed on the video stream and displayed.
7. A device for analyzing abnormal gathering of people, It is characterized in that include: An acquisition module is used to acquire video streams; An extraction module, used for extracting a first target frame image from the video stream; A person detection module, used to perform person detection on the first target frame image to obtain target frame information of each person in the first target frame image; The clustering module is used to perform cluster analysis on multiple persons based on the target frame information of each person to obtain multiple clusters; The abnormal aggregation analysis module is used to perform abnormal aggregation analysis of personnel based on the multiple clusters to obtain the abnormal aggregation analysis result of personnel of the first target frame image.
8. A device, comprising an electronic device, the electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method for analyzing abnormal aggregation of personnel as described in any one of claims 1 to 6 are implemented.
9. A medium comprising a non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method for analyzing abnormal aggregation of personnel as described in any one of claims 1 to 6 are implemented.
10. A product, the product comprising a computer program product, the computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method for analyzing abnormal aggregation of personnel as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and system for recognizing illegal parking positions of passenger service vehicles
CN103903438A
Vehicle abnormal gathering monitoring method and device, computer equipment and storage medium
CN114494994A
Abnormal aggregation study and judgment analysis method and system
CN114913363A
Place type identification method and device, computer equipment and storage medium
CN114943892A
Defect classification method and device, electronic equipment and storage medium
CN117456290A
