Method, device and server for counting crowd flow characteristics

Through the multi-level classification statistical method, the problems of low computing efficiency and poor real-time performance of traditional facial recognition abortion statistics methods are solved, and real-time statistics and efficient calculation of the abortion characteristics are realized.

CN112906725BActive Publication Date: 2024-11-12BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911146379.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-19
Publication Date
2024-11-12
Estimated Expiration
2039-11-19

AI Technical Summary

Technical Problem

The traditional facial recognition and abortion statistics method has low computing efficiency and poor real-time performance when processing large-scale facial data, which cannot meet the needs of large-scale real-time abortion statistics.

Method used

A multi-level classification and statistics method is adopted to obtain the facial image feature data of the sub-region in the specified area, and perform first- and second-level classification statistics to reduce the calculation amount of statistical data, improve the calculation efficiency, and count the flow characteristics in real time.

Benefits of technology

Real-time statistics of the abortion characteristics are realized, the calculation load is reduced, and the statistical efficiency is improved. It is suitable for large-scale abortion statistics scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112906725B_ABST
    Figure CN112906725B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and server for counting crowd flow characteristics, which obtains characteristic data of facial images of each sub-region in a specified area; classifies and counts the characteristic data corresponding to each sub-region to obtain the primary classification results corresponding to each sub-region; if there is a target sub-region in the sub-region whose number of categories in the primary classification results meets the first preset number threshold, the primary classification results of the target sub-region are counted into the current secondary classification results of the specified area to obtain the secondary classification results after statistics; and the crowd flow characteristics of the specified area are determined according to the secondary classification results after statistics. This multi-level statistical method helps to reduce the amount of calculation of statistical data and improves calculation efficiency, so that the crowd flow characteristics can be counted in real time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of crowd flow statistics, and in particular to a method, device and server for counting crowd flow characteristics. Background Art

[0002] With the development of society, the population flow of various public infrastructures such as shopping malls and stations has increased rapidly. How to summarize the rules from the large amount of user behavior is of great significance to the construction of smart communities. Crowd counting technology refers to the method of using manual means or cameras, sensors and other equipment to collect data and use a series of analysis technologies to count the flow of people in a certain period of time or a certain area. Traditional methods of crowd counting mainly include manual detection, infrared sensing equipment, Wi-Fi (wireless Internet access) probes, face recognition and other technologies to count the flow of people every day. In the crowd counting method based on face recognition, all historical face data needs to be statistically processed every time the statistics are performed. When the face data continues to grow, the calculation efficiency of this method is low and the real-time performance of the statistics is poor. Summary of the invention

[0003] The object of the present invention is to provide a method, device and server for counting human flow characteristics, so as to reduce the amount of computation of statistical data and improve computational efficiency, thereby being able to count human flow characteristics in real time.

[0004] In a first aspect, an embodiment of the present invention provides a method for counting crowd flow characteristics, the method comprising: obtaining feature data of facial images of each sub-region in a specified area; classifying and counting the feature data corresponding to each sub-region to obtain a primary classification result corresponding to each sub-region; wherein, in the primary classification result, the feature data of the facial image of the same person belongs to the same category; if there is a target sub-region in the sub-region whose number of categories in the primary classification result meets a first preset number threshold, counting the primary classification result of the target sub-region into the current secondary classification result of the specified area to obtain a statistically analyzed secondary classification result; and determining the crowd flow characteristics of the specified area based on the statistically analyzed secondary classification result.

[0005] In combination with the first aspect, an embodiment of the present invention provides a first possible implementation method of the first aspect, wherein the step of counting the primary classification results of the target sub-area into the current secondary classification results of the specified area includes: for each feature data in the primary classification results of the target sub-area, performing similarity matching between the current feature data and the secondary classification results of the specified area; if there is target feature data in the secondary classification results whose similarity meets a preset similarity threshold, classifying the current feature data into the category to which the target feature data belongs; if there is no target feature data in the secondary classification results whose similarity meets the preset similarity threshold, creating a new category and classifying the current feature data into the newly created category.

[0006] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the step of performing similarity matching between the current feature data and the secondary classification results of the specified area includes: performing block processing on the secondary classification results of the specified area according to a preset parallelism to obtain multiple block data; and performing similarity matching between the current feature data and each block data respectively.

[0007] In combination with the first aspect, an embodiment of the present invention provides a third possible implementation of the first aspect, wherein, after the step of obtaining the primary classification result of each sub-region, the method also includes: for each sub-region, calculating the mean feature of each feature data in the primary classification result of the current sub-region; determining the mean feature as the regional feature of the current sub-region; and clearing the primary classification result corresponding to the current sub-region.

[0008] In combination with the first aspect, an embodiment of the present invention provides a fourth possible implementation of the first aspect, wherein the step of determining the pedestrian flow characteristics of a specified area based on the statistical secondary classification results includes at least one of the following: calculating the total pedestrian flow in the specified area based on the statistical secondary classification results; counting the pedestrian flow corresponding to the specified pedestrian flow characteristic attributes in the specified area based on the statistical secondary classification results; determining the hot spot area in the specified area based on the statistical secondary classification results; wherein the hot spot area is an area with a pedestrian flow higher than a second preset quantity threshold; calculating the mean feature and / or median feature of each feature data in the secondary classification results to obtain a calculation result; and determining the calculation result as the regional feature of the specified area.

[0009] In combination with any possible implementation of the first aspect, an embodiment of the present invention provides a fifth possible implementation of the first aspect, wherein the method is applied to a server running a Cassandra database; the Cassandra database is communicatively connected to a PostgreSQL engine; the Cassandra database is used to store facial images, primary classification results, and secondary classification results; before the step of obtaining feature data of facial images of each sub-area in a specified area, the method further includes: obtaining a statistical calculator through a PostgreSQL engine; running the statistical calculator on a server running the Cassandra database, and executing a method for counting crowd flow features through the statistical calculator.

[0010] In a second aspect, an embodiment of the present invention provides a device for counting crowd flow characteristics, the device comprising: a feature data acquisition module, used to obtain feature data of facial images of each sub-region in a specified area; a feature data classification module, used to classify and count the feature data corresponding to each sub-region, and obtain a primary classification result corresponding to each sub-region; wherein, in the primary classification result, the feature data of the facial image of the same person belongs to the same category; a category quantity judgment module, used to count the primary classification result of the target sub-region into the current secondary classification result of the specified area if there is a target sub-region in the sub-region whose category number in the primary classification result meets a first preset quantity threshold, to obtain a secondary classification result after statistics; a crowd flow feature determination module, used to determine the crowd flow characteristics of the specified area according to the secondary classification result after statistics.

[0011] In combination with the second aspect, an embodiment of the present invention provides a first possible implementation method of the second aspect, wherein the feature data classification module is also used to: for each feature data in the primary classification result of the target sub-area, perform similarity matching between the current feature data and the secondary classification result of the specified area; if there is target feature data in the secondary classification result whose similarity meets a preset similarity threshold, classify the current feature data into the category to which the target feature data belongs; if there is no target feature data in the secondary classification result whose similarity meets the preset similarity threshold, create a new category and classify the current feature data into the newly created category.

[0012] In combination with the first possible implementation of the second aspect, an embodiment of the present invention provides a second possible implementation of the second aspect, wherein the feature data classification module is also used to: block the secondary classification results of the specified area according to a preset degree of parallelism to obtain multiple block data; and perform similarity matching on the current feature data with each block data respectively.

[0013] In combination with the second aspect, an embodiment of the present invention provides a third possible implementation of the second aspect, wherein the device also includes: a mean feature calculation module, used to calculate, for each sub-region, the mean feature of each feature data in a class classification result of the current sub-region; determine the mean feature as the regional feature of the current sub-region; and a classification result clearing module, used to clear the class classification result corresponding to the current sub-region.

[0014] In a third aspect, an embodiment of the present invention provides a server including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned method for counting crowd flow characteristics.

[0015] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned method of counting crowd flow characteristics.

[0016] The embodiments of the present invention bring the following beneficial effects:

[0017] The present invention provides a method, device and server for counting the characteristics of human flow. First, the characteristic data of the facial image of each sub-region in the specified area is obtained; then, the characteristic data corresponding to each sub-region is classified and counted to obtain the first-level classification result corresponding to each sub-region; if there is a target sub-region in the sub-region whose number of categories in the first-level classification result meets the first preset number threshold, the first-level classification result of the target sub-region is counted into the current second-level classification result of the specified area to obtain the second-level classification result after statistics; finally, the human flow characteristics of the specified area are determined according to the second-level classification result after statistics. In this method, when the scope of the specified area is large, it can be divided into multiple sub-regions, and each sub-region is counted first, and then the entire specified area is counted based on the statistical results of each sub-region; compared with the existing method of performing statistics based on all data in the area, this multi-level statistical method helps to reduce the amount of calculation of statistical data and improves the calculation efficiency, so that the human flow characteristics can be counted in real time. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A flow chart of a method for counting crowd flow characteristics provided by an embodiment of the present invention;

[0020] Figure 2 A schematic diagram of an application scenario of a method for counting crowd flow characteristics provided by an embodiment of the present invention;

[0021] Figure 3 A flow chart of another method for counting crowd flow characteristics provided by an embodiment of the present invention;

[0022] Figure 4 A schematic diagram of a parallel computing structure provided by an embodiment of the present invention;

[0023] Figure 5 A flow chart of another method for counting crowd flow characteristics provided by an embodiment of the present invention;

[0024] Figure 6 A flow chart of another method for counting crowd flow characteristics provided by an embodiment of the present invention;

[0025] Figure 7 A schematic diagram of an application scenario of another method for counting crowd flow characteristics provided by an embodiment of the present invention;

[0026] Figure 8 A timing diagram of a small file calculation process algorithm provided by an embodiment of the present invention;

[0027] Fig. 9 A timing diagram of a mid-range archive calculation process algorithm provided by an embodiment of the present invention;

[0028] Fig.10 A timing diagram of a large file calculation process algorithm provided by an embodiment of the present invention;

[0029] Fig.11 A schematic diagram of the structure of a device for counting crowd flow characteristics provided by an embodiment of the present invention;

[0030] Fig.12 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than 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.

[0032] In the related art, the methods of counting people flow mainly include manual detection, infrared sensing equipment, Wi-Fi probes and other technologies. Among them, the manual detection method requires additional personnel costs and requires the staff to concentrate their attention. This method is inefficient and difficult to implement for a long time and automatically. The technology of infrared, Wi-Fi probes and other equipment requires customers or pedestrians to carry corresponding equipment and keep the equipment in an active state. The hardware conditions are too demanding, and the age, gender, and other appearance characteristics of pedestrians cannot be obtained, which is not conducive to further mining data. At the same time, this technical means has the risk of leaking user privacy. With the development of computer vision technology, from monitoring equipment such as cameras, relying on face recognition technology to promote the development of people flow statistics. In the related art, the method of counting people flow based on face recognition, through computer vision to identify faces, technically count faces, to a certain extent solves the shortcomings of the above methods, but each time statistics are performed, all face data need to be statistically processed. When face data continues to grow, the calculation efficiency of this method is low, the real-time performance of statistics is poor, and it cannot be applied to large-scale real-time people flow statistics.

[0033] Based on the above problems, the embodiments of the present invention provide a method, device and server for counting crowd flow characteristics, which can be applied to crowd flow characteristic statistics in various scenarios, especially can be used for real-time crowd flow characteristic statistics. Firstly, the embodiments of the present invention provide a method for counting crowd flow characteristics, such as Figure 1 As shown, the method comprises the following steps:

[0034] Step S102, acquiring feature data of the face image of each sub-region in the specified region;

[0035] The designated area may be provided with a plurality of cameras for collecting facial images of people entering the designated area. The designated area may be a shopping mall or commercial street or other area with dense traffic. The designated area may be pre-divided into a plurality of sub-areas, each of which may be a small geographical area in a geographical area, such as an entrance or exit of a shopping mall, a counter area or a store area, etc., and each sub-area is usually provided with at least one camera. The feature data of the facial image may be feature data extracted from the facial image using artificial intelligence tools such as neural networks, and the feature data may include attribute information such as gender, age, height, etc.

[0036] Step S104, classifying and counting the feature data corresponding to each sub-region to obtain a primary classification result corresponding to each sub-region; wherein, in the primary classification result, the feature data of the face image of the same person belongs to the same category;

[0037] The above classification statistics may refer to clustering the feature data of the facial image obtained in step S102, and the clustering algorithm may be an algorithm such as k-means, to classify each person into a category. It can be understood that the feature data of the facial images collected by all cameras contained in a sub-area within a preset time period (such as within a day) is obtained, and then the feature data of the facial images are clustered in real time, and repeated feature data of facial images can be filtered out. Each person will be classified into a category, and finally the statistics are the first-level classification results corresponding to the sub-area. Since the behavior trajectory of a person is not fixed, the same person may appear repeatedly in the same sub-area, or may appear in other sub-areas at different times. Therefore, among all the first-level classification results, there may be repeated facial image feature data between the first-level classification results corresponding to each sub-area, and in the first-level classification results corresponding to a sub-area, the feature data of the facial images of the same person belong to the same category, and usually there is no repeated facial image feature data.

[0038] Step S106, if there is a target sub-region in the sub-region where the number of categories in the first-level classification result meets the first preset number threshold, the first-level classification result of the target sub-region is counted into the current second-level classification result of the designated region to obtain the second-level classification result after counting;

[0039] The number of categories in the above-mentioned first-level classification result can be the number of people counted in the sub-region. When the number of categories in the first-level classification result corresponding to the sub-region meets the first preset number threshold, the sub-region is used as the target sub-region, and then the first-level classification result of the target sub-region is counted into the current second-level classification result of the specified region to obtain the second-level classification result after statistics. The second-level classification result after statistics can be the feature data of the face images of all the target sub-regions. The above-mentioned first preset number threshold can be a preset value, such as 500.

[0040] The above-mentioned secondary classification results are usually the summary classification results of all sub-regions in the specified area. Since the corresponding primary classification results between the sub-regions may have repeated feature data of facial images, the process of adding the primary classification results of the target sub-region to the current secondary classification results of the specified area includes the process of filtering out the repeated feature data of facial images, which can be specifically counted by clustering, cyclic updating, classifiers, etc. In addition, after the primary classification results of the target sub-region are counted to the secondary classification results, the primary classification results can be cleared to facilitate classification and statistics of facial image feature data calculated subsequently.

[0041] Step S108, determining the pedestrian flow characteristics of the designated area according to the statistical secondary classification results.

[0042] The above-mentioned secondary classification results after statistics include the primary classification results of all target sub-areas, and the characteristic data of each category in the statistical secondary classification results may also include a regional identifier indicating which sub-area the characteristic data comes from. The crowd flow characteristics of the above-mentioned designated area may include the total crowd flow of the designated area, crowd flow attribute characteristic information, etc., such as the distribution of people of different age groups and different genders in the designated area, and the distribution of people of different characteristics in each sub-area. Based on the distribution of people with these characteristics, various characteristics of the designated area can be counted, such as the operation data of the shopping mall, including crowd flow, store entry rate, store entry attributes, hot spots, etc., which ultimately helps commercial real estate and other companies solve refined operation problems such as investment promotion, store layout, precision marketing, brand management, etc., and achieve the purpose of intelligent operation of shopping malls.

[0043] The embodiment of the present invention provides a method for counting crowd flow characteristics, which first obtains the characteristic data of the face image of each sub-region in the specified area; then classifies and counts the characteristic data corresponding to each sub-region to obtain the first-level classification result corresponding to each sub-region; if there is a target sub-region in the sub-region whose number of categories in the first-level classification result meets the first preset number threshold, the first-level classification result of the target sub-region is counted into the current second-level classification result of the specified area to obtain the second-level classification result after counting; finally, the crowd flow characteristics of the specified area are determined according to the second-level classification result after counting. In this method, when the specified area is large, it can be divided into multiple sub-regions, and each sub-region is counted first, and then the entire specified area is counted based on the statistical results of each sub-region; compared with the existing method of counting based on all data in the area, this multi-level statistical method helps to reduce the amount of statistical data calculation and improves the calculation efficiency, so that the crowd flow characteristics can be counted in real time.

[0044] For ease of understanding, this embodiment proposes an application scenario in which the method for counting crowd flow characteristics provided by this embodiment can be implemented, but the method for counting crowd flow characteristics provided by this embodiment is not limited to this application scenario. Figure 2 As shown, the scenario includes a distributed log system Kafka, a Cassandra database, a business system database, a Hive data warehouse, an SQL (Structured Query Language) scheduler, an object-relational database management system PostgreSQL, and a face classification calculator and an indicator calculation calculator based on the PostgreSQL.

[0045] Among them, the PostgreSQL includes FDW (Foreign-Data Wrapper), functions Functions and CPU (central processing unit). The above-mentioned CPU provides data calculation and processing, and the functions Functions include functions that can perform various data processing functions, such as the above-mentioned face classification statistics calculator and indicator calculation statistics calculator functions. The above-mentioned Kafka can be used to build a real-time data pipeline. After obtaining the feature data of the face image, the feature data of the face image can be first recorded through Kafka, and the feature data of a large number of face images can be processed in real time. The feature data is written into the message queue as a video structured log to meet various demand scenarios. The above-mentioned Cassandra database is an open source distributed NoSQL database system, which stores the feature data of the face image in the form of a video structured log output by the above-mentioned Kafka to meet the needs of real-time retrieval and subsequent crowd statistics.

[0046] The above-mentioned PostgreSQL is an object-relational database management system with complete features and free software. By calling the PDW, Functions and CPU in PostgreSQL through the SQL scheduler, PostgreSQL can integrate and calculate multi-source heterogeneous data such as Cassandra database, business system database and Hive data warehouse. FDW is used to use Cassandra database as an external data source to participate in the calculation in the form of external tables, solving the problem of multi-source heterogeneous data integration calculation. The statistical calculator can be directly applied to the external table through the in-database compute calculation mode. The external data does not need to be landed in the local PostgreSQL system, which reduces the IO consumption of data migration and the data copying process during the calculation process, and greatly improves the computing performance. Among them, the above-mentioned business system database stores the information obtained by the statistics of the characteristics of the flow of people, and the above-mentioned Hive data warehouse is mainly used for later data processing. The above-mentioned facial classification statistical calculator and indicator calculation statistical calculator can be run directly in the Cassandra database through PostgreSQL, without copying the data stored in the Cassandra database to the server running PostgreSQL.

[0047] Based on the above application scenario, the embodiment of the present invention further provides another method for counting pedestrian flow characteristics, which is implemented on the basis of the above embodiment method; the method focuses on describing the specific implementation process of counting the primary classification results of the target sub-area into the current secondary classification results of the specified area (implemented by steps S306-S310), such as Figure 3 As shown, the method comprises the following steps:

[0048] Step S302, obtaining feature data of the face image of each sub-region in the specified region;

[0049] In actual implementation, the camera in each sub-area of ​​the designated area can first collect the video information of the flow of people to form unstructured video stream data. In order to solve the problem of standardized data collection, SDK (Software Development Kit), ONVIF (Open Network Video Interface Forum), RSTP (Rapid Spanning Tree Protocol), FTP (File Transfer Protocol) and other methods can be used to support various IPC (Inter-Process Communication), NVR (Network Video Recorder), DVR (Digital Video Recorder) and other methods. Recorder) and extract frames from the video stream to convert the video data into image data; then, according to the preset scoring criteria, the score of the above image data is calculated, and the image with a quality score reaching the preset value is selected, and the image is compressed to obtain the above face image; the face image is transmitted to the cloud processor, and the cloud processor can extract the feature data of the face image by using methods such as deep network, and then write the feature data of the face image as a video structured log into the message queue; finally, since the video structured log is the basis for subsequent calculations and has the characteristics of large quantity and dynamic expansion of data columns, the video structured log output can be stored in the Cassandra database to meet the needs of real-time retrieval and support the statistics of subsequent face classification. Among them, the dynamic expansion of data columns can refer to each data column recording an attribute. The dynamic expansion of data columns is essentially the expansion of the attributes extracted from the image.

[0050] Step S304, classifying and counting the feature data corresponding to each sub-region to obtain a primary classification result corresponding to each sub-region; wherein, in the primary classification result, the feature data of the face image of the same person belongs to the same category;

[0051] Step S306, if there is a target sub-region in the sub-region where the number of categories in the first-level classification result meets the first preset number threshold, for each feature data in the first-level classification result of the target sub-region, the current feature data is matched with the second-level classification result of the specified region for similarity;

[0052] Each feature data in the above-mentioned first-level classification result corresponds to a person, and the feature data may include the person's age, gender, height, weight and other features. Since the second-level classification result of the specified area is obtained by counting the first-level classification results of each sub-area, the second-level classification result of the specified area is empty in the initial state, and there is no feature data. Since there is no repeated feature data of the face image in the first-level classification result in a sub-area, in this case, the similarity match between the feature data in the first target sub-area and the second-level classification result is low, that is, there is no feature data in the second-level classification result that is the same as the feature data of the face image in the target sub-area.

[0053] Taking the implementation process of the above step S306 as an example, the primary classification results of all target sub-areas are collected in a preset order, which can be collected in the order of time, and the feature data of the current face image is determined one by one. The feature data of each current face image includes feature sub-data such as age, gender, height, and weight. Then, each feature sub-data is matched with the corresponding feature sub-data in the feature data of each face image in the secondary classification result for similarity, and the matching of the feature data of the current face image is completed. Then, the new feature data of the current face image is re-determined from the primary classification result until the feature data in the primary classification results of all target sub-areas are matched.

[0054] In the above-mentioned process of similarity matching of feature data or feature sub-data, various distance formulas can be used to calculate the distance between two matching data, such as the Euclidean distance formula, the cosine distance formula, etc.; according to a preset distance threshold, determine whether the two data match each other; for example, if the distance is less than or equal to the preset distance threshold, it can be determined that the two data match each other, and if the distance is greater than the preset distance threshold, it can be determined that the two data do not match each other.

[0055] In another embodiment, see Figure 4 As shown, in order to make the similarity matching process simpler and more efficient, the secondary classification results of the specified area can be processed in blocks according to the preset parallelism to obtain multiple block data; the feature data of all target sub-areas are similarly matched with each block data at the same time, and the similarity matching is performed in parallel to reduce the calculation time. For example, for example, the secondary classification results of the specified area have 100 categories, and the 100 categories are processed in blocks to obtain 5 block data, each block has 20 categories, and the primary classification results of all target sub-areas have 10 categories. These 10 categories are similarly matched with all the feature data of the 20 categories in each block data at the same time, until the feature data of these 10 categories are matched with the feature data of the 20 categories in each block.

[0056] Step S308, if there is target feature data whose similarity meets the preset similarity threshold in the secondary classification result, the current feature data is classified into the category to which the target feature data belongs;

[0057] Before the similarity matching begins, the secondary classification result of the specified area may be empty, with no feature data. Moreover, there is no repeated feature data of the facial image in the primary classification result in a sub-area. The feature data of the facial image in the first target sub-area will be matched with the feature data in the secondary classification result for similarity, and the results do not meet the preset similarity threshold. Therefore, after the similarity matching between the feature data of the facial image in the first target sub-area and the feature data in the secondary classification result is completed, when the second target sub-area is matched with the secondary classification result, there may be target feature data whose similarity meets the preset similarity threshold, that is, there is feature data in the secondary classification result that is the same as the feature data of the facial image in the target sub-area, and these two feature data belong to the same category.

[0058] Since the first-level classification results of different target sub-areas may have the same category, if the feature data for similarity matching meets the preset similarity threshold, that is, the category to which the feature data belongs is matched, it means that the category to which the feature data belongs already exists. Then the feature data with the same feature category are classified into one category, which can be specifically identified with the same category identifier. This process is equivalent to filtering out duplicate categories in the first-level classification results.

[0059] Step S310, if there is no target feature data whose similarity meets the preset similarity threshold in the secondary classification result, a new category is created, and the current feature data is classified into the newly created category; and the statistical secondary classification result is obtained;

[0060] In the above secondary classification results, there is no target feature data whose similarity meets the preset similarity threshold, that is, there is no feature data in the secondary classification results that is the same as the feature data of the face image in the target sub-region, and the category to which the feature data belongs is not matched. In this case, a new category needs to be established, and the feature data in the target sub-region that does not meet the preset similarity threshold is counted into the newly created category. For example, a new category identifier is set, and the new category identifier is added to the feature data in the target sub-region that does not meet the preset similarity threshold.

[0061] Step S312, determining the pedestrian flow characteristics of the designated area according to the statistical secondary classification results.

[0062] The embodiment of the present invention provides a method for counting the characteristics of human flow, firstly, obtaining the characteristic data of the face image of each sub-region in the specified area; then classifying and counting the characteristic data corresponding to each sub-region to obtain the first-level classification result corresponding to each sub-region; if there is a target sub-region in the sub-region whose number of categories in the first-level classification result meets the first preset number threshold, for each characteristic data in the first-level classification result of the target sub-region, the current characteristic data is matched with the second-level classification result of the specified area by similarity; it is judged whether there is target characteristic data in the second-level classification result whose similarity meets the preset similarity threshold, if there is, the current characteristic data is classified into the category to which the target characteristic data belongs, if not, the current characteristic data is classified into the newly created category; the second-level classification result after statistics is obtained; finally, according to the second-level classification result after statistics, the human flow characteristics of the specified area are determined. In this method, when the specified area is large, it can be divided into multiple sub-regions, each sub-region is counted first, and then the whole specified area is counted based on the statistical results of each sub-region; compared with the existing method of performing statistics based on all data in the area, this multi-level statistical method helps to reduce the amount of calculation of statistical data and improve the calculation efficiency, so that the human flow characteristics can be counted in real time.

[0063] The embodiment of the present invention also provides another method for counting the characteristics of human flows, which is implemented on the basis of the method in the above embodiment; the method focuses on describing the specific steps after the step of obtaining the primary classification results of each sub-area (implemented by steps S506 and S514), and the specific process of determining the characteristics of human flows in the designated area based on the statistical secondary classification results (implemented by step S516). Figure 5 As shown, the method comprises the following steps:

[0064] Step S502, acquiring feature data of the face image of each sub-region in the specified region;

[0065] Step S504, classifying and counting the feature data corresponding to each sub-region to obtain a primary classification result corresponding to each sub-region; wherein, in the primary classification result, the feature data of the face image of the same person belongs to the same category;

[0066] Step S506, for each sub-region, calculating the mean feature of each feature data in the primary classification result of the current sub-region; and determining the mean feature as the region feature of the current sub-region;

[0067] The above-mentioned mean feature can be the average value of each feature data in the primary classification result of each sub-region. The number of the above-mentioned mean features corresponds to the type of feature data, and finally multiple mean features are obtained. For example, in the primary classification result of the current sub-region, there are 100 categories, and the feature data of each category includes four feature data of age, gender, height, and weight of the face image. The average values ​​of the four feature data of the 100 categories are calculated respectively, and the average values ​​of the four feature data are combined into a feature vector, which is determined as the regional feature of the current sub-region.

[0068] Step S508, if there is a target sub-region in the sub-region where the number of categories in the first-level classification result meets the first preset number threshold, for each feature data in the first-level classification result of the target sub-region, the current feature data is matched with the second-level classification result of the specified region for similarity;

[0069] Step S510, if there is target feature data whose similarity meets a preset similarity threshold in the secondary classification result, the current feature data is classified into the category to which the target feature data belongs;

[0070] Step S512: if there is no target feature data whose similarity meets the preset similarity threshold in the secondary classification result, a new category is created, and the current feature data is classified into the newly created category; and the statistical secondary classification result is obtained;

[0071] Step S514, clearing the first-level classification result corresponding to the current sub-region;

[0072] Since video acquisition is time-series, the first-level classification results collect the feature data of facial images within a preset time period (such as one hour, half a day or one day). Therefore, after completing the statistics of the second-level classification results of the specified area, it is necessary to clear the first-level classification results corresponding to the current sub-area in order to subsequently calculate the feature data of the facial images of each sub-area, and perform a new round of classification statistics on the feature data corresponding to each sub-area to obtain new first-level classification results corresponding to each sub-area.

[0073] Step S516, determining the pedestrian flow characteristics of the designated area according to the statistical secondary classification results.

[0074] According to the statistical secondary classification results, the pedestrian flow characteristics of the specified area can be determined, and the following possible results can be obtained:

[0075] 1. Calculate the total flow of people in the designated area based on the statistical secondary classification results; when the number of categories of the primary classification results of each sub-area in the designated area reaches the first preset number threshold, the statistical secondary classification results include the feature data of all face images in the designated area. In the above case, the total flow of people in the designated area can be the number of categories of the statistical secondary classification results, and the total flow of people in the designated area within the preset time period can be obtained by calculating the number of categories.

[0076] 2. According to the statistical secondary classification results, the flow of people corresponding to the specified flow characteristic attributes in the specified area is counted; the characteristic data of the statistical secondary classification results may include multiple characteristics; the above-mentioned specified flow characteristic attributes may specifically be a specified gender, a specified age group, a specified physical feature, etc. For example, the number of categories to which the characteristic data of male gender in the specified area belongs can be calculated. By calculating the number of categories, the number of male people in the specified area within the preset time period can be obtained. In the same way, the number of people in the specified age group of 18-25 years old, or the number of male people aged 18-25 years old can also be obtained.

[0077] 3. Determine the hotspot area in the designated area according to the statistical secondary classification results; wherein the hotspot area is an area where the flow of people is higher than the second preset number threshold, for example, the second preset number threshold may be 800. Since each feature data may carry an area identifier, the number of categories of different area identifiers may be counted according to the area identifier carried in the feature data of the statistical secondary classification results, and the number of categories is equivalent to the flow of people. When the number of categories is higher than the second preset number threshold, the area is a hotspot area; in addition, the characteristic attributes of the flow of people in the hotspot area may be determined according to the feature data in the hotspot area.

[0078] 4. Calculate the mean and / or median features of each feature data in the secondary classification results to obtain the calculation results; determine the calculation results as the regional features of the specified area. Since the feature data contained in the statistical secondary classification results are the feature data of the primary classification results in multiple target sub-regions, there are more feature data than the primary classification results of each sub-region, so it is necessary to calculate the mean and median features of each feature data. Using multiple features to represent the regional features of the specified area will be more accurate and more comprehensive. Of course, the mean feature or the median feature can also be used to represent the regional features of the specified area.

[0079] Another method for counting crowd flow features provided by the present invention first obtains feature data of a face image of each sub-region in a specified area; then classifies and counts the feature data corresponding to each sub-region to obtain a first-level classification result corresponding to each sub-region; for each sub-region, calculates the mean feature of each feature data in the first-level classification result of the current sub-region; determines the mean feature as the regional feature of the current sub-region; if there is a target sub-region in the sub-region whose number of categories in the first-level classification result meets the first preset number threshold, counts the first-level classification result of the target sub-region to the current second-level classification result of the specified area to obtain the second-level classification result after counting; clears the first-level classification result corresponding to the current sub-region; and finally determines the crowd flow features of the specified area according to the second-level classification result after counting. In this method, when the specified area is large, it can be divided into multiple sub-regions, and each sub-region is counted first, and then the entire specified area is counted based on the statistical results of each sub-region; compared with the existing method of counting based on all data in the area, this multi-level statistical method helps to reduce the amount of calculation of statistical data and improves the calculation efficiency, so that the crowd flow features can be counted in real time.

[0080] The embodiment of the present invention also provides another method for counting human flow features, which is applied to a server running a Cassandra database; the Cassandra database is connected to a PostgreSQL engine for communication; the Cassandra database is used to store face images, primary classification results, and secondary classification results; the method is implemented on the basis of the above-mentioned embodiment method; the method focuses on the specific steps before the step of obtaining feature data of face images of each sub-area in the specified area (implemented by steps S602 to S604), such as Figure 6 As shown, the method comprises the following steps:

[0081] Step S602, obtaining statistical calculators through the PostgreSQL engine;

[0082] See also Figure 1 As shown, the statistical calculator can be a face classification statistical calculator or an indicator calculation statistical calculator, and the PostgreSQL engine can include a query engine, an execution engine, a storage engine, etc. Specifically, the statistical calculator can be obtained through the external call of the PostgreSQL engine.

[0083] Step S604, running a statistical calculator on a server running a Cassandra database, and executing the following method steps for counting the characteristics of the flow of people through the statistical calculator;

[0084] The above-mentioned PostgreSQL engine can call the above-mentioned statistical calculator to the server of the Cassandra database, and use the face classification statistical calculator in the server to perform classification of feature data, calculation and statistics of crowd flow characteristics, etc., and use the indicator calculation statistical calculator to perform operation indicator data calculation, trajectory calculation, spatiotemporal aggregation calculation and association analysis calculation, so as to obtain the total customer flow, store entry rate, customer attributes, hot spots, etc. of the specified area, and ultimately help commercial real estate solve the problems of investment promotion, store layout, precision marketing, and refined operation of brand management, so as to achieve the purpose of intelligent operation of shopping malls.

[0085] Step S606, acquiring feature data of the face image of each sub-region within the specified region;

[0086] Step S608, classifying and counting the feature data corresponding to each sub-region to obtain a primary classification result corresponding to each sub-region; wherein, in the primary classification result, the feature data of the face image of the same person belongs to the same category;

[0087] Step S610, for each sub-region, calculating the mean feature of each feature data in the first-class classification result of the current sub-region; and determining the mean feature as the region feature of the current sub-region;

[0088] Step S612: if there is a target sub-region in which the number of categories in the first-level classification result meets the first preset number threshold, for each feature data in the first-level classification result of the target sub-region, similarity matching is performed between the current feature data and the second-level classification result of the designated region;

[0089] Step S614, if there is target feature data whose similarity meets the preset similarity threshold in the secondary classification result, the current feature data is classified into the category to which the target feature data belongs;

[0090] Step S616, if there is no target feature data whose similarity meets the preset similarity threshold in the secondary classification result, a new category is created, and the current feature data is classified into the newly created category; and the statistical secondary classification result is obtained;

[0091] Step S618, clearing the one-category classification result corresponding to the current sub-region;

[0092] Step S620, determining the pedestrian flow characteristics of the designated area according to the statistical secondary classification results.

[0093] The above method also includes that when the target area to be counted is large, the above designated area can also be used as a sub-area of ​​the target area; the target area can include multiple designated areas, and based on the secondary classification results of each designated area, the third-level classification results corresponding to the target area are obtained by statistics in the above manner.

[0094] Specifically, the feature data corresponding to each designated area is classified and counted to obtain the secondary classification result corresponding to each designated area; if there is a target designated area in the designated area where the number of categories in the secondary classification result meets the second preset number threshold, the secondary classification result of the target designated area is counted into the current third-level classification result of the target area to obtain the statistical third-level classification result; according to the statistical third-level classification result, the crowd flow characteristics of the target area are determined. The specific implementation process is consistent with the method of counting the feature data of the facial image of the target sub-area of ​​the primary classification result into the secondary classification result, so it can refer to the above embodiment and will not be repeated here.

[0095] Another method for counting crowd flow features provided by the present invention comprises the following steps: firstly obtaining a statistical calculator through a PostgreSQL engine; running the statistical calculator on a server running a Cassandra database, and executing a method for counting crowd flow features through the statistical calculator; then obtaining feature data of facial images of each sub-region in a specified area; classifying and counting the feature data corresponding to each sub-region to obtain a primary classification result corresponding to each sub-region; if there is a target sub-region in the sub-region whose number of categories in the primary classification result meets a first preset number threshold, counting the primary classification result of the target sub-region into the current secondary classification result of the specified region to obtain a statistical secondary classification result; finally, determining the crowd flow features of the specified region according to the statistical secondary classification result. In this method, the statistical calculator is directly run on the Cassandra database through the PostgreSQL engine, thereby avoiding data transmission during the calculation process; at the same time, the multi-level statistical method helps to reduce the amount of calculation of statistical data and improves calculation efficiency, so that the crowd flow features can be counted in real time.

[0096] An embodiment of the present invention also provides an implementation method for a specific method of counting crowd flow characteristics. The face archiving described in this embodiment includes small-file archiving, medium-file archiving and large-file archiving, which correspond to the first-level classification statistics, second-level classification statistics and third-level classification statistics described in the above embodiment; the small-file archives, medium-file archives and large-file archives correspond to the first-level classification results, second-level classification results and third-level classification results described in the above embodiment; the face feature archives correspond to the regional characteristics of the specified area described in the above embodiment.

[0097] For ease of understanding, this embodiment provides a specific application scenario, such as Figure 7The schematic diagram of another application scenario of a method for counting crowd flow characteristics is shown. The camera of the video structured processing module is used to collect crowd flow video information to form unstructured video stream data. The video stream is framed to extract captured information, including facial features and attribute information such as gender and age. The feature data of the above facial images are used as video structured logs and written into the message queue. Since the video structured log is the basis for subsequent calculations and has the characteristics of large quantity and dynamic expansion of data columns, the video structured log output can be stored in the Cassandra database to meet the needs of real-time retrieval and support subsequent face archiving statistics. Then, the face archiving calculation module is used to cluster the facial features of each captured face image to form a face file for calculating passenger flow. Finally, the data processing module implements parallel computing based on the basic data generated by the face archiving calculation module to generate operational data indicators.

[0098] First, see Figure 8 The algorithm timing diagram of a small file calculation process is shown in FIG. Figure 8 Multiple sub-cameras in the specified area acquire the feature data of the face image of each sub-area in parallel. Figure 8 The sub-camera parallelism in can be understood as: pre-dividing the designated area into multiple sub-areas, each sub-area is provided with at least one camera for collecting the feature data of the facial images of the people entering the sub-area; the feature data of the facial images can also be identified, including information such as capture ID, capture timestamp and tracking ID. The above information is stored in the face capture library, wherein the capture ID can be the camera position information for collecting the feature data of the facial image, the facial feature can be the feature data of the facial image of each sub-area, the capture timestamp can be the current moment of the feature data collection of the facial image, and the tracking ID can be the category identification of the feature data of the facial image, that is, one person corresponds to one category identification, that is, one tracking ID. The first-level classification result of a sub-area is equivalent to a small file. The small file archiving operator is used to cluster the feature data of the facial images of each small file, and each person is classified into one category. The repeated feature data of the facial images are filtered out, and each person will be classified into one category, and then counted as the small file corresponding to the sub-area. Finally, the mean of the feature data of each face image in all small file archives is taken to represent the small file feature, which can also be called the L1 face file feature. Then the feature data in the small file archive, the L1 face file feature, the snapshot ID list, etc. are put into the face small file library. If the number of categories in the small file archive meets the preset threshold, the feature data of the small file archive is transferred to the medium file calculation step.

[0099] See also Fig. 9The figure shows a timing diagram of the algorithm for calculating the mid-range archive. If there is a target small-range archive that meets the first preset number threshold in the small-range archive of the face small-range library, that is, the primary classification result of the target sub-region, the feature data of the target small-range archive is counted in the current mid-range archive of the specified region to obtain the statistical mid-range archive. The above target small-range archive is equivalent to the small-range information (T) shown in the figure. Because data collection is time-series, the mid-range information (T-1) in the figure is equivalent to the mid-range archive counted in the previous period of time. It is necessary to merge the target small-range archive with the original mid-range archive for statistics, which is equivalent to a continuous updating process. Since there may be a large number of repeated people between each target small-range archive, the process of counting to the mid-range archive uses the mid-range archiving operator to match the feature data in the target small-range archive with the feature data in all the mid-range archives for similarity. If the preset threshold is met, it means that the above two feature data have a feature category, then the feature data with a feature category will be classified into one category, that is, classified into the category to which the feature data belongs in the mid-range archive, otherwise a new category will be re-established. Then, the mean and median of all feature data in the mid-range file are taken as mid-range file features, which can also be called L2 face file features. Of course, one of the mean or median can also be used as the L2 face file feature.

[0100] The newly added L2 file features (i.e., feature data in the newly added categories) and the snapshot ID list included in the newly added L2 file features, the feature data L2 of the existing categories in the original mid-range file and the corresponding snapshot ID list (i.e., L2-ID list), and the feature data and corresponding snapshot ID list (i.e., L1-ID list) of the small-file files included in the existing categories in the mid-range file, are finally obtained through the mid-range feature operator. The mid-range file can also be called the L2 feature file, that is, the secondary classification result after statistics, is put into the face mid-range library, and the face small-file library is cleared. When the number of categories in the face mid-range library meets the preset threshold, it is transmitted to the large-file calculation step.

[0101] See also Fig.10The figure shows a timing diagram of the algorithm for calculating the large-file. If there is a target mid-file that meets the first preset number threshold in the mid-file, that is, the secondary classification result of the hot spot area, the characteristic data of the target mid-file is counted in the current large-file in the specified area to obtain the statistical large-file. The above target mid-file is equivalent to the mid-file information (T) shown in the figure. Because data collection is time-series, the large-file information (T-1) in the figure is equivalent to the large-file counted in the previous period of time. It is necessary to merge the target mid-file with the original large-file, which is equivalent to a continuous update process. All large files are divided into blocks by hashing (hash, a hash function) to increase the parallelism of the algorithm. The feature data of the target mid-file is matched with the feature data of each block of the large file in parallel by the large file MR (MapReduce) operator. If the similarity value between the feature data of the current target mid-file and the feature data of the block of the large file meets the preset threshold, it means that the above two feature data have a feature category. The feature data with a feature category are classified into one category, that is, the category to which the feature data in the large file belongs. Otherwise, a new face category is re-established, and the mean and median of all feature data of each block of the large file are calculated as the feature value of the large file. Of course, one of the mean or median can also be used as the feature value of the large file.

[0102] The newly added L3 file features (i.e., feature data in the newly added category) and the snapshot ID list included in the newly added L3 file features, the feature data L3 of the existing category in the original large file and the corresponding snapshot ID list (i.e., L3-ID list), and the feature data of the mid-level file of the existing category in the large file and the corresponding snapshot ID list (i.e., L2-ID list), finally obtain the large file through the large file feature operator, which can also be called the L3 feature file, that is, the statistical three-level classification result, put it into the face large file library, and clear the face mid-level library. Finally, based on the above L3 feature file, the operation indicator data calculation, trajectory calculation, spatiotemporal aggregation calculation and correlation analysis calculation are performed, and the calculation results are output to the business end in the form of a business table.

[0103] Among them, the above-mentioned small-file archiving operator, medium-range archiving operator, large-file MR operator, medium-range feature operator, and large-file feature operator can be obtained from the PostgreSQL engine and then run on a server running a Cassandra database; the archiving operator and feature operator can specifically be the unified operator in the aforementioned embodiment, and the above-mentioned small-file archive, medium-range archive, and large-file archive calculation process is executed by the unified operator.

[0104] In addition, the present invention is not limited to the two-level or three-level classification described in the above embodiments. It is necessary to increase or decrease the number of classification levels according to actual conditions, and the number of levels is not limited here.

[0105] The above-mentioned specific method embodiment for counting crowd flow characteristics can solve the problem of multi-source heterogeneous data fusion calculation through FDW (Foreign-Data Wrapper), and can use the calculation mode of in-database compute to reduce the data copy process in the calculation process, which greatly improves the calculation performance. At the same time, a hierarchical face clustering method is proposed. In this method, when the specified area is large, it can be divided into multiple sub-areas, and each sub-area is counted first, and then the entire specified area is counted based on the statistical results of each sub-area; compared with the existing method of counting based on all data in the area, this multi-level statistical method helps to reduce the amount of statistical data calculation and improve the calculation efficiency, so that the crowd flow characteristics can be counted in real time.

[0106] Corresponding to the above-mentioned method embodiment for counting the characteristics of human flow, the embodiment of the present invention further provides a device for counting the characteristics of human flow, such as Fig.11 As shown, the device comprises:

[0107] The feature data acquisition module 111 is used to acquire feature data of the face image of each sub-region in the specified region;

[0108] The feature data classification module 112 is used to classify and count the feature data corresponding to each sub-region to obtain a primary classification result corresponding to each sub-region; wherein, in the primary classification result, the feature data of the face image of the same person belongs to the same category;

[0109] The category quantity judgment module 113 is used to count the first-level classification results of the target sub-region into the current second-level classification results of the designated region to obtain the second-level classification results after statistics if there is a target sub-region in the sub-region where the number of categories in the first-level classification results meets the first preset number threshold;

[0110] The crowd flow feature determination module 114 is used to determine the crowd flow features of the designated area according to the statistical secondary classification results.

[0111] Furthermore, the feature data classification module is also used to: for each feature data in the primary classification result of the target sub-area, perform similarity matching between the current feature data and the secondary classification result of the specified area; if there is target feature data in the secondary classification result whose similarity meets a preset similarity threshold, classify the current feature data into the category to which the target feature data belongs; if there is no target feature data in the secondary classification result whose similarity meets the preset similarity threshold, create a new category and classify the current feature data into the newly created category.

[0112] Furthermore, the feature data classification module is also used to process the secondary classification results of the designated area in blocks according to a preset parallelism to obtain a plurality of block data; and perform similarity matching between the current feature data and each block data.

[0113] Furthermore, the above-mentioned device also includes: a mean feature calculation module, which is used to calculate the mean feature of each feature data in a class classification result of the current sub-region for each sub-region; determine the mean feature as the regional feature of the current sub-region; and a classification result clearing module, which is used to clear the class classification result corresponding to the current sub-region.

[0114] Furthermore, the above-mentioned crowd flow feature determination module is also used for at least one of the following: calculating the total crowd flow in the specified area based on the statistical secondary classification results; counting the crowd flow corresponding to the specified crowd flow feature attribute in the specified area based on the statistical secondary classification results; determining the hot spot area in the specified area based on the statistical secondary classification results; wherein the hot spot area is an area with a crowd flow higher than a second preset number threshold; calculating the mean feature and / or median feature of each feature data in the secondary classification results to obtain a calculation result; and determining the calculation result as the regional feature of the specified area.

[0115] Furthermore, the above-mentioned device is arranged on a server running a Cassandra database; the Cassandra database is connected to a PostgreSQL engine for communication; the Cassandra database is used to store face images, primary classification results and secondary classification results;

[0116] Furthermore, the above-mentioned device also includes: a statistical calculator acquisition module, which is used to obtain a statistical calculator through a PostgreSQL engine; a statistical calculator execution module, which is used to run the statistical calculator on a server running a Cassandra database, and execute the method of statistically analyzing crowd flow characteristics through the statistical calculator.

[0117] An embodiment of the present invention provides a device for counting crowd flow characteristics, which first obtains the characteristic data of the face image of each sub-region in the specified area; then classifies and counts the characteristic data corresponding to each sub-region to obtain the first-level classification result corresponding to each sub-region; if there is a target sub-region in the sub-region whose number of categories in the first-level classification result meets the first preset number threshold, the first-level classification result of the target sub-region is counted into the current second-level classification result of the specified area to obtain the second-level classification result after counting; finally, the crowd flow characteristics of the specified area are determined according to the second-level classification result after counting. In this method, when the scope of the specified area is large, it can be divided into multiple sub-regions, and each sub-region is counted first, and then the entire specified area is counted based on the statistical results of each sub-region; compared with the existing method of counting based on all data in the area, this multi-level statistical method helps to reduce the amount of statistical data calculation and improves the calculation efficiency, so that the crowd flow characteristics can be counted in real time.

[0118] The device for counting crowd flow characteristics provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment for counting crowd flow characteristics. For the sake of brief description, for matters not mentioned in the embodiment of the device for counting crowd flow characteristics, reference may be made to the corresponding contents in the aforementioned traffic scheduling method embodiment.

[0119] The embodiment of the present invention also provides a server, see Fig.12 As shown, it includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned method for counting human flow characteristics.

[0120] Further, Fig.12 The server shown also includes a bus 132 and a communication interface 133 , and the processor 130 , the communication interface 133 and the memory 131 are connected via the bus 132 .

[0121] The memory 131 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 133 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 132 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0122] The processor 130 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 130. The above processor 130 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131 and completes the steps of the method of the above embodiment in combination with its hardware.

[0123] An embodiment of the present invention further provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned method of counting crowd flow characteristics. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0124] The computer program product of the method and device for counting crowd flow characteristics and the server provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.

[0125] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0126] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for calculating the characteristics of human flow, characterized in that: The method comprises: Obtain feature data of the face image of each sub-region in the specified region; Classify and count the feature data corresponding to each of the sub-regions to obtain a primary classification result corresponding to each of the sub-regions; wherein, in the primary classification result, the feature data of the face image of the same person belongs to the same category; If there is a target sub-region in the sub-region where the number of categories in the primary classification result meets the first preset number threshold, the primary classification result of the target sub-region is counted into the current secondary classification result of the designated region, and the feature data of repeated face images are filtered by clustering, cyclic updating or classifier to obtain the statistical secondary classification result; Determine the crowd flow characteristics of the designated area according to the statistical secondary classification results; the crowd flow characteristics include: the total crowd flow of the designated area, the crowd flow corresponding to the designated crowd flow characteristic attributes, the hot spot area and the regional characteristics; The step of adding the primary classification result of the target sub-area to the current secondary classification result of the designated area includes: for each feature data in the primary classification result of the target sub-area, performing similarity matching between the current feature data and the secondary classification result of the designated area; if there is target feature data in the secondary classification result whose similarity meets a preset similarity threshold, classifying the current feature data into the category to which the target feature data belongs; if there is no target feature data in the secondary classification result whose similarity meets the preset similarity threshold, creating a new category and classifying the current feature data into the newly created category.

2. The method according to claim 1, characterized in that The step of performing similarity matching between the current feature data and the secondary classification result of the designated area includes: According to a preset parallelism, the secondary classification result of the specified area is processed in blocks to obtain a plurality of block data; The current feature data is matched with each of the block data respectively for similarity.

3. The method according to claim 1, characterized in that After the step of obtaining the primary classification result of each sub-region, the method further comprises: For each of the sub-regions, calculating the mean feature of each feature data in the primary classification result of the current sub-region; determining the mean feature as the regional feature of the current sub-region; Clear the primary classification result corresponding to the current sub-region.

4. The method according to claim 1, characterized in that: The step of determining the pedestrian flow characteristics of the designated area according to the statistical secondary classification results includes: Calculate the total flow of people in the designated area according to the statistical secondary classification results; According to the statistical secondary classification results, counting the flow of people corresponding to the specified flow characteristic attribute in the specified area; Determine a hotspot area in the designated area according to the statistical secondary classification results; wherein the hotspot area is an area where the flow of people is higher than a second preset number threshold; The mean feature and / or median feature of each feature data in the secondary classification result is calculated to obtain a calculation result; and the calculation result is determined as the regional feature of the designated area.

5. The method according to any one of claims 1 to 4, characterized in that: The method is applied to a server running a Cassandra database; the Cassandra database is communicatively connected to a PostgreSQL engine; the Cassandra database is used to store face images, the primary classification results, and the secondary classification results; Before the step of acquiring feature data of the facial image of each sub-region within the specified area, the method further includes: Obtain statistical calculators through the PostgreSQL engine; The statistical calculator is run on the server running the Cassandra database, and the method for counting the characteristics of human flow is executed by the statistical calculator.

6. A device for counting the characteristics of human flow, characterized in that: The device comprises: A feature data acquisition module, used to acquire feature data of the face image of each sub-region in the specified region; A feature data classification module is used to classify and count the feature data corresponding to each of the sub-regions to obtain a primary classification result corresponding to each of the sub-regions; wherein, in the primary classification result, the feature data of the face image of the same person belongs to the same category; A category quantity judgment module is used for, if there is a target sub-region in the sub-region whose category quantity in the primary classification result meets a first preset quantity threshold, counting the primary classification result of the target sub-region into the current secondary classification result of the designated region, and filtering the feature data of repeated face images by clustering, cyclic updating or classifier to obtain the statistical secondary classification result; A crowd flow feature determination module is used to determine the crowd flow features of the designated area according to the statistical secondary classification results; the crowd flow features include: the total crowd flow of the designated area, the crowd flow corresponding to the designated crowd flow feature attributes, hot spots and regional features; The feature data classification module is also used to: for each feature data in the primary classification result of the target sub-area, perform similarity matching between the current feature data and the secondary classification result of the designated area; if there is target feature data in the secondary classification result whose similarity meets a preset similarity threshold, classify the current feature data into the category to which the target feature data belongs; if there is no target feature data in the secondary classification result whose similarity meets the preset similarity threshold, create a new category and classify the current feature data into the newly created category.

7. The device according to claim 6, characterized in that The feature data classification module is also used for: According to a preset parallelism, the secondary classification result of the specified area is processed in blocks to obtain a plurality of block data; The current feature data is matched with each of the block data respectively for similarity.

8. The device according to claim 6, characterized in that The device also includes: A mean feature calculation module, used to calculate, for each of the sub-regions, the mean feature of each feature data in the primary classification result of the current sub-region; and determine the mean feature as the region feature of the current sub-region; The classification result clearing module is used to clear the primary classification result corresponding to the current sub-region.

9. A server, characterized in that: The method comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for counting human flow characteristics as described in any one of claims 1 to 5.

10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the method for counting human flow characteristics according to any one of claims 1 to 5.