Passenger flow number counting method and device, communication device and storage medium
By acquiring captured images and updating duplicate entries based on similarity and adding reference images, the problem of inaccurate passenger flow statistics caused by missing or poor-quality images in existing technologies has been solved, achieving more accurate passenger flow statistics.
Patent Information
- Application Number
- CN202011502964.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-17
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2040-12-17
AI Technical Summary
Existing methods for counting passenger flow rely on facial image archiving, which can easily miss images of poor quality, leading to inaccurate passenger flow statistics.
By acquiring captured images, if there are reference images in the deduplication task dataset that meet the preset similarity value, the number of duplicate people is updated; otherwise, the captured images are added as reference images. This process is repeated until the preset deduplication condition is met, and the number of captured people and duplicate people is counted to calculate the number of passengers.
It improves the accuracy of duplicate entries, prevents omissions, and increases the accuracy of passenger flow statistics.
Smart Images

Figure CN114648727B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular relates to a method, apparatus, communication equipment and storage medium for counting passenger flow. Background Art
[0002] Existing methods for counting passenger flow are generally combined with the archiving of facial images. Passenger flow is generally counted based on the archiving results of facial images. During the archiving process of facial images, in order to ensure the accuracy of archiving, high requirements are placed on image quality. It is easy to miss images with poor quality, and thus it is easy to miss the number of people, resulting in inaccurate passenger flow statistics. Summary of the Invention
[0003] In view of this, embodiments of the present application provide a method, apparatus, communication device, and storage medium for counting passenger flow, which can improve the accuracy of passenger flow counting.
[0004] A first aspect of an embodiment of the present application provides a method for counting passenger flow, including:
[0005] Get snapshots of passenger flow tracking;
[0006] If there is a reference picture whose similarity with the captured picture meets the preset value, the number of repeated people is updated, the reference picture is stored in the deduplication task dataset, the similarity between the reference pictures does not meet the preset value, and the number of repeated people is used to represent the number of captured pictures whose similarity with the reference picture meets the preset value;
[0007] If there is no reference picture whose similarity with the captured picture meets the preset value, the captured picture is used as a reference picture and added to the deduplication task dataset;
[0008] Repeat the above steps until the preset deduplication conditions are met;
[0009] The number of captured people is obtained, and the number of passenger flow is counted according to the number of captured people and the updated repeated number of people, where the number of captured people is equal to the number of captured pictures.
[0010] In a possible implementation, after obtaining the snapshot image during passenger flow tracking, the method further includes:
[0011] Extracting attribute values of the captured image, wherein the attribute values include one or more of a feature value, gender, and age attribute;
[0012] According to the attribute value, it is determined whether there is a reference picture whose similarity with the captured picture meets a preset value.
[0013] In a possible implementation, after obtaining the snapshot image during passenger flow tracking, the method further includes:
[0014] Identifying the captured image;
[0015] If the captured image is a face image, using a first deduplication scheme to determine whether there is a reference image whose similarity to the captured image meets a preset value;
[0016] If the captured picture is a tracked picture sequence, a second deduplication scheme is used to determine whether there is a reference picture whose similarity with the captured picture meets a preset value.
[0017] In a possible implementation, the determining whether there is a reference picture whose similarity to the captured picture meets a preset value by using the first deduplication scheme includes:
[0018] using a reference picture whose similarity to the face picture satisfies a first preset similarity condition as a first picture, wherein satisfying the first preset similarity condition indicates that the similarity between the first picture and the face picture is greater than a set value;
[0019] If the similarity between the first image and the face image satisfies a second preset similarity condition, determining whether there is a first image whose similarity to the captured image satisfies a first preset threshold, wherein satisfying the second preset similarity condition indicates that a difference between a preset feature of the first image and the face image is within a preset range, the preset feature including a shooting angle and / or an age feature;
[0020] If the similarity between the first picture and the face picture does not meet the second preset similarity condition, determine whether there is a first picture whose similarity with the captured picture meets a second preset threshold, and the second preset threshold is greater than the first preset threshold.
[0021] In a possible implementation, the determining whether there is a reference picture whose similarity to the captured picture meets a preset value by using the second deduplication scheme includes:
[0022] If there are faces and human bodies in the tracked image sequence, at least one reference image whose similarity with the face meets a third preset threshold is used as the second image, and at least one reference image whose similarity with the human body meets a fourth preset threshold is used as the third image. Based on whether there is an intersection between the second image and the third image, it is determined whether there is a reference image whose similarity with the captured image meets a preset value.
[0023] In a possible implementation, the determining whether there is a picture whose similarity to the captured picture meets a preset value by using the second deduplication scheme further includes:
[0024] If only human faces exist in the tracked image sequence, determining whether there is an image whose similarity to the human face meets a preset value;
[0025] If only a human body exists in the tracked picture sequence, it is determined whether there is a picture whose similarity to the human body meets a preset value.
[0026] In a possible implementation, if there is no reference picture whose similarity with the captured picture meets a preset value, the captured picture is used as a reference picture and added to the deduplication task dataset, including:
[0027] If there is no picture whose similarity with the tracked picture sequence meets the preset value, the picture corresponding to the face and the picture corresponding to the body are respectively used as reference pictures and added to the deduplication task dataset.
[0028] In a possible implementation, after updating the number of repeated persons if there is a reference picture whose similarity with the captured picture meets a preset value, the method further includes:
[0029] If the quality of the captured image is higher than that of the corresponding reference image, the corresponding reference image is replaced with the captured image, where the corresponding reference image is a reference image whose similarity with the captured image meets a preset value.
[0030] In a possible implementation, before obtaining the snapshot image during passenger flow tracking, the method further includes:
[0031] Obtaining a deduplication task, wherein the deduplication task includes a time period for counting the number of passengers and / or a snapshot camera;
[0032] Correspondingly, the acquisition of snapshot images during passenger flow tracking includes:
[0033] Acquire snapshot images within the time period, and / or acquire snapshot images sent by the snapshot camera.
[0034] A second aspect of an embodiment of the present application provides a passenger flow counting device, comprising:
[0035] The acquisition module is used to obtain snapshot images during passenger flow tracking;
[0036] A first judgment module is configured to update the number of duplicate people if there is a reference picture whose similarity with the captured picture meets a preset value, the reference picture being stored in the deduplication task dataset, the similarity between the reference pictures not meeting the preset value, and the number of duplicate people representing the number of captured pictures whose similarity with the reference picture meets the preset value;
[0037] A second judgment module is configured to, if there is no reference image whose similarity with the captured image meets a preset value, use the captured image as a reference image and add it to the deduplication task dataset;
[0038] A loop module is used to loop through the above steps until the preset deduplication conditions are met;
[0039] The calculation module is used to obtain the number of captured people and count the number of passenger flow according to the number of captured people and the updated repeated number of people, and the number of captured people is equal to the number of captured pictures.
[0040] In a possible implementation, the passenger flow counting device further includes an extraction module configured to:
[0041] Extracting attribute values of the captured image, wherein the attribute values include one or more of a feature value, gender, and age attribute;
[0042] According to the attribute value, it is determined whether there is a reference picture whose similarity with the captured picture meets a preset value.
[0043] In a possible implementation, the passenger flow counting device further includes:
[0044] An identification module, used to identify the captured image;
[0045] a first determining module configured to, if the captured image is a face image, determine, using a first deduplication scheme, whether there is a reference image whose similarity to the captured image satisfies a preset value;
[0046] The second determining module is configured to, if the captured image is a tracked image sequence, use a second deduplication scheme to determine whether there is a reference image whose similarity with the captured image meets a preset value.
[0047] In a possible implementation, the first determining module is specifically configured to:
[0048] using a reference picture whose similarity to the face picture satisfies a first preset similarity condition as a first picture, wherein satisfying the first preset similarity condition indicates that the similarity between the first picture and the face picture is greater than a set value;
[0049] If the similarity between the first image and the face image satisfies a second preset similarity condition, determining whether there is a first image whose similarity to the captured image satisfies a first preset threshold, wherein satisfying the second preset similarity condition indicates that a difference between a preset feature of the first image and the face image is within a preset range, the preset feature including a shooting angle and / or an age feature;
[0050] If the similarity between the first picture and the face picture does not meet the second preset similarity condition, determine whether there is a first picture whose similarity with the captured picture meets a second preset threshold, and the second preset threshold is greater than the first preset threshold.
[0051] In a possible implementation, the second determining module is specifically configured to:
[0052] If there are faces and human bodies in the tracked image sequence, at least one reference image whose similarity with the face meets a third preset threshold is used as the second image, and at least one reference image whose similarity with the human body meets a fourth preset threshold is used as the third image. Based on whether there is an intersection between the second image and the third image, it is determined whether there is a reference image whose similarity with the captured image meets a preset value.
[0053] In a possible implementation, the second determining module is further configured to:
[0054] If only human faces exist in the tracked image sequence, determining whether there is an image whose similarity to the human face meets a preset value;
[0055] If only a human body exists in the tracked picture sequence, it is determined whether there is a picture whose similarity to the human body meets a preset value.
[0056] In a possible implementation, the second determination module is further configured to:
[0057] If there is no picture whose similarity with the tracked picture sequence meets the preset value, the picture corresponding to the face and the picture corresponding to the body are respectively used as reference pictures and added to the deduplication task dataset.
[0058] In a possible implementation, the passenger flow counting device further includes a replacement module, configured to:
[0059] If the quality of the captured image is higher than that of the corresponding reference image, the corresponding reference image is replaced with the captured image, where the corresponding reference image is a reference image whose similarity with the captured image meets a preset value.
[0060] In a possible implementation, the acquisition module is further configured to:
[0061] Obtaining a deduplication task, wherein the deduplication task includes a time period for counting the number of passengers and / or a snapshot camera;
[0062] Acquire snapshot images within the time period, and / or acquire snapshot images sent by the snapshot camera.
[0063] A third aspect of an embodiment of the present application provides a communication device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the passenger flow counting method as described in the first aspect above is implemented.
[0064] A fourth aspect of an embodiment of the present application 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 passenger flow counting method as described in the first aspect above is implemented.
[0065] A fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on a communication device, the communication device executes the passenger flow counting method described in the first aspect above.
[0066] Compared with the prior art, the beneficial effects of the embodiments of the present application are as follows: by obtaining snapshot images of passenger flow, if there is a reference image in the deduplication task data set whose similarity with the snapshot image meets the preset value, the number of duplicate people is updated, and the number of duplicate people is used to represent the number of snapshot images whose similarity with the reference image meets the preset value. The similarity between the reference images does not meet the preset value. If there is no reference image in the deduplication task data set whose similarity with the snapshot image meets the preset value, it means that the snapshot image is a newly added image. The snapshot image is added to the deduplication task data set as a reference image, which improves the integrity of the images in the deduplication task data set, and thus can improve the accuracy of the repeated number of people counted. The above steps are executed repeatedly until the preset deduplication conditions are met, and the number of snapshot people is obtained. The number of snapshot people is equal to the number of snapshot images, and the number of passenger flow is counted based on the number of snapshot people and the updated repeated number of people. Compared with counting passenger flow by archiving, the method of counting the number of snapshot people and the number of duplicate people can prevent the omission of people, and because the accuracy of the calculated number of duplicate people is higher, the accuracy of passenger flow statistics is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art.
[0068] Figure 1 Schematic diagram of the flow of passenger flow counting method provided in the embodiment of the present application;
[0069] Figure 2 1 is a flow chart of a method for counting repeated visits provided in an embodiment of the present application;
[0070] Figure 3 is a schematic diagram of a passenger flow counting device provided in an embodiment of the present application;
[0071] Figure 4 It is a structural diagram of the communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0073] In order to illustrate the technical solution described in this application, specific embodiments are provided below.
[0074] It will be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0075] It should also be understood that the terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0076] It should be further understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0077] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0078] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0079] Existing methods for counting passenger flow are generally combined with the archiving of facial images. Passenger flow is generally counted based on the archiving results of facial images. During the archiving process of facial images, in order to ensure the accuracy of archiving, high requirements are placed on image quality. It is easy to miss images with poor quality, and thus it is easy to miss the number of people, resulting in inaccurate passenger flow statistics.
[0080] To this end, the present application provides a method for counting the number of passengers, which obtains snapshot images during passenger flow tracking. If there is a reference image in the deduplication task data set whose similarity with the snapshot image meets the preset value, the number of duplicate passengers is updated. If there is no reference image in the deduplication task data set whose similarity with the snapshot image meets the preset value, it means that the snapshot image is a newly added image. The snapshot image is added to the deduplication task data set as a reference image, which improves the integrity of the reference image in the deduplication task data set, thereby improving the accuracy of the counted duplicate passengers. The above steps are executed in a loop until the preset deduplication conditions are met. The number of snapshots is obtained again, and the number of snapshots is equal to the number of snapshots. The number of passengers is counted based on the number of snapshots and the updated duplicates. Compared with counting the number of passengers by archiving, the method of counting the number of snapshots and duplicates can prevent the omission of people, and since the accuracy of the calculated duplicates is high, the accuracy of the passenger flow statistics is improved.
[0081] The following is an exemplary description of the passenger flow counting method provided in the embodiment of the present application.
[0082] The passenger flow counting method provided in the embodiment of the present application is applied to communication equipment, which may be a computer, a mobile phone, a server, a camera, or other equipment.
[0083] See also Figure 1 The passenger flow counting method provided in the embodiment of the present application includes:
[0084] S101: Acquire snapshot images during passenger flow tracking.
[0085] The captured image can be a face image, a body image, or a sequence of tracked images. A face image is the face portion extracted from an image captured by a camera, and a body image is the body portion extracted from an image captured by a camera. Generally, only one face image or one body image is captured during a tracking session, and the number of captured people tracked during a tracking session is also 1. A sequence of tracked images is a sequence of faces and bodies segmented from at least one captured image during a tracking session. That is, a sequence of tracked images includes multiple images corresponding to faces and / or bodies.
[0086] In one possible implementation, a communication device (e.g., a server) obtains snapshot images sent by a camera, which is installed at a location used to count the number of people, such as a shopping mall entrance. There are multiple cameras connected to the communication device. In order to improve computing efficiency, the communication device pre-acquires a deduplication task, which includes a time period for counting the number of people and / or a snapshot camera. According to the deduplication task, only snapshot images within the time period for counting the number of people are obtained, and / or snapshot images sent by the corresponding snapshot camera are obtained. For example, if the business hours of a shopping mall are 10:00-22:00, it is considered that the customer flow that is useful to the user is the customer flow during the business hours. Therefore, only the customer flow during the business hours needs to be statistically analyzed, and data outside the above business hours does not need to be processed. In this case, only snapshot images between 10:00-22:00 need to be obtained. If the shopping mall has multiple floors and multiple cameras are installed on each floor, only the snapshot images sent by the camera at the entrance of the first floor can be obtained, thereby reducing interference factors and improving calculation speed when performing similarity calculations later, thereby improving the real-time performance of the customer flow statistics.
[0087] In another possible implementation, before capturing a captured image, the communication device determines configuration parameters based on the actual scenario, ensuring that the parameters are consistent with the scenario and improving the accuracy of passenger counts. These configuration parameters include filtering parameters for the captured image and preset thresholds for subsequent similarity determination. The scenario includes information such as the camera's installation angle and the lighting in the captured area.
[0088] S102: If there is a reference picture whose similarity with the captured picture meets the preset value, the number of duplicate people is updated. The reference picture is stored in the deduplication task data set. The similarity between the reference pictures does not meet the preset value. The number of duplicate people is used to represent the number of captured pictures whose similarity with the reference picture meets the preset value.
[0089] Specifically, the initial value of the number of duplicate people is 0. The reference images stored in the deduplication task dataset are snapshots that have already undergone similarity calculations, and there are no duplicate reference images in the deduplication task dataset. If there is a reference image in the deduplication task dataset that meets the preset similarity value with the snapshot image, it means that the snapshot image and the corresponding reference image correspond to the same person, and also that the snapshot image is a duplicate image, and the number of duplicate people is updated. Updating the number of duplicate people is to accumulate the number of duplicate people that have already been counted, for example, adding 1 to the current number of duplicate people. In one possible implementation, if it is determined that there is a reference picture in the deduplication task data set whose similarity with the captured picture meets a preset value, the quality of the captured picture is compared with the quality of the corresponding reference picture in the deduplication task data set. The corresponding reference picture is a reference picture whose similarity with the captured picture meets the preset value. If the quality of the captured picture is higher than the quality of the corresponding reference picture, the corresponding reference picture is replaced with the captured picture, that is, the reference picture in the deduplication task data set is replaced with a picture with better quality. The picture with better quality will be used to determine whether the subsequently acquired captured picture is a repeated picture, thereby improving the accuracy of the similarity judgment.
[0090] In one possible implementation, a communication device identifies a captured image and obtains attribute values of the captured image. The attribute values include one or more of a characteristic value, gender, and age attribute. The characteristic value is obtained by extracting image features from the captured image. The attribute values of the captured image are compared with the attribute values of a reference image in a deduplication task dataset. Based on the comparison results of the attribute values, the similarity between the captured image and the reference image in the deduplication task dataset is determined. Based on the similarity, it is then determined whether there is a reference image in the deduplication task dataset whose similarity to the captured image meets a preset value. Determining the similarity based on the attribute values of the captured image can improve the accuracy of the similarity calculation.
[0091] S103: If there is no reference picture whose similarity with the captured picture meets a preset value, the captured picture is used as a reference picture and added to the deduplication task dataset.
[0092] Specifically, if there is no reference picture in the deduplication task data set whose similarity with the captured picture meets the preset value, it means that the captured picture is a newly added picture. The captured picture is placed in the deduplication task data set to ensure the integrity of the reference pictures in the deduplication task data set. When the reference pictures in the complete deduplication task data set are used to determine whether the subsequently obtained captured pictures are repeated pictures, the accuracy of the repeated person statistics can be improved.
[0093] S104: Execute the above steps repeatedly until the preset deduplication condition is met.
[0094] Specifically, steps S101 to S103 are performed for each captured image until a preset deduplication condition is satisfied. The preset deduplication condition refers to the completion of the task of counting duplicate people. For example, when the time period for counting the number of passengers ends, it indicates that the task of counting duplicate people has been completed, or the similarity calculation for all captured images has been completed.
[0095] S105: Obtain the number of captured people, and count the number of passenger flows based on the number of captured people and the updated number of repeated people, where the number of captured people is equal to the number of captured pictures.
[0096] The number of captured people is the total number of people counted in advance, without distinguishing duplicates, so duplicates are included. The updated number of duplicates is the number of duplicates obtained at the end of the duplicate counting task. The number of visitors is calculated by subtracting the number of duplicates from the number of captured people.
[0097] In one possible implementation, the number of captured visitors is counted using face or body tracking. For example, a camera is installed at the entrance of a shopping mall and the number of customers entering the mall tracked by the camera is accumulated to obtain the number of captured visitors. The camera used to capture the captured images and count the number of captured visitors can be the same as the camera used to track customer flow and count repeat visitors, or they can be different.
[0098] In the above embodiment, by obtaining a captured image of the passenger flow, if there is a reference image in the deduplication task data set whose similarity with the captured image meets the preset value, the number of repeated people is updated. The repeated number of people is used to represent the number of captured images whose similarity with the reference image meets the preset value. The similarity between the reference images does not meet the preset value. If there is no reference image in the deduplication task data set whose similarity with the captured image meets the preset value, it means that the captured image is a newly added image. The captured image is added to the deduplication task data set as a reference image, which improves the integrity of the images in the deduplication task data set and thus improves the accuracy of the repeated number of people counted. The above steps are executed repeatedly until the preset deduplication conditions are met, and the number of captured people is obtained. The number of captured people is equal to the number of captured images, and the number of passenger flow is counted based on the captured people and the updated repeated number of people. Compared with counting passenger flow by archiving, the method of counting captured people and repeated people can prevent the omission of people, and because the accuracy of the calculated repeated people is higher, the accuracy of passenger flow statistics is improved.
[0099] In one possible implementation, after acquiring a captured image, the communication device identifies the captured image and identifies the type of the captured image. Based on the type of the captured image, different deduplication schemes are used to determine whether there is a reference image in the deduplication task data set whose similarity with the captured image meets a preset value. Specifically, after identifying the captured image, if the captured image is a face image, a first deduplication scheme is used to determine whether there is a reference image in the deduplication task data set whose similarity with the captured image meets a preset value. If the captured image is a tracked image sequence, a second deduplication scheme is used to determine whether there is a reference image in the deduplication task data set whose similarity with the captured image meets a preset value. This allows the deduplication scheme to adapt to different scenario requirements and improves the accuracy of the counted number of duplicate people. The communication device can determine the type of the captured image based on the type of camera that sent the captured image, or it can perform image recognition on the captured image to determine the type of the captured image.
[0100] In a possible implementation, different deduplication schemes are used to determine whether there is a reference image in the deduplication task dataset whose similarity with the captured image meets a preset value, and then the process of counting the number of duplicate people is as follows: Figure 2 shown.
[0101] The communication device receives a deduplication task and sets configuration parameters. After acquiring a captured image, it extracts its attribute values and determines a deduplication scheme based on the image type. If the captured image is a face image, the first deduplication scheme is used; if the captured image is a tracking image sequence, the second deduplication scheme is used.
[0102] In one possible implementation, if the captured image is a face image, the similarity between the face image and the reference image in the deduplication task dataset is calculated based on the attribute value of the face image and the attribute value of the reference image in the deduplication task dataset, and it is determined whether there is a reference image in the deduplication task dataset whose similarity with the face image meets a preset value. If so, the number of duplicates is increased by 1; if not, the face image is added to the deduplication task dataset.
[0103] like Figure 2As shown, in another possible implementation, to improve the accuracy of similarity calculation, if the captured image is a face image, based on the similarity between the face image and reference images in the deduplication task dataset, a reference image in the deduplication task dataset whose similarity to the face image meets a first similarity condition is determined. The reference image in the task dataset whose similarity to the face image meets the first similarity condition is then used as the first image. Meeting the first preset similarity condition indicates that the similarity between the first image and the face image is greater than a set value. For example, there are multiple first images, and the first image is the image ranked in the top N in terms of similarity to the face image among the reference images. After determining the first image, it is then determined whether the first image and the face image meet a second preset similarity condition. Meeting the second preset similarity condition indicates that the difference between the first image and the face image is within a preset range of preset features. The preset features include shooting angle and / or age features. That is, the second preset similarity condition refers to the degree of similarity in facial angle and age. If the first image and the face image meet the second preset similarity condition, it indicates that the first image and the face image have a high similarity. The similarity between the face image and the first image is then determined based on a first preset threshold. If the first image and the face image do not meet the second preset similarity condition, it means that the similarity between the first image and the face image is not high. The first preset threshold is increased to the second preset threshold, that is, the similarity judgment threshold is increased, and the similarity between the face image and the first image is determined according to the second preset threshold. According to the judgment result, it is determined whether there is a reference image in the deduplication task data set whose similarity with the captured image meets the preset value.
[0104] In one possible implementation, the first image (the top N images in terms of similarity to the face image) is sorted in descending order of similarity, and first a determination is made as to whether the similarity between the top 1 image and the face image satisfies the second preset similarity condition. If the similarity between the top 1 image and the face image satisfies the second preset similarity condition, then a determination is made as to whether the similarity between the top 1 image and the face image satisfies the first preset threshold. If the first preset threshold is satisfied, the number of repetitions is increased by 1. If the first preset threshold is not satisfied, the face image is added to the deduplication task dataset. If the similarity between the top 1 image and the face image does not satisfy the second preset similarity condition, then a determination is made as to whether the similarity between the top 2 images and the face image satisfies the second preset similarity condition. If the similarity between the top 2 images and the face image does not satisfy the second preset similarity condition, then the similarity between the top 3 images and the face image is determined, and so on, until the top N images are reached. If a picture is determined in the first picture to be similar to a face picture and meets the second preset similarity condition, then the picture is determined to see if it meets the first preset threshold. If so, the number of repetitions is increased by 1. If not, the face picture is added to the deduplication task dataset. If none of the top N pictures and the face picture meet the second preset similarity condition, then the similarity between the top 1 picture and the face picture is determined to see if it meets the second preset threshold. If so, the number of repetitions is increased by 1. If not, the face picture is added to the deduplication task dataset. By determining multiple first pictures from the deduplication task dataset and performing multiple similarity comparisons, the problem of inaccurate similarity due to computational errors can be reduced, thereby reducing the chance of misjudgment.
[0105] In one possible implementation, Figure 2 As shown, before determining the similarity of face images, the face images are preprocessed to filter out images of poor quality, thereby avoiding misjudgment caused by poor image quality and improving the accuracy of similarity calculation.
[0106] If the captured image is a tracking image sequence, that is, the captured image is a face and body image segmented from at least one image captured when tracking a person, first determine whether faces and bodies exist in the tracking image sequence at the same time. If faces and bodies exist in the tracking image sequence at the same time, that is, there are images corresponding to faces and images corresponding to bodies in the tracking image sequence, use at least one reference image in the deduplication task dataset whose similarity with faces meets a third preset threshold as the second image, and use at least one reference image in the deduplication task dataset whose similarity with bodies meets a fourth preset threshold as the third image. Based on whether there is an intersection between the second image and the third image, determine whether there is a reference image in the deduplication task dataset whose similarity with the captured image meets a preset value. The intersection between the second image and the third image means that there are images with the same identity identifier in the second image and the third image. The identity identifier is used to represent the identifier of each customer in the passenger flow. One identity identifier corresponds to one customer, and the images corresponding to one customer include images corresponding to the face and / or the body of the customer. For example, if the second picture includes reference pictures whose identification marks are A, B, and C, and the third picture includes reference pictures whose identification marks are C, D, and E, then the second picture and the third picture have an intersection. If the second picture and the third picture have an intersection, it means that the face and the body correspond to the same person, which further indicates that there is a reference picture in the deduplication task dataset whose similarity with the captured picture meets the preset value, and the number of duplicate people is increased by 1. If the second picture and the third picture do not have an intersection, it means that there is no reference picture in the deduplication task dataset whose similarity with the captured picture meets the preset value, and the pictures corresponding to the face and the pictures corresponding to the body in the tracked picture sequence are added to the deduplication task dataset for subsequent similarity comparison with the tracked picture sequence to count the number of duplicate people. This can ensure the integrity of the deduplication task dataset and improve the accuracy of the counted number of duplicate people.
[0107] If there are only faces in the tracked image sequence, determine whether there is a reference image in the deduplication task dataset whose similarity with the face meets the preset value. If so, increase the number of duplicates by 1. If not, add the image corresponding to the face to the deduplication task dataset.
[0108] If there are only human bodies in the tracked image sequence, determine whether there are reference images in the deduplication task dataset whose similarity with the human body meets the preset value. If so, increase the number of duplicate people by 1. If not, add the image corresponding to the human body to the deduplication task dataset.
[0109] In one possible implementation, if only faces exist in the tracked image sequence, at least one reference image is determined whose similarity to the face meets a third preset threshold, that is, reference images ranked in the top N in similarity to the face are determined. If the at least one reference image has a similarity to the face that meets the preset value, the number of duplicates is increased by 1. Otherwise, the image corresponding to the face is added to the deduplication task dataset. If only human bodies exist in the tracked image sequence, at least one reference image is determined whose similarity to the human body meets a fourth threshold, that is, reference images ranked in the top N in similarity to the human body are determined. If the at least one reference image has a similarity to the human body that meets the preset value, the number of duplicates is increased by 1. Otherwise, the image corresponding to the human body is added to the deduplication task dataset.
[0110] Correspondingly, if the captured image is the image sequence to be tracked, the process is as follows Figure 2 As shown, for each picture in the tracked picture sequence, if there is a face in the picture, that is, the picture is a picture corresponding to a face, a reference picture whose similarity with the face meets the third preset threshold is determined from the deduplication task dataset, that is, a reference picture whose similarity with the face meets the fourth preset threshold is determined, that is, a reference picture whose similarity with the human body is ranked in the TopN is determined. After determining the TopN pictures, it is determined whether there are both faces and human bodies in the tracked picture sequence. If there are both faces and human bodies in the tracked picture sequence, it is determined whether there is an intersection between the TopN pictures corresponding to the face and the TopN pictures corresponding to the human body. If there is an intersection, the number of repeated people is increased by 1. If there is no intersection, the pictures corresponding to the face and the pictures corresponding to the human body are added to the deduplication task dataset. If only faces or bodies exist in the tracked image sequence, determine whether any of the top N images corresponding to faces meet a preset similarity threshold. If so, increment the number of duplicates by 1; otherwise, add the face image to the deduplication task dataset. Determine whether any of the top N images corresponding to bodies meet a preset similarity threshold. If so, increment the number of duplicates by 1; otherwise, add the body image to the deduplication task dataset. By identifying multiple images similar to faces or bodies from the deduplication task dataset and performing multiple similarity comparisons, inaccurate similarity measurements due to computational errors can be mitigated, thereby reducing the chance of misjudgment.
[0111] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0112] Corresponding to the passenger flow counting method described in the above embodiment, Figure 3 The structural block diagram of the passenger flow counting device provided in an embodiment of the present application is shown. For the sake of convenience, only the parts related to the embodiment of the present application are shown.
[0113] like Figure 3 As shown, the passenger flow counting device includes:
[0114] Acquisition module 10, used to obtain snapshot images during passenger flow tracking;
[0115] A first judgment module 20 is configured to update the number of duplicate people if there is a reference picture whose similarity with the captured picture meets a preset value, the reference picture being stored in the deduplication task dataset, and the similarity between the reference pictures does not meet a preset value, and the number of duplicate people is used to represent the number of captured pictures whose similarity with the reference picture meets the preset value;
[0116] A second judgment module 30 is configured to use the captured image as a reference image and add it to the deduplication task dataset if there is no reference image whose similarity to the captured image meets a preset value;
[0117] A loop module 40 is configured to loop through the above steps until a preset deduplication condition is met;
[0118] The calculation module 50 is used to obtain the number of captured people and count the number of passenger flow according to the number of captured people and the updated repeated number of people. The number of captured people is equal to the number of captured pictures.
[0119] In a possible implementation, the passenger flow counting device further includes an extraction module configured to:
[0120] Extracting attribute values of the captured image, wherein the attribute values include one or more of a feature value, gender, and age attribute;
[0121] According to the attribute value, it is determined whether there is a reference picture whose similarity with the captured picture meets a preset value.
[0122] In a possible implementation, the passenger flow counting device further includes:
[0123] An identification module, used to identify the captured image;
[0124] a first determining module configured to, if the captured image is a face image, determine, using a first deduplication scheme, whether there is a reference image whose similarity to the captured image satisfies a preset value;
[0125] The second determining module is configured to, if the captured image is a tracked image sequence, use a second deduplication scheme to determine whether there is a reference image whose similarity with the captured image meets a preset value.
[0126] In a possible implementation, the first determining module is specifically configured to:
[0127] using a reference picture whose similarity to the face picture satisfies a first preset similarity condition as a first picture, wherein satisfying the first preset similarity condition indicates that the similarity between the first picture and the face picture is greater than a set value;
[0128] If the similarity between the first image and the face image satisfies a second preset similarity condition, determining whether there is a first image whose similarity to the captured image satisfies a first preset threshold, wherein satisfying the second preset similarity condition indicates that a difference between a preset feature of the first image and the face image is within a preset range, the preset feature including a shooting angle and / or an age feature;
[0129] If the similarity between the first picture and the face picture does not meet the second preset similarity condition, determine whether there is a first picture whose similarity with the captured picture meets a second preset threshold, and the second preset threshold is greater than the first preset threshold.
[0130] In a possible implementation, the second determining module is specifically configured to:
[0131] If there are faces and human bodies in the tracked image sequence, at least one reference image whose similarity with the face meets a third preset threshold is used as the second image, and at least one reference image whose similarity with the human body meets a fourth preset threshold is used as the third image. Based on whether there is an intersection between the second image and the third image, it is determined whether there is a reference image whose similarity with the captured image meets a preset value.
[0132] In a possible implementation, the second determining module is further configured to:
[0133] If only human faces exist in the tracked image sequence, determining whether there is an image whose similarity to the human face meets a preset value;
[0134] If only a human body exists in the tracked picture sequence, it is determined whether there is a picture whose similarity to the human body meets a preset value.
[0135] In a possible implementation, the second determining module 30 is further configured to:
[0136] If there is no picture whose similarity with the tracked picture sequence meets the preset value, the picture corresponding to the face and the picture corresponding to the body are respectively used as reference pictures and added to the deduplication task dataset.
[0137] In a possible implementation, the passenger flow counting device further includes a replacement module, configured to:
[0138] If the quality of the captured image is higher than that of the corresponding reference image, the corresponding reference image is replaced with the captured image, where the corresponding reference image is a reference image whose similarity with the captured image meets a preset value.
[0139] In a possible implementation, the acquisition module 10 is further configured to:
[0140] Obtaining a deduplication task, wherein the deduplication task includes a time period for counting the number of passengers and / or a snapshot camera;
[0141] Acquire snapshot images within the time period, and / or acquire snapshot images sent by the snapshot camera.
[0142] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the image detection method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0143] Figure 4 Schematic diagram of the communication device provided in the embodiment of the present application. Figure 4 As shown, the communication device of this embodiment includes: a processor 11, a memory 12, and a computer program 13 stored in the memory 12 and executable on the processor 11. When the processor 11 executes the computer program 13, the steps in the embodiment of the method for displaying the above-mentioned data flow are implemented, for example Figure 1 Alternatively, when the processor 11 executes the computer program 13, the functions of the modules / units in the above-mentioned device embodiments are realized, for example, Figure 3 The functions of the acquisition module 10 to the calculation module 50 are shown.
[0144] Exemplarily, the computer program 13 may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 11 to implement the present application. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 13 in the communication device.
[0145] Those skilled in the art will understand that Figure 4 It is only an example of a communication device and does not constitute a limitation of the communication device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the communication device may also include input and output devices, network access equipment, buses, etc.
[0146] The processor 11 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0147] The memory 12 may be an internal storage unit of the communication device, such as a hard disk or memory of the communication device. The memory 12 may also be an external storage device of the communication device, such as a plug-in hard disk equipped on the communication device, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Furthermore, the memory 12 may include both an internal storage unit of the communication device and an external storage device. The memory 12 is used to store the computer program and other programs and data required by the communication device. The memory 12 may also be used to temporarily store data that has been output or is about to be output.
[0148] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0149] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0150] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0151] In the embodiments provided in this application, it should be understood that the disclosed devices / communication equipment and methods can be implemented in other ways. For example, the device / communication equipment embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0152] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0153] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0154] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0155] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A passenger flow counting method, characterized in that: include: Get snapshots of passenger flow tracking; If there is a reference picture whose similarity with the captured picture meets the preset value, the number of repeated people is updated, the reference picture is stored in the deduplication task dataset, the similarity between the reference pictures does not meet the preset value, and the number of repeated people is used to represent the number of captured pictures whose similarity with the reference picture meets the preset value; If there is no reference picture whose similarity with the captured picture meets the preset value, the captured picture is used as a reference picture and added to the deduplication task dataset; Repeat the above steps until the preset deduplication conditions are met; Obtain the number of captured people, and count the number of passengers based on the captured number of people and the updated repeated number of people, where the captured number of people is equal to the number of captured pictures; After obtaining the captured images during passenger flow tracking, the method further includes: The captured image is identified to determine the type of the captured image. Based on the type of the captured image, different deduplication schemes are used to determine whether there is a reference image in the deduplication task data set whose similarity with the captured image meets a preset value. If the captured image is a tracked image sequence, a second deduplication scheme is used to determine whether there is a reference image whose similarity with the captured image meets a preset value, specifically including: if there are faces and human bodies in the tracked image sequence, at least one reference image whose similarity with the face meets a third preset threshold is used as the second image, and at least one reference image whose similarity with the human body meets a fourth preset threshold is used as the third image. Based on whether there is an intersection between the second image and the third image, it is determined whether there is a reference image whose similarity with the captured image meets the preset value. The intersection between the second image and the third image means that there are images with the same identity identifier in the second image and the third image.
2. The passenger flow counting method according to claim 1, characterized in that: After obtaining the snapshot image during passenger flow tracking, the method further includes: Extracting attribute values of the captured image, wherein the attribute values include one or more of a feature value, gender, and age attribute; According to the attribute value, it is determined whether there is a reference picture whose similarity with the captured picture meets a preset value.
3. The passenger flow counting method according to claim 1, characterized in that: Depending on the type of captured image, different deduplication schemes are used to determine whether there are reference images in the deduplication task dataset whose similarity with the captured image meets the preset value. The following are some examples: If the captured image is a face image, a first deduplication scheme is used to determine whether there is a reference image whose similarity with the captured image meets a preset value.
4. The passenger flow counting method according to claim 3, characterized in that: The determining whether there is a reference picture whose similarity to the captured picture meets a preset value by using the first deduplication scheme includes: using a reference picture whose similarity to the face picture satisfies a first preset similarity condition as a first picture, wherein satisfying the first preset similarity condition indicates that the similarity between the first picture and the face picture is greater than a set value; If the similarity between the first image and the face image satisfies a second preset similarity condition, determining whether there is a first image whose similarity to the captured image satisfies a first preset threshold, wherein satisfying the second preset similarity condition indicates that a difference between a preset feature of the first image and the face image is within a preset range, the preset feature including a shooting angle and / or an age feature; If the similarity between the first picture and the face picture does not meet the second preset similarity condition, determine whether there is a first picture whose similarity with the captured picture meets a second preset threshold, and the second preset threshold is greater than the first preset threshold.
5. The passenger flow counting method according to claim 1, characterized in that: If only human faces exist in the tracked image sequence, determining whether there is a reference image whose similarity to the human face meets a preset value; If only a human body exists in the tracked picture sequence, it is determined whether there is a reference picture whose similarity with the human body meets a preset value.
6. The passenger flow counting method according to claim 1, characterized in that: If there is no reference picture whose similarity with the captured picture meets a preset value, the captured picture is used as a reference picture and added to the deduplication task dataset, including: If there is no picture whose similarity with the tracked picture sequence meets the preset value, the picture corresponding to the face and the picture corresponding to the body are respectively used as reference pictures and added to the deduplication task dataset.
7. The passenger flow counting method according to claim 1, characterized in that: After updating the number of repeated persons if there is a reference picture whose similarity with the captured picture meets a preset value, the method further includes: If the quality of the captured image is higher than that of the corresponding reference image, the corresponding reference image is replaced with the captured image, where the corresponding reference image is a reference image whose similarity with the captured image meets a preset value.
8. The passenger flow counting method according to claim 1, characterized in that: Before obtaining the captured images during passenger flow tracking, the method further includes: Obtaining a deduplication task, wherein the deduplication task includes a time period for counting the number of passengers and / or a snapshot camera; Correspondingly, the acquisition of snapshot images during passenger flow tracking includes: Acquire snapshot images within the time period, and / or acquire snapshot images sent by the snapshot camera.
9. A passenger flow counting device, characterized in that: include: The acquisition module is used to obtain snapshot images during passenger flow tracking; A first judgment module is configured to update the number of duplicate people if there is a reference picture whose similarity with the captured picture meets a preset value, the reference picture being stored in the deduplication task dataset, the similarity between the reference pictures not meeting the preset value, and the number of duplicate people representing the number of captured pictures whose similarity with the reference picture meets the preset value; A second judgment module is configured to, if there is no reference image whose similarity with the captured image meets a preset value, use the captured image as a reference image and add it to the deduplication task dataset; A loop module is used to loop through the above steps until the preset deduplication conditions are met; A calculation module is used to obtain the number of captured people and count the number of passenger flow according to the number of captured people and the updated number of repeated people, where the number of captured people is equal to the number of captured pictures; The device further includes: an identification module for identifying the captured image and identifying the type of the captured image, so that the device can use different deduplication schemes according to the type of the captured image to determine whether there is a reference image in the deduplication task data set whose similarity with the captured image meets a preset value; The second determination module is used to determine whether there is a reference picture whose similarity with the captured picture meets a preset value by using a second deduplication scheme if the captured picture is a tracked picture sequence, specifically including: if there are faces and human bodies in the tracked picture sequence, at least one reference picture whose similarity with the face meets a third preset threshold is used as the second picture, and at least one reference picture whose similarity with the human body meets a fourth preset threshold is used as the third picture, and according to whether there is an intersection between the second picture and the third picture, determine whether there is a reference picture whose similarity with the captured picture meets the preset value. The intersection between the second picture and the third picture means that there are pictures with the same identity identifier in the second picture and the third picture.
10. A communication device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the passenger flow counting method according to any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the passenger flow counting method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Passenger flow statistics method and device based on face recognition
CN110457993A
Passenger flow statistics method and device, storage medium and electronic equipment
CN110874583A
Face passenger flow recognition method and device suitable for multi-person scene, equipment and medium
CN111723678A