Method, device, equipment and medium for counting human traffic

Through the generative adversarial network, the problem of errors in traffic statistics in the prior art is solved, and the accuracy of face recognition and statistics is improved.

CN112733682BActive Publication Date: 2025-01-07PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011637043.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-31
Publication Date
2025-01-07
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

The prior art is difficult to recognize faces in low-resolution images, resulting in errors in traffic statistics.

Method used

Generative adversarial network is used to process low-resolution images with high resolution through generators and discriminators, and statistics are carried out through European-style distance matching and face information in preset databases to improve the accuracy of face recognition.

Benefits of technology

It effectively improves the accuracy of face recognition, reduces traffic statistics errors, and realizes accurate detection of blurred and small faces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112733682B_ABST
    Figure CN112733682B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for counting human traffic, comprising: obtaining video information corresponding to a node to be counted; preprocessing the video information to obtain preprocessed video frame information corresponding to the node to be counted; performing face detection on the preprocessed video frame information to obtain first face information and other information in each preprocessed video frame information; traversing each video frame information after face detection, inputting other information in the video frame information after face detection into a generative adversarial network, extracting second face information from the other information through the generative adversarial network; counting human traffic according to the first face information and the second face information to obtain human traffic information corresponding to the node to be counted. The present invention solves the problem of human traffic counting errors caused by the inability to recognize faces in low-resolution images in the prior art, and greatly improves the accuracy of human traffic counting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a method, device, equipment and medium for counting human traffic. Background Art

[0002] The existing technology uses computer vision-based face recognition technology to count the flow of people in dense environments. The statistical process includes feature extraction, face discrimination and quantity statistics of face information appearing in the surveillance video. Among them, face recognition involves face recognition in continuous image motion features and face recognition in scenes with high crowd density. For low-resolution and blurred images, it is difficult to recognize smaller faces in the image, resulting in obvious statistical errors. Summary of the invention

[0003] The embodiments of the present invention provide a method, device, equipment and medium for counting human flow, so as to solve the problem of human flow counting errors caused by the inability to recognize human faces in low-resolution images in the prior art.

[0004] A method for counting human traffic, comprising:

[0005] Get the video information corresponding to the node to be counted;

[0006] Preprocessing the video information to obtain preprocessed video frame information corresponding to the node to be counted;

[0007] Performing face detection on the preprocessed video frame information to obtain first face information in each preprocessed video frame information and other information except the first face information;

[0008] Traversing each video frame information after face detection, inputting the remaining information in the video frame information after face detection into a generative adversarial network, and extracting second face information from the remaining information through the generative adversarial network;

[0009] Human flow statistics are performed according to the first face information and the second face information to obtain human flow information corresponding to the node to be counted.

[0010] Optionally, the preprocessing the video information to obtain the preprocessed video frame information corresponding to the node to be counted includes:

[0011] Traversing each video frame information in the video information to obtain the clarity of the video frame information;

[0012] comparing the clarity with a preset clarity threshold;

[0013] When the definition is greater than or equal to the preset definition threshold, retain the video frame information, otherwise delete the video frame information;

[0014] When the number of retained video frame information reaches a preset number threshold, noise reduction processing and illumination adjustment are performed on each retained video frame information.

[0015] Optionally, the generative adversarial network includes a generator and a first discriminator, and traversing each video frame information after face detection, inputting the remaining information in the video frame information after face detection into the generative adversarial network, and extracting the second face information from the remaining information through the generative adversarial network includes:

[0016] For each video frame information after face detection, the remaining information in the video frame information after face detection is input into the generator, and the generator generates a corresponding high-resolution image according to the remaining information;

[0017] The high-resolution image is input to the first discriminator, and the second face information is extracted from the high-resolution image by the first discriminator.

[0018] Optionally, the generative adversarial network further includes a second discriminator, and after the generator generates a corresponding high-resolution image according to the remaining information, the method includes:

[0019] Inputting the high-resolution image corresponding to the remaining information into the second discriminator, and performing authenticity judgment on the high-resolution image by the second discriminator to obtain a judgment result of the high-resolution image;

[0020] The high-resolution image and its judgment result are used as training data to train the generator in the generative adversarial network.

[0021] Optionally, performing human flow statistics according to the first face information and the second face information to obtain human flow information corresponding to the node to be counted includes:

[0022] For a preprocessed video frame information, calculating the Euclidean distance between the first face information and each face information in a preset database;

[0023] If the Euclidean distance is greater than a preset distance threshold, the flow of people information corresponding to the node to be counted is increased by 1, and the first face information and the second face information are added to the preset database;

[0024] If the Euclidean distance is less than or equal to the preset distance threshold, the flow information of people corresponding to the node to be counted is not updated; and,

[0025] For a preprocessed video frame information, calculating the Euclidean distance between the second face information and each face information in a preset database;

[0026] If the Euclidean distance is greater than a preset distance threshold, the human flow information corresponding to the node to be counted is increased by 1, and the second face information is added to the preset database;

[0027] If the Euclidean distance is less than or equal to the preset distance threshold, the flow information of people corresponding to the node to be counted is not updated;

[0028] The pre-processed video frame information corresponding to the node to be counted is traversed to obtain the human flow information corresponding to the node to be counted.

[0029] Optionally, obtaining video information corresponding to the node to be counted includes:

[0030] Get video information;

[0031] The video information is intercepted at a preset time interval to obtain a number of nodes to be counted and their corresponding video information.

[0032] A device for counting human traffic, comprising:

[0033] The acquisition module is used to obtain the video information corresponding to the node to be counted;

[0034] A preprocessing module, used to preprocess the video frame information to obtain the preprocessed video information corresponding to the node to be counted;

[0035] A face detection module, used to perform face detection on the preprocessed video frame information, and obtain the first face information in each preprocessed video frame information and other information except the first face information;

[0036] An extraction module, configured to traverse each video frame information after face detection, input the remaining information in the video frame information after face detection into a generative adversarial network, and extract second face information from the remaining information through the generative adversarial network;

[0037] The statistics module is used to perform human flow statistics based on the first face information and the second face information to obtain human flow information corresponding to the node to be counted.

[0038] Optionally, the generative adversarial network includes a generator and a first discriminator, and the extraction module includes:

[0039] A generating unit, configured to input the remaining information in each video frame information after face detection into the generator, and generate a corresponding high-resolution image according to the remaining information through the generator;

[0040] The extraction unit is used to input the high-resolution image into the first discriminator, and extract the second face information from the high-resolution image through the first discriminator.

[0041] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for counting human flow when executing the computer program.

[0042] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for counting human flow is implemented.

[0043] The embodiment of the present invention obtains video information corresponding to the node to be counted; preprocesses the video information to obtain preprocessed video frame information corresponding to the node to be counted; performs face detection on the preprocessed video frame information to obtain first face information and remaining information in each video frame information; traverses each video frame information, inputs the remaining information in the video frame information into a generative adversarial network, and extracts second face information from the remaining information through the generative adversarial network; performs face statistics based on the first face information and the second face information to obtain the crowd flow information corresponding to the node to be counted; thereby realizing face recognition in low-resolution images, improving the accuracy of face recognition, and further improving the accuracy of crowd flow statistics. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0045] Figure 1 is a flow chart of a method for counting human traffic in one embodiment of the present invention;

[0046] Figure 2 is a flow chart of step S101 in a method for counting human flow in one embodiment of the present invention;

[0047] Figure 3 is a flow chart of step S102 in a method for counting human flow in one embodiment of the present invention;

[0048] Figure 4 is a flow chart of step S104 in a method for counting human flow in one embodiment of the present invention;

[0049] Figure 5 is a flow chart of step S104 in a method for counting human flow in another embodiment of the present invention;

[0050] Figure 6 is a flow chart of step S105 in a method for counting human flow in one embodiment of the present invention;

[0051] Figure 7 is a flowchart of step S105 in a method for counting human flow in another embodiment of the present invention.

[0052] Figure 8 It is a principle block diagram of a device for counting human flow in one embodiment of the present invention;

[0053] Fig. 9 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] This embodiment provides a method for counting human traffic. The following is a detailed description of the method for counting human traffic provided by this embodiment. Figure 1 As shown, the method for counting the flow of people includes:

[0056] In step S101, video information corresponding to the node to be counted is obtained.

[0057] Here, the node to be counted refers to a time node where human traffic statistics are required. In the embodiment of the present invention, based on a preset time interval, a plurality of nodes to be counted are obtained by intercepting video information. Each node to be counted corresponds to a segment of video information, and the segment of video information is composed of a plurality of video frame information. Optionally, as a preferred example of the present invention, Figure 2 As shown, the step S101 further includes:

[0058] In step S1011, video information is acquired.

[0059] Optionally, the video information is live video information collected in real time by a camera installed in a place with dense flow of people, including but not limited to subway entrances and exits, streets or sports stadiums.

[0060] In step S1012, the video information is intercepted at a preset time interval to obtain a number of nodes to be counted and their corresponding video information.

[0061] Here, the embodiment of the present invention sets a fixed duration as the time interval according to the statistical requirements, and then intercepts a plurality of continuous video frame information corresponding to a time node every the fixed duration. The plurality of continuous video frame information corresponding to one time node is used as the video information corresponding to a node to be counted, thereby obtaining a plurality of nodes to be counted and their corresponding video information. Then, the flow of people is counted according to the nodes to be counted.

[0062] In step S102, the video information is preprocessed to obtain preprocessed video frame information corresponding to the node to be counted.

[0063] For the video frame information in the node to be counted, the embodiment of the present invention pre-processes each video frame information through image pre-processing technology to improve the operability of subsequent face recognition. Optionally, as a preferred example of the present invention, the pre-processing includes but is not limited to clarity detection, noise reduction processing and lighting adjustment. Figure 3 FIG. 1 is a flowchart of the implementation of step S102 provided in an embodiment of the present invention. Figure 3 As shown, the step S102 further includes:

[0064] In step S1021, each video frame information in the video information is traversed to obtain the definition of the video frame information.

[0065] Here, the embodiment of the present invention adopts an edge detection algorithm to obtain the clarity corresponding to the video frame information, so as to realize the clarity detection of the video frame information.

[0066] In step S1022, the clarity is compared with a preset clarity threshold.

[0067] In the embodiment of the present invention, a clarity threshold is preset. The clarity threshold is used as a criterion for judging whether the clarity of the video frame information meets the standard. During preprocessing, the clarity of the video frame information obtained in step S1021 is compared with the clarity threshold to judge whether the video frame information has a relatively serious blur problem.

[0068] In step S1023, when the definition is greater than or equal to the preset definition threshold, the video frame information is retained.

[0069] Here, when the clarity is greater than or equal to the preset clarity threshold, it indicates that the video frame information does not have a serious blur problem and the clarity meets the standard, and the video frame information is retained.

[0070] In step S1024, when the definition is less than the preset definition threshold, the video frame information is deleted.

[0071] When the clarity is less than the preset clarity threshold, it indicates that the video frame information has a serious blur problem, and the video frame information is deleted.

[0072] Continue to obtain the next video frame information in the node to be counted to perform clarity judgment until all video frame information in the node to be counted is traversed.

[0073] In step S1025, when the number of retained video frame information reaches a preset number threshold, noise reduction processing and illumination adjustment are performed on each retained video frame information.

[0074] The embodiment of the present invention counts the video frame information retained after the clarity detection. When the number of the retained video frame information is greater than or equal to a preset number threshold, such as 10, the retained video frame information is taken as a series, and noise reduction processing and lighting adjustment are performed on each video frame information in the series. The noise reduction processing refers to reducing the noise in the video frame information. The lighting adjustment refers to changing the brightness in the video frame information. The video frame information after the clarity detection, noise reduction processing and lighting adjustment is used as the pre-processed video frame information.

[0075] The embodiment of the present invention pre-processes the video frame information corresponding to the node to be counted and removes the video frame information that does not meet the clarity requirement, which is beneficial to improving the accuracy of subsequent face recognition and ensuring that the number of video frame information corresponding to the node to be counted after pre-processing is not less than a preset number threshold, which is beneficial to improving the accuracy of human flow statistics.

[0076] In step S103, face detection is performed on the preprocessed video frame information to obtain first face information in each preprocessed video frame information and other information except the first face information.

[0077] The embodiment of the present invention pre-sets several feature templates of different sizes to perform face detection on video frame information. Face detection is performed starting from the first frame image in the preprocessed video frame information, and the video frame information is cropped according to the result of the face detection to obtain first face information and remaining information. The first face information refers to image data that is detected as containing a face, and the remaining information refers to image data that is detected as not containing a face. Among them, for the remaining information, the embodiment of the present invention further extracts misjudged face information from it through a generative adversarial network.

[0078] In step S104, each video frame information after face detection is traversed, and the remaining information in the video frame information after face detection is input into a generative adversarial network, and the second face information is extracted from the remaining information through the generative adversarial network.

[0079] Here, the generative adversarial network refers to a deep learning model. The model optimizes the output through the mutual game learning of at least two modules in the framework: the generator (Generative Model) and the discriminator (Discriminative Model). In an embodiment of the present invention, the generative adversarial network includes a generator and a first discriminator, and the generator is used to perform high-resolution processing on the input image to generate a high-resolution image corresponding to the input image. The first discriminator is used to extract the second face information from the high-resolution image to achieve secondary extraction of face information. Optionally, as a preferred example of the present invention, Figure 4 As shown, step S104 also includes:

[0080] In step S1041, for each video frame information after face detection, the remaining information in the video frame information after face detection is input into the generator, and the generator generates a corresponding high-resolution image according to the remaining information.

[0081] Through the extraction of step S103, the face information and other information in each video frame information can be obtained. When the resolution of the video frame information is low or the face is small, the actual face information is likely to be detected as other information. In order to correct this misjudgment, the embodiment of the present invention further inputs the other information into the generator in the generative adversarial network. In the embodiment of the present invention, the generator uses super-resolution and refinement sub-networks to perform high-resolution processing or deblurring processing on the other information, and generates a high-resolution image corresponding to the other information, so that the other information becomes clearer.

[0082] In step S1042, the high-resolution image is input to the first discriminator, and the second face information is extracted from the high-resolution image by the first discriminator.

[0083] The embodiment of the present invention further extracts second facial information from the high-resolution image through the first discriminator, thereby achieving secondary extraction of facial information, reducing misjudgment of facial information, and facilitating improving the accuracy of human flow statistics.

[0084] Optionally, in order to improve the accuracy of the generator in generating high-resolution images, the embodiment of the present invention further trains the generator using the high-resolution images as feedback. The generative adversarial network also includes a second discriminator, which is used to determine whether the high-resolution image generated by the generator is a real image, so as to realize the authenticity judgment of the high-resolution image. As a preferred example of the present invention, Figure 5 As shown, after the generator generates a corresponding high-resolution image according to the remaining information in step S1041, the method further includes:

[0085] In step S1043, the high-resolution image corresponding to the remaining information is input into the second discriminator, and the authenticity of the high-resolution image is judged by the second discriminator to obtain a judgment result of the high-resolution image.

[0086] In the embodiment of the present invention, the input of the second discriminator is the high-resolution image corresponding to the remaining information, and the output is the judgment result, which includes whether the high-resolution image is a real image or the high-resolution image is not a real image. The second discriminator performs authenticity judgment by detecting whether there are defects such as image deformity and distortion in the high-resolution image. If there are defects such as image deformity and distortion in the high-resolution image, it is considered that it is not a real image.

[0087] In step S1044, the high-resolution image and its judgment result are used as training data to train the generator in the generative adversarial network.

[0088] Here, the embodiment of the present invention uses a second discriminator to perform quality inspection on the effect of the generator generating high-resolution images, and feeds the high-resolution images and their judgment results as training data back to the generative adversarial network. The generator is continuously trained through the generative adversarial network to optimize the performance of the generator, which is beneficial to improving the effect of the generator generating high-resolution images, thereby improving the accuracy of secondary extraction of facial information.

[0089] Traverse each pre-processed video frame information corresponding to the node to be counted, repeat steps S1041 to S1044, and extract the second face information from the remaining information corresponding to each video frame information through the generative adversarial network. The first face information obtained by face detection in step S103 and the second face information extracted by the generative adversarial network in step S104 are used together for crowd flow statistics.

[0090] In step S105, human flow statistics are performed based on the first face information and the second face information to obtain human flow information corresponding to the node to be counted.

[0091] In the embodiment of the present invention, the flow of people statistics is based on the flow of people information corresponding to the previous node to be counted, and the flow of people increment of the node to be counted is obtained based on the matching between the face information and the face information stored in the preset database. Figure 6 As shown, the step S105 further includes:

[0092] In step S1051, for a pre-processed video frame information, the Euclidean distance between the first face information and each face information in a preset database is calculated.

[0093] Here, the embodiment of the present invention compares the first face information in the video frame information with the face information in the preset database for each video frame information. Specifically, the Euclidean distance between the first face information in the video frame information and the face information in the preset database is calculated to obtain the degree of difference between the first face information in the video frame information and the face information in the preset database. Then the Euclidean distance is compared with a preset distance threshold. Among them, the preset distance threshold is used as a judgment standard for whether the first face information in the video frame information coincides with the face information in the preset database, and is set according to actual needs and experience.

[0094] In step S1052, if the Euclidean distance is greater than a preset distance threshold, the human flow information corresponding to the node to be counted is increased by 1, and the first face information is added to the preset database.

[0095] If the Euclidean distance is greater than the preset distance threshold, it indicates that the first face information in the video frame information does not overlap with the face information in the preset database, and the crowd flow information is increased by 1 to update the crowd flow statistics result. Since the face information has been matched and included in the crowd flow information, the embodiment of the present invention also adds the first face information to the preset database to avoid repeated statistics.

[0096] In step S1053, if the Euclidean distance is less than or equal to the preset distance threshold, the human flow information corresponding to the node to be counted is not updated.

[0097] If the Euclidean distance is less than or equal to the preset distance threshold, it indicates that the first face information in the video frame information overlaps with the face information in the preset database, and the face information has been previously counted in the human flow and is no longer counted in the human flow this time.

[0098] In step S1054, the pre-processed video frame information corresponding to the node to be counted is traversed.

[0099] For each pre-processed video frame information corresponding to the node to be counted, the above steps S1051 to S1053 are repeated until the matching of the first face information in each video frame information is completed. Figure 7 As shown, the step S105 further includes:

[0100] In step S701, for a preprocessed video frame information, the Euclidean distance between the second face information and each face information in a preset database is calculated;

[0101] In step S702, if the Euclidean distance is greater than a preset distance threshold, the human flow information corresponding to the node to be counted is increased by 1, and the second face information is added to the preset database;

[0102] In step S703, if the Euclidean distance is less than or equal to the preset distance threshold, the flow information of people corresponding to the node to be counted is not updated;

[0103] In step S704, the pre-processed video frame information corresponding to the node to be counted is traversed.

[0104] The above steps S701 to S704 are the same as the above step S1051 referring to step S1054. For details, please refer to the description of the above embodiment, which will not be repeated here. The embodiment of the present invention obtains the flow increment corresponding to the node to be counted by matching the first face information and the second face information corresponding to the node to be counted, and the finally updated flow information is the flow information corresponding to the node to be counted. The flow information corresponding to the node to be counted will be used for the next node to be counted to perform flow statistics.

[0105] The embodiment of the present invention introduces a generative adversarial network on the basis of traditional face detection. The generator generates high-resolution images, and the first discriminator performs secondary extraction of face information. This can effectively improve the face detection accuracy in crowded scenes and the detection accuracy of blurred small faces. The generated high-resolution images are conducive to more accurate matching with the face information in a preset database, thereby achieving accurate statistics of pedestrian flow, effectively reducing the errors in pedestrian flow statistics caused by the inability to distinguish blurred and small face images, and solving the problem of errors in pedestrian flow statistics caused by the inability to recognize faces in low-resolution images in the prior art.

[0106] It should be understood that the order of execution of the steps in the above embodiment does not necessarily 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 embodiment of the present invention.

[0107] In one embodiment, a device for counting human flow is provided, and the device for counting human flow corresponds one-to-one to the method for counting human flow in the above embodiment. Figure 8 As shown, the human flow statistics device includes an acquisition module 81, a preprocessing module 82, a face detection module 83, an extraction module 84, and a statistics module 85. The detailed description of each functional module is as follows:

[0108] An acquisition module 81 is used to acquire video information corresponding to the node to be counted;

[0109] A preprocessing module 82 is used to preprocess the video information to obtain preprocessed video frame information corresponding to the node to be counted;

[0110] A face detection module 83 is used to perform face detection on the preprocessed video frame information to obtain the first face information and other information except the first face information in each preprocessed video frame information;

[0111] An extraction module 84 is used to traverse each video frame information after face detection, input the remaining information in the video frame information after face detection into a generative adversarial network, and extract second face information from the remaining information through the generative adversarial network;

[0112] The statistical module 85 is used to perform human flow statistics based on the first face information and the second face information to obtain human flow information corresponding to the node to be counted.

[0113] Optionally, the preprocessing module 82 includes:

[0114] A definition acquisition unit, used for traversing each video frame information in the video information to acquire the definition of the video frame information;

[0115] A comparison unit, configured to compare the clarity with a preset clarity threshold;

[0116] A retaining / deleting unit, configured to retain the video frame information when the definition is greater than or equal to the preset definition threshold, and otherwise delete the video frame information;

[0117] The processing unit is used to perform noise reduction processing and illumination adjustment on each retained video frame information when the number of retained video frame information reaches a preset number threshold.

[0118] Optionally, the generative adversarial network includes a generator and a first discriminator, and the extraction module 84 includes:

[0119] A generating unit, configured to input the remaining information in each video frame information after face detection into the generator, and generate a corresponding high-resolution image according to the remaining information through the generator;

[0120] The extraction unit is used to input the high-resolution image into the first discriminator, and extract the second face information from the high-resolution image through the first discriminator.

[0121] Optionally, the generative adversarial network further includes a second discriminator, and the extraction module 84 further includes:

[0122] an authenticity judgment unit, configured to input the high-resolution image corresponding to the remaining information into the second discriminator, and perform authenticity judgment on the high-resolution image through the second discriminator to obtain a judgment result of the high-resolution image;

[0123] A training unit is used to train the generator in the generative adversarial network by using the high-resolution image and its judgment result as training data.

[0124] Optionally, the statistics module 85 further includes:

[0125] A first calculation unit, configured to calculate, for a preprocessed video frame information, a Euclidean distance between the first face information and each face information in a preset database;

[0126] A first statistical unit, configured to, if the Euclidean distance is greater than a preset distance threshold, add 1 to the human flow information corresponding to the node to be counted, and add the first face information to the preset database;

[0127] A second statistical unit, configured to not update the human flow information corresponding to the node to be counted if the Euclidean distance is less than or equal to the preset distance threshold;

[0128] A first traversal unit, used for traversing the pre-processed video frame information corresponding to the node to be counted;

[0129] A second calculation unit is used to calculate the Euclidean distance between the second face information and each face information in a preset database for a preprocessed video frame information;

[0130] A second statistical unit, configured to, if the Euclidean distance is greater than a preset distance threshold, add 1 to the human flow information corresponding to the node to be counted, and add the second face information to the preset database;

[0131] A third statistical unit, configured to not update the human flow information corresponding to the node to be counted if the Euclidean distance is less than or equal to the preset distance threshold;

[0132] The second traversal unit is used to traverse the pre-processed video frame information corresponding to the node to be counted.

[0133] Optionally, the acquisition module 81 includes:

[0134] An acquisition unit, used for acquiring video information;

[0135] The interception unit is used to intercept the video information at a preset time interval to obtain a number of nodes to be counted and their corresponding video information.

[0136] The specific definition of the human flow statistics device can be found in the definition of the human flow statistics method mentioned above, which will not be repeated here. Each module in the above human flow statistics device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0137] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for counting human flow is implemented.

[0138] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0139] Get the video information corresponding to the node to be counted;

[0140] Preprocessing the video information to obtain preprocessed video frame information corresponding to the node to be counted;

[0141] Performing face detection on the preprocessed video frame information to obtain first face information in each preprocessed video frame information and other information except the first face information;

[0142] Traversing each video frame information after face detection, inputting the remaining information in the video frame information after face detection into a generative adversarial network, and extracting second face information from the remaining information through the generative adversarial network;

[0143] Human flow statistics are performed according to the first face information and the second face information to obtain human flow information corresponding to the node to be counted.

[0144] The user information used in this application is obtained through conventional legal means and is only used in scenarios specified by corresponding laws and regulations.

[0145] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0146] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. 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.

[0147] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for counting human traffic, characterized in that: include: Get the video information corresponding to the node to be counted; Preprocess the video information to obtain the preprocessed video frame information corresponding to the node to be counted, traverse each video frame information in the video information to obtain the clarity of the video frame information; compare the clarity with a preset clarity threshold; when the clarity is greater than or equal to the preset clarity threshold, retain the video frame information, otherwise delete the video frame information; when the number of retained video frame information reaches a preset number threshold, perform noise reduction processing and lighting adjustment on each retained video frame information; Performing face detection on the preprocessed video frame information to obtain first face information in each preprocessed video frame information and other information except the first face information, wherein the other information refers to image data that does not contain a face after face detection; Traversing each video frame information after face detection, inputting the remaining information in the video frame information after face detection into a generative adversarial network, extracting second face information from the remaining information through the generative adversarial network, for each video frame information after face detection, inputting the remaining information in the video frame information after face detection into a generator, and generating a corresponding high-resolution image according to the remaining information through the generator; inputting the high-resolution image into a first discriminator, and extracting second face information from the high-resolution image through the first discriminator; Human flow statistics are performed according to the first face information and the second face information to obtain human flow information corresponding to the node to be counted.

2. The method for counting human traffic according to claim 1, characterized in that: The generative adversarial network further includes a second discriminator. After the generator generates a corresponding high-resolution image according to the remaining information, the method includes: Inputting the high-resolution image corresponding to the remaining information into the second discriminator, and performing authenticity judgment on the high-resolution image by the second discriminator to obtain a judgment result of the high-resolution image; The high-resolution image and its judgment result are used as training data to train the generator in the generative adversarial network.

3. The method for counting human traffic according to any one of claims 1 to 2, characterized in that: The performing of human flow statistics according to the first face information and the second face information to obtain human flow information corresponding to the node to be counted includes: For a preprocessed video frame information, calculating the Euclidean distance between the first face information and each face information in a preset database; If the Euclidean distance is greater than a preset distance threshold, the flow of people information corresponding to the node to be counted is increased by 1, and the first face information is added to the preset database; If the Euclidean distance is less than or equal to the preset distance threshold, the flow information of people corresponding to the node to be counted is not updated; and, For a preprocessed video frame information, calculating the Euclidean distance between the second face information and each face information in a preset database; If the Euclidean distance is greater than a preset distance threshold, the human flow information corresponding to the node to be counted is increased by 1, and the second face information is added to the preset database; If the Euclidean distance is less than or equal to the preset distance threshold, the flow information of people corresponding to the node to be counted is not updated; The pre-processed video frame information corresponding to the node to be counted is traversed to obtain the human flow information corresponding to the node to be counted.

4. The method for counting human traffic according to claim 3, characterized in that: The step of obtaining video information corresponding to the node to be counted includes: Get video information; The video information is intercepted at a preset time interval to obtain a number of nodes to be counted and their corresponding video information.

5. A device for counting human traffic, characterized in that: The device comprises: The acquisition module is used to obtain the video information corresponding to the node to be counted; A preprocessing module is used to preprocess the video information to obtain the preprocessed video information corresponding to the node to be counted, traverse each video frame information in the video information, and obtain the clarity of the video frame information; compare the clarity with a preset clarity threshold; when the clarity is greater than or equal to the preset clarity threshold, retain the video frame information, otherwise delete the video frame information; when the number of retained video frame information reaches a preset number threshold, perform noise reduction processing and lighting adjustment on each retained video frame information; A face detection module is used to perform face detection on the preprocessed video frame information to obtain first face information in each preprocessed video frame information and other information except the first face information, wherein the other information refers to image data that does not contain a face after face detection; An extraction module is used to traverse each video frame information after face detection, input the remaining information in the video frame information after face detection into a generative adversarial network, and extract the second face information from the remaining information through the generative adversarial network. The generative adversarial network includes a generator and a first discriminator. The extraction module includes: a generation unit, for each video frame information after face detection, input the remaining information in the video frame information after face detection into the generator, and generate a corresponding high-resolution image according to the remaining information through the generator; an extraction unit, for inputting the high-resolution image into the first discriminator, and extracting the second face information from the high-resolution image through the first discriminator; The statistics module is used to perform human flow statistics based on the first face information and the second face information to obtain human flow information corresponding to the node to be counted.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for counting human flow as described in any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for counting human flow as claimed in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Image processing method and image processing device

    CN105447824A

  • Pedestrian volume statistical method and device

    CN110738137A