Passenger flow statistics method, device, electronic equipment and storage medium
Through video stream analysis technology, the personnel characteristics and trajectory information are extracted, and the problems of high memory usage and long counting time in the existing passenger flow statistics methods are solved, achieving efficient and accurate passenger flow statistics and file establishment.
Patent Information
- Application Number
- CN202111679108.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-12-31
AI Technical Summary
The existing passenger flow statistics method can only count passenger flow through wifi probes or head and shoulders technology, resulting in high memory occupancy and long counting time when building passenger flows.
By obtaining the video stream of the passenger flow entrance and exit of the area to be counted within the preset time period, extracting the personnel characteristic information of the personnel contained in the image frame in the video stream, generating personnel trajectory information, determining the target personnel and the number of personnel, and finally determining the passenger flow statistics results .
It reduces the memory usage of statistics, shortens the counting time, and improves the efficiency and accuracy of customer flow file establishment.
Smart Images

Figure CN114445774B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of face detection, and in particular to a passenger flow counting method, device, electronic equipment and storage medium. Background Art
[0002] With the development and progress of artificial intelligence technology, the demand for shopping mall / store customer flow statistics and face archiving is increasing. Among the related technologies, most of the current customer flow statistics are calculated through technologies such as wifi probes / head and shoulder. However, the above methods can only count the customer flow, resulting in high memory usage and long counting time when building customer flow archives. Summary of the invention
[0003] In a first aspect, the main purpose of the present invention is to provide a passenger flow counting method, comprising:
[0004] Obtain the video stream of the passenger flow entrance and exit of the area to be counted within a preset time period;
[0005] Extracting personnel feature information of personnel included in the image frames in the video stream to generate personnel trajectory information of the personnel included in the video stream;
[0006] Based on the personnel trajectory information of the personnel included in the video stream, determine the target personnel and the number of the target personnel who enter and exit the area to be counted within the preset time period;
[0007] Based on the number of the target personnel and the personnel characteristic information of the target personnel, a passenger flow statistics result entering and exiting the area to be counted within the preset time period is determined.
[0008] Optionally, extracting the personnel feature information of the personnel contained in the image frames in the video stream to generate the personnel trajectory information of the personnel contained in the video stream includes:
[0009] Detecting the head region of each image frame in the video stream to obtain head region feature data of the person contained in each image frame in the video stream;
[0010] Based on the head region feature data of the persons contained in each of the image frames in the video stream, the person trajectory information of the persons contained in the video stream is determined and generated.
[0011] Optionally, the detecting of the head region of each image frame in the video stream to obtain the head region feature data of the person contained in each image frame in the video stream includes:
[0012] Detecting the human head region of each image frame in the video stream to determine the interval between the human head regions corresponding to adjacent image frames;
[0013] Determining whether the interval between the head regions exceeds a preset interval;
[0014] When the interval between the head regions is less than the preset interval, deleting the head region feature data of the person contained in one of the image frames;
[0015] When the interval between the head regions exceeds the preset interval, the feature data of the head regions of the persons contained in the image frame are retained.
[0016] Optionally, the passenger flow counting method further includes:
[0017] Detecting each image frame in the video stream to determine head region feature data and body region feature data of the persons included therein;
[0018] Determine whether there is a missing head area between each image frame;
[0019] When there is a disappeared head region between each image frame, matching the head region feature data and the human body region feature data between each image frame to determine the human body trajectory data of the included person;
[0020] The human body trajectory data is determined as the human body trajectory information of the person included in the video stream.
[0021] Optionally, the determining, based on the personnel trajectory information of the personnel included in the video stream, the target personnel and the number of the target personnel who enter and exit the area to be counted within the preset time period comprises:
[0022] Based on the personnel trajectory information of the personnel included in the video stream, determining whether the personnel included in the video stream enters and / or leaves the area to be counted;
[0023] When a person included in the video stream enters and / or leaves the area to be counted, the person included in the video stream and corresponding to the person trajectory information is determined as a target person;
[0024] The number of the target persons is calculated based on the target persons in the video stream.
[0025] Optionally, the passenger flow counting method further includes:
[0026] Determining the direction of the human body trajectory of the person included in the video stream according to the person trajectory information of the person included in the video stream;
[0027] According to the direction of the human body trajectory, determining whether the personnel trajectory information contains characteristic data of a human head region opposite to the direction of the human body trajectory;
[0028] When the head region feature data is in opposite directions to the human body trajectory, the head region feature data is deleted to obtain the person trajectory information after the deletion process.
[0029] In a second aspect, an embodiment of the present invention provides a passenger flow counting device, including:
[0030] An acquisition module is used to acquire the video stream of the passenger flow entrance and exit of the area to be counted within a preset time period;
[0031] An extraction module, used to extract personnel feature information of personnel contained in the image frames in the video stream to generate personnel trajectory information of the personnel contained in the video stream;
[0032] A first determination module is used to determine the target person and the number of the target person who enters and exits the area to be counted within the preset time period based on the person trajectory information of the person included in the video stream;
[0033] The second determination module is used to determine the passenger flow statistics result entering and exiting the area to be counted within the preset time period based on the number of the target personnel and the personnel characteristic information of the target personnel.
[0034] Optionally, the extraction module includes:
[0035] A detection unit, configured to detect a head region of each image frame in the video stream to obtain feature data of a head region of a person contained in each image frame in the video stream;
[0036] A determination unit is used to determine and generate person trajectory information of the person included in the video stream based on the head area feature data of the person included in each of the image frames in the video stream.
[0037] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the passenger flow counting method as described above when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the passenger flow counting method as described above are implemented.
[0039] The above solution of the present invention includes at least the following beneficial effects:
[0040] The passenger flow counting method provided by the present invention first obtains the video stream of the passenger flow entrance and exit of the area to be counted within a preset time period; and extracts the personnel feature information of the personnel contained in the image frame in the video stream to generate the personnel trajectory information of the personnel contained in the video stream; then, based on the personnel trajectory information of the personnel contained in the video stream, the target personnel and the number of the target personnel entering and exiting the area to be counted within the preset time period are determined; finally, based on the number of the target personnel and the personnel feature information of the target personnel, the passenger flow counting result entering and exiting the area to be counted within the preset time period is determined. Therefore, when the passenger flow is archived, the memory occupied by the statistics is reduced, and the counting time is shortened. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 the structures shown in these drawings without paying creative work.
[0042] Figure 1 A network architecture diagram of a passenger flow counting method provided by an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of the overall process of the passenger flow counting method provided by an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of a specific flow chart of step S20 provided in an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of a specific flow chart of step S30 provided in an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of a specific flow chart of step S40 provided in an embodiment of the present invention;
[0047] Figure 6 Another schematic diagram of a flow chart of a passenger flow counting method provided by an embodiment of the present invention;
[0048] Figure 7 Another schematic diagram of a flow chart of a passenger flow counting method provided by an embodiment of the present invention;
[0049] Figure 8 A structural block diagram of a passenger flow counting device provided by an embodiment of the present invention;
[0050] Fig. 9 A structural block diagram of an extraction module provided in an embodiment of the present invention;
[0051] Fig.10 This is a structural block diagram of an electronic device provided by an embodiment of the present invention.
[0052] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] The terms "first", "second", "third", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variation thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0055] First, the network architecture to which the solution of the embodiment of the present application may be applied is introduced by way of example with reference to the relevant drawings.
[0056] like Figure 1 As shown, the above network architecture involves servers, image acquisition devices deployed in shopping malls or stores, and management platforms. The server can be understood as recording information such as human features and monitoring data of monitored passenger flows; the image acquisition device is used to collect monitoring image data around shopping malls or stores, and the image acquisition device can specifically be a camera, a snapshot machine, etc.; the management platform is used to receive and display passenger flow data uploaded by the server, etc., to facilitate subsequent commercial applications and analysis based on passenger flow data.
[0057] like Figure 2 As shown, a specific embodiment of the present invention provides a passenger flow counting method, including:
[0058] S10: Obtain the video stream of the passenger entrance and exit of the area to be counted within a preset time period.
[0059] In this embodiment, the area to be counted may be a shopping mall, a store, a supermarket or the like, the entrance and exit of the customer flow may be the entrance and exit area of a shopping mall, a store, a supermarket or the like, the preset time period may be any pre-set time, the video stream refers to the transmission of video data, which can be processed as a stable and continuous stream through the network, and the video stream is collected in real time by an image acquisition device in the shopping mall or the store, and the video stream can be transmitted to the first thread, the video stream may include a plurality of different characters, and each character has different features, such as a face, a body and a head, etc., and the image acquisition device may be used to capture the image data; optionally, the format of the video stream may be a YUV format, YUV represents a color encoding method, which is often used in various video processing components, "Y" represents brightness (Luminance or Luma), that is, a grayscale value, and "U" and "V" represent chrominance (Chrominance or Chroma), which is used to specify the color of a pixel.
[0060] S20: extracting personnel feature information of personnel included in the image frames in the video stream to generate personnel trajectory information of the personnel included in the video stream.
[0061] In this embodiment, after acquiring the video stream, the video stream can be preprocessed to form image data, and high-pixel image data can be changed into low-pixel detection image data, for example, 4 million pixels can be converted into 2 million pixels of detection image data, and it can be converted into detection image data in BGR format, so that the image data occupies less memory, improves the preprocessing efficiency and saves time; by extracting the personnel feature information in each image frame in the video stream and analyzing the personnel feature information, the corresponding personnel trajectory information can be determined; that is, when the video stream contains 5 people, the head area, body area, etc. of the 5 people can be extracted through each image frame in the video stream to determine the trajectory information of the 5 people according to the head area and the body area.
[0062] like Figure 3 As shown, the above extraction of personnel feature information of personnel contained in the image frame in the video stream to generate personnel trajectory information of the personnel contained in the video stream includes:
[0063] S21, detecting the head region of each image frame in the video stream to obtain head region feature data of the person contained in each image frame in the video stream;
[0064] S22. Based on the head region feature data of the persons included in each image frame in the video stream, determine and generate the person trajectory information of the persons included in the video stream.
[0065] Among them, the head area represents the head position of each person, and the head area feature data can be used as the identity identification information of each person. The image acquisition device is used to track the people included in the video stream, so that the head area feature data of each person can be determined, and then for each image frame in the video stream, the corresponding head area feature data can be determined in each image frame, so that the personnel trajectory information of each person can be determined according to the head area feature data in each image frame; for example, for 5 people included in the video stream, the image acquisition device can track the head of each person to determine the moving trajectory of the heads of the 5 people according to each image frame in the video stream, and then determine the corresponding trajectory information.
[0066] Optionally, by detecting each image frame in the video stream, the body, head and face of different people in each image frame can be determined, and by tracking the heads of different characters, the subsequent trajectory determination and storage of facial area features, head area features and body area features of different characters can be more accurately matched and integrated.
[0067] S30. Based on the trajectory information of the persons included in the video stream, determine the target persons and the number of the target persons who enter and exit the area to be counted within a preset time period.
[0068] In this embodiment, the video stream includes multiple different persons, and the persons passing through the area to be counted within a preset time period may have different person trajectory information. Therefore, the trajectory direction and trajectory density of each person in the area to be counted can be determined by the person trajectory information of each person in the video stream. The trajectory direction can be determined by the face orientation of each person in the area to be counted, and the trajectory density can be determined by the interval between each image frame. For example, if the interval between two adjacent image frames is relatively small, it means that the trajectory density is relatively large. When the interval between two adjacent image frames is relatively large, it means that the trajectory density is relatively small.
[0069] like Figure 4 As shown, the head region of each image frame in the video stream is detected to obtain the head region feature data of the person contained in each image frame in the video stream, including:
[0070] S31, detecting the head region of each image frame in the video stream to determine the interval between the head regions corresponding to adjacent image frames;
[0071] S32, determining whether the interval between the head regions exceeds a preset interval;
[0072] S33, when the interval between the head regions is less than a preset interval, deleting the head region feature data of the person included in one of the image frames;
[0073] S34. When the interval between the head regions exceeds the preset interval, the feature data of the head regions of the persons contained in the image frame are retained.
[0074] In this embodiment, when determining the head area feature data of each person in the video stream, a judgment can be made based on the head area feature data in each image frame. When the interval between the head area feature data of adjacent image frames is relatively large, it can be retained; when the interval between the head area feature data of adjacent image frames is relatively small, the head area feature data in one of the image frames can be deleted, thereby avoiding the density of the human body area feature data being too dense to save memory space; optionally, the interval between adjacent image frames can be compared with a preset interval. When it is compared that the interval between adjacent image frames is lower than the preset interval, it means that the trajectory of the head area feature data of the person contained in the adjacent image frames is too dense, so it can be deleted. It can be understood that when it is compared that the interval between adjacent image frames is greater than the preset interval, it means that the head area feature data of the person contained in the adjacent image frames is a normal trajectory, so it can be retained.
[0075] That is to say, by tracking the trajectory of each person in the current frame data, when the trajectory data is too dense, the dense trajectory data can be deleted through trajectory compression, so that the trajectory data can save more space and is convenient for counting. For example, the person being collected enters the mall entrance to shop, and the tracking frame tracks the head area features of the person being collected, so that each frame of the trajectory of the person being collected at the mall entrance can be recorded by the tracking frame. When the person being collected shows a repeated in and out movement trajectory at the mall entrance, it means that the trajectory data of the person being collected is too dense. By deleting the overly dense trajectory data through trajectory compression, the trajectory data of the person being collected can save more memory space and facilitate statistical counting. In the process of file building and statistics, the store entry rate can be judged more accurately, so that the customer flow count is more accurate and the file building is more comprehensive.
[0076] S40: Based on the number of target personnel and the personnel characteristic information of the target personnel, determine the passenger flow statistics result entering and exiting the area to be counted within a preset time period.
[0077] The passenger flow counting method provided by the present invention first obtains the video stream of the passenger flow entrance and exit of the area to be counted within a preset time period; and extracts the personnel feature information of the personnel contained in the image frame in the video stream to generate the personnel trajectory information of the personnel contained in the video stream; then, based on the personnel trajectory information of the personnel contained in the video stream, the target personnel and the number of the target personnel entering and exiting the area to be counted within the preset time period are determined; finally, based on the number of the target personnel and the personnel feature information of the target personnel, the passenger flow counting result entering and exiting the area to be counted within the preset time period is determined. Therefore, when the passenger flow is archived, the memory occupied by the statistics is reduced, and the counting time is shortened.
[0078] like Figure 5 As shown, the above-mentioned method of determining the target person and the number of the target person who enters and exits the area to be counted within a preset time period based on the person trajectory information of the person contained in the video stream includes:
[0079] S41, based on the trajectory information of the persons included in the video stream, determining whether the persons included in the video stream enter and / or leave the area to be counted;
[0080] S42, when a person included in the video stream enters and / or leaves the area to be counted, the person included in the video stream corresponding to the person trajectory information is determined as a target person;
[0081] S43. Calculate the number of target persons according to the target persons in the video stream.
[0082] In this embodiment, the personnel trajectory information may include the entry trajectory and exit trajectory of the personnel. Through the personnel trajectory information of each person, it is determined whether each person enters or leaves the area to be counted. When determining the entry trajectory and exit trajectory of each person, it can be determined by the feature data of the head area of each person. When a person in the video stream enters the statistical area, he can be counted as a target person. When a person in the video stream leaves the statistical area, he can be counted as a target person. When a person in the video stream enters and leaves the statistical area, he can also be counted as a target person. Therefore, by determining the personnel trajectory information of all people in the video stream in the area to be counted, it can be determined whether each person can be determined as a target person, thereby counting.
[0083] like Figure 6 As shown, the passenger flow counting method provided in the embodiment of the present invention further includes:
[0084] 501. Detect each image frame in the video stream to determine head region feature data and body region feature data of the persons included therein;
[0085] 502. Determine whether there is a disappeared human head area between each image frame;
[0086] 503. When there is a disappeared head region between each image frame, the head region feature data and the human body region feature data between each image frame are matched to determine the human body trajectory data of the included person;
[0087] 504. Determine the human body trajectory data as the human trajectory information of the person included in the video stream.
[0088] In this embodiment, when the head area of a person in the video stream is blocked, the head area feature data and the human body area feature data in each image frame can be matched and associated to determine the human body trajectory data of each person according to the human body area feature data, and to determine the human body trajectory information of the corresponding person through the human body area feature data to avoid trajectory interruption due to occlusion, thereby determining the corresponding person trajectory information after association, thereby making the statistical counting more accurate; for example, when the head of a person in the video stream disappears, when the disappeared head area appears, the trajectory of the associated human body area can be determined, and then statistical counting can be performed.
[0089] like Figure 7 As shown, the passenger flow counting method provided in the embodiment of the present invention further includes:
[0090] 601. Determine a body trajectory direction of a person included in the video stream according to the person trajectory information of the person included in the video stream;
[0091] 602. According to the direction of the human body trajectory, determine whether the human body trajectory information contains feature data of a human head region opposite to the direction of the human body trajectory;
[0092] 603. When the direction of the head region feature data is opposite to that of the human body trajectory, the head region feature data is deleted to obtain the deleted person trajectory information.
[0093] In this embodiment, the trajectory information of each person can be smoothed by adopting a trajectory smoothing algorithm to make the trajectory data smoother. It can be understood that the smoothing process mainly eliminates trajectory jitter by sliding average smoothing, thereby avoiding miscounting during the counting process; after the trajectory data is smoothed, the person trajectory information can be made more accurate; it can be understood that when performing trajectory processing on the trajectory information of each person, it can be judged by the direction of the human body trajectory, and the direction of the human body trajectory can be judged according to the head area feature data of each person. When most of the faces of the head area feature data are facing the same direction, it can be determined as the corresponding human body trajectory direction. Therefore, when head area feature data that is opposite to or different from the human body trajectory direction appears, it can be deleted, and the multiple head area feature data obtained after the deletion process can be determined as the corresponding person trajectory information.
[0094] like Figure 8 As shown, a specific embodiment of the present invention further provides a passenger flow counting device 10, comprising:
[0095] An acquisition module 11 is used to acquire a video stream of a passenger flow entrance and exit of a region to be counted within a preset time period;
[0096] An extraction module 12, used to extract the personnel feature information of the personnel contained in the image frame in the video stream to generate the personnel trajectory information of the personnel contained in the video stream;
[0097] A first determination module 13 is used to determine the target person and the number of the target person who enters and exits the area to be counted within a preset time period based on the person trajectory information of the person included in the video stream;
[0098] The second determination module 14 is used to determine the passenger flow statistics result entering and exiting the area to be counted within a preset time period based on the number of target personnel and the personnel characteristic information of the target personnel.
[0099] like Fig. 9 As shown, the extraction module 12 includes:
[0100] The detection unit 121 is used to detect the head region of each image frame in the video stream to obtain the head region feature data of the person contained in each image frame in the video stream;
[0101] The determination unit 122 is used to determine and generate the person trajectory information of the person included in the video stream based on the head region feature data of the person included in each image frame in the video stream.
[0102] The passenger flow counting device provided by the present invention first obtains the video stream of the passenger flow entrance and exit of the area to be counted within a preset time period; and extracts the personnel feature information of the personnel contained in the image frame in the video stream to generate the personnel trajectory information of the personnel contained in the video stream; then, based on the personnel trajectory information of the personnel contained in the video stream, the target personnel and the number of the target personnel entering and exiting the area to be counted within the preset time period are determined; finally, based on the number of the target personnel and the personnel feature information of the target personnel, the passenger flow counting result entering and exiting the area to be counted within the preset time period is determined. Therefore, when the passenger flow is archived, the memory occupied by the statistics is reduced, and the counting time is shortened.
[0103] It should be noted that the passenger flow counting device 10 provided in the specific embodiment of the present invention is a device corresponding to the above-mentioned passenger flow counting method, and all embodiments of the above-mentioned passenger flow counting method are applicable to the passenger flow counting device 10. The above-mentioned passenger flow counting device 10 embodiments all have corresponding modules corresponding to the steps in the above-mentioned passenger flow counting method, and can achieve the same or similar beneficial effects. In order to avoid excessive repetition, each module in the passenger flow counting device 10 will not be described in detail here.
[0104] like Fig.10 As shown, a specific embodiment of the present invention further provides an electronic device 20, including a memory 202, a processor 201, and a computer program stored in the memory 202 and executable on the processor 201, wherein the processor 201 implements the steps of the above-mentioned passenger flow counting method when executing the computer program.
[0105] Specifically, the processor 201 is used to call the computer program stored in the memory 202 to perform the following steps:
[0106] Obtain the video stream of the passenger flow entrance and exit of the area to be counted within a preset time period;
[0107] Extracting personnel feature information of personnel contained in the image frames in the video stream to generate personnel trajectory information of the personnel contained in the video stream;
[0108] Based on the trajectory information of the personnel included in the video stream, determine the target personnel and the number of the target personnel who enter and exit the area to be counted within a preset time period;
[0109] Based on the number of target personnel and the personnel characteristic information of the target personnel, the passenger flow statistics results entering and leaving the area to be counted within a preset time period are determined.
[0110] Optionally, the processor 201 extracts the personnel feature information of the personnel contained in the image frame in the video stream to generate the personnel trajectory information of the personnel contained in the video stream, including:
[0111] Detecting the head region of each image frame in the video stream to obtain the head region feature data of the person contained in each image frame in the video stream;
[0112] Based on the head region feature data of the persons included in each image frame in the video stream, the person trajectory information of the persons included in the generated video stream is determined.
[0113] Optionally, the processor 201 performs head region detection on each image frame in the video stream to obtain head region feature data of persons included in each image frame in the video stream, including:
[0114] Detecting the head region of each image frame in the video stream to determine the interval between the head regions corresponding to adjacent image frames;
[0115] Determine whether the interval between the head areas exceeds the preset interval;
[0116] When the interval between the head regions is less than a preset interval, the feature data of the head region of the person contained in one of the image frames is deleted;
[0117] When the interval between the head regions exceeds the preset interval, the feature data of the head regions of the persons contained in the image frame are retained.
[0118] Optionally, the passenger flow counting method executed by the processor 201 further includes:
[0119] Detect each image frame in the video stream to determine the head region feature data and body region feature data of the persons included;
[0120] Determine whether there is a missing head area between each image frame;
[0121] When there is a disappeared head region between each image frame, the head region feature data and the human body region feature data between each image frame are matched to determine the human body trajectory data of the included person;
[0122] The human body trajectory data is determined as the human body trajectory information of the human body contained in the video stream.
[0123] Optionally, the processor 201 determines the target person and the number of the target person who enters and exits the area to be counted within a preset time period based on the person trajectory information of the person included in the video stream, including:
[0124] Based on the trajectory information of the persons included in the video stream, determine whether the persons included in the video stream enter and / or leave the area to be counted;
[0125] When a person included in the video stream enters and / or leaves the area to be counted, the person included in the video stream corresponding to the person trajectory information is determined as the target person;
[0126] According to the target persons in the video stream, the number of the target persons is calculated.
[0127] Optionally, the passenger flow counting method executed by the processor 201 further includes:
[0128] Determine the direction of the human body trajectory of the person included in the video stream according to the person trajectory information of the person included in the video stream;
[0129] According to the direction of the human body trajectory, determine whether the human body trajectory information contains feature data of the human head area opposite to the direction of the human body trajectory;
[0130] When the direction of the head region feature data is opposite to that of the human body trajectory, the head region feature data is deleted to obtain the deleted person trajectory information.
[0131] That is, in a specific embodiment of the present invention, the processor 201 of the electronic device 20 implements the steps of the above-mentioned passenger flow statistics method when executing a computer program, thereby reducing the memory occupied by statistics and shortening the counting time when archiving passenger flow.
[0132] It should be noted that, since the processor 201 of the electronic device 20 implements the steps of the above passenger flow counting method when executing a computer program, all embodiments of the above passenger flow counting method are applicable to the electronic device 20 and can achieve the same or similar beneficial effects.
[0133] The computer-readable storage medium provided in the embodiment of the present invention stores a computer program. When the computer program is executed by the processor, it implements the various processes of the passenger flow statistics method or the application-end passenger flow statistics method provided in the embodiment of the present invention, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0134] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0135] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0136] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A passenger flow counting method, characterized in that: include: Obtain the video stream of the passenger flow entrance and exit of the area to be counted within a preset time period; Extracting personnel feature information of personnel included in the image frames in the video stream to generate personnel trajectory information of the personnel included in the video stream; Based on the personnel trajectory information of the personnel included in the video stream, determine the target personnel and the number of the target personnel who enter and exit the area to be counted within the preset time period; Based on the number of target personnel and the personnel characteristic information of the target personnel, determining the passenger flow statistics result entering and leaving the area to be counted within the preset time period; The passenger flow counting method further includes: Detecting each image frame in the video stream to determine head region feature data and body region feature data of the persons included therein; Determine whether there is a missing head area between each image frame; When there is a disappeared head region between each image frame, matching the head region feature data and the human body region feature data between each image frame to determine the human body trajectory data of the included person; The human body trajectory data is determined as the human body trajectory information of the person included in the video stream.
2. The passenger flow counting method according to claim 1, characterized in that: The extracting the personnel feature information of the personnel contained in the image frame in the video stream to generate the personnel trajectory information of the personnel contained in the video stream includes: Detecting the head region of each image frame in the video stream to obtain head region feature data of the person contained in each image frame in the video stream; Based on the head region feature data of the persons contained in each of the image frames in the video stream, the person trajectory information of the persons contained in the video stream is determined and generated.
3. The passenger flow counting method according to claim 2, characterized in that: The detecting of the head region of each image frame in the video stream to obtain the head region feature data of the person contained in each image frame in the video stream includes: Detecting the human head region of each image frame in the video stream to determine the interval between the human head regions corresponding to adjacent image frames; Determining whether the interval between the head regions exceeds a preset interval; When the interval between the head regions is less than the preset interval, deleting the head region feature data of the person contained in one of the image frames; When the interval between the head regions exceeds the preset interval, the feature data of the head regions of the persons contained in the image frame are retained.
4. The passenger flow counting method according to claim 1, characterized in that: The determining, based on the personnel trajectory information of the personnel included in the video stream, the target personnel and the number of the target personnel who enter and exit the area to be counted within the preset time period includes: Based on the personnel trajectory information of the personnel included in the video stream, determining whether the personnel included in the video stream enters and / or leaves the area to be counted; When a person included in the video stream enters and / or leaves the area to be counted, the person included in the video stream and corresponding to the person trajectory information is determined as a target person; The number of the target persons is calculated based on the target persons in the video stream.
5. The passenger flow counting method according to claim 1, characterized in that: The passenger flow counting method further includes: Determining the direction of the human body trajectory of the person included in the video stream according to the person trajectory information of the person included in the video stream; According to the direction of the human body trajectory, determining whether the personnel trajectory information contains characteristic data of a human head region opposite to the direction of the human body trajectory; When the head region feature data is in opposite directions to the human body trajectory, the head region feature data is deleted to obtain the person trajectory information after the deletion process.
6. A passenger flow counting device, characterized in that: include: An acquisition module is used to acquire the video stream of the passenger flow entrance and exit of the area to be counted within a preset time period; An extraction module, used to extract personnel feature information of personnel contained in the image frames in the video stream to generate personnel trajectory information of the personnel contained in the video stream; A first determination module is used to determine the target person and the number of the target person who enters and exits the area to be counted within the preset time period based on the person trajectory information of the person included in the video stream; A second determination module is used to determine the passenger flow statistics result entering and leaving the area to be counted within the preset time period based on the number of target personnel and the personnel characteristic information of the target personnel; The passenger flow counting device is also used to detect each image frame in the video stream to determine the head area feature data and the body area feature data of the persons included; judge whether there is a missing head area between each image frame; when there is a missing head area between each image frame, match the head area feature data and the body area feature data between each image frame to determine the body trajectory data of the persons included; determine the body trajectory data as the person trajectory information of the persons included in the video stream.
7. The passenger flow counting device according to claim 6, characterized in that: The extraction module comprises: A detection unit, configured to detect a head region of each image frame in the video stream to obtain feature data of a head region of a person contained in each image frame in the video stream; A determination unit is used to determine and generate person trajectory information of the person included in the video stream based on the head area feature data of the person included in each of the image frames in the video stream.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the passenger flow counting method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the passenger flow counting method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Counting method of moving objects in picture
CN105184821A
Subway compartment passenger flow statistics method based on video analysis, apparatus and system thereof
CN107491715A