Method and system for accurately counting passenger flow
By determining the appearance point, vanishing point, and midpoint of the human coordinates in the customer flow counting device and calculating the areas inside and outside the store, the problem of the inability to accurately count complex customer behaviors in existing technologies is solved, and an intuitive display of the number of people entering and leaving the store and their movement trajectories is achieved, meeting customer needs.
Patent Information
- Application Number
- CN202510880369.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-09-19
AI Technical Summary
Existing customer flow counting equipment cannot accurately count complex customer behaviors, cannot intuitively display customer movement trajectories, and cannot meet customer needs.
By obtaining the areas outside and inside the store, the appearance point, vanishing point, and midpoint of the human coordinates are determined. Based on these points, the trajectory labels of customer flow are determined, including entering the store, leaving the store, entering and exiting the store, and passing through the store. Combined with Json package parsing and exclusion rules, the in-store area is calculated to achieve accurate statistics of human trajectories.
It realizes the intuitive counting of the number of people entering and leaving the store and the intuitive display of each person's movement trajectory, making it convenient for store owners to understand customers' walking records and improving the accuracy and intuitiveness of customer flow statistics.
Smart Images

Figure CN120672742A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and system for accurately counting passenger flows. Background Art
[0002] At present, customer flow counting equipment tracks the same person as the same ID based on an algorithm, and then determines whether the person enters or leaves the store; it can count the number of people entering and leaving the store, and can also display the number of people entering and leaving the store on the preview interface, and intuitively display the current number of people entering and leaving the store.
[0003] However, the above process only counts customer flow status for three status labels: entering the store, leaving the store, and wandering, which does not fully capture customer trajectory behavior. Customer flow statistics based on human-shaped image display cannot intuitively display customer movement trajectories. For customer flow statistics, setting rule lines to count whether customers cross the line is relatively simple, and cannot accurately count complex behaviors, which fails to meet customer needs. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method and system for accurately counting customer flow, which can intuitively count the number of people entering and leaving the store, and can intuitively see the movement trajectory of each person, which greatly facilitates store owners to understand the situation of entering and leaving the store, and facilitates store owners to review customers' walking records.
[0005] In a first aspect, an embodiment of the present invention provides a method for accurately counting passenger flow, the method comprising:
[0006] Get the set off-store area;
[0007] Calculating the in-store area based on the out-store area;
[0008] Acquire alarm information, parse the alarm information, and obtain a Json package body; wherein the Json package body includes human coordinates;
[0009] Determining the appearance point, vanishing point, and middle point of the human figure coordinates according to the area outside the store and the area inside the store;
[0010] Determining a trajectory label of the passenger flow according to the appearance point, the vanishing point, and the middle point;
[0011] The trajectory tags include entering the store, leaving the store, entering and exiting the store, same side, and passing the store.
[0012] Furthermore, calculating the in-store area based on the out-of-store area includes:
[0013] Obtaining the store line and the image area captured by the camera in the area outside the store;
[0014] Calculating the slope of the store line;
[0015] Obtain a first straight line and a second straight line having slopes perpendicular to the store line;
[0016] Calculating the intersection points of the first straight line and the second straight line with the coordinate system; wherein the intersection points include the first intersection point and the second intersection point;
[0017] Get the set exclusion rules;
[0018] Obtain the first and third intersection points of the area outside the store, the intersection point with the coordinate system, and the screen area through the set exclusion rule;
[0019] The in-store area is obtained according to the first intersection point, the third intersection point, the slope of the store line and the second intersection point.
[0020] Furthermore, the appearance point is the first time that the human figure coordinates appear in the area outside the store, the area inside the store, or other areas; the vanishing point is the last time that the human figure coordinates appear in the area outside the store, the area inside the store, or other areas; the intermediate point is whether the human figure coordinates pass through the area outside the store or the area inside the store during the process between the appearance point and the vanishing point; wherein, the other areas are areas other than the area outside the store and the area inside the store.
[0021] Furthermore, determining the trajectory label of the passenger flow according to the appearance point, the vanishing point, and the middle point includes:
[0022] When the appearance point is in the area outside the store or in the other area, and the disappearance point is in the area inside the store, the movement trajectory is entering the store;
[0023] When the appearance point is in the in-store area and the disappearance point is in the out-store area or the other area, the movement trajectory is leaving the store;
[0024] When the appearance point and the vanishing point are both outside the store area and intersect with the area outside the store, the movement trajectory is a passing store;
[0025] When, based on the store passing, the middle point intersects with the store area, the movement trajectory is in and out of the store;
[0026] When the appearance point and the vanishing point are both in the store area, the movement trajectory is on the same side.
[0027] Furthermore, the method further comprises:
[0028] Aggregate all images of the same person into motion trajectories;
[0029] The movement path of the same person is checked according to the movement trajectory.
[0030] In a second aspect, an embodiment of the present invention provides a system for accurately counting passenger flow, the system comprising:
[0031] The acquisition module is used to obtain the set off-store area;
[0032] a calculation module, configured to calculate the in-store area based on the out-of-store area;
[0033] A parsing module, configured to obtain alarm information, parse the alarm information, and obtain a Json package body; wherein the Json package body includes human coordinates;
[0034] A first determining module is configured to determine an appearance point, a vanishing point, and a middle point of the human figure coordinates based on the area outside the store and the area inside the store;
[0035] A second determining module is used to determine a trajectory label of the passenger flow according to the appearance point, the vanishing point and the middle point;
[0036] The trajectory tags include entering the store, leaving the store, entering and exiting the store, same side, and passing the store.
[0037] Furthermore, the calculation module is specifically used to:
[0038] Obtaining the store line and the image area captured by the camera in the area outside the store;
[0039] Calculating the slope of the store line;
[0040] Obtain a first straight line and a second straight line having slopes perpendicular to the store line;
[0041] Calculating the intersection points of the first straight line and the second straight line with the coordinate system; wherein the intersection points include the first intersection point and the second intersection point;
[0042] Get the set exclusion rules;
[0043] Obtain the first and third intersection points of the area outside the store, the intersection point with the coordinate system, and the screen area through the set exclusion rule;
[0044] The in-store area is obtained according to the first intersection point, the third intersection point, the slope of the store line and the second intersection point.
[0045] Furthermore, the appearance point is the first time that the human figure coordinates appear in the area outside the store, the area inside the store, or other areas; the vanishing point is the last time that the human figure coordinates appear in the area outside the store, the area inside the store, or other areas; the intermediate point is whether the human figure coordinates pass through the area outside the store or the area inside the store during the process between the appearance point and the vanishing point; wherein, the other areas are areas other than the area outside the store and the area inside the store.
[0046] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the above-mentioned method when executing the computer program.
[0047] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium having a non-volatile program code executable by a processor, wherein the program code enables the processor to execute the method as described above.
[0048] An embodiment of the present invention provides a method and system for accurately counting customer flow, including: obtaining a set out-of-store area; calculating the in-store area based on the out-of-store area; obtaining alarm information, parsing the alarm information, and obtaining a Json package body; wherein the Json package body includes human coordinates; according to the out-of-store area and the in-store area, determining the appearance point, vanishing point, and middle point of the human coordinates; according to the appearance point, vanishing point, and middle point, determining the trajectory label of the customer flow; wherein the trajectory label includes entering the store, leaving the store, entering and exiting the store, on the same side, and passing the store; the number of people entering and exiting the store can be intuitively counted, and the movement trajectory of each person can be intuitively seen, which greatly facilitates the store owner to understand the situation of entering and exiting the store and facilitates the store owner to review the walking records of customers.
[0049] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purposes and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 Flowchart of the method for accurately counting passenger flow provided in the first embodiment of the present invention;
[0053] Figure 2 A schematic diagram showing the distribution of areas outside and inside a store provided in Example 1 of the present invention;
[0054] Figure 3 Schematic diagram of a system for accurately counting passenger flow provided by the second embodiment of the present invention. DETAILED DESCRIPTION
[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0056] To facilitate understanding of this embodiment, the embodiment of the present invention is described in detail below.
[0057] Example 1:
[0058] Figure 1 This is a flow chart of the method for accurately counting passenger flow provided in Example 1 of the present invention.
[0059] Reference Figure 1 , the method comprises the following steps:
[0060] Step S101, obtaining the set off-store area;
[0061] Step S102, calculating the store area based on the store area;
[0062] Here, the in-store area is automatically calculated based on the out-store area, avoiding tedious operations for customers.
[0063] Step S103: Acquire alarm information, parse the alarm information, and obtain a Json package body; wherein the Json package body includes the coordinates of the human figure;
[0064] Step S104, determining the appearance point, vanishing point, and middle point of the human figure coordinates based on the area outside the store and the area inside the store;
[0065] Step S105, determining the trajectory label of the passenger flow according to the appearance point, vanishing point and middle point;
[0066] Among them, the trajectory labels include entering the store, leaving the store, entering and exiting the store, same side and passing the store.
[0067] In this embodiment, the status labels of human-shaped trajectories are enriched, covering the basic human-shaped trajectories, scientifically and reasonably marking the human-shaped trajectories entering and leaving the store, and the setting is simple. By setting the out-store area, the in-store area is automatically calculated based on the out-store area; then the trajectory labels of the customer flow are automatically calculated based on the human-shaped coordinates, which can cover the movement trajectories of people inside and outside the store; this application can also package pictures and alarm information and upload them to the cloud server, where they are intuitively displayed, framing the human figure and displaying each person's movement trajectory and status label.
[0068] This application can directly count the number of people entering and leaving the store, and can intuitively see the movement trajectory of each person, which greatly facilitates the store owner to understand the situation of entering and leaving the store, and facilitates the store owner to review the customer's walking records. In addition, the cloud server can also filter all alarms according to the unified trajectory status and display alarms with the same trajectory.
[0069] Further, refer to Figure 2 , step S102 includes the following steps:
[0070] Step S201, obtaining the store line CG of the store exterior area and the image area captured by the camera;
[0071] Step S202, calculating the slope of the store line CG;
[0072] Step S203, obtaining a first straight line H and a second straight line J with slopes perpendicular to the store line CG;
[0073] Step S204, calculating the intersection points of the first straight line and the second straight line with the coordinate system; wherein the intersection points include the first intersection point and the second intersection point;
[0074] Specifically, according to the slope of the store line CG, a first straight line H and a second straight line J are drawn perpendicular to the two points CG; the two straight lines intersect with the coordinate system, and the intersection points D and E with the coordinate system are calculated.
[0075] Step S205: Obtain the set exclusion rules; wherein the exclusion rules include: excluding points whose coordinates are less than 0, excluding points on the same side as the area outside the store, and excluding points not on the screen area;
[0076] Step S206: The intersection of the store area A, the coordinate system, and the screen area is obtained by applying the set exclusion rule to obtain the first intersection point D and the third intersection point F;
[0077] In step S207 , the in-store area B (ie, CDEFG) is obtained according to the first intersection point D, the third intersection point F, the slope CG of the store line, and the second intersection point E.
[0078] Furthermore, the appearance point is the first time that the human figure coordinates appear in the off-store area A, the in-store area B or other areas C; the vanishing point is the last time that the human figure coordinates appear in the off-store area A, the in-store area B or other areas C; the intermediate point is whether the human figure coordinates pass through the off-store area A or the in-store area B in the process between the appearance point and the vanishing point; among them, the other areas C are areas other than the off-store area A and the in-store area B.
[0079] Furthermore, step S105 includes the following steps:
[0080] Step S301: When the appearance point is in the area outside the store or other areas, and the disappearance point is in the store area, the movement trajectory is entering the store;
[0081] Step S302: When the appearance point is in the store area and the disappearance point is outside the store or other areas, the movement trajectory is leaving the store;
[0082] Step S303: When both the appearance point and the vanishing point are outside the store area and intersect with the area outside the store, the movement trajectory is a passing store;
[0083] Step S304: when the middle point intersects with the store area after passing through the store, the movement trajectory is in and out of the store;
[0084] Step S305: When the appearance point and the vanishing point are both in the store area, the movement trajectory is on the same side.
[0085] Specifically, according to the above logic, the area where the appearance point appears, the area where the middle point appears, and the area where the vanishing point appears are determined, and different trajectory labels are obtained by comprehensive calculation, such as entering the store, leaving the store, passing the store, entering and exiting the store, and on the same side.
[0086] Furthermore, the method further comprises the following steps:
[0087] Step S401, aggregating all images of the same person into a motion trajectory;
[0088] Step S402: Check the movement path of the same person based on the movement trajectory.
[0089] Specifically, the algorithm tracks the same human figure and aggregates them into the same ID (this ID is the human figure ID, representing the same person); then all pictures of the same person are aggregated into tracks, so that the person's movement path can be clearly seen; finally, by intuitively displaying the continuous movement track of the same human figure ID, customers can clearly see the walking track of the same person, which is convenient for management.
[0090] Example 2:
[0091] Figure 3 Schematic diagram of a system for accurately counting passenger flow provided by the second embodiment of the present invention.
[0092] Reference Figure 3 , the system comprises:
[0093] The acquisition module is used to obtain the set off-store area;
[0094] A calculation module, used to calculate the store area based on the store area;
[0095] The parsing module is used to obtain the alarm information, parse the alarm information, and obtain a Json package body; wherein the Json package body includes the coordinates of the human figure;
[0096] The first determination module is used to determine the appearance point, vanishing point and middle point of the human figure coordinates based on the area outside the store and the area inside the store;
[0097] The second determination module is used to determine the trajectory label of the passenger flow based on the appearance point, vanishing point and middle point;
[0098] Among them, the trajectory labels include entering the store, leaving the store, entering and exiting the store, same side and passing the store.
[0099] Furthermore, the calculation module is specifically used to:
[0100] Get the store line and camera-captured image area outside the store;
[0101] Calculate the slope of the store line;
[0102] Obtain a first straight line H and a second straight line J with slopes perpendicular to the store line;
[0103] Calculate the intersection points of the first straight line and the second straight line with the coordinate system; wherein the intersection points include the first intersection point and the second intersection point;
[0104] Get the set exclusion rules;
[0105] The first and third intersection points of the area outside the store, the intersection points with the coordinate system, and the screen area are obtained by using the set exclusion rules;
[0106] The store area is obtained according to the first intersection point, the third intersection point, the slope of the store line and the second intersection point.
[0107] Furthermore, the appearance point is the first time that the human figure coordinates appear in the area outside the store, the area inside the store, or other areas; the vanishing point is the last time that the human figure coordinates appear in the area outside the store, the area inside the store, or other areas; the intermediate point is whether the human figure coordinates pass through the area outside the store or the area inside the store in the process between the appearance point and the vanishing point; among them, other areas are areas other than the area outside the store and the area inside the store.
[0108] An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for accurately counting passenger flow provided in the above embodiment are implemented.
[0109] An embodiment of the present invention further provides a computer-readable medium having a non-volatile program code executable by a processor, wherein a computer program is stored on the computer-readable medium, and when the computer program is executed by the processor, the steps of the method for accurately counting passenger flow in the above embodiment are executed.
[0110] The computer program product provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. For specific implementation, please refer to the method embodiments and will not be repeated here.
[0111] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0112] In addition, in the description of the embodiments of the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; they may refer to mechanical connections or electrical connections; they may refer to direct connections or indirect connections through an intermediate medium; and they may refer to internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.
[0113] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0114] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0115] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for accurately counting passenger flow, characterized in that: The method comprises: Get the set off-store area; Calculating the in-store area based on the out-store area; Acquire alarm information, parse the alarm information, and obtain a Json package body; wherein the Json package body includes human coordinates; Determining the appearance point, vanishing point, and middle point of the human figure coordinates according to the area outside the store and the area inside the store; Determining a trajectory label of the passenger flow according to the appearance point, the vanishing point, and the middle point; The trajectory tags include entering the store, leaving the store, entering and exiting the store, same side, and passing the store.
2. The method for accurately counting passenger flow according to claim 1, characterized in that: Calculate the in-store area based on the out-store area, including: Obtaining the store line and the image area captured by the camera in the area outside the store; Calculating the slope of the store line; Obtain a first straight line and a second straight line having slopes perpendicular to the store line; Calculating the intersection points of the first straight line and the second straight line with the coordinate system; wherein the intersection points include the first intersection point and the second intersection point; Get the set exclusion rules; Obtain the first and third intersection points of the area outside the store, the intersection point with the coordinate system, and the screen area through the set exclusion rule; The in-store area is obtained according to the first intersection point, the third intersection point, the slope of the store line and the second intersection point.
3. The method for accurately counting passenger flow according to claim 1, characterized in that: The appearance point is the first time that the coordinates of the human figure appear in the area outside the store, the area inside the store, or other areas; the vanishing point is the last time that the coordinates of the human figure appear in the area outside the store, the area inside the store, or other areas; The intermediate point is whether the coordinates of the human figure pass through the area outside the store or the area inside the store in the process between the appearance point and the vanishing point; wherein the other area is the area other than the area outside the store and the area inside the store.
4. The method for accurately counting passenger flow according to claim 3, characterized in that: Determining a passenger flow trajectory label according to the appearance point, the vanishing point, and the middle point includes: When the appearance point is in the area outside the store or in the other area, and the disappearance point is in the area inside the store, the movement trajectory is entering the store; When the appearance point is in the in-store area and the disappearance point is in the out-store area or the other area, the movement trajectory is leaving the store; When the appearance point and the vanishing point are both outside the store area and intersect with the area outside the store, the movement trajectory is a passing store; When, based on the store passing, the middle point intersects with the store area, the movement trajectory is in and out of the store; When the appearance point and the vanishing point are both in the store area, the movement trajectory is on the same side.
5. The method for accurately counting passenger flow according to claim 1, characterized in that: The method further comprises: Aggregate all images of the same person into motion trajectories; The movement path of the same person is checked according to the movement trajectory.
6. A system for accurately counting passenger flow, characterized by: The system comprises: The acquisition module is used to obtain the set off-store area; a calculation module, configured to calculate the in-store area based on the out-of-store area; A parsing module is used to obtain alarm information, parse the alarm information, and obtain a Json package; wherein the Json package includes human coordinates; A first determining module is used to determine the appearance point, vanishing point and middle point of the human figure coordinates according to the area outside the store and the area inside the store; A second determining module is used to determine a trajectory label of the passenger flow according to the appearance point, the vanishing point and the middle point; The trajectory tags include entering the store, leaving the store, entering and exiting the store, same side, and passing the store.
7. The system for accurately counting passenger flow according to claim 6, characterized in that: The calculation module is specifically used for: Obtaining the store line and the image area captured by the camera in the area outside the store; Calculating the slope of the store line; Obtain a first straight line and a second straight line having slopes perpendicular to the store line; Calculating the intersection points of the first straight line and the second straight line with the coordinate system; wherein the intersection points include the first intersection point and the second intersection point; Get the set exclusion rules; Obtain the first and third intersection points of the area outside the store, the intersection point with the coordinate system, and the screen area through the set exclusion rule; The in-store area is obtained according to the first intersection point, the third intersection point, the slope of the store line and the second intersection point.
8. The system for accurately counting passenger flow according to claim 6, characterized in that: The appearance point is the first time that the coordinates of the human figure appear in the area outside the store, the area inside the store, or other areas; the vanishing point is the last time that the coordinates of the human figure appear in the area outside the store, the area inside the store, or other areas; The intermediate point is whether the coordinates of the human figure pass through the area outside the store or the area inside the store in the process between the appearance point and the vanishing point; wherein the other area is the area other than the area outside the store and the area inside the store.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
10. A computer-readable medium having a non-volatile program code executable by a processor, characterized in that The program code causes the processor to execute the method according to any one of claims 1 to 5.