A camera-based crowd heat map generation method and system
By gridding the camera video stream and adjusting the overlapping areas, a more accurate crowd heat map is generated, solving the problem of accuracy in crowd density statistics in multiple obscured areas.
Patent Information
- Application Number
- CN202210985679.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-17
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-08-17
AI Technical Summary
Existing technologies make it difficult to accurately count crowd density in densely populated areas, especially in public areas with many obstructions, where there are errors in estimating crowd density using camera video streams.
By obtaining the real-time video stream of the cameras in the monitoring area, grid processing is performed to generate the first two-dimensional grid map, which is mapped to the world coordinate system. The overlapping area of the grid map is determined and the number of people is adjusted to generate a three-dimensional crowd heat map.
It improves the accuracy of crowd density statistics, reduces errors caused by camera occlusion, and generates more accurate crowd distribution maps.
Smart Images

Figure CN115249342B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a camera-based crowd heat map generation method and system. Background Art
[0002] With the rapid development of the economy and transportation, the flow of people in public areas such as airports, subways, train stations, and shopping malls is increasing. Crowd counting has become a fundamental tool for managers in various areas to analyze and predict product sales, target demographics, and provide early warnings for safety issues such as congestion. These important public areas are generally covered by cameras, so using video streams from multiple cameras to estimate crowd density in a specific area is a very effective and cost-effective method. Summary of the Invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is:
[0004] An embodiment of the present invention provides a method for generating a crowd heat map based on a camera, the method comprising the following steps:
[0005] S100, obtain the real-time video stream i shot by any camera i in the monitoring area s ; The value of i ranges from 1 to N, where N is the number of cameras in the monitoring area;
[0006] S120, obtain real-time video stream i s The crowd distribution information (D ij , t ij , ID ii ), D ij is the first two-dimensional grid obtained by dividing image j according to the set step size, t ij The timestamp of image j, ID ii is the ID of camera i; where D ij Any unit grid in the memory stores the number of people in the unit grid; the value of j ranges from 1 to m(i), where m(i) is i s The number of images in
[0007] S140, obtaining a first two-dimensional grid map of all cameras within the monitoring area and within the current time range to form a first two-dimensional grid map set;
[0008] S160, for any first two-dimensional grid graph D in the first two-dimensional grid graph set, p , based on D p The ID of the corresponding camera is used to obtain the parameter information of the corresponding camera; the value of p ranges from 1 to n, where n is the number of the first two-dimensional grid images in the first two-dimensional grid image set;
[0009] S180, based on the parameter information obtained in S160, any D p Mapping from the image coordinate system to the world coordinate system, we get the second two-dimensional grid map D' p ; Form a second two-dimensional grid atlas; wherein, D' p The unit grid A in the rth row and sth column rs p Including (P rs p , G rs p , O rs p ), P rs p A rs p The number of people in G rs p A rs p The position in the world coordinate system, O rs p A rs p The number of times it overlaps with other unit grids in the two-dimensional grid atlas at the same spatial position, O rs p The initial value of is 0;
[0010] S200, determining the second two-dimensional grid graph D' in the second two-dimensional grid graph set p and D' q Whether there is overlap, if there is an overlapping area, get D' respectively p and D' q All unit grids in the overlapping area and set O rs p =O rs p +1 and set O uv q =O q uv +1; q ranges from 1 to n, and q≠p, O uv q D' q The number of times the unit grid in the uth row and vth column in the 2D grid atlas overlaps with other unit grids in the same spatial position, O uv q The initial value of is 0;
[0011] S220, for D' p A in rs p , set P rsp =P rs p *(1 / (O rs p +1); forming a third two-dimensional grid atlas;
[0012] S240: Generate a three-dimensional crowd heat map based on the positions and number of people of all unit grids in the third two-dimensional grid atlas.
[0013] Another embodiment of the present invention provides a camera-based crowd heat map generation system, the system comprising: a master controller and n slave controllers communicatively connected to the master controller, each slave controller being communicatively connected to at least one camera disposed within a monitoring area;
[0014] Wherein, any slave controller i is used to execute a computer program to implement the following steps:
[0015] S300, obtain any camera i in the corresponding camera c Live video stream captured s ; The value of i ranges from 1 to n;
[0016] S320, obtain real-time video stream i s The crowd distribution information (D ij , t ij , ID ii ), D ij is the first two-dimensional grid obtained by dividing image j according to the set step size, t ij The timestamp of image j, ID ii For camera i c ID; where D ij Any unit grid in the memory stores the number of people in the unit grid; the value of j ranges from 1 to m(i), where m(i) is i s The number of images in
[0017] S340, sending the obtained crowd distribution information to the main controller;
[0018] The main controller is used to execute a computer program to implement the following steps:
[0019] S360, obtaining first two-dimensional grid images of all cameras within the monitoring area and within the current time range to form a first two-dimensional grid image set;
[0020] S380, for any first two-dimensional grid graph D in the first two-dimensional grid graph set, p , based on D pThe ID of the corresponding camera is used to obtain the parameter information of the corresponding camera; the value of p ranges from 1 to n, where n is the number of the first two-dimensional grid images in the first two-dimensional grid image set;
[0021] S400, based on the parameter information obtained in S380, any D p Mapping from the image coordinate system to the world coordinate system, we get the second two-dimensional grid map D' p ; Form a second two-dimensional grid atlas; wherein, D' p The unit grid A in the rth row and sth column rs p Including (P rs p , G rs p , O rs p ), P rs p A rs p The number of people in G rs p A rs p The position in the world coordinate system, O rs p A rs p The number of times it overlaps with other unit grids in the two-dimensional grid atlas at the same spatial position, O rs p The initial value of is 0;
[0022] S420, determining the second two-dimensional grid graph D' in the second two-dimensional grid graph set p and D' q Whether there is overlap, if there is an overlapping area, get D' respectively p and D' q All unit grids in the overlapping area and set O rs p =O rs p +1 and set O uv q =O q uv +1; q ranges from 1 to n, and q≠p, O uv q D' q The number of times the unit grid in the uth row and vth column in the 2D grid atlas overlaps with other unit grids in the same spatial position, O uv q The initial value of is 0;
[0023] S440, for D'p A in rs p , set P rs p =P rs p *(1 / (O rs p +1); forming a third two-dimensional grid atlas;
[0024] S460: Generate a three-dimensional crowd heat map based on the positions and number of people of all unit grids in the third two-dimensional grid atlas.
[0025] The present invention has at least the following beneficial effects:
[0026] The camera-based crowd heat map generation method and system provided by the embodiment of the present invention first grids each real-time image captured in the monitoring area and obtains the number of people in each unit grid to generate a first two-dimensional grid map. Then, each first two-dimensional grid map belonging to the same time range is mapped from the image coordinate system to the world coordinate system to obtain a second two-dimensional grid map. Each unit grid in each second two-dimensional grid map includes the number of people, grid position, and overlap count. Then, for any two grid maps, if there is an overlapping area, the count value of all unit grids located in the overlapping area is increased by 1. Then, based on the overlap count of each unit grid, the number of people in the unit grid is corrected to obtain the corrected number of people. Finally, a two-dimensional crowd heat map is obtained based on the number of people and positions in all the second two-dimensional grid maps with corrected number of people. Since the present invention corrects the number of people in each unit grid based on the overlap count, the number of people counted is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0028] Figure 1 A flow chart of a crowd manpower map provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the scope of protection of the present invention.
[0030] Figure 1 A flow chart of a crowd manpower map provided by an embodiment of the present invention.
[0031] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a crowd heat map based on a camera, the method comprising the following steps:
[0032] S100, obtain the real-time video stream i shot by any camera i in the monitoring area s ; The value of i ranges from 1 to N, where N is the number of cameras in the monitoring area.
[0033] In embodiments of the present invention, the monitoring area may be a densely populated and heavily obstructed public area, such as a train station, shopping mall, or airport. Cameras may be deployed at designated locations within the monitoring area as needed. The number of cameras may be set based on actual circumstances.
[0034] S120, obtain real-time video stream i s The crowd distribution information (D ij , t ij , ID ii ), D ij is the first two-dimensional grid obtained by dividing the image j according to the set step size p, t ij The timestamp of image j, ID ii is the ID of camera i; where D ij Any unit grid in the memory stores the number of people in the unit grid; the value of j ranges from 1 to m(i), where m(i) is i s The number of images in .
[0035] In the embodiment of the present invention, the real-time video stream i s Decoded into multiple frames. For each frame, the image can be gridded based on a set step size to obtain a two-dimensional grid. The two dimensions of the two-dimensional grid correspond to the X and Y axes of the image.
[0036] The step size p can be determined based on experiments. In one exemplary embodiment, the step size can be set to 64 pixels. If the area of a frame image is not an integer multiple of p*p, the image width and / or height can be expanded to make the image area an integer multiple of p*p.
[0037] In the embodiment of the present invention, D ij The number of people in each unit grid is stored in any unit grid and is obtained through a deep neural network. Those skilled in the art know that calculating the number of people appearing in each unit grid through a deep neural network algorithm is an existing technology.
[0038] S140: Obtain first two-dimensional grid images of all cameras in the monitoring area within the current time range to form a first two-dimensional grid image set.
[0039] In an embodiment of the present invention, considering network transmission speed and stability, it is difficult to precisely control the timestamps of different images to be identical. Therefore, an acceptable time error must be considered, that is, images within the current time range must be acquired. In this embodiment of the present invention, the current time range can be [t-Δt, t+Δt], where t is the current time and Δt is a set time interval. This can be set based on actual conditions. In one exemplary embodiment, considering that the human body does not move a large distance in a short period of time, Δt can be set to 10ms.
[0040] In an embodiment of the present invention, a two-dimensional grid image can be obtained by means of a message queue. Each camera can be provided with a message queue, and at each current time, the head image in the message queue can be extracted as the two-dimensional grid image within the current time range.
[0041] S160, for any first two-dimensional grid graph D in the first two-dimensional grid graph set, p , based on D p The ID of the corresponding camera is used to obtain the parameter information of the corresponding camera; the value of p ranges from 1 to n, where n is the number of the first two-dimensional grid images in the first two-dimensional grid image set.
[0042] In an embodiment of the present invention, the camera parameter information may include intrinsic parameters and extrinsic parameters. The parameter information of each camera can be obtained by a three-dimensional camera calibration method. For example, it can be obtained by the following steps: (1) making a calibration chessboard; (2) using a camera to capture an image of the calibration chessboard as a first test image; (3) calculating the camera intrinsic parameters based on the first test image; (4) setting multiple coordinate marks on the ground of the area actually captured by the camera; (5) capturing an image of the ground of the area actually captured as a second test image; (6) obtaining the camera extrinsic parameters based on the camera intrinsic parameters, the positions of the multiple coordinate marks in the world coordinate system, and the positions in the second test image. It should be noted that if there are multiple planes in the real scene captured by a camera, such as a ground area and an escalator area or a cross-floor image, it is necessary to perform extrinsic parameter measurement separately for each area in the scene.
[0043] S180, based on the parameter information obtained in S160, any D p Mapping from the image coordinate system to the world coordinate system, we get the second two-dimensional grid map D' p ; Form a second two-dimensional grid atlas; wherein, D' p The unit grid A in the rth row and sth column rs p Including (P rsp , G rs p , O rs p ), P rs p A rs p The number of people in G rs p A rs p The position in the world coordinate system, specifically A rs p The position of the center point in the world coordinate system. rs p A rs p The number of times it overlaps with other unit grids in the two-dimensional grid atlas at the same spatial position, O rs p The initial value of is 0.
[0044] In the embodiment of the present invention, any D p Mapping from the image coordinate system to the world coordinate system, specifically, calculating a coordinate transformation formula based on the intrinsic and extrinsic parameters of the camera obtained in S160, and the specific acquisition method can be the existing technology.
[0045] S200, determining the second two-dimensional grid graph D' in the second two-dimensional grid graph set p and D' q Whether there is overlap, if there is an overlapping area, get D' respectively p and D' q All unit grids in the overlapping area and set O rs p =O rs p +1 and set O uv q =O q uv +1; q ranges from 1 to n, and q≠p, O uv q D' q The number of times the unit grid in the uth row and vth column in the 2D grid atlas overlaps with other unit grids in the same spatial position, O uv q The initial value of is 0.
[0046] In the embodiments of the present application, whether two two-dimensional grid maps exist overlapping regions can be determined based on an open source geometry toolkit, such as a Python geographic data processing library shapely. Specifically, the vertex coordinates of each two-dimensional grid map can be input into shapely to determine whether there is an overlapping region in the two two-dimensional grid maps.
[0047] In the embodiments of the present application, D' p and D' q may be obtained based on a vector cross product calculation method.
[0048] In S200, whether D' p and D' q overlap can be determined by traversing the second two-dimensional grid map set, specifically, the following steps can be included:
[0049] S201, for any D' p , if p≤n, S202 is executed; otherwise, the overlapping determination control program is exited.
[0050] S202, whether D' p and D' q exist overlapping regions is determined, if yes, S203 is executed; otherwise, S204 is executed.
[0051] S203, all unit grids in D' p and D' q located in the overlapping region are obtained respectively, and O rs p is set to O rs p +1 and O uv q+1 is set to O uv q+1 +1.
[0052] S204, q is set to q+1; S205 is executed.
[0053] S205, if q≤n, S203 is executed; otherwise, S206 is executed.
[0054] S206, p is set to p+1; S201 is executed.
[0055] For two two-dimensional grid maps with overlapping regions, the overlapping times of all unit grids in each two-dimensional grid map located in the overlapping region will increase by 1.
[0056] S220, for A p in D' rs p , P rs is set top =P rs p *(1 / (O rs p +1); forming a third two-dimensional grid atlas.
[0057] S220 can solve the problem of counting overlapping spaces captured by different cameras, so that the number of people in each unit grid can be as accurate as possible.
[0058] S240: Generate a two-dimensional crowd heat map based on the positions and number of people of all unit grids in the third two-dimensional grid atlas.
[0059] Specifically, all grid maps of the third two-dimensional grid atlas can be aggregated into a single grid map, and a three-dimensional crowd heat map can be generated based on the world coordinates and recorded number of people of all unit grids in the single grid map.
[0060] Those skilled in the art know that generating a two-dimensional crowd heat map based on the positions and number of people of all unit grids in the third two-dimensional grid atlas may be an existing technology.
[0061] Furthermore, the embodiment of the present invention may further include:
[0062] S260: Visually display the generated two-dimensional crowd heat map.
[0063] In an exemplary embodiment, the density of people can be represented by different colors. For example, areas with a large number of people can be displayed in red, while areas with a small number of people can be displayed in blue, so that users can intuitively understand the distribution of people in the monitored area.
[0064] Another embodiment of the present invention further provides a camera-based crowd heat map generation system, which includes: a main controller and n slave controllers communicatively connected to the main controller, each slave controller being communicatively connected to at least one camera set in a monitoring area.
[0065] In embodiments of the present invention, the monitoring area may be a densely populated and heavily obstructed public area, such as a train station, shopping mall, or airport. Cameras may be deployed at designated locations within the monitoring area as needed. The number of cameras may be set based on actual circumstances.
[0066] Wherein, any slave controller i is used to execute a computer program to implement the following steps:
[0067] S300, obtain any camera i in the corresponding camera c Live video stream captured s ; The value of i is 1 to n.
[0068] S320, obtain real-time video stream i s The crowd distribution information (D ij , t ij , ID ii ), D ij is the first two-dimensional grid obtained by dividing image j according to the set step size, t ij The timestamp of image j, ID ii For camera i c ID; where D ij Any unit grid in the memory stores the number of people in the unit grid; the value of j ranges from 1 to m(i), where m(i) is i s The number of images in .
[0069] S340: Send the obtained crowd distribution information to the main controller.
[0070] In the embodiment of the present invention, the real-time video stream i s Decoded into multiple frames. For each frame, the image can be gridded based on a set step size to obtain a two-dimensional grid. The two dimensions of the two-dimensional grid correspond to the X and Y axes of the image.
[0071] The step size p can be determined experimentally. In one exemplary embodiment, the step size can be set to 64 pixels. If the area of a frame image is not an integer multiple of p*p, the width and / or height of the image can be expanded using pure color pixel blocks to make the image area an integer multiple of p*p.
[0072] In the embodiment of the present invention, D ij The number of people in each unit grid is stored in any unit grid and is obtained through a deep neural network. It is known to those skilled in the art that obtaining the number of people appearing in each unit grid through a deep neural network algorithm is an existing technology.
[0073] The main controller is used to execute a computer program to implement the following steps:
[0074] S360: Obtain first two-dimensional grid images of all cameras in the monitoring area within the current time range to form a first two-dimensional grid image set.
[0075] S380, for any first two-dimensional grid graph D in the first two-dimensional grid graph set, p , based on D p The ID of the corresponding camera is used to obtain the parameter information of the corresponding camera; the value of p ranges from 1 to n, where n is the number of the first two-dimensional grid images in the first two-dimensional grid image set.
[0076] S400, based on the parameter information obtained in S380, any D pMapping from the image coordinate system to the world coordinate system, we get the second two-dimensional grid map D' p ; Form a second two-dimensional grid atlas; wherein, D' p The unit grid A in the rth row and sth column rs p Including (P rs p , G rs p , O rs p ), P rs p A rs p The number of people in G rs p A rs p The position in the world coordinate system, O rs p A rs p The number of times it overlaps with other unit grids in the two-dimensional grid atlas at the same spatial position, O rs p The initial value of is 0.
[0077] S420, determining the second two-dimensional grid graph D' in the second two-dimensional grid graph set p and D' q , whether they overlap, if so, get D' respectively p and D' q All unit grids in the overlapping area and set O rs p =O rs p +1 and set O uv q =O uv p +1; q ranges from 1 to n, and q≠p, O uv q D' q The number of times the unit grid in the uth row and vth column in the 2D grid atlas overlaps with other unit grids in the same spatial position, O uv q The initial value of is 0.
[0078] S440, for D' p A in rs p , set P rs p =P rs p *(1 / (O rsp +1); forming a third two-dimensional grid atlas.
[0079] S460: Generate a two-dimensional crowd heat map based on the positions and number of people of all unit grids in the third two-dimensional grid atlas.
[0080] The specific implementation of the above S360 to S460 may refer to S140 to S240 of the aforementioned embodiment.
[0081] Furthermore, the system provided by the embodiment of the present invention may further include a display in communication with the main controller, wherein the display is used to visually display the generated two-dimensional crowd heat map.
[0082] In an exemplary embodiment, the density of people can be represented by different colors. For example, areas with a large number of people can be displayed in red, while areas with a small number of people can be displayed in blue, so that users can intuitively understand the distribution of people in the monitored area.
[0083] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing a method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiment.
[0084] An embodiment of the present invention further provides an electronic device including a processor and the aforementioned non-transitory computer-readable storage medium.
[0085] An embodiment of the present invention further provides a computer program product comprising program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present invention described above in this specification.
[0086] Although some specific embodiments of the present invention have been described in detail by way of example, it will be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A camera-based crowd heat map generation method, characterized in that: The method comprises the following steps: S100, obtain the real-time video stream i shot by any camera i in the monitoring area s ; The value of i ranges from 1 to N, where N is the number of cameras in the monitoring area; S120, obtain real-time video stream i s The crowd distribution information of any frame image j in (D ij , t ij , ID ii ), D ij is the first two-dimensional grid obtained by dividing image j according to the set step size, t ij The timestamp of image j, ID ii is the ID of camera i; where D ij Any unit grid in the memory stores the number of people in the unit grid; the value of j ranges from 1 to m(i), where m(i) is i s The number of images in S140, obtaining a first two-dimensional grid map of all cameras within the monitoring area and within the current time range to form a first two-dimensional grid map set; S160, for any first two-dimensional grid graph D in the first two-dimensional grid graph set, p , based on D p The ID of the corresponding camera is used to obtain the parameter information of the corresponding camera; the value of p ranges from 1 to n, where n is the number of the first two-dimensional grid images in the first two-dimensional grid image set; S180, based on the parameter information obtained in S160, any D p Mapping from the image coordinate system to the world coordinate system, we get the second two-dimensional grid map D ’ p ; Form a second two-dimensional grid atlas; where D ’ p The unit grid A in the rth row and sth column rs p Including (P rs p , G rs p , O rs p ), P rs p A rs p The number of people in G rs p A rs p The position in the world coordinate system, O rs p A rs p The number of times it overlaps with other unit grids in the two-dimensional grid atlas at the same spatial position, O rs p The initial value of is 0; S200, determining the second two-dimensional grid image D in the second two-dimensional grid image set ’ p and D ’ q Is there overlap? If there is an overlapping area, get D respectively ’ p and D ’ q All unit grids in the overlapping area and set O rs p =O rs p +1 and set O uv q =O q uv +1; q ranges from 1 to n, and q≠p, O uv q D ’ q The number of times the unit grid in the uth row and vth column in the 2D grid atlas overlaps with other unit grids in the same spatial position, O uv q The initial value of is 0; S220, for D ’ p A in rs p , set P rs p =P rs p *(1 / (O rs p +1)); forming a third two-dimensional grid atlas; S240: Generate a three-dimensional crowd heat map based on the positions and number of people of all unit grids in the third two-dimensional grid atlas.
2. The method according to claim 1, characterized in that In S180, any D p Map from image coordinates to world coordinates.
3. The method according to claim 1, characterized in that In S160 , the parameter information includes internal parameters and external parameters.
4. The method according to claim 1, wherein In S140 , the current time range is [t−Δt, t+Δt], where t is the current time and Δt is the set time interval.
5. The method according to claim 1, wherein D ij Any unit grid in the is stored with the number of people in the unit grid calculated by a deep neural network.
6. The method according to claim 1, characterized in that The set step size is 64 pixels.
7. The method according to claim 1, characterized in that Also includes: S260: Visually display the generated two-dimensional crowd heat map.
8. A camera-based crowd heat map generation system, characterized in that: The system includes: a master controller and n slave controllers in communication with the master controller, each slave controller in communication with at least one camera arranged in a monitoring area; Wherein, any slave controller is used to execute a computer program to implement the following steps: S300, obtaining the real-time video stream i shot by any camera i in the corresponding camera s ; The value of i ranges from 1 to n; S320, obtain real-time video stream i s The crowd distribution information of any frame image j in (D ij , t ij , ID ii ), D ij is the first two-dimensional grid obtained by dividing image j according to the set step size, t ij The timestamp of image j, ID ii For camera i c ID; where D ij Any unit grid in the memory stores the number of people in the unit grid; j ranges from 1 to m(i), where m(i) is i s The number of images in S340, sending the obtained crowd distribution information to the main controller; The main controller is used to execute a computer program to implement the following steps: S360, obtaining first two-dimensional grid images of all cameras within the monitoring area and within the current time range to form a first two-dimensional grid image set; S380, for any first two-dimensional grid graph D in the first two-dimensional grid graph set, p , based on D p The ID of the corresponding camera is used to obtain the parameter information of the corresponding camera; the value of p ranges from 1 to n, where n is the number of the first two-dimensional grid images in the first two-dimensional grid image set; S400, based on the parameter information obtained in S380, any D p Mapping from the image coordinate system to the world coordinate system, we get the second two-dimensional grid map D ’ p ; Form a second two-dimensional grid atlas; where D ’ p The unit grid A in the rth row and sth column rs p Including (P rs p , G rs p , O rs p ), P rs p A rs p The number of people in G rs p A rs p The position in the world coordinate system, O rs p A rs p The number of times it overlaps with other unit grids in the two-dimensional grid atlas at the same spatial position, O rs p The initial value of is 0; S420, determining the second two-dimensional grid image D in the second two-dimensional grid image set. ’ p and D ’ q Is there overlap? If there is an overlapping area, get D respectively ’ p and D ’ q All unit grids in the overlapping area and set O rs p =O rs p +1 and set O uv q =O q uv +1; q ranges from 1 to n, and q≠p, O uv q D ’ q The number of times the unit grid in the uth row and vth column in the 2D grid atlas overlaps with other unit grids in the same spatial position, O uv q The initial value of is 0; S440, for D ’ p A in rs p , set P rs p =P rs p *(1 / (O rs p +1)); forming a third two-dimensional grid atlas; S460: Generate a three-dimensional crowd heat map based on the positions and number of people of all unit grids in the third two-dimensional grid atlas.
9. A non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The device comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.
Citation Information
Patent Citations
A method and apparatus for obtaining a crowd thermodynamic diagram
CN109189878A
Pedestrian flow control method and system based on thermodynamic diagram algorithm and storage medium
CN112419123A