Checkpoint people flow detection method and system, electronic equipment and storage medium
By combining YOLO target detection and Kalman filter, the accuracy and efficiency of pedestrian flow monitoring in densely populated areas are solved. This method enables accurate flow statistics even under conditions of multiple people blocking the view and reverse flow, thereby improving the intelligence and real-time performance of pedestrian flow management.
Patent Information
- Application Number
- CN202511280350.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-09
- Publication Date
- 2026-01-16
AI Technical Summary
Existing technologies have low accuracy and low statistical efficiency in monitoring pedestrian flow in densely populated areas, especially in complex situations such as multiple people blocking the view or reverse flow, making it difficult to provide accurate flow monitoring.
The YOLO target detection algorithm is used to identify human targets. Combined with the hidden time Kalman filter and probabilistic data association algorithm, the target position is predicted and the movement trajectory is updated. The direction of the target's entry and exit is determined, and the flow of people is counted.
It improves the accuracy and efficiency of people flow statistics, can stably track targets in complex crowd environments, and provides real-time and accurate people flow management support.
Smart Images

Figure CN121354005A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence, and in particular relates to a method for detecting pedestrian flow at checkpoints, a system electronic device, and a storage medium. Background Technology
[0002] When monitoring and managing pedestrian flow at checkpoints or entrances with high pedestrian density, traditional methods mainly rely on infrared sensing, turnstile recording, or manual monitoring. These methods can play a certain role in low-density pedestrian environments, but with the acceleration of modern urbanization, the flow of people in public places, transportation hubs, and other places is becoming increasingly dense and complex. Traditional technologies have many shortcomings in dealing with large-scale, multi-directional, and multi-target pedestrian flow management.
[0003] For example, infrared sensors and turnstiles have low accuracy when handling large crowds, especially in scenarios where multiple people enter and exit simultaneously. They cannot accurately count people, easily leading to missed or double counting. In densely populated areas such as subway entrances and exits, when multiple people pass through at the same time, sensors can only record a single passing event, resulting in inaccurate statistics. Turnstiles, due to physical space limitations, are easily affected by factors such as people being too close together or carrying luggage or items, leading to counting errors. Image processing-based flow detection systems perform poorly when dealing with multiple people obstructing each other or overlapping targets, making it difficult to accurately distinguish individuals. Furthermore, in situations with multiple people moving around, especially at two-way entrances and exits, the inability to detect the direction of movement makes it difficult to distinguish between people entering and exiting, further affecting the accuracy of statistics.
[0004] Current methods of traffic flow statistics can only handle simple, low-density traffic scenarios. When faced with complex situations such as a large number of people entering and exiting at the same time, reverse flow, and multiple people blocking the way, they are unable to provide accurate traffic flow monitoring and have low traffic flow statistics efficiency. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a method for detecting pedestrian flow at checkpoints, a system electronic device, and a storage medium to solve the problems of low accuracy and low statistical efficiency in current checkpoint pedestrian flow monitoring.
[0006] In a first aspect of the present invention, a method for detecting pedestrian flow at a checkpoint is provided, comprising: The YOLO target detection algorithm was used to identify human targets in image frames captured by security cameras at checkpoints. The position of the human target in the next frame is predicted by a Kalman filter with a hidden time. When the current human target is detected to be occluded, the position of the human target in the next frame is predicted by a probabilistic data association algorithm. Update the character's movement trajectory based on the predicted character's position, and determine the character's direction of entering or leaving the level based on the character's movement trajectory; Based on the direction in which characters enter and exit the checkpoint, the flow of people entering and exiting the checkpoint during the same period is counted.
[0007] In a second aspect of the present invention, a checkpoint pedestrian flow detection system is provided, comprising: The target detection module is used to identify human targets in image frames captured by checkpoint surveillance cameras using the YOLO target detection algorithm; The target tracking module is used to predict the position of the human target in the next frame using a Kalman filter with a concealment time. When the current human target is detected to be occluded, the position of the human target in the next frame is predicted using a probabilistic data association algorithm. The direction prediction module is used to update the movement trajectory of the character based on the predicted position of the character, and to determine the direction of the character entering or leaving the level based on the movement trajectory. The quantity statistics module is used to count the number of people entering and exiting the checkpoint during the same period, based on the direction in which characters enter and exit the checkpoint.
[0008] In a third aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor executes the computer program to implement the steps of the method as described in the first aspect of the present invention.
[0009] In a fourth aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method provided in the first aspect of the present invention.
[0010] In this embodiment of the invention, the YOLO target detection algorithm is employed to quickly and accurately detect each target in dense crowds. A hidden time-of-flight Kalman filter with probabilistic data association is used to track the targets. Based on the tracked target trajectory, the direction of entry and exit from the checkpoint is determined, and the flow of people entering and exiting the checkpoint during the same period is statistically analyzed. This not only solves the problem of decreased accuracy in flow statistics caused by target occlusion and bidirectional target movement, effectively improving the accuracy and reliability of checkpoint target statistics, but also ensures the efficiency and real-time nature of flow statistics, providing support for venue management and crowd control, and achieving intelligent and precise crowd management. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart illustrating a method for detecting pedestrian flow at a checkpoint, provided in one embodiment of the present invention. Figure 2 This is another flowchart illustrating a method for detecting pedestrian flow at a checkpoint, as provided in one embodiment of the present invention. Figure 3 This is a schematic diagram of a checkpoint pedestrian flow detection system provided in one embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation
[0013] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0014] It should be understood that the terms "comprising" and other similar expressions in the specification, claims, and accompanying drawings of this invention are intended to cover a non-exclusive inclusion, such as a process, method, system, or apparatus that includes a series of steps or units and is not limited to the listed steps or units. Furthermore, "first" and "second" are used to distinguish different objects and are not intended to describe a specific order.
[0015] Please see Figure 1 A flowchart illustrating a checkpoint pedestrian flow detection method provided in this embodiment of the invention includes: S101. Identify human targets in image frames captured by checkpoint surveillance cameras using the YOLO target detection algorithm; The YOLO (You Only Look Once) object detection algorithm is used to detect targets in surveillance videos at checkpoints. YOLO boasts high detection speed and accuracy, automatically identifying human targets within video frames. It divides each input frame into multiple grid cells, quickly locating and identifying human targets within each cell, thus achieving real-time personnel detection across the entire scene.
[0016] Compared to traditional detection algorithms, YOLO's advantage lies in its efficiency in processing all regions at once, reducing redundant calculations, improving overall detection efficiency, and having a smaller memory footprint than other target detection algorithms, making it more suitable for deployment on low-power devices.
[0017] The person target refers to the person appearing in the surveillance video. The YOLO object detection algorithm can automatically detect the position of the person in the video frame and draw the corresponding target box (bounding box).
[0018] S102. Predict the position of the human target in the next frame using a Kalman filter with a hidden time. When the current human target is detected to be occluded, predict the position of the human target in the next frame using a probabilistic data association algorithm. Human targets in video frames are tracked using a hidden-time Kalman filter with probabilistic data association. After a human target is detected, the hidden-time Kalman filter predicts the position of each target in the next frame. The hidden-time Kalman filter is an extension of the Kalman filter that estimates the hidden state of a target between observations by incorporating the hidden-time distribution into the filtering equation. When observations are available, the hidden-time Kalman filter updates the target state estimate using the observation data and the estimated state during the hiding period. The Kalman filter expression is as follows: State prediction: ; Status Update: ; in, K k Let A be the Kalman gain, A be the state transition matrix, and H be the observation matrix.
[0019] When a target is partially occluded, the position of the person is predicted using a probabilistic data association algorithm. The probabilistic data association algorithm (PDA) is a probabilistic inference algorithm used for target tracking and multi-target tracking. It processes incomplete, inaccurate, or conflicting observation data by introducing probabilistic models and correlation information to provide reliable target state estimation and trajectory prediction.
[0020] Specifically, the target observations are associated with the target's potential trajectory based on the likelihood function. When the target is occluded, the Kalman filter is used to maintain the prediction of the potential trajectory of each target and assign a prediction probability to each trajectory. When the target observations are reacquired, the prediction probabilities of different trajectories are updated according to the target's likelihood function, and the trajectory with the highest probability is selected as the estimate of the target's position.
[0021] By associating observations with potential trajectories of a target using a likelihood function, the filter maintains multiple potential trajectories of the target during occlusion and assigns a probability to each trajectory based on their consistency with previous observations. When new observation data becomes available, the filter updates the probabilities of different trajectories based on their likelihood and selects the trajectory with the highest probability as the current estimate of the target's state. This reduces tracking errors caused by target occlusion or partial disappearance, thereby stably predicting the future location of personnel.
[0022] S103. Update the character target's movement trajectory based on the predicted character target's position, and determine the character target's direction of entering or leaving the level based on the character target's movement trajectory; During target tracking, the system continuously predicts the target's position in the next frame and updates the target's movement trajectory. Based on the target's movement trajectory, the direction in which the target enters or exits the level can be determined, i.e., whether the character's target is entering or exiting the level.
[0023] S104. Based on the direction of the character's entry and exit from the checkpoint, count the number of people entering and exiting the checkpoint during the same period.
[0024] Since each video frame of the surveillance video contains target detection information, that is, all targets in the video frame have been detected, and combined with the direction of each target entering and leaving the checkpoint, the number of people entering the checkpoint and the number of people leaving the checkpoint during the same period can be counted.
[0025] In this embodiment, the YOLO target detection algorithm is used to process surveillance video in real time and automatically identify each person target. A hidden time Kalman filter with probabilistic data association is used to track the target's movement trajectory in real time. This maintains the accuracy and stability of target detection even in complex scenarios with multiple people obscuring or partially disappearing objects, thereby improving the accuracy of people flow statistics. Based on people flow statistics, accurate real-time information can be provided to venue managers, facilitating the optimization of traffic efficiency and the prevention of congestion or potential safety hazards.
[0026] In one embodiment, such as Figure 2 As shown, step S103 also includes: S1031. Obtain the number of people passing through the checkpoint within a unit of time, and calculate the population density rate of the checkpoint based on the number of people passing through the checkpoint within a unit of time and the width of the gate at the checkpoint.
[0027] The density of pedestrian traffic can be classified based on the pedestrian density rate (D) at checkpoints, which is the average number of people passing through each meter of gate width per unit time. The expression for calculating the pedestrian density rate is: ; Where N is the number of people passing through the checkpoint per unit time, and W is the width of the gate at the checkpoint.
[0028] Furthermore, step S1031 also includes: S1032. When the population density is lower than the preset value, the movement direction of each person is determined based on the movement trajectory of the person and the direction of the head of the person. S1033. When the crowd density is higher than the preset value, the direction of the crowd entering and leaving the checkpoint is determined based on the movement trajectory of the target group of people.
[0029] By comparing the crowd density rate with the preset value, it can be determined whether the current crowd passing through the checkpoint is a moderately dense crowd or a high-density crowd.
[0030] For example, when 0 ≤ D < 3, it is considered low-density pedestrian flow, and when D ≥ 3, it is considered high-density pedestrian flow. Different methods are used to estimate the direction of low-density and high-density pedestrian flow based on the density of the flow.
[0031] In low-density crowds, there is less interference between pedestrians, and the head information of pedestrians collected by cameras is clearer. The system can estimate the movement direction of each target based on the head orientation and pedestrian trajectory, analyze the pedestrian's head using grayscale histograms, determine its front and back orientation, and combine the target's movement trajectory to determine the target's movement direction.
[0032] By analyzing the pedestrian's positional changes in video frames, the trajectory of the target's movement is obtained. The trajectory data refers to the target's "starting coordinates" in the current frame and the "coordinate displacement vector" to the position in the next frame. Combining head orientation and trajectory data, when a pedestrian moves from near the camera to a distance with their head facing backward, it is determined that they are entering the checkpoint; when a pedestrian moves from far away from the camera to near the camera with their head facing forward, it is determined that they are leaving the checkpoint. When the pedestrian's trajectory movement direction is consistent with their head orientation, it is determined to be normal entry or exit. When the trajectory and head orientation are opposite, the overall trend of the trajectory needs to be further confirmed to rule out anomalies.
[0033] In high-density crowds, the mutual occlusion and movement interference between individual pedestrians are significant, making it difficult to identify the head direction of each pedestrian individually. Therefore, the direction of entry and exit of the crowd can be determined by the movement trajectory of the group.
[0034] Among them, the overall movement trajectory of pedestrians in the same group is analyzed to determine the direction of entry and exit of the crowd. When the centroid of the group moves from near the camera to far away, it is judged as entering the checkpoint; when the centroid of the group moves from far away to near the camera, it is judged as leaving the checkpoint.
[0035] In this embodiment, different methods are used to process the direction estimation of low-density and high-density crowds. In low-density crowd environments, head orientation and movement trajectories are used to accurately determine the direction of entry and exit. In high-density crowd environments, groups are defined when multiple people enter and exit. By analyzing the overall movement trend of the group, targets in different directions can be distinguished more accurately, and the main movement direction of the group can be identified. This can improve the accuracy of the system in determining the direction of targets in high-density crowd environments, thereby improving the accuracy of crowd flow statistics.
[0036] In one embodiment, the Region of Interest (ROI) of the target person's head is extracted, grayscale processing is performed on the head ROI, and the peak value of the grayscale histogram corresponding to the head ROI is compared with a preset threshold to determine the orientation of the target person's head.
[0037] The upper third of the pedestrian bounding box is used as the ROI for the head to perform grayscale analysis. The human face typically contains more variations in light and shadow, such as features like the eyes, nose, and mouth, resulting in large variations in grayscale values and multiple peaks in the histogram. In contrast, the back of the head is usually smoother and more uniform, with grayscale values concentrated within a certain range, resulting in a single or few peaks in the histogram.
[0038] For example, when the peak value of the histogram of the head region exceeds 4, the head is determined to be facing forward; when the peak value of the histogram of the head region is less than 4, the head is determined to be facing backward. Heads entering the level exhibit a backward-facing back-of-the-head feature, while heads leaving the level exhibit a forward-facing facial feature.
[0039] In one embodiment, the angle between the motion vectors of each character target and the surrounding character targets is analyzed. If the angle is less than a set value, the character targets are defined as the same group with similar directions. The overall motion trajectory of the character targets in the same group is analyzed to determine the direction of people entering and leaving the checkpoint.
[0040] Considering the spatial distribution and temporal dynamics of pedestrians, the system analyzes the angle between the motion vectors of each target and surrounding targets, defining targets with similar directions as belonging to the same group. Within a specific range, if the angle between the motion vectors of other targets and the motion vector of this target is less than or equal to a set value, such as 20 degrees, then these targets can be considered to belong to the same group. This group determination helps distinguish targets from different directions when multiple people enter or exit simultaneously. In dense crowds, individual pedestrians may briefly change direction; the system prioritizes the overall flow trend and ignores a few individuals moving in the opposite direction.
[0041] Assumption It is the first i The first goal in t Frame coordinates, It is the first i The goal is in t The dynamic data of a frame can be defined. For the first i The first goal in t The "crowd" in the frame: ; in, and h These represent the width and height of the source video, respectively.
[0042] In one embodiment, calculating the flow of people entering and exiting a checkpoint during the same period, based on the direction in which a person enters or exits the checkpoint, also includes: Surveillance cameras are installed in both directions of the checkpoint. The entry and exit data from the two cameras within the same time period are accumulated and averaged to obtain the flow of people entering and exiting the checkpoint during the same period.
[0043] In this embodiment, based on data from two cameras positioned in different directions, the system performs pedestrian flow statistics and generates real-time flow reports, providing decision support for managers and optimizing pedestrian flow management and scheduling. By setting up cameras in two directions, the system fully utilizes multi-view information, effectively increasing the comprehensiveness and accuracy of pedestrian flow monitoring.
[0044] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0045] Figure 3 A schematic diagram of a checkpoint pedestrian flow detection system provided in an embodiment of the present invention is shown. The system includes: The target detection module 310 is used to identify human targets in image frames captured by the checkpoint monitoring camera using the YOLO target detection algorithm; The target tracking module 320 is used to predict the position of the human target in the next frame through a Kalman filter with a concealment time. When the current human target is detected to be occluded, the position of the human target in the next frame is predicted through a probabilistic data association algorithm. Among them, the target observation value is associated with the target's potential trajectory based on the likelihood function. When the human target is occluded, the Kalman filter is used to maintain the prediction of the potential trajectory of each target and assign a prediction probability to each trajectory. Once the target observation is reacquired, the predicted probabilities of different trajectories are updated based on the target's likelihood function, and the trajectory with the highest probability is selected as the estimate of the target's location.
[0046] The direction prediction module 330 is used to update the movement trajectory of the character target based on the predicted position of the character target, and to determine the direction of the character target entering or leaving the level based on the movement trajectory of the character target. The quantity statistics module 340 is used to count the number of people entering and exiting the checkpoint during the same period, based on the direction in which the characters enter and exit the checkpoint.
[0047] In one embodiment, the direction prediction module 330 includes: The flow calculation unit is used to obtain the number of people passing through the checkpoint per unit time, and calculate the flow density rate of people passing through the checkpoint based on the number of people passing through the checkpoint per unit time and the width of the gate at the checkpoint.
[0048] In one possible embodiment, the direction prediction module 330 includes: The low-density crowd flow direction determination unit is used to determine the movement direction of each person based on the movement trajectory and head orientation of the person when the crowd density is lower than a preset value. The high-density crowd flow direction judgment unit is used to determine the direction of people entering and leaving the checkpoint based on the movement trajectory of the target group when the crowd density is higher than the preset value.
[0049] The step of determining the movement direction of each human target based on the human target's movement trajectory and head orientation includes: Extract the ROI (Region of Interest) of the target person's head, perform grayscale processing on the ROI, and compare the peak value of the grayscale histogram corresponding to the ROI with a preset threshold to determine the orientation of the target person's head.
[0050] The step of determining the direction of people entering and exiting the checkpoint based on the movement trajectory of the target group includes: Analyze the angle between the motion vectors of each target character and the surrounding targets characters. If the angle is less than a set value, the targets characters are defined as the same group with similar directions. Analyze the overall movement trajectory of people in the same group to determine the direction of people entering and exiting the checkpoint.
[0051] In one embodiment, surveillance cameras are installed in both directions of entry and exit at the checkpoint. The entry and exit data from the two cameras within the same time period are cumulatively counted and averaged to obtain the flow of people entering and exiting the checkpoint during the same period.
[0052] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system and modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0053] Figure 4 This is a schematic diagram of an electronic device according to an embodiment of the present invention. The electronic device is used for detecting pedestrian flow at a checkpoint. Figure 4 As shown, the electronic device 4 in this embodiment includes a memory 410, a processor 420, and a system bus 430. The memory 410 includes an executable program 4101 stored thereon. As those skilled in the art will understand, Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0054] The following is combined Figure 4 A detailed introduction to each component of the electronic device: The memory 410 can be used to store software programs and modules. The processor 420 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 410. The memory 410 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as cached data), etc. In addition, the memory 410 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0055] The memory 410 contains an executable program 4101 for network request methods. This executable program 4101 can be divided into one or more modules / units, which are stored in the memory 410 and executed by the processor 420 to perform tasks such as gate traffic statistics. Each module / unit can be a series of computer program instruction segments capable of performing a specific function, describing the execution process of the computer program 4101 in the electronic device 4. For example, the computer program 4101 can be divided into functional modules such as a target detection module, a target tracking module, a direction prediction module, and a quantity statistics module.
[0056] The processor 420 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 410, and by calling data stored in the memory 410, it performs various functions and processes data, thereby monitoring the overall status of the electronic device. Optionally, the processor 420 may include one or more processing units; preferably, the processor 420 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, application programs, etc., and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 420.
[0057] The system bus 430 is used to connect various functional components inside the computer, transmitting data, address, and control information. Its type can be, for example, a PCI bus, an ISA bus, or a CAN bus. Instructions from the processor 420 are transmitted to the memory 410 via the bus, and the memory 410 sends data back to the processor 420. The system bus 430 is responsible for data and instruction exchange between the processor 420 and the memory 410. Of course, the system bus 430 can also connect to other devices, such as network interfaces and display devices.
[0058] In this embodiment of the invention, the executable program executed by the processing 420 of the electronic device includes: The YOLO target detection algorithm was used to identify human targets in image frames captured by security cameras at checkpoints. The position of the human target in the next frame is predicted by a Kalman filter with a hidden time. When the current human target is detected to be occluded, the position of the human target in the next frame is predicted by a probabilistic data association algorithm. Update the character's movement trajectory based on the predicted character's position, and determine the character's direction of entering or leaving the level based on the character's movement trajectory; Based on the direction in which characters enter and exit the checkpoint, the flow of people entering and exiting the checkpoint during the same period is counted.
[0059] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0060] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0061] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method of detecting the number of people at a checkpoint, characterized by, The method comprises the steps of: recognizing a person target in an image frame collected by a checkpoint monitoring camera through a YOLO target detection algorithm; predicting the position of the person target in the next frame through a Kalman filter with hidden time, and when it is detected that the current person target is blocked, predicting the position of the person target in the next frame through a probability data association algorithm; updating the motion trajectory of the person target based on the predicted position of the person target, and judging the direction of the person target entering or leaving the checkpoint according to the motion trajectory of the person target; statistically counting the flow of people entering or leaving the checkpoint at the same period according to the direction of the person target entering or leaving the checkpoint.
2. The method of claim 1, wherein, When it is detected that the current person target is blocked, the position of the person target in the next frame is predicted through a probability data association algorithm, which comprises the steps of: associating the target observation value with the potential trajectory of the target based on the likelihood function, maintaining the potential trajectory prediction of each target through the Kalman filter when the person target is blocked, and assigning a prediction probability to each trajectory; when the target observation value is reacquired, updating the prediction probability of different trajectories according to the likelihood function of the target, and selecting the trajectory with the highest probability as the estimation of the position of the person target.
3. The method of claim 1, wherein, The direction of the person target entering or leaving the checkpoint is judged according to the motion trajectory of the person target, which comprises the steps of: acquiring the number of people passing through the checkpoint per unit time, and calculating the crowd density rate passing through the checkpoint according to the number of people passing through the checkpoint per unit time and the width of the door at the checkpoint.
4. The method of claim 3, wherein, The direction of the person target entering or leaving the checkpoint is judged according to the motion trajectory of the person target, which comprises the steps of: when the crowd density rate is lower than a preset value, the motion direction of each person target is judged based on the motion trajectory of the person target and the head direction of the target; when the crowd density rate is higher than the preset value, the direction of the crowd entering or leaving the checkpoint is judged according to the motion trajectory of the group of person targets.
5. The method of claim 4, wherein, The motion direction of each person target is judged based on the motion trajectory of the person target and the head direction of the target, which comprises the steps of: extracting the head ROI of the person target, performing grayscale processing on the head ROI, comparing the peak value of the grayscale histogram corresponding to the head ROI with a preset threshold, and judging the head direction of the person target.
6. The method of claim 4, wherein, The direction of the crowd entering or leaving the checkpoint is judged according to the motion trajectory of the group of person targets, which comprises the steps of: analyzing the motion vector angle between each person target and the surrounding person targets, and defining the person target as the same group in the similar direction when the angle is less than a set value; analyzing the overall motion trajectory of the person targets in the same group, and judging the direction of the crowd entering or leaving the checkpoint.
7. The method of claim 1, wherein, The flow of people entering or leaving the checkpoint at the same period is statistically counted according to the direction of the person target entering or leaving the checkpoint, which comprises the steps of: setting up monitoring cameras in two directions of the checkpoint, and reversely accumulating and statistically counting the entering and leaving data of the two cameras in the same time period, and then performing average calculation to obtain the flow of people entering or leaving the checkpoint at the same period.
8. A turnstile people counting system, characterized by, The method comprises the steps of: a target detection module for recognizing a person target in an image frame collected by a checkpoint monitoring camera through a YOLO target detection algorithm; a target tracking module for predicting the position of the person target in the next frame through a Kalman filter with hidden time, and predicting the position of the person target in the next frame through a probability data association algorithm when it is detected that the current person target is blocked. A direction prediction module is configured to update a motion trajectory of the character target based on the predicted position of the character target, and determine a direction in which the character target enters or exits the checkpoint according to the motion trajectory of the character target; A quantity counting module is configured to count a flow of people entering or exiting the checkpoint at the same period according to the direction in which the character target enters or exits the checkpoint.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor implements the steps of the checkpoint flow detection method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed to implement the steps of the checkpoint flow detection method according to any one of claims 1 to 7.