Passenger flow statistical method and device based on density map and electronic equipment

Through the passenger flow statistics method based on density map, the problem of the reduction in accuracy in the existing technology in crowded scenarios and complex environments is solved, and stable and accurate passenger flow statistics under these conditions are achieved.

CN120014606APending Publication Date: 2025-05-16CHANGSHA HISENSE INTELLIGENT SYST RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311519199.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-15
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The existing passenger flow statistics methods are prone to missed target detectors in crowded scenarios, and their accuracy rapidly decreases in complex environments.

Method used

The passenger flow statistics method based on the density map is adopted. By obtaining the images collected by the camera, setting the region of interest, drawing direction lines and mixing lines, using the density estimation network to obtain the head coordinates, generate head detection boxes, and tracking through the multi-target tracking network, determining whether the target has a mixing line, calculating the cosine value to identify the forward direction, counting the number of people entering and outbound stations, and obtaining the total passenger flow.

Benefits of technology

The stability and accuracy of passenger flow statistics are ensured in crowded scenarios and complex environments, and the number of people entering and leaving the station and the total number of passenger flows can be promptly and quickly feedback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014606A_ABST
    Figure CN120014606A_ABST
Patent Text Reader

Abstract

The invention discloses a passenger flow statistical method and device based on a density map and electronic equipment. The method comprises the following steps: acquiring an image acquired by a camera in an entrance / exit or a channel, setting a region of interest, drawing a direction line and a mixing line, inputting the image into a density estimation network, obtaining a head coordinate position of a target in the region of interest, generating a head detection frame, and inputting the head detection frame into a multi-target tracking network for tracking. Judging whether the current target is subjected to line mixing according to the tracking result, calculating the cosine value of the target subjected to line mixing and the direction line so as to identify the advancing direction of the target, and respectively calculating the number of the targets with the advancing direction being the same as the direction line and the number of the targets with the advancing direction being opposite to the direction line; according to the method, good stability and accuracy can be ensured in a crowded scene and a complex environment, and the number of passengers entering and leaving the station and the total passenger flow of passengers can be timely and rapidly fed back to station management personnel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and in particular to a passenger flow statistics method, device and electronic equipment based on a density map. Background Art

[0002] With the development of urban rail transit, more and more citizens use subways as their main means of transportation, thanks to the speed and convenience of subways. During holidays and rush hours in the morning and evening, subway stations have a large flow of people. How to quickly and in real time reflect the number of people entering and leaving the station and the total passenger flow has practical guiding significance for subway managers. For example, the allocation of security personnel, more security personnel are arranged in subway stations with large passenger flow, and fewer security personnel are arranged in subway stations with small passenger flow, so as to reduce labor costs; for example, iron fences are set up in advance for guidance, guiding passengers to different entrances and exits, leaving or entering the station. This can avoid the occurrence of unsafe accidents such as crowding and trampling.

[0003] In recent years, with the development of video surveillance technology and computer vision, AI algorithms can be used to automatically count the number of people entering and leaving subway stations, so that station managers can improve efficiency and reduce costs while ensuring that passengers have a good riding experience. At present, the methods for passenger flow counting mainly include methods based on target detectors, optical flow methods, and mechanical methods.

[0004] The target detector-based method cannot solve the problem of missed detection in crowded scenes, which will greatly affect the accuracy of passenger flow statistics. In addition, the target detector-based method requires annotated files with anchor boxes during training, and the annotation of anchor boxes is extremely time-consuming.

[0005] The traditional optical flow method uses the optical flow method to predict the direction of movement of people in the previous and next frames. However, this method is easily affected by the environment. In complex environments, such as large changes in lighting and brightness, the accuracy of this method will drop rapidly.

[0006] The mechanical method counts the number of people by the number of times the entrance and exit gates are opened and closed. On the one hand, this method can only count the number of people entering and exiting the gates, and cannot provide timely feedback on the number of people entering the subway station entrance; on the other hand, this method requires hardware modification and the addition of a device to count the number of times the gates are opened and closed, which increases costs. Summary of the invention

[0007] The purpose of the present invention is to provide a passenger flow counting method, device and electronic device based on density map to solve the problem that the existing passenger flow counting method cannot solve the problem of missed detection of target detectors in crowded scenes and the rapid decrease in accuracy in complex environments.

[0008] In a first aspect, the present invention provides a passenger flow statistics method based on a density map, comprising:

[0009] Obtain images captured by cameras at the entrance or exit or in the passage;

[0010] Setting a region of interest for the image, drawing a direction line and a mixing line, wherein the direction line intersects with the mixing line, and the direction line indicates a direction in which a passenger exits or enters the station;

[0011] Input the image into a density estimation network to obtain the head coordinate position of the target in the region of interest;

[0012] Generate a head detection frame according to the head coordinate position;

[0013] Inputting the head detection frame into a multi-target tracking network for tracking;

[0014] Determine whether the current target is tripped based on the tracking results;

[0015] If the current target is tripped, calculate the cosine value of the target and the direction line where the trip occurs;

[0016] Identifying the moving direction of the target according to the cosine value;

[0017] Calculate the number of targets whose moving directions are the same as the direction line and the opposite to the direction line respectively, get the target number of people entering and leaving the station, and add the two together to get the total passenger flow;

[0018] Output the target number of people entering and leaving the station and the total passenger flow.

[0019] Further, generating a head detection frame according to the head coordinate position includes:

[0020] Generate a rectangular frame with the head coordinate position as the center and s(x, y) as the size according to the formula s(x, y) = min(σ / h, σ / w) × max(w, h);

[0021] Where h and w are the height and width of the input image respectively; x and y are the head coordinate information; σ is the scale factor; and s(x, y) is the size of the head coordinate box.

[0022] Further, judging whether the current target is tripped according to the tracking result includes:

[0023] Determine whether the line connecting the head coordinates of the two frames before and after the current target in the tracking result intersects with the mixing line;

[0024] If the line connecting the head coordinates of the previous and next frames intersects with the trip line, it is determined that the current target has a trip line;

[0025] If the line connecting the head coordinates of the previous and next two frames does not intersect with the tripping line, it is determined that the current target has not tripped the line.

[0026] Furthermore, the cosine value of the target and the direction line where the line is tripped is calculated, including:

[0027] According to the formula Calculate the target direction vector and direction lines The cosine value of .

[0028] Furthermore, when calculating the cosine value, the drawn direction line is projected onto the mixing line to obtain a direction line perpendicular to the mixing line as the direction line

[0029] Further, identifying the moving direction of the target according to the cosine value includes:

[0030] Determine whether the cosine value is greater than or equal to zero;

[0031] If the cosine value is greater than or equal to zero, it is determined that the moving direction of the target is the same as the direction line;

[0032] If the cosine value is less than zero, it is determined that the moving direction of the target is opposite to the direction line.

[0033] In a second aspect, the present invention provides a passenger flow counting device based on a density map, comprising:

[0034] An acquisition unit is used to acquire images captured by cameras at the entrance or exit or in the passage;

[0035] A drawing unit, used for setting an area of ​​interest for the image, drawing a direction line and a mixing line, wherein the direction line intersects with the mixing line, and the direction line indicates the direction in which the passenger exits or enters the station;

[0036] An obtaining unit, used for inputting the image into a density estimation network to obtain the coordinate position of the head of the target in the region of interest;

[0037] A generating unit, configured to generate a head detection frame according to the coordinate position of the head;

[0038] A tracking unit, used for inputting the head detection frame into a multi-target tracking network for tracking;

[0039] A judgment unit, used to judge whether the current target is in line tripping state according to the tracking result;

[0040] The first calculation unit is used to calculate the cosine value of the target and the direction line when the current target is tripped;

[0041] an identification unit, used for identifying the moving direction of the target according to the cosine value;

[0042] The second calculation unit is used to calculate the number of targets whose advancing directions are the same as the direction line and the opposite to the direction line, respectively, to obtain the target number of people entering and leaving the station, and to add the two to obtain the total passenger flow;

[0043] The output unit is used to output the target number of passengers entering and leaving the station and the total passenger flow.

[0044] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method described in the first aspect above.

[0045] Beneficial effects of the present invention: The passenger flow statistics method, device and electronic device based on density map provided by the present invention obtain images collected by cameras at entrances and exits or in passages, set interest regions for images, draw direction lines and mixing lines, the direction lines intersect with the mixing lines, the direction lines represent the direction of passengers entering or exiting the station, input the images into a density estimation network, obtain the head coordinate position of the target in the interest region, generate a head detection frame according to the head coordinate position, input the head detection frame into a multi-target tracking network for tracking, judge whether the current target has a mixing line according to the tracking result, if the current target has a mixing line, calculate the cosine value of the target and the direction line that has a mixing line, identify the forward direction of the target according to the cosine value, calculate the number of targets whose forward direction is the same as the direction of the direction line and the opposite to the direction of the direction line, obtain the target number of people entering and exiting the station, add the two to obtain the total passenger flow, output the target number of people entering and exiting the station and the total passenger flow, the method can ensure good stability and accuracy in crowded scenes and complex environments, and can promptly and quickly feedback the number of people entering and exiting the station and the total passenger flow of passengers to station managers. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to further understand the features and technical contents of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings are only provided for reference and illustration and are not intended to limit the present invention.

[0047] In the accompanying drawings,

[0048] Figure 1 It is a flow chart of the passenger flow counting method based on density map of the present invention;

[0049] Figure 2 Schematic diagram of the area of ​​interest, direction line and mixing line;

[0050] Figure 3 Schematic diagram of human body detection frame;

[0051] Figure 4 This is a schematic diagram of the processing result of the first frame;

[0052] Figure 5 This is a schematic diagram of the processing result of the second frame;

[0053] Figure 6 A flow chart for determining whether the current target is tripped based on the tracking results;

[0054] Figure 7 A flow chart for identifying the target's heading based on the cosine value;

[0055] Figure 8 This is a schematic diagram of the camera at the entrance or exit or in the passage;

[0056] Fig. 9 It is a block diagram of a passenger flow counting device based on a density map of the present invention;

[0057] Fig.10 It is a block diagram of an electronic device of the present invention. DETAILED DESCRIPTION

[0058] To further illustrate the technical means and effects of the present invention, the following is a detailed description in conjunction with the preferred embodiments of the present invention and the accompanying drawings.

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

[0060] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first" and "second" are used only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0061] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or description". Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.

[0062] Generally, during peak hours in the morning and evening or during holidays, subway stations have a large passenger flow. How to quickly and in real time reflect the passenger flow in and out of the station has practical guiding significance for subway managers, such as the allocation of security personnel. More security personnel are arranged in subway stations with large passenger flow, and fewer security personnel are arranged in subway stations with small passenger flow to reduce labor costs; for example, iron fences are set up in advance for guidance, guiding passengers to different entrances and exits, to exit or enter the station, thereby avoiding unsafe accidents such as crowding and trampling.

[0063] The present invention is based on the surveillance video in the subway station, and can obtain the real-time characteristics of the subway station entrance and exit or passage in real time. First, a rectangular area is drawn at the entrance and exit to give the direction of entry or exit, and the line mixing logic is used for screening to obtain the direction of passenger travel, and further separately count the number of passengers in different directions, so as to obtain the total number of passengers entering and leaving the station. This method can ensure good stability and accuracy, and can promptly and quickly feedback the number of people entering and leaving the station and the total passenger flow to station managers. The passenger flow statistics method based on the density map of the present invention is described in detail below.

[0064] See also Figure 1 , an embodiment of the present invention provides a passenger flow counting method based on a density map, comprising:

[0065] S101, obtaining images captured by cameras at the entrance or exit or in the passage.

[0066] S102, setting an area of ​​interest for the image, drawing a direction line and a mixing line, wherein the direction line intersects with the mixing line, and the direction line indicates the direction in which passengers exit or enter the station.

[0067] Setting a region of interest (ROI) is used to reduce the amount of calculation and filter out targets that are not in the region of interest, thereby increasing the execution speed and accuracy of the algorithm and further improving the accuracy of passenger flow statistics.

[0068] It should be noted that the location of the mixing line is generally drawn at the center of the area of ​​interest, which is conducive to reducing miscounting; the direction line needs to intersect with the mixing line and cannot be parallel to the mixing line. The direction line is a vector, not a line segment. The direction line indicates the direction of passengers leaving or entering the station. Figure 2 In fact, the area of ​​interest is not limited to the rectangular box, it can be other polygons, but the rectangular box is generally recommended). The corresponding coordinates of the direction line and the mixing line can be obtained, such as Figure 2 shown.

[0069] S103, inputting the image into a density estimation network to obtain the coordinate position of the target head in the region of interest.

[0070] The density estimation network is a density map-based crowd estimation network, which is a method based on computer vision technology for estimating the number of people in a crowded area. It infers the number of people by analyzing the pixel density in an image or video. At the same time, the density estimation network can also be used to obtain the target position in the image's region of interest and further extract the head coordinate position of the target position. The present invention uses this function of the density estimation network to obtain the head coordinate position of the target in the region of interest.

[0071] According to the generation method of density map, there are two commonly used density estimation networks for population estimation, namely, density estimation network based on Gaussian kernel and density estimation network based on distance transformation function. The density estimation network used in this patent is a density estimation network that generates density map based on distance transformation function.

[0072] S104: Generate a head detection frame according to the head coordinate position.

[0073] Specifically, see Figure 3 , according to the formula s(x, y) = min(σ / h, σ / w) × max(w, h), a rectangular box with the head coordinate position as the center and s(x, y) as the size is generated;

[0074] Where h and w are the height and width of the input image respectively; x and y are the head coordinate information; σ is the scale factor; and s(x, y) is the size of the head coordinate box.

[0075] like Figure 4 As shown, the dots in the figure represent the positions of people's heads, and passenger 1 and passenger 2 are on both sides of the mixing line respectively.

[0076] S105: input the head detection frame into a multi-target tracking network for tracking.

[0077] Multi-target tracking is an important research direction in the field of computer vision, which aims to accurately detect and track multiple targets in video sequences. Multi-target tracking networks usually consist of two main parts: feature extraction network and tracking network. Feature extraction network usually uses deep learning models, such as convolutional neural network (CNN) to extract features of input video sequences. These features are used to describe targets and scenes in the video. The tracking network is responsible for tracking targets in video sequences. It usually uses a method called "Hungarian Algorithm" to match targets with their corresponding features. By continuously updating the position and features of the target, continuous tracking of the target is achieved. In addition, multi-target tracking networks also need to consider some other issues, such as target occlusion, illumination changes, motion changes, etc. In order to solve these problems, researchers have proposed many different methods and techniques, such as filter-based tracking methods, deep learning-based tracking methods, and Hungarian algorithm-based tracking methods.

[0078] like Figure 5 As shown, the forward direction of passenger 1 is the same as the direction line, and the forward direction of passenger 2 is opposite to the direction line. The head position information of the previous and next frames is obtained. The coordinates of passenger 1 in the first frame and the second frame are (x1, y1) and (x11, y11) respectively; the coordinates of passenger 2 in the first frame and the second frame are (x2, y2) and (x22, y22) respectively.

[0079] S106, judging whether the current target is tripped by a line according to the tracking result.

[0080] Specifically, see Figure 6 , judging whether the current target is in line mixing according to the tracking results specifically includes:

[0081] S1061, determining whether the line connecting the head coordinates of the two frames before and after the current target in the tracking result intersects with the mixing line.

[0082] S1062: If the line connecting the head coordinates of the two frames intersects with the trip line, it is determined that the current target is tripped by the trip line.

[0083] S1063: If the line connecting the head coordinates of the two frames before and after does not intersect with the line tripping, it is determined that the current target does not have a line tripping event.

[0084] S107, if the current target is in contact with the line, calculate the cosine value of the target in contact with the line and the direction line.

[0085] Specifically, taking passenger 1 as an example, determine whether the line connecting the head coordinates of the two frames intersects with the mixing line. If so, according to the formula Calculate the target direction vector and direction lines The cosine of the target direction vector is Figure 4 Shown by the dashed line.

[0086] It is worth noting that when calculating the cosine value, it is necessary to project the drawn direction line onto the mixing line to obtain a direction line perpendicular to the mixing line as the direction line. The purpose of doing this is that when drawing the direction line, it is not necessary to be perpendicular to the mixing line, just need to give a direction.

[0087] S108, identifying the moving direction of the target according to the cosine value.

[0088] Specifically, see Figure 7 , identifying the moving direction of the target according to the cosine value specifically includes:

[0089] S1081, determine whether the cosine value is greater than or equal to zero.

[0090] S1082: If the cosine value is greater than or equal to zero, it is determined that the moving direction of the target is the same as the direction line.

[0091] S1083: If the cosine value is less than zero, it is determined that the moving direction of the target is opposite to the direction line.

[0092] S109, respectively calculating the number of targets whose advancing directions are the same as the direction line and the opposite to the direction line, obtaining the target number of people entering and leaving the station, and adding the two to obtain the total passenger flow.

[0093] S110, outputting the target number of passengers entering and leaving the station and the total passenger flow.

[0094] Figure 8 This is a schematic diagram of the camera at the entrance or exit or in the channel. In order to reduce the amount of calculation, the present invention only obtains the head position coordinates in the area of ​​interest and generates a corresponding detection frame and determines whether the line is crossed and calculates the target's travel direction and the cosine value of the direction vector. When the passenger is in the area of ​​interest, the passenger is identified with the help of deep learning, the current head position coordinates are obtained, and a detection frame of the same size is generated according to the position information. Then the detection frame is sent to the multi-target tracking network, and then the target direction vector of the person's travel composed of the head coordinates of the previous and next two frames is determined, and the cosine value of the target direction vector and the pre-given direction vector is calculated, so as to determine whether the target direction vector and the direction vector are in the same or opposite directions.

[0095] It can be seen from the above embodiments that the passenger flow counting method based on density map of the present invention, for subway scenes, collects subway entrance and exit images, extracts head features, obtains head position coordinates, and then generates a rectangular frame with the head position coordinates, calculates the direction of head movement, and determines whether the head is crossing the line, and timely and accurately gives the number of passengers in and out of the station and the total passenger flow. The passenger flow counting method based on density map of the present invention adopts a head detection method based on density map + multi-target tracking strategy, which avoids the problem that the accuracy of the traditional target detector-based method drops rapidly in crowded scenes, thereby causing the tracker to fail, and can improve the accuracy of passenger flow counting. The passenger flow counting method based on density map of the present invention proposes a method for automatically generating a detection frame. In order to improve the matching accuracy of the tracker, the present invention ignores the influence of lens perspective transformation when generating the head target frame, that is, regardless of the distance of the pedestrian from the camera, a target frame of uniform size is generated. Compared with the existing detector-based methods, the method proposed in the present invention can save manpower to a great extent when processing network training data; since the detector-based method requires accurate annotation of anchor frames, the method proposed in this patent does not require annotation of anchor frames, and only needs to mark the positions where there are heads.

[0096] See also Fig. 9 The present invention provides a passenger flow counting device based on a density map, comprising:

[0097] An acquisition unit 91 is used to acquire images captured by cameras at the entrance or exit or in the passage;

[0098] A drawing unit 92, configured to set an area of ​​interest for the image, draw a direction line and a mixing line, wherein the direction line intersects with the mixing line, and the direction line indicates a direction in which a passenger exits or enters the station;

[0099] An obtaining unit 93 is used to input the image into a density estimation network to obtain the coordinate position of the head of the target in the region of interest;

[0100] A generating unit 94, configured to generate a head detection frame according to the head coordinate position;

[0101] A tracking unit 95, configured to input the head detection frame into a multi-target tracking network for tracking;

[0102] A judging unit 96, used to judge whether the current target is tripped according to the tracking result;

[0103] The first calculation unit 97 is used to calculate the cosine value of the target and the direction line when the current target is tripped;

[0104] An identification unit 98, configured to identify the moving direction of the target according to the cosine value;

[0105] The second calculation unit 99 is used to calculate the number of targets whose advancing directions are the same as the direction line and the opposite to the direction line, respectively, to obtain the target number of entering and leaving the station, and to add the two to obtain the total passenger flow;

[0106] The output unit 90 is used to output the target number of passengers entering and leaving the station and the total passenger flow.

[0107] It can be seen from the above embodiments that the passenger flow counting device based on density map provided by the present invention obtains the image collected by the camera at the entrance and exit or in the channel through the acquisition unit; sets the region of interest for the image through the drawing unit, draws the direction line and the mixing line, the direction line intersects with the mixing line, and the direction line represents the direction of the passenger leaving or entering the station; the image is input into the density estimation network through the acquisition unit to obtain the head coordinate position of the target in the region of interest; the head detection frame is generated according to the head coordinate position by the generation unit; the head detection frame is input into the multi-target tracking network for tracking by the tracking unit; and the judgment unit judges whether the current target occurs according to the tracking result. Line mixing; when the current target is mixed with the line, the first calculation unit calculates the cosine value of the target and the direction line where the line mixing occurs; the identification unit identifies the moving direction of the target according to the cosine value; the second calculation unit calculates the number of targets whose moving directions are the same as the direction line and the opposite to the direction line, respectively, to obtain the target number of people entering and leaving the station, and the two are added to obtain the total passenger flow; the output unit outputs the target number of people entering and leaving the station and the total passenger flow. This method can ensure good stability and accuracy in crowded scenes and complex environments, and can promptly and quickly feedback the number of people entering and leaving the station and the total passenger flow to station managers.

[0108] See also Fig.10 An embodiment of the present invention further provides an electronic device, a memory 100 and a processor 200, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.

[0109] The embodiment of the present invention further provides a storage medium, and the embodiment of the present invention further provides a storage medium, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, some or all of the steps in each embodiment of the passenger flow counting method based on the density map provided by the present invention are implemented. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0110] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes 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 of the present invention or some parts of the embodiments.

[0111] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the passenger flow counting device embodiment based on the density map, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.

[0112] The above-described embodiments of the present invention do not limit the protection scope of the present invention.

Claims

1. A passenger flow statistics method based on density map, characterized in that: include: Obtain images captured by cameras at the entrance or exit or in the passage; Setting a region of interest for the image, drawing a direction line and a mixing line, wherein the direction line intersects with the mixing line, and the direction line indicates a direction in which a passenger exits or enters the station; Input the image into a density estimation network to obtain the head coordinate position of the target in the region of interest; Generate a head detection frame according to the head coordinate position; Inputting the head detection frame into a multi-target tracking network for tracking; Determine whether the current target is tripped based on the tracking results; If the current target is tripped, calculate the cosine value of the target and the direction line where the trip occurs; Identifying the moving direction of the target according to the cosine value; Calculate the number of targets whose moving directions are the same as the direction line and the opposite to the direction line respectively, get the target number of people entering and leaving the station, and add the two together to get the total passenger flow; Output the target number of people entering and leaving the station and the total passenger flow.

2. The passenger flow counting method based on density map according to claim 1, characterized in that: Generating a head detection frame according to the head coordinate position includes: Generate a rectangular frame with the head coordinate position as the center and s(x, y) as the size according to the formula s(x, y) = min(σ / h, σ / w) × max(w, h); Where h and w are the height and width of the input image respectively; x and y are the head coordinate information; σ is the scale factor; and s(x, y) is the size of the head coordinate box.

3. The passenger flow counting method based on density map according to claim 1, characterized in that: Determine whether the current target is tripped based on the tracking results, including: Determine whether the line connecting the head coordinates of the two frames before and after the current target in the tracking result intersects with the mixing line; If the line connecting the head coordinates of the previous and next two frames intersects with the trip line, it is determined that the current target has a trip line; If the line connecting the head coordinates of the previous and next two frames does not intersect with the tripping line, it is determined that the current target has not tripped the line.

4. The passenger flow counting method based on density map according to claim 1, characterized in that: Calculate the cosine value of the target and direction line where the line is tripped, including: According to the formula Calculate the target direction vector and direction lines The cosine value of .

5. The passenger flow counting method based on density map according to claim 4, characterized in that: When calculating the cosine value, project the drawn direction line onto the mixing line to obtain a direction line perpendicular to the mixing line as the direction line.

6. The passenger flow counting method based on density map according to claim 1, characterized in that: Identifying the moving direction of the target according to the cosine value includes: Determine whether the cosine value is greater than or equal to zero; If the cosine value is greater than or equal to zero, it is determined that the moving direction of the target is the same as the direction line; If the cosine value is less than zero, it is determined that the moving direction of the target is opposite to the direction line.

7. A passenger flow counting device based on density map, characterized in that: include: An acquisition unit is used to acquire images captured by cameras at the entrance or exit or in the passage; A drawing unit, used for setting an area of ​​interest for the image, drawing a direction line and a mixing line, wherein the direction line intersects with the mixing line, and the direction line indicates the direction in which the passenger exits or enters the station; An obtaining unit, used for inputting the image into a density estimation network to obtain the coordinate position of the head of the target in the region of interest; A generating unit, configured to generate a head detection frame according to the coordinate position of the head; A tracking unit, used for inputting the head detection frame into a multi-target tracking network for tracking; A judgment unit, used to judge whether the current target is in line tripping state according to the tracking result; The first calculation unit is used to calculate the cosine value of the target and the direction line when the current target is tripped; an identification unit, used for identifying the moving direction of the target according to the cosine value; The second calculation unit is used to calculate the number of targets whose advancing directions are the same as the direction line and the opposite to the direction line, respectively, to obtain the target number of people entering and leaving the station, and to add the two to obtain the total passenger flow; The output unit is used to output the target number of passengers entering and leaving the station and the total passenger flow.

8. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 6.