Method, device, equipment and storage medium for identifying crowd behavior
By identifying the corner points and optical flow vectors of video frames, combined with pre-trained behavior recognition models, it can quickly identify crowd behaviors, solve the problems of low recognition efficiency and insufficient accuracy in the existing technology, and improve the safety and prevention capabilities of public places.
Patent Information
- Application Number
- CN202110253938.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-09
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-03-09
AI Technical Summary
Existing video analysis technology has low efficiency and insufficient accuracy in identifying crowd behavior, making it difficult to quickly and effectively detect and prevent emergencies in public places, affecting public safety.
By obtaining the target video, the corner points of the video frame are determined, and predictions are made based on the corner optical flow vector and the pre-trained behavior recognition model to identify the behavior of the crowd. The method includes a video acquisition unit, a corner determination unit, an optical flow determination unit and a behavior recognition unit, and uses a computer processor and memory to execute relevant instructions to achieve rapid recognition of crowd behavior.
It achieves rapid and effective identification of crowd behavior, provides technical support for smart security, and improves the safety and prevention capabilities of public places.
Smart Images

Figure CN112989987B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, specifically to the field of computer vision, and in particular to methods, devices, equipment and storage media for identifying crowd behavior. Background Art
[0002] With the rapid development and application of computer vision and artificial intelligence, video analysis technology has flourished and is widely used in many areas of human life, such as smart security, human-computer interaction, smart home and smart medical care. With the continuous improvement of video surveillance systems in Chinese urban communities, smart communities have also become a new model of social management innovation. Video surveillance has the advantages of non-invasiveness, large monitoring range, rich and intuitive information collection, and has more advantages than other prevention and control methods. In public places such as squares and stations where pedestrians are the main monitoring objects, using computers to automatically analyze scenes and perceive environmental situations is an important auxiliary means to effectively detect and prevent emergencies and ensure public safety. Summary of the invention
[0003] Provided are a method, apparatus, device and storage medium for identifying crowd behavior.
[0004] According to a first aspect, a method for identifying crowd behavior is provided, comprising: acquiring a target video, the target video including a crowd; determining the corner points of each video frame in the target video; determining the corner point optical flow vector based on the corner points of each video frame; and predicting the crowd behavior in the target video based on the corner point optical flow vector and a pre-trained behavior recognition model.
[0005] According to the second aspect, a device for identifying crowd behavior is provided, comprising: a video acquisition unit, configured to acquire a target video, the target video including a crowd; a corner point determination unit, configured to determine the corner points of each video frame in the target video; an optical flow determination unit, configured to determine the corner point optical flow vector according to the corner points of each video frame; and a behavior recognition unit, configured to predict the behavior of the crowd in the target video according to the corner point optical flow vector and a pre-trained behavior recognition model.
[0006] According to a third aspect, an electronic device for identifying crowd behavior is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor executes the method described in the first aspect.
[0007] According to a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method as described in the first aspect.
[0008] According to a fifth aspect, a computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the method described in the first aspect.
[0009] The technology of the present application provides a crowd behavior recognition method that can quickly and effectively recognize the behavior of a crowd and provide technical support for smart security.
[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.
[0012] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied;
[0013] Figure 2 is a flow chart of an embodiment of a method for identifying crowd behavior according to the present application;
[0014] Figure 3 is a schematic diagram of an application scenario of the method for identifying crowd behavior according to the present application;
[0015] Figure 4 is a flow chart of another embodiment of a method for identifying crowd behavior according to the present application;
[0016] Figure 5 is a structural schematic diagram of an embodiment of a device for identifying crowd behavior according to the present application;
[0017] Figure 6 It is a block diagram of an electronic device used to implement the method for identifying crowd behavior in an embodiment of the present application. DETAILED DESCRIPTION
[0018] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0019] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0020] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the method for identifying crowd behavior or the apparatus for identifying crowd behavior of the present application can be applied.
[0021] like Figure 1 As shown, the system architecture 100 may include a monitoring device 101, a terminal device 102, a network 103, and a server 104. The network 104 is used to provide a medium for a communication link between the monitoring device 101, the terminal device 102, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0022] The monitoring device 101 can be installed in various public places, such as shopping malls, stations, squares, etc. The monitoring device 101 can collect videos of people in public places in real time, and send the collected videos to the terminal device 102 or the server 104 through the network.
[0023] The terminal device 102 can interact with the monitoring device 101 or the server 104. The terminal device 102 can be connected to a display screen and installed with various video playback applications, so that the terminal device 102 can display the video collected by the monitoring device 101. The user can watch the above video through the terminal device 102.
[0024] The terminal device 102 can be hardware or software. When the terminal device 102 is hardware, it can be various electronic devices, including but not limited to smart phones, tablet computers, car computers, laptop computers, desktop computers, etc. When the terminal device 102 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0025] The server 104 may be a server that provides various services, such as a background server that processes the video collected by the monitoring device 101. The background server may perform various processing and analysis on the video, obtain crowd behavior, and feed back the crowd behavior to the terminal device 102.
[0026] It should be noted that the server 104 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server 104 is software, it can be implemented as multiple software or software modules (for example, for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0027] It should be noted that the method for identifying crowd behavior provided in the embodiment of the present application is generally executed by the server 104. Accordingly, the device for identifying crowd behavior is generally set in the server 104.
[0028] It should be understood that Figure 1 The number of monitoring devices, terminal devices, networks and servers in the embodiment is only for illustration. Any number of monitoring devices, terminal devices, networks and servers may be provided according to implementation requirements.
[0029] Continue to refer Figure 2 , shows a process 200 of an embodiment of a method for identifying crowd behavior according to the present application. The method for identifying crowd behavior in this embodiment includes the following steps:
[0030] Step 201, obtaining a target video.
[0031] In this embodiment, the execution subject of the method for identifying crowd behavior (for example Figure 1 The server 104 shown in FIG. 104 ) can obtain the target video in various ways. Here, the target video can be a monitoring device (e.g. Figure 1 The target video may be a video of a crowd collected by the monitoring device 101 shown in the figure. For example, the target video may be a video of a public place collected by the monitoring device.
[0032] Step 202: determine the corner points of each video frame in the target video.
[0033] The execution entity can use various corner point extraction algorithms to analyze the target video and determine the corner points of each video frame in the target video. Corner points are extreme points, that is, points with particularly outstanding properties in some aspects. The above-mentioned corner point extraction algorithm can be Harris corner point extraction algorithm, etc. Alternatively, the execution entity can use the corner point extraction algorithm to determine the corner points in the first video frame in the target video. Then, the corner points in the video frame are tracked to obtain their positions in the subsequent video frame, thereby obtaining the corner points in the subsequent video frame. Alternatively, the execution entity can also determine whether the pixel point is a corner point based on the brightness value of each pixel point in the video frame. In this way, the corner points of each video frame can be obtained.
[0034] Step 203: Determine the corner point optical flow vector according to the corner points of each video frame.
[0035] After determining the corner points of each video frame, the execution subject can determine the optical flow vector of the corner point. Optical flow is the instantaneous speed of the pixel movement of a spatial moving object on the observation imaging plane. The optical flow method is a method that uses the changes in pixels in the time domain in an image sequence and the correlation between adjacent frames to find the corresponding relationship between the previous frame and the current frame, thereby calculating the motion information of the object between adjacent frames. The instantaneous rate of change of grayscale at a specific coordinate point on a two-dimensional image plane is usually defined as an optical flow vector. In this embodiment, the execution subject can determine the optical flow vector of the corner point based on the position of the corner point in two adjacent video frames.
[0036] Step 204 , predicting the behavior of the crowd in the target video based on the corner point optical flow vector and the pre-trained behavior recognition model.
[0037] After obtaining the optical flow vectors of each corner point, the execution subject can input the optical flow vectors of each corner point into a pre-trained behavior recognition model, and use the output of the behavior recognition model as the predicted behavior of the crowd in the target video. In this embodiment, the above-mentioned behavior recognition model is used to characterize the corresponding relationship between the optical flow vectors of the corner points and the behavior of the crowd. The behavior recognition model can be various networks, such as a convolutional neural network, etc.
[0038] Continue to see Figure 3 , which shows a schematic diagram of an application scenario of the method for identifying crowd behavior according to the present application. Figure 3 In the application scenario, the monitoring device 301 sends the collected video of the intersection to the server 302. After receiving the above video, the server 302 can first determine the corner points of each video frame in the video. And according to the position of the corner point in each video frame, determine the corner point optical flow vector. Finally, combined with the pre-trained behavior recognition model, predict the crowd behavior. And send the recognized crowd behavior to the terminal device 303.
[0039] The method for identifying crowd behavior provided by the above embodiment of the present application can determine the corner point optical flow vector through the corner points of each video frame in the target video, and can be combined with a pre-trained behavior recognition model to quickly and effectively identify crowd behavior.
[0040] Continue to see Figure 4 , which shows a process 400 of another embodiment of the method for identifying crowd behavior according to the present application. Figure 4 As shown, the method of this embodiment may include the following steps:
[0041] Step 401, obtaining a target video.
[0042] Step 402, for each pixel in each video frame, determine whether the pixel is a corner point based on the brightness of the pixel in the image frame and the brightness of multiple pixels around the pixel; determine the corner points of each video frame in the target video based on the judgment result.
[0043] In this embodiment, after acquiring the target video, the execution subject can analyze each video frame in the target video to determine the brightness of each pixel in each video frame. For any pixel, if the absolute value of the difference between the brightness of the surrounding pixels and the brightness of the pixel is greater than a preset threshold, the pixel is considered to be a corner point. Therefore, the execution subject can use this logic to determine the corner points of each video frame in the target video.
[0044] For example, when determining whether a pixel point P is a corner point, the execution subject may first set its brightness to Ip and set a suitable threshold t. Consider the brightness values of the 16 pixels around the pixel point P. The 16 pixels here may be pixels with a distance of 3 from the pixel point P (see Figure 5 , the pixels that the circle passes through are the surrounding pixels). If the brightness values of N consecutive pixels among the 16 pixels are all greater than Ip+t, or are all less than Ip-t, the pixel point P is considered to be a corner point. The value of N can be set according to the actual application scenario. Here, N is set to 12.
[0045] In order to speed up the determination of corner points, the brightness values of the pixels at positions 1, 9, 5 and 13 can be determined first. Specifically, the execution entity can first determine the brightness values of the pixels at positions 1 and 9. If the brightness values of these two pixels are both greater than Ip+t, or both are less than Ip-t, then continue to check the brightness values of the pixels at positions 5 and 13. It can be understood that if pixel point P is a corner point, then the brightness values of at least three of the pixels at positions 1, 9, 5 and 13 are both greater than Ip+t, or both are less than Ip-t. The upper part of the circle that meets the conditions contains one of the above three pixels. If none of the conditions are met, pixel point P is definitely not a corner point.
[0046] In some optional implementations of this embodiment, the execution subject may first perform grayscale processing on each video frame in the target video to obtain a grayscale video frame sequence; and determine the corner point of each video frame in the grayscale video frame sequence.
[0047] It can be understood that the arrangement order of the video frames in the grayscale video frame sequence is consistent with the arrangement order of the video frames in the target video.
[0048] Step 403, determining the number of corner points in each video frame according to the judgment result; in response to determining that the number of corner points is less than a preset threshold, re-determining the corner points in the video frame.
[0049] After determining the corner points in each video frame, the execution subject can determine the number of corner points in each video frame. If the number of corner points in a video frame is less than a preset threshold, it is determined that the number of corner points in the video frame is too small and the corner points in the video frame need to be re-determined.
[0050] In some optional implementations of this embodiment, the execution subject may determine the corner points in the first video frame of the target video using step 402. Then, the corner points in the first video frame are tracked to obtain the corner points in the next video frame. If the number of corner points obtained in this way is less than a preset threshold, step 402 may be continued to be used for the video frame to perform a secondary determination of the corner points.
[0051] In some optional implementations of this embodiment, the execution subject may determine the corner points of each video frame in the target video using step 402. If the number of corner points of a certain video frame is less than a preset threshold, when step 402 is used again to determine the corner points, the value of N may be adjusted (for example, the value of N may be reduced by 2) to obtain newly added corner points.
[0052] Step 404, for each video frame, track the corner points of the previous video frame, determine the corner points in the current video frame that correspond to the corner points of the previous video frame, and obtain corner point pairs; determine the corner point optical flow vector according to the positions of the corner points in the determined corner point pairs.
[0053] After determining the corner points in each video frame, the execution subject can also track the corner points of the previous video frame to determine the corner points in the current video frame that correspond to the corner points of the previous video frame. Here, tracking refers to finding a pixel point that meets the set error in a fixed window area in the video frame. If it can be found, the pixel point is used as the corner point. The corresponding two corner points can be called a corner point pair. The execution subject can determine the corner point optical flow vector based on the position of the corner point in the previous video frame and the position of the corner point in the next video frame in the corner point pair.
[0054] Step 405 , predicting the behavior of the crowd in the target video based on the corner point optical flow vector and the pre-trained behavior recognition model.
[0055] The behavior recognition model can be a convolutional neural network, for example, it can be a network based on LeNet5. In this embodiment, the behavior recognition model may include an input layer, a convolutional layer, a subsampling layer, a fully connected layer, a classification layer and an output layer. Specifically, the behavior recognition model may include 2 convolutional layers and 2 subsampling layers. The convolutional layer can be a fully connected convolutional layer. There is 1 subsampling layer between the 2 convolutional layers. And the convolutional layer does not set the gain and bias parameters. In other words, the output of the convolutional layer can be directly used as the input of the subsampling layer, without adding a bias and mapping through a sigmoid function. The subsampling layer can achieve maximum pooling. The classification layer can be a softmax layer.
[0056] When training a behavior recognition model, a training sample video may be first obtained, which may include crowd images and behavior labels corresponding to each crowd image. The above labels may include normal crowds walking, abnormal crowds retreating, and abnormal crowds flying around.
[0057] Then, each image in the training sample video is grayed out and then normalized. The normalized image can increase the convergence of the gradient descent process when used for model training. The difference between each adjacent video frame in the image sequence is calculated. The difference is used as input and the corresponding behavior label is used as the expected output to train the above behavior recognition model.
[0058] In some optional implementations of this embodiment, the execution subject may further perform denoising on the optical flow vectors, and then input the denoised optical flow vectors into the above-mentioned behavior recognition model, so as to improve the accuracy of behavior recognition.
[0059] Step 406: In response to determining that the behavior of the crowd indicates an abnormal event, outputting warning information.
[0060] The execution subject can determine whether there is an abnormal event based on the output of the behavior video model. If there is an abnormal event, an early warning message is output. The above-mentioned early warning information may include location, time, number of people, etc.
[0061] The method for identifying crowd behavior provided by the above-mentioned embodiment of the present application can represent the original motion information in the scene through the corner point optical flow vector, and then automatically select the most effective function through the LeNet5-based network, so as to realize accurate, effective and fast identification of crowd behavior.
[0062] Further references Figure 5 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a device for identifying crowd behavior. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0063] like Figure 5 As shown, the apparatus 500 for identifying crowd behavior in this embodiment includes: a video acquisition unit 501 , a corner point determination unit 502 , an optical flow determination unit 503 and a behavior identification unit 504 .
[0064] The video acquisition unit 501 is configured to acquire a target video, where the target video includes a crowd.
[0065] The corner point determination unit 502 is configured to determine the corner points of each video frame in the target video.
[0066] The optical flow determination unit 503 is configured to determine the corner point optical flow vector according to the corner points of each video frame.
[0067] The behavior recognition unit 504 is configured to predict the behavior of the crowd in the target video according to the corner point optical flow vector and the pre-trained behavior recognition model.
[0068] In some optional implementations of the present embodiment, the corner point determination unit 502 may be further configured to: for each pixel point in each video frame, determine whether the pixel point is a corner point based on the brightness of the pixel point in the image frame and the brightness of multiple pixels around the pixel point; and determine the corner points of each video frame in the target video based on the determination result.
[0069] In some optional implementations of this embodiment, the corner point determination unit 502 may be further configured to: determine the number of corner points in each video frame based on the judgment result; and in response to determining that the number of corner points is less than a preset threshold, re-determine the corner points in the video frame.
[0070] In some optional implementations of this embodiment, the optical flow determination unit 503 can be further configured to: for each video frame, track the corner points of the previous video frame, determine the corner points in the current video frame that correspond to the corner points of the previous video frame, and obtain corner point pairs; determine the corner point optical flow vector according to the position of the corner point in the determined corner point pair.
[0071] In some optional implementations of this embodiment, the apparatus 500 may further include: Figure 5 The information output unit not shown in the figure is configured to: output warning information in response to determining that the behavior of the crowd indicates an abnormal event.
[0072] In some optional implementations of this embodiment, the optical flow determination unit 503 may be further configured to: perform grayscale processing on each video frame in the target video to obtain a grayscale video frame sequence; and determine a corner point of each video frame in the grayscale video frame sequence.
[0073] It should be understood that the units 501 to 504 described in the apparatus 500 for identifying crowd behavior are respectively the same as those described in reference Figure 2 Therefore, the operations and features described above for the method for identifying crowd behavior are also applicable to the device 500 and the units included therein, and will not be described in detail here.
[0074] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.
[0075] Figure 6 A block diagram of an electronic device 600 for performing a method for identifying crowd behavior according to an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0076] like Figure 6 As shown, the device 600 includes a processor 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a memory 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An I / O interface (input / output interface) 605 is also connected to the bus 604.
[0077] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a memory 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0078] The processor 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 601 performs the various methods and processes described above, such as a method for identifying crowd behavior. For example, in some embodiments, the method for identifying crowd behavior may be implemented as a computer software program, which is tangibly contained in a machine-readable storage medium, such as a memory 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the processor 601, one or more steps of the method for identifying crowd behavior described above may be performed. Alternatively, in other embodiments, the processor 601 may be configured to perform a method for identifying crowd behavior in any other appropriate manner (e.g., by means of firmware).
[0079] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0080] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. The above program code can be packaged into a computer program product. These program codes or computer program products can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor 601, enables the functions / operations specified in the flow chart and / or the block diagram to be implemented. The program code can be executed completely on the machine, partially on the machine, partially on the machine as an independent software package and partially on a remote machine or completely on a remote machine or server.
[0081] In the context of the present application, a machine-readable storage medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable storage medium may be a machine-readable signal storage medium or a machine-readable storage medium. A machine-readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0082] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0083] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0084] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server in a distributed system, or a server combined with a blockchain.
[0085] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.
[0086] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A method for identifying crowd behavior, comprising: Acquire a target video, where the target video includes a crowd; Determine the corner points and the number of corner points of each video frame in the target video; In response to determining that the number of corner points of any video frame is less than a preset threshold, re-determining the corner points in the video frame; In response to determining that the number of the corner points is not less than a preset threshold, determining a corner point optical flow vector according to the corner points of each video frame; Predicting the behavior of the crowd in the target video according to the corner point optical flow vector and a pre-trained behavior recognition model; The step of determining the corner points and the number of corner points of each video frame in the target video includes: Determine the corner points and the number of corner points in the first video frame according to the brightness value of each pixel in the first video frame; Tracking the corner points in the first video frame to obtain the corner points and the number of corner points in the next video frame; Wherein, re-determining the corner points in the video frame includes: According to the brightness value of each pixel in the video frame, secondarily determining the corner points and the number of corner points in the video frame; In response to the number of corner points determined for the second time being less than the preset threshold, the preset threshold is reduced, and the corner points and the number of corner points in the video frame are determined again according to the brightness value of each pixel in the video frame.
2. The method according to claim 1, wherein: The determining of the corner points and the number of the corner points in the video frame includes: For each pixel in the video frame, judging whether the pixel is a corner point according to the brightness of the pixel and the brightness of multiple pixels around the pixel; According to the judgment result, the corner points and the number of corner points in the video frame are determined.
3. The method according to claim 1, wherein: The step of determining the corner point optical flow vector according to the corner points of each video frame includes: For each video frame, the corner points of the previous video frame are tracked to determine the corner points in the current video frame that correspond to the corner points of the previous video frame, and obtain corner point pairs; According to the position of the center corner point of the determined corner point pair, the corner point optical flow vector is determined.
4. The method according to claim 1, wherein: The method further comprises: In response to determining that the behavior of the group of people indicates an abnormal event, outputting warning information.
5. The method according to claim 1, wherein: The determining of the corner points and the number of corner points of each video frame in the target video includes: Performing grayscale processing on each video frame in the target video to obtain a grayscale video frame sequence; Determine the corner points and the number of corner points of each video frame in the grayscale video frame sequence.
6. A device for identifying crowd behavior, comprising: A video acquisition unit is configured to acquire a target video, wherein the target video includes a crowd; A corner point determination unit, configured to determine the corner points and the number of corner points of each video frame in the target video; In response to determining that the number of corner points of any video frame is less than a preset threshold, re-determining the corner points in the video frame; an optical flow determination unit, configured to determine a corner point optical flow vector according to the corner points of each video frame in response to determining that the number of the corner points is not less than a preset threshold; A behavior recognition unit, configured to predict the behavior of the crowd in the target video according to the corner point optical flow vector and a pre-trained behavior recognition model; Wherein, the corner point determination unit is further configured to: Determine the corner points and the number of corner points in the first video frame according to the brightness value of each pixel in the first video frame; Tracking the corner points in the first video frame to obtain the corner points and the number of corner points in the next video frame; Wherein, the corner point determination unit is further configured to: According to the brightness value of each pixel in the video frame, secondarily determining the corner points and the number of corner points in the video frame; In response to the number of corner points determined for the second time being less than the preset threshold, the preset threshold is reduced, and the corner points and the number of corner points in the video frame are determined again according to the brightness value of each pixel in the video frame.
7. The device according to claim 6, wherein: The corner point determination unit is further configured to: For each pixel in the video frame, judging whether the pixel is a corner point according to the brightness of the pixel and the brightness of multiple pixels around the pixel; According to the judgment result, the corner points and the number of corner points in the video frame are determined.
8. The device according to claim 6, wherein: The optical flow determination unit is further configured to: For each video frame, the corner points of the previous video frame are tracked to determine the corner points in the current video frame that correspond to the corner points of the previous video frame, and obtain corner point pairs; According to the position of the center corner point of the determined corner point pair, the corner point optical flow vector is determined.
9. The device according to claim 6, wherein: The device further comprises an information output unit configured to: In response to determining that the behavior of the group of people indicates an abnormal event, outputting warning information.
10. The device according to claim 6, wherein: The corner point determination unit is further configured to: Performing grayscale processing on each video frame in the target video to obtain a grayscale video frame sequence; Determine the corner points and the number of corner points of each video frame in the grayscale video frame sequence.
11. An electronic device for executing a method for identifying crowd behavior, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Target speed estimation method and device and image processing equipment
CN110033476A
Public place abnormal behavior automatic identification method and device, and camera equipment
CN112085003A
Method and device for estimating rate of object and image processor
JP2019124683A
Key point detection method and device, storage medium and electronic device
WO2018202089A1
