Passenger flow statistical method and device, computer equipment and storage medium
By using head detection, tracking and face recognition technologies in passenger flow statistics, the problem of inaccurate passenger flow statistics caused by turning or bowing people is solved, and higher accuracy and reliability of statistical results are achieved.
Patent Information
- Application Number
- CN202411779026.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-05
AI Technical Summary
The passenger flow statistics method based on face detection and tracking fails to effectively deal with the failure to recognize and track the face caused by turning or bowing the head, resulting in low accuracy of the passenger flow statistics results.
By obtaining video data of the door camera, head detection and tracking, the behavior status of the head is determined, and face recognition and feature extraction are carried out when the head image quality is qualified, and face feature value and behavior status information are saved to the passenger flow information statistics table.
It improves the accuracy of the passenger flow statistics results, prevents face recognition and tracking failure caused by turning or bowing people, and reduces face recognition errors through strict quality judgment conditions.
Smart Images

Figure CN119832487A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of passenger flow statistics, and in particular to a passenger flow statistics method, device, computer equipment and storage medium. Background Art
[0002] Traditional retail and service industries rely on customer flow to measure sales performance. By counting and analyzing customer flow, merchants can gain insights into customer behavior, optimize operational strategies, improve service quality, and ultimately achieve higher sales performance. With the advancement of artificial intelligence and video image analysis technology, the accuracy and efficiency of customer flow statistics have been significantly improved, providing a more reliable data basis for merchants to make decisions.
[0003] In the related art, there are various methods for passenger flow statistics, and a commonly used method is video-based passenger flow statistics. A method based on face detection and tracking in a video-based passenger flow statistics method is usually used to count passenger flow.
[0004] However, the method based on face detection and tracking does not take into account the situation where the face cannot be recognized or tracked due to the person turning his head or lowering his head during the tracking process, resulting in low accuracy of the passenger flow statistics results. Summary of the invention
[0005] In view of this, the present invention provides a passenger flow counting method to solve the problem in the related art that the passenger flow counting results are of low accuracy because the method based on face detection and tracking does not take into account the situation where the face cannot be recognized and the tracking fails due to the person turning his head or lowering his head during the tracking process.
[0006] In a first aspect, the present invention provides a method for counting passenger flow, the method comprising:
[0007] Acquire the first video data of the first camera at the entrance of the place to be counted;
[0008] Performing head detection on the first video data to obtain a first target head;
[0009] Tracking the first target head to obtain a first head image of the first target head;
[0010] Determining a behavior state of the first target head based on the tracking route of the first target head;
[0011] When the quality of the first head image is qualified, performing face recognition and feature extraction on the first head image to obtain a face feature value of the first target head;
[0012] Based on the behavior state of the first target head, determining the behavior state information of the first target head;
[0013] The facial feature value of the first target head and the behavior status information are saved in a passenger flow information statistics table;
[0014] Based on the passenger flow information statistics table, the passenger flow information of the place to be counted is determined.
[0015] The passenger flow counting method provided in this embodiment performs head detection on the first video data of the first camera at the entrance of the place to be counted, obtains the first target head, tracks the first target head, and obtains the first head image of the first target head, thereby preventing the situation where the face cannot be recognized and the tracking fails due to the person turning his head or lowering his head. When the quality of the first head image is qualified, face recognition and feature extraction are performed on the first head to obtain the face feature value of the first target head. By judging the quality of the head image, face recognition and feature extraction are performed when the head image quality is qualified, thereby preventing the situation where face recognition errors are caused by reasons such as the image being too small or not clear enough. Based on the tracking route of the first target head, the behavior state of the first target head is determined, and based on the behavior state of the first target head, the behavior state information of the first target head is determined, and the face feature value and behavior state information of the first target head are saved in the passenger flow information statistics table. Based on the passenger flow information statistics table, the passenger flow information of the place to be counted is determined. The accuracy of the passenger flow statistics results is improved.
[0016] In an optional implementation manner, determining the behavior state of the first target human head based on the tracking route of the first target human head includes:
[0017] When the first target person disappears from the monitoring screen of the first camera, and the tracking route of the first target person is from top to bottom in the monitoring screen, determining that the behavior state of the first target person is the store entry state;
[0018] When the first target head disappears from the monitoring screen of the first camera and the tracking route of the first target head is from bottom to top in the monitoring screen, it is determined that the behavior state of the first target head is the exit state.
[0019] The customer flow counting method provided in this embodiment determines the behavior status of the first target person based on the tracking route of the first target person, thereby accurately judging the customer's entry and exit status, improving the accuracy and reliability of customer flow statistics, and providing merchants with more valuable customer behavior data, which helps to optimize operating strategies and improve sales performance.
[0020] In an optional implementation, when the quality of the first head image is qualified, performing face recognition and feature extraction on the first head image to obtain the face feature value of the first target head includes:
[0021] The quality of the first head image is judged according to the following quality judgment conditions:
[0022] W>80,H>80
[0023]
[0024] Wherein, W is the width value of the first head image, H is the height value of the first head image, Y is the number of pixels with brightness values greater than 100 in the grayscale first head image, Gr(x, y) is the brightness value at the coordinate (x, y) in the grayscale first head image, Z is the number of pixels with gradient values of the edge detection operator greater than 50 in the grayscale first head image, and G(x, y) is the gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image;
[0025] When the first head image meets the quality judgment condition, it is determined that the quality of the first head image is qualified, and face recognition and feature extraction are performed on the first head image to obtain the face feature value of the first target head.
[0026] The passenger flow counting method provided in this embodiment ensures that only the first head image with qualified quality is used for face recognition and feature extraction through strict quality judgment conditions, which reduces the impact of low-quality images on the recognition results, thereby improving the accuracy and reliability of face recognition.
[0027] In an optional embodiment, the method further includes:
[0028] The convolution operation is performed on the grayscale first head image to obtain the gradient value of the edge detection operator in the horizontal direction and the gradient value of the edge detection operator in the vertical direction of the image block with the center coordinates (x, y) in the grayscale first head image:
[0029]
[0030] Among them, G x is the gradient value of the edge detection operator in the horizontal direction of the image block with the center coordinate (x, y) in the grayscale first head image, G y is the gradient value of the edge detection operator in the vertical direction of the image block with the central coordinates (x, y) in the grayscale first head image, and I is the image block with the central coordinates (x, y) in the grayscale first head image;
[0031] The gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image is determined by the following formula based on the gradient value of the edge detection operator in the horizontal direction and the gradient value of the edge detection operator in the vertical direction of the image block with the center coordinate (x, y) in the grayscale first head image:
[0032]
[0033] Wherein, G(x, y) is the gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image.
[0034] The passenger flow counting method provided in this embodiment obtains the gradient value of the edge detection operator in the horizontal direction and the gradient value of the edge detection operator in the vertical direction through a convolution operation, and determines the gradient value of the final edge detection operator based on these gradient values, and then judges whether the first head image meets the quality judgment condition according to the gradient value of the edge detection operator, thereby ensuring the accuracy of the quality detection of the first head image.
[0035] In an optional implementation, before saving the facial feature value of the first target head and the behavior status information to the passenger flow information statistics table, the method further includes:
[0036] Collecting facial images of employees at the places to be counted;
[0037] Extracting feature values from the employee's face image to obtain the employee's face feature values;
[0038] Saving the employee's facial feature value to the employee's facial feature data table;
[0039] The step of saving the facial feature value of the first target head and the behavior status information to a passenger flow information statistics table includes:
[0040] Comparing the facial feature value of the first target head with the facial feature value of the employee in the employee facial feature data table;
[0041] If the comparison fails, the facial feature value of the first target head is repeatedly compared with the facial feature value in the passenger flow information statistics table;
[0042] If the repeatability comparison is passed, the facial feature value of the first target head and the behavior status information are updated to the storage area corresponding to the first target head in the passenger flow information statistics table;
[0043] If the repeatability comparison fails, a storage area for the first target head is created in the passenger flow information statistics table, and the facial feature value of the first target head and the behavior status information are saved in the storage area for the first target head.
[0044] The customer flow statistics method provided in this embodiment can eliminate the situation where employees are mistaken for customers by comparing the facial feature values of the first target head with the facial feature values of employees in the employee facial feature data table, ensure that the customer flow information in the customer flow information statistics table only contains real customer data, and improve the accuracy of the statistical customer flow information.
[0045] By repeatedly comparing the facial feature values of the first target head with the facial feature values in the customer flow information statistics table, it is ensured that the information of the same customer will not be counted repeatedly, thereby improving the accuracy of the customer flow statistics results.
[0046] In an optional embodiment, the method further includes:
[0047] Acquire the second video data of the second camera in other areas of the place to be counted except the door;
[0048] Performing head detection on the second video data to obtain a second target head;
[0049] Tracking the second target head to obtain a second head image of the second target head;
[0050] Based on the tracking route of the second target head, determining the tracking start time and the tracking end time;
[0051] Determine the stay time of the second target head under the second camera based on the tracking start time and the tracking end time;
[0052] If the second head image is of qualified quality, performing face recognition and feature extraction on the second head image to obtain a face feature value of the second target head;
[0053] Comparing the facial feature value of the second target head with the facial feature value of the employee in the employee facial feature data table;
[0054] If the comparison fails, the facial feature value of the second target head is repeatedly compared with the facial feature value in the passenger flow information statistics table;
[0055] If the repeatability comparison is passed, the facial feature value of the second target head and the residence time of the second target head under the second camera are updated to the storage area corresponding to the second target head in the passenger flow information statistical table.
[0056] The customer flow statistics method provided in this embodiment obtains the residence time of each customer under the second camera and associates the data from multiple second cameras through facial feature value comparison, thereby realizing statistical analysis of the behavioral activities of each customer after entering the store, providing important time dimension data for customer flow analysis, helping merchants understand the residence time of customers in different areas, and further analyzing the customers' interest in different products, so as to help merchants better understand customers and optimize product display and product promotion according to customers' preferences.
[0057] In an optional embodiment, the method further includes:
[0058] For any target person in the customer flow information statistics table of the day, if the number of appearances of the target person within the historical preset time period reaches the appearance threshold, the facial feature value and behavior status information of the target person will be pushed to the employee terminal, so that the employee can provide targeted services to the corresponding customer based on the facial feature value and behavior status information of the target person.
[0059] The customer flow counting method provided in this embodiment pushes the facial feature values and behavior status information of frequently appearing target heads to employees, so that employees can pay special attention to customers who repeatedly enter the store within a certain period of time, better serve these customers, and thus increase the purchase rate of goods.
[0060] In a second aspect, the present invention provides a passenger flow counting device, the device comprising:
[0061] A first acquisition module is used to acquire first video data of a first camera at the entrance of a place to be counted;
[0062] A second acquisition module is used to perform head detection on the first video data to obtain a first target head;
[0063] A third acquisition module is used to track the first target head and obtain a first head image of the first target head;
[0064] A first determination module, configured to determine a behavior state of the first target head based on a tracking route of the first target head;
[0065] A fourth acquisition module is used to perform face recognition and feature extraction on the first head image to obtain a face feature value of the first target head when the first head image is of qualified quality;
[0066] A second determining module, configured to determine the behavior state information of the first target human head based on the behavior state of the first target human head;
[0067] A first saving module, used for saving the facial feature value of the first target head and the behavior status information into a passenger flow information statistics table;
[0068] The third determination module is used to determine the passenger flow information of the place to be counted based on the passenger flow information statistics table.
[0069] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the passenger flow counting method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0070] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the passenger flow counting method of the first aspect or any corresponding embodiment thereof.
[0071] In a fifth aspect, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the passenger flow counting method of the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0073] Figure 1 is a flow chart of a passenger flow counting method according to an embodiment of the present invention;
[0074] Figure 2 is a flow chart of another passenger flow counting method according to an embodiment of the present invention;
[0075] Figure 3 is a flow chart of another passenger flow counting method according to an embodiment of the present invention;
[0076] Figure 4 is a structural block diagram of a passenger flow counting device according to an embodiment of the present invention;
[0077] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0078] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0079] Traditional retail and service industries rely on customer flow to measure sales performance. By counting and analyzing customer flow, merchants can gain a deeper understanding of customer behavior patterns in the store, such as customer flow, the time spent in front of different products, and in-store flow routes, thereby optimizing staff allocation, product display, promotional activity planning, etc., improving operational efficiency and service quality, and ultimately achieving higher sales performance.
[0080] With the development and progress of technologies such as artificial intelligence and video image analysis, the accuracy and efficiency of customer flow statistics have been significantly improved. These technologies enable customer flow statistics to be highly accurate even in complex environments, providing more reliable data support for business decision-making.
[0081] In the related art, there are various methods for passenger flow statistics, such as infrared-based passenger flow statistics, WIFI-based passenger flow statistics, video-based passenger flow statistics, etc. The most commonly used is video-based passenger flow statistics. And the video-based passenger flow statistics method has many implementation methods, such as face detection and tracking-based passenger flow statistics method, head detection and tracking-based passenger flow statistics method, etc.
[0082] However, the passenger flow counting method based on face detection and tracking does not take into account the situation that the face cannot be recognized or tracked due to the person turning his head or lowering his head during the tracking process, resulting in low accuracy of the passenger flow counting results. In addition, the passenger flow counting method based on face detection and tracking lacks quality judgment of face images, and there are cases of face recognition errors caused by reasons such as face images being too small or not clear enough.
[0083] The customer flow counting method based on head detection and tracking can only count the total number of people entering and leaving the venue. It is unable to count and analyze the specific customer behavior data such as the time of entry, exit, and the time spent in front of different products. It is also unable to count and analyze the number of customers entering the store within a day, and the number of customers who repeatedly enter the store within a month. These data are important factors affecting the store's sales performance. The inability to count these data makes the customer flow analysis results inaccurate, which affects the merchant's in-depth understanding of customer behavior.
[0084] Furthermore, the above two passenger flow counting methods do not take into account the influence of employees on the statistical results, that is, they do not count, update or compare the facial feature values of employees, resulting in low accuracy of the obtained passenger flow statistical results.
[0085] An embodiment of the present invention provides a method for counting passenger flow, which performs head detection on first video data of a first camera at the entrance of a place to be counted to obtain a first target head, tracks the first target head, obtains a first head image of the first target head, and, if the quality of the first head image is qualified, performs face recognition and feature extraction on the first head to obtain a face feature value of the first target head, determines a behavior state of the first target head based on the tracking route of the first target head, determines behavior state information of the first target head based on the behavior state of the first target head, saves the face feature value and behavior state information of the first target head to a passenger flow information statistics table, and determines the passenger flow information of the place to be counted based on the passenger flow information statistics table to prevent the situation that the face cannot be recognized and the tracking fails due to people turning their heads or lowering their heads, and prevents the situation that the face recognition error is caused by the picture being too small or not clear enough, so as to improve the accuracy of the passenger flow statistics result.
[0086] According to an embodiment of the present invention, an embodiment of a passenger flow counting method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0087] In this embodiment, a passenger flow counting method is provided, which can be used in mobile terminals, such as servers, central processing units, etc. Figure 1 is a flow chart of a passenger flow counting method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0088] Step S101, obtaining first video data from a first camera at the entrance of a place to be counted.
[0089] The places to be counted may be stores in the retail and service industries. The first video data shot by a first camera at the entrance of the places to be counted for monitoring the flow of customers entering and leaving the store is obtained in real time.
[0090] Step S102: Perform head detection on the first video data to obtain a first target head.
[0091] After the first video data is acquired, head detection is performed on the first video data based on a trained neural network model such as a yolov5 model to obtain a first target head in the first video data.
[0092] Step S103: Track the first target head to obtain a first head image of the first target head.
[0093] After the first target head is detected, the first target head in the first video data is tracked, and during the tracking process, a first head image of the first target head is obtained.
[0094] Step S104: determining the behavior state of the first target human head based on the tracking route of the first target human head.
[0095] The first target person is tracked to obtain a tracking route of the first target person, and the behavior state of the first target person is determined based on the tracking route. The behavior state may be a store entry state or a store exit state.
[0096] Step S105, when the quality of the first head image is qualified, face recognition and feature extraction are performed on the first head image to obtain the face feature value of the first target head.
[0097] Among them, after obtaining the first head image, the quality of the first head image is judged. If the quality of the first head image is qualified, face recognition and feature extraction, i.e., feature calculation, are performed on the first head image based on a deep learning method such as SeetaFace to obtain the facial feature value of the first target head.
[0098] Step S106: determining the behavior status information of the first target human head based on the behavior status of the first target human head.
[0099] Wherein, when the behavior status of the first target person is the store-entering status, the behavior status information of the first target person is determined to be the store-entering time.
[0100] When the behavior status of the first target person is the exit state, the behavior status information of the first target person is determined to be the exit time.
[0101] Step S107, saving the facial feature value and behavior status information of the first target head to the passenger flow information statistics table.
[0102] After obtaining the facial feature value and behavior status information of the first target head, the facial feature value and behavior status information of the first target head are saved in the passenger flow information statistics table.
[0103] It should be noted that a daily customer flow statistics table is established in the database according to the date to record the facial feature values, entry time, exit time and other information of customers entering the store every day. This information can be used to identify key customers who enter the store multiple times within a period of time.
[0104] It can be understood that the facial feature value and the behavior status information of the first target head are saved in the corresponding passenger flow information statistical table according to the behavior status information.
[0105] Step S108, based on the passenger flow information statistics table, determine the passenger flow information of the place to be counted.
[0106] Based on the daily customer flow information statistics table, the customer flow information of the places to be counted can be determined every day. The customer flow information is customer flow statistics information, including the number of customers entering and leaving the store, the time each customer enters and leaves the store, etc.
[0107] Among them, the number of customers entering and leaving the store every day is determined based on the number of target heads corresponding to the facial feature values and behavior status information in the daily customer flow information statistics table.
[0108] The passenger flow counting method provided in this embodiment performs head detection on the first video data of the first camera at the entrance of the place to be counted, obtains the first target head, tracks the first target head, and obtains the first head image of the first target head, thereby preventing the situation where the face cannot be recognized and the tracking fails due to the person turning his head or lowering his head. When the quality of the first head image is qualified, face recognition and feature extraction are performed on the first head to obtain the face feature value of the first target head. By judging the quality of the head image, face recognition and feature extraction are performed when the head image quality is qualified, thereby preventing the situation where face recognition errors are caused by reasons such as the image being too small or not clear enough. Based on the tracking route of the first target head, the behavior state of the first target head is determined, and based on the behavior state of the first target head, the behavior state information of the first target head is determined, and the face feature value and behavior state information of the first target head are saved in the passenger flow information statistics table. Based on the passenger flow information statistics table, the passenger flow information of the place to be counted is determined. The accuracy of the passenger flow statistics results and the analysis results of the passenger flow statistics results are improved.
[0109] In this embodiment, a passenger flow counting method is provided, which can be used in mobile terminals, such as servers, central processing units, etc. Figure 2 is a flow chart of a passenger flow counting method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0110] Step S201, obtain the first video data of the first camera at the entrance of the place to be counted. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0111] Step S202: Perform head detection on the first video data to obtain a first target head. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0112] Step S203: Track the first target head to obtain a first head image of the first target head. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0113] Step S204: determining the behavior state of the first target human head based on the tracking route of the first target human head.
[0114] Specifically, the above step S204 includes:
[0115] Step S2041, when the first target head disappears from the monitoring screen of the first camera, and the tracking route of the first target head is from top to bottom in the monitoring screen, it is determined that the behavior state of the first target head is the store entry state.
[0116] It can be understood that the behavior state of the first target head is determined according to the tracking route of the first target head in the monitoring picture of the first camera.
[0117] The tracking route of the first target head is from top to bottom in the monitoring screen, which means that the first target head moves from far to near until it disappears from the monitoring screen of the first camera. It is determined that the behavior state of the first target head is the entering-store state, that is, the customer corresponding to the first target head enters the store.
[0118] Step S2042, when the first target person disappears from the monitoring screen of the first camera, and the tracking route of the first target person is from bottom to top in the monitoring screen, it is determined that the behavior state of the first target person is the exit state.
[0119] The tracking route of the first target person is from bottom to top in the monitoring screen, which means that the first target person moves from near to far until it disappears from the monitoring screen of the first camera. It is determined that the behavior state of the first target person is the exit state, that is, the customer corresponding to the first target person leaves the store.
[0120] Step S205: If the quality of the first head image is qualified, perform face recognition and feature extraction on the first head image to obtain the face feature value of the first target head. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0121] Step S206: Based on the behavior state of the first target head, determine the behavior state information of the first target head. Figure 1 Step S106 of the illustrated embodiment will not be described in detail here.
[0122] Step S207: Save the facial feature value and behavior status information of the first target head to the passenger flow information statistics table. Figure 1Step S107 of the illustrated embodiment will not be described in detail here.
[0123] Step S208: Determine the passenger flow information of the place to be counted based on the passenger flow information statistics table. Figure 1 Step S108 of the illustrated embodiment will not be described in detail here.
[0124] The customer flow counting method provided in this embodiment determines the behavior status of the first target person based on the tracking route of the first target person, thereby accurately judging the customer's entry and exit status, improving the accuracy and reliability of customer flow statistics, and providing merchants with more valuable customer behavior data, which helps to optimize operating strategies and improve sales performance.
[0125] In some optional implementations, the above step S205 includes:
[0126] Step a1: judging the quality of the first head image by the following quality judgment conditions:
[0127] W>80,H>80
[0128]
[0129]
[0130] Among them, W is the width value of the first head image, H is the height value of the first head image, Y is the number of pixels with brightness values greater than 100 in the grayscale first head image, Gr(x, y) is the brightness value at the coordinate (x, y) in the grayscale first head image, Z is the number of pixels with gradient values of the edge detection operator greater than 50 in the grayscale first head image, and G(x, y) is the gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image.
[0131] It can be understood that the grayscale first head image is an image obtained by performing grayscale processing on the first head image.
[0132] Step a2, when the first head image meets the quality judgment condition, determine that the first head image is of qualified quality, perform face recognition and feature extraction on the first head image, and obtain the face feature value of the first target head.
[0133] The first head image meets the quality judgment conditions, that is, the width of the first head image is greater than 80 pixels, the height is greater than 80 pixels, and the total number of pixels with brightness values greater than 100 and the number of pixels with gradient values (representing texture information) greater than 50 in the first head image accounts for more than half of the image, and the quality of the first head image is determined to be qualified.
[0134] The passenger flow counting method provided in this embodiment ensures that only the first head image with qualified quality is used for face recognition and feature extraction through strict quality judgment conditions. This reduces the impact of low-quality images on the recognition results and prevents inaccurate calculation of facial feature values due to reasons such as the image being too small or not clear enough, thereby improving the accuracy and reliability of face recognition.
[0135] In some optional implementations, the above passenger flow counting method further includes:
[0136] Step b1, performing a convolution operation on the grayscale first head image by the following formula to obtain the gradient value of the edge detection operator in the horizontal direction and the gradient value of the edge detection operator in the vertical direction of the image block with the center coordinates (x, y) in the grayscale first head image:
[0137]
[0138]
[0139] Among them, G x is the gradient value of the edge detection operator in the horizontal direction of the image block with the center coordinate (x, y) in the grayscale first head image, G y is the gradient value of the edge detection operator in the vertical direction of the image block with the central coordinates (x, y) in the grayscale first head image, and I is the image block with the central coordinates (x, y) in the grayscale first head image.
[0140] Step b2, determining the gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image based on the gradient value of the edge detection operator in the horizontal direction and the gradient value of the edge detection operator in the vertical direction of the image block with the center coordinate (x, y) in the grayscale first head image by the following formula:
[0141]
[0142] Wherein, G(x, y) is the gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image.
[0143] The passenger flow counting method provided in this embodiment obtains the gradient value of the edge detection operator in the horizontal direction and the gradient value of the edge detection operator in the vertical direction through a convolution operation, and determines the gradient value of the final edge detection operator based on these gradient values, and then judges whether the first head image meets the quality judgment condition according to the gradient value of the edge detection operator, thereby ensuring the accuracy of the quality detection of the first head image.
[0144] In some optional implementations, before saving the facial feature value and behavior status information of the first target head to the passenger flow information statistics table, the passenger flow statistics method further includes:
[0145] Step c1, collecting facial images of employees in the places to be counted.
[0146] Step c2: extracting feature values from the employee's face image to obtain the employee's face feature values.
[0147] Use deep learning methods such as SeetaFace to extract facial feature values from employees' face images and obtain employees' facial feature values.
[0148] Step c3, saving the employee's facial feature values to the employee's facial feature data table.
[0149] After obtaining the employee's facial feature value, the employee's facial feature value is saved in the employee's facial feature value data table. Among them, the employee's facial feature data table is pre-established in the database to remove the influence of employees on passenger flow statistics and analysis.
[0150] It should be noted that an employee may include multiple facial feature values, for example, facial feature values of the front face of the employee and facial feature values of the side face of the employee, etc. It is understandable that the employee facial feature value data table essentially stores the correspondence between employees and their facial feature values.
[0151] It is understandable that the employee facial feature value data table can be supplemented and updated in a timely manner according to actual conditions.
[0152] The above step S207 includes:
[0153] Step d1, comparing the facial feature values of the first target head with the facial feature values of employees in the employee facial feature data table.
[0154] After the facial feature value of the first target head is obtained, it is first compared with the employee facial feature value in the employee facial feature data table to determine whether the person corresponding to the first target head is an employee.
[0155] Step d2: If the comparison fails, the facial feature value of the first target head is repeatedly compared with the facial feature value in the passenger flow information statistics table.
[0156] Among them, the facial feature value of the first target head fails to match with any employee facial feature value in the employee facial feature data table, indicating that the person corresponding to the first target head is not an employee. The facial feature value of the first target head is then repeatedly compared with multiple facial feature values in the customer flow information statistics table of the day to determine whether the customer corresponding to the first target head has entered the store.
[0157] It can be understood that if the employee facial feature value in the employee facial feature data table is the same as the facial feature value of the first target head, it is determined that the comparison is successful, indicating that the person corresponding to the first target head is an employee, and there is no need to execute the steps after this step, and the process can be ended.
[0158] Step d3: If the repeatability comparison is passed, the facial feature value and behavior status information of the first target head are updated to the storage area corresponding to the first target head in the passenger flow information statistics table.
[0159] Among them, if there is a facial feature value in the customer flow information statistics table for the day that is the same as the facial feature value of the first target head, it is determined that the repetitive comparison has passed, and the customer corresponding to the first target head has entered the store, then the facial feature value and behavior status information of the first target head are updated to the storage area corresponding to the first target head in the customer flow information statistics table for the day.
[0160] It should be noted that updating the facial feature value and behavior status information of the first target person head to the storage area corresponding to the first target person head in the passenger flow information statistics table of the day includes:
[0161] If the facial feature value of the first target head is the same as any facial feature value in the storage area corresponding to the first target head, there is no need to update the facial feature value of the first target head to the storage area corresponding to the first target head. Instead, it is necessary to add the behavioral status information of the first target head to the storage area corresponding to the first target head.
[0162] Step d4: if the repeatability comparison fails, a storage area for the first target head is created in the passenger flow information statistics table, and the facial feature value and behavior status information of the first target head are saved in the storage area for the first target head.
[0163] Among them, if any facial feature value in the customer flow information statistics table of the day is different from the facial feature value of the first target head, it is determined that the repeatability comparison has failed, and the customer corresponding to the first target head has not entered the store today, then a storage area for the first target head is created in the customer flow information statistics table of the day, and the facial feature value and behavior status information of the first target head are saved in the storage area of the first target head.
[0164] It can be understood that the passenger flow information statistics table substantially includes the correspondence between the first target head and its corresponding storage area, and the storage area stores the facial feature value and behavior status information of the first target head.
[0165] That is to say, when the behavior state of the first target person is the state of entering the store, the facial feature value of the first target person is compared with the employee facial feature value in the employee facial feature data table; if the comparison fails, the facial feature value of the first target person is repeatedly compared with the facial feature value in the customer flow information statistics table for that day; if the repeated comparison passes, the facial feature value and the store entry time of the first target person are updated to the storage area corresponding to the first target person in the customer flow information statistics table for that day; if the repeated comparison fails, a storage area for the first target person is created in the customer flow information statistics table for that day, and the facial feature value and the store entry time of the first target person are saved in the storage area of the first target person.
[0166] When the behavior state of the first target person is the out-of-store state, the facial feature value of the first target person is compared with the employee facial feature value in the employee facial feature data table; if the comparison fails, the facial feature value of the first target person is repeatedly compared with the facial feature value in the customer flow information statistics table for that day; if the repeated comparison passes, the facial feature value and out-of-store time of the first target person are updated to the storage area corresponding to the first target person in the customer flow information statistics table for that day; if the repeated comparison fails, a storage area for the first target person is created in the customer flow information statistics table for that day, and the facial feature value and out-of-store time of the first target person are saved in the storage area of the first target person.
[0167] The customer flow statistics method provided in this embodiment can eliminate the situation where employees are mistaken for customers by comparing the facial feature values of the first target head with the facial feature values of employees in the employee facial feature data table, ensure that the customer flow information in the customer flow information statistics table only contains real customer data, and improve the accuracy of the statistical customer flow information.
[0168] By repeatedly comparing the facial feature values of the first target head with the facial feature values in the customer flow information statistics table, it is ensured that the information of the same customer will not be counted repeatedly, thereby improving the accuracy of the customer flow statistics results.
[0169] In some optional implementations, the passenger flow counting method further includes:
[0170] Step e1, obtaining the second video data of the second camera in other areas of the place to be counted except the door.
[0171] The second video data shot by the second camera in other areas of the place to be counted except the entrance is obtained in real time.
[0172] Step e2: perform head detection on the second video data to obtain a second target head.
[0173] After the second video data is acquired, head detection is performed on the second video data based on a trained neural network model such as a yolov5 model to obtain a second target head in the second video data.
[0174] Step e3: Track the second target head to obtain a second head image of the second target head.
[0175] After the second target human head is detected, the second target human head in the second video data is tracked, and during the tracking process, a second head image of the second target human head is obtained.
[0176] Step e4, determining the tracking start time and the tracking end time based on the tracking route of the second target head.
[0177] The second target head is tracked to obtain a tracking route of the second target head, and based on the tracking route, a tracking start time and a tracking end time of the second target head under the second camera are determined.
[0178] When the second target head starts to be tracked, the tracking start time is recorded, and when the second target head disappears from the monitoring screen of the second camera, the tracking end time is recorded.
[0179] Step e5, based on the tracking start time and the tracking end time, determine the stay time of the second target head under the second camera.
[0180] The time the second target head stays under the second camera is obtained by subtracting the tracking start time from the tracking end time.
[0181] Step e6, when the quality of the second head image is qualified, perform face recognition and feature extraction on the second head image to obtain the face feature value of the second target head.
[0182] After the second head image is obtained, the quality of the second head image is judged. The quality judgment method is similar to the quality judgment method of the first head image, which will not be repeated here.
[0183] When the quality of the second head image is qualified, face recognition and feature extraction, i.e., feature calculation, are performed on the second head image based on a deep learning method such as SeetaFace to obtain the facial feature value of the second target head.
[0184] Step e7, comparing the facial feature value of the second target head with the employee facial feature value in the employee facial feature data table. This is similar to the description of step d1 and will not be repeated here.
[0185] Step e8, if the comparison fails, the facial feature value of the second target head is repeatedly compared with the facial feature value in the passenger flow information statistics table. The description is similar to step d2 and will not be repeated here.
[0186] Step e9: if the repeatability comparison is passed, the facial feature value of the second target head and the residence time of the second target head under the second camera are updated to the storage area corresponding to the second target head in the passenger flow information statistics table.
[0187] Among them, if there is a facial feature value in the customer flow information statistics table that is the same as the facial feature value of the second target head, it is determined that the repetitive comparison has passed, and the customer corresponding to the second target head has entered the store, then the facial feature value of the second target head and the stay time of the second target head under the second camera are updated to the storage area corresponding to the second target head in the customer flow information statistics table.
[0188] It should be noted that updating the facial feature value of the second target head and the residence time of the second target head under the second camera to the storage area corresponding to the second target head in the passenger flow information statistics table includes:
[0189] If the facial feature value of the second target head is the same as any facial feature value in the storage area corresponding to the second target head, there is no need to update the facial feature value of the second target head to the storage area corresponding to the second target head. Instead, the stay time of the second target head under the second camera needs to be added to the storage area corresponding to the second target head.
[0190] That is to say, the customer flow information statistics table is also used to record the time customers stay under each camera, and the customer flow information also includes the time customers stay under each camera, etc.
[0191] The customer flow statistics method provided in this embodiment obtains the residence time of each customer under the second camera by counting the time each customer appears in each camera after entering the store, and associates the data in multiple second cameras by comparing facial feature values, thereby realizing statistical analysis of the behavioral activities of each customer after entering the store, and further realizing statistical analysis of the behavioral activities of all customers entering the store in one day, providing important time dimension data for customer flow analysis, helping merchants understand the residence time of customers in different areas, and further analyzing the interest of customers in different products, so that merchants can better understand the shopping preferences of customers, thereby optimizing product display, employee allocation, product promotion, etc. according to the preferences of customers.
[0192] In some optional implementations, the passenger flow counting method further includes:
[0193] Step f1, for any target person in the customer flow information statistics table of the day, if the number of appearances of the target person within the historical preset time period reaches the appearance threshold, the facial feature value and behavior status information of the target person will be pushed to the employee terminal, so that the employee can provide targeted services to the corresponding customer based on the facial feature value and behavior status information of the target person.
[0194] The historical preset time period may be within a historical month. The occurrence number threshold is determined by a technician, and illustratively, the occurrence number threshold is 2 times.
[0195] For any target person in the passenger flow information statistics table of the day, the passenger flow information statistics table of the past month is queried. If the number of appearances of the target person in the passenger flow information statistics table of the past month reaches the appearance threshold, the facial feature value and behavior status information stored in the storage area of the target person in the passenger flow information statistics table will be pushed to the employee terminal through the mini program push method, so that the employee can provide targeted services to customers based on this information.
[0196] It should be noted that the stay time under the second camera stored in the storage area of the target head can also be synchronized to the employee.
[0197] The customer flow statistics method provided in this embodiment queries the historical store entry records of customers on the day, and when key customers who have entered the store multiple times within a certain period of time are queried, the facial feature values and behavioral status information of the frequently appearing target heads are pushed to employees through mini-program push messages, reminding store employees to pay timely attention, so that employees can pay special attention to customers who have repeatedly entered the store within a certain period of time, better serve these customers, and thus increase the purchase rate of goods.
[0198] In some optional implementations, the passenger flow counting method further includes:
[0199] Step g1, for any target person in the passenger flow information statistics table of the day, obtain the stay time of the target person under the second camera.
[0200] Step g2: if the target person's stay time under the second camera exceeds the stay time threshold, the facial feature value, behavioral status information and stay time of the target person's head under the second camera are pushed to the employee terminal of the employee who manages the monitoring area of the second camera, so that the employee who manages the monitoring area of the second camera can provide targeted services to the corresponding customers based on the facial feature value, behavioral status information and stay time of the target person's head under the second camera.
[0201] The residence time threshold is set by the technicians and is not specifically limited here.
[0202] If the residence time of any target person under the second camera exceeds the residence time threshold, it indicates that there are commodities that the target person is interested in within the monitoring area of the second camera. Then, the facial feature value, behavior status information and residence time of the target person under the second camera will be pushed to the employee terminal of the employee who manages the monitoring area of the second camera, so that the employee can provide targeted services to the customer.
[0203] The customer flow counting method provided in this embodiment compares the target person's stay time under the second camera with the stay time threshold. If the target person's stay time under the second camera exceeds the stay time threshold, the employee who manages the monitoring area of the second camera is reminded by pushing a message through the mini program, so that the employee can more quickly identify customers who may need help, thereby providing more timely and efficient services and improving customers' shopping experience.
[0204] In this embodiment, a passenger flow counting method is provided, which can be used in mobile terminals, such as servers, central processing units, etc. Figure 3 is a flow chart of a passenger flow counting method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0205] The first step is to collect the facial information of store employees and establish a feature value database.
[0206] In this case, store employees' face pictures are collected, and facial feature values are extracted to establish an employee facial feature database. The feature value database is the employee facial feature database, which corresponds to the employee facial feature data table in the above embodiment.
[0207] For a detailed description of this step, please refer to the description of steps c1 to c3 in the above embodiment, which will not be repeated here.
[0208] The second step is to establish a database of passenger flow information for the day.
[0209] The customer flow information database corresponds to the customer flow information statistics table in the above embodiment. The customer flow information database is used to record information such as facial feature values, store entry time, store exit time, and time spent under each camera of customers entering the store on the day.
[0210] The third step is to start independent thread 1, perform head detection and tracking on the camera monitoring the entrance and exit; judge the quality of the head image to determine whether face recognition can be performed; if face recognition can be performed, perform face recognition and feature value calculation; whether someone is detected entering the store; if someone is detected entering the store, compare the recognized face feature value with the employee's face feature value; determine whether it is an employee; if not, compare the face feature with the customer of the day; determine whether there is duplication, if so, increase the store entry time, if not, add a new customer.
[0211] Specifically, the camera at the store entrance that monitors the flow of customers entering and leaving the store is used to detect and track heads; during the tracking process, the quality of the head image is judged according to the above-mentioned quality judgment conditions; face recognition and feature calculation are performed on the images that meet the quality standards to obtain face feature values; based on the tracked route, it is determined whether the customer enters or exits the store, and the face feature values of the customers entering the store are compared, first compared with the face feature values of the employees to determine whether they are employees. If they are not employees, then a duplicate judgment is made with the customers of the day in the database. If there is no duplication, then the customer is regarded as a new customer entering the store, and the entry time and face feature values are saved in the database.
[0212] It can be understood that the figure only shows the process of counting the number of customers entering the store. The process of counting the number of customers leaving the store is similar to the process of counting the number of customers entering the store, and will not be repeated here.
[0213] Please refer to the related descriptions of the aforementioned steps S202 to S207 for details, which will not be repeated here.
[0214] The fourth step is to start independent thread 2 while starting independent thread 1, and perform head detection and tracking on other cameras in the store; judge the quality of the head image to determine whether face recognition can be performed; if face recognition can be performed, perform face recognition and feature value calculation; whether someone is detected leaving the camera, if someone is detected leaving the camera, compare the recognized face feature value with the employee's face feature to determine whether it is an employee; if not an employee, compare the face feature with the customer of the day to determine whether there is a record of entering the store; if there is a record of entering the store, record the customer's stay time under the camera.
[0215] It can be understood that this step has the same meaning as steps e1 to e9 of the aforementioned embodiment. Please refer to the detailed description of steps e1 to e9 of the aforementioned embodiment for details, which will not be repeated here.
[0216] The fifth step is to start independent thread 3 while starting independent thread 1 and independent thread 2, and query the previous store entry history of customers who entered the store on that day to determine whether there is a historical store entry record; if so, push a message through the mini program to remind employees.
[0217] It can be understood that this step has the same meaning as step f1 in the aforementioned embodiment. Please refer to the detailed description of step f1 in the aforementioned embodiment for details, which will not be repeated here.
[0218] The customer flow statistics method provided in this embodiment is based on head detection and tracking, face image quality judgment, face feature calculation and comparison, so that the customer flow statistics results are more accurate. The time statistics of customers entering the store under each camera can be used to analyze customers' shopping preferences and provide data support for merchants' product display and employee allocation. Pay attention to and remind key customers who repeatedly enter the store within a certain period of time, so as to better serve these customers and increase the purchase rate of goods.
[0219] In this embodiment, a passenger flow counting device is also provided, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0220] This embodiment provides a passenger flow counting device, such as Figure 4 As shown, including:
[0221] The first acquisition module 401 is used to acquire first video data of a first camera at the entrance of the place to be counted.
[0222] The second acquisition module 402 is used to perform head detection on the first video data to obtain a first target head.
[0223] The third acquisition module 403 is used to track the first target head and obtain a first head image of the first target head.
[0224] The first determination module 404 is used to determine the behavior state of the first target human head based on the tracking route of the first target human head.
[0225] The fourth acquisition module 405 is used to perform face recognition and feature extraction on the first head image to obtain the face feature value of the first target head if the quality of the first head image is qualified.
[0226] The second determining module 406 is configured to determine the behavior state information of the first target human head based on the behavior state of the first target human head.
[0227] The first saving module 407 is used to save the facial feature value and behavior status information of the first target head into the passenger flow information statistics table.
[0228] The third determination module 408 is used to determine the passenger flow information of the place to be counted based on the passenger flow information statistics table.
[0229] In some optional implementations, the first determining module 404 includes:
[0230] The first determining unit is used to determine that the behavior state of the first target head is the store entry state when the first target head disappears from the monitoring picture of the first camera and the tracking route of the first target head is from top to bottom in the monitoring picture.
[0231] The second determining unit is used to determine that the behavior state of the first target head is the exit state when the first target head disappears from the monitoring picture of the first camera and the tracking route of the first target head is from bottom to top in the monitoring picture.
[0232] In some optional implementations, the fourth acquisition module 405 includes:
[0233] The first judgment unit is used to judge the quality of the first head image according to the following quality judgment conditions:
[0234] W>80,H>80
[0235]
[0236] Among them, W is the width value of the first head image, H is the height value of the first head image, Y is the number of pixels with brightness values greater than 100 in the grayscale first head image, Gr(x, y) is the brightness value at the coordinate (x, y) in the grayscale first head image, Z is the number of pixels with gradient values of the edge detection operator greater than 50 in the grayscale first head image, and G(x, y) is the gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image.
[0237] The first acquisition unit is used to determine that the quality of the first head image is qualified when the first head image meets the quality judgment condition, perform face recognition and feature extraction on the first head image, and obtain the face feature value of the first target head.
[0238] In some optional implementations, the passenger flow counting device further includes:
[0239] The fifth acquisition module is used to perform a convolution operation on the grayscale first head image to obtain the gradient value of the edge detection operator in the horizontal direction and the gradient value of the edge detection operator in the vertical direction of the image block with the center coordinates (x, y) in the grayscale first head image:
[0240]
[0241] Among them, G x is the gradient value of the edge detection operator in the horizontal direction of the image block with the center coordinate (x, y) in the grayscale first head image, G y is the gradient value of the edge detection operator in the vertical direction of the image block with the central coordinates (x, y) in the grayscale first head image, and I is the image block with the central coordinates (x, y) in the grayscale first head image.
[0242] The fourth determination module is used to determine the gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image based on the gradient value of the edge detection operator in the horizontal direction and the gradient value of the edge detection operator in the vertical direction of the image block with the center coordinate (x, y) in the grayscale first head image by the following formula:
[0243]
[0244] Wherein, G(x, y) is the gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image.
[0245] In some optional implementations, the passenger flow counting device further includes:
[0246] The collection module is used to collect facial images of employees in the places to be counted.
[0247] The sixth acquisition module is used to extract feature values from employee face images to obtain employee face feature values.
[0248] The second saving module is used to save the employee's facial feature values to the employee's facial feature data table.
[0249] The first saving module 407 includes:
[0250] The first comparison unit is used to compare the facial feature value of the first target head with the employee facial feature value in the employee facial feature data table.
[0251] The second comparison unit is used to repeatedly compare the facial feature value of the first target head with the facial feature value in the passenger flow information statistics table if the comparison fails.
[0252] The first updating unit is used to update the facial feature value and behavior status information of the first target head to the storage area corresponding to the first target head in the passenger flow information statistics table if the repetitive comparison is passed.
[0253] The first saving subunit is used to create a storage area for the first target head in the passenger flow information statistics table if the repeatability comparison fails, and save the facial feature value and behavior status information of the first target head in the storage area of the first target head.
[0254] In some optional implementations, the passenger flow counting device further includes:
[0255] The seventh acquisition module is used to acquire the second video data of the second camera in other areas of the place to be counted except the door.
[0256] The eighth acquisition module is used to perform head detection on the second video data to obtain a second target head.
[0257] The ninth acquisition module is used to track the second target head and obtain a second head image of the second target head.
[0258] The fifth determination module is used to determine the tracking start time and the tracking end time based on the tracking route of the second target head.
[0259] The sixth determination module is used to determine the stay time of the second target head under the second camera based on the tracking start time and the tracking end time.
[0260] The tenth acquisition module is used to perform face recognition and feature extraction on the second head image to obtain the face feature value of the second target head when the second head image quality is qualified.
[0261] The first comparison module is used to compare the facial feature value of the second target head with the employee facial feature value in the employee facial feature data table.
[0262] The second comparison module is used to repeatedly compare the facial feature value of the second target head with the facial feature value in the passenger flow information statistics table if the comparison fails.
[0263] The first updating module is used to update the facial feature value of the second target head and the residence time of the second target head under the second camera to the storage area corresponding to the second target head in the passenger flow information statistics table if the repetitive comparison is passed.
[0264] In some optional implementations, the passenger flow counting device further includes:
[0265] The push module is used to push the facial feature value and behavior status information of any target person in the customer flow information statistics table of the day to the employee terminal if the target person's appearance times within the historical preset time period reaches the appearance times threshold, so that the employee can provide targeted services to the corresponding customer based on the facial feature value and behavior status information of the target person.
[0266] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0267] The passenger flow counting device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0268] The embodiment of the present invention also provides a computer device having the above Figure 4 The passenger flow counting device shown.
[0269] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 501, memory 502, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Each component utilizes different buses to communicate with each other, and can be installed on a common mainboard or installed in other ways as required. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 501 is taken as an example.
[0270] The processor 501 may be a central processing unit, a network processor or a combination thereof. The processor 501 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0271] The memory 502 stores instructions executable by at least one processor 501 , so that the at least one processor 501 executes the method shown in the above embodiment.
[0272] The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 502 may optionally include a memory remotely arranged relative to the processor 501, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0273] The memory 502 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 502 may also include a combination of the above types of memory.
[0274] The computer device also includes a communication interface 503, which is used for the computer device to communicate with other devices or a communication network.
[0275] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0276] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0277] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A passenger flow statistics method, characterized in that: The method comprises: Acquire the first video data of the first camera at the entrance of the place to be counted; Performing head detection on the first video data to obtain a first target head; Tracking the first target head to obtain a first head image of the first target head; Determining a behavior state of the first target head based on the tracking route of the first target head; When the quality of the first head image is qualified, performing face recognition and feature extraction on the first head image to obtain a face feature value of the first target head; Based on the behavior state of the first target head, determining the behavior state information of the first target head; The facial feature value of the first target head and the behavior status information are saved in a passenger flow information statistics table; Based on the passenger flow information statistics table, the passenger flow information of the place to be counted is determined.
2. The method according to claim 1, characterized in that The determining the behavior state of the first target head based on the tracking route of the first target head includes: When the first target person disappears from the monitoring screen of the first camera, and the tracking route of the first target person is from top to bottom in the monitoring screen, determining that the behavior state of the first target person is the store entry state; When the first target head disappears from the monitoring screen of the first camera and the tracking route of the first target head is from bottom to top in the monitoring screen, it is determined that the behavior state of the first target head is the exit state.
3. The method according to claim 1, characterized in that When the quality of the first head image is qualified, performing face recognition and feature extraction on the first head image to obtain the face feature value of the first target head includes: The quality of the first head image is judged according to the following quality judgment conditions: W>80,H>80 Wherein, W is the width value of the first head image, H is the height value of the first head image, Y is the number of pixels with brightness values greater than 100 in the grayscale first head image, Gr(x, y) is the brightness value at the coordinate (x, y) in the grayscale first head image, Z is the number of pixels with gradient values of the edge detection operator greater than 50 in the grayscale first head image, and G(x, y) is the gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image; When the first head image meets the quality judgment condition, it is determined that the quality of the first head image is qualified, and face recognition and feature extraction are performed on the first head image to obtain the face feature value of the first target head.
4. The method according to claim 3, characterized in that The method further comprises: The convolution operation is performed on the grayscale first head image to obtain the gradient value of the edge detection operator in the horizontal direction and the gradient value of the edge detection operator in the vertical direction of the image block with the center coordinates (x, y) in the grayscale first head image: Among them, G x is the gradient value of the edge detection operator in the horizontal direction of the image block with the center coordinate (x, y) in the grayscale first head image, G y is the gradient value of the edge detection operator in the vertical direction of the image block with the central coordinates (x, y) in the grayscale first head image, and I is the image block with the central coordinates (x, y) in the grayscale first head image; The gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image is determined by the following formula based on the gradient value of the edge detection operator in the horizontal direction and the gradient value of the edge detection operator in the vertical direction of the image block with the center coordinate (x, y) in the grayscale first head image: Wherein, G(x, y) is the gradient value of the edge detection operator at the coordinate (x, y) in the grayscale first head image.
5. The method according to claim 1, characterized in that: Before saving the facial feature value of the first target head and the behavior status information to the passenger flow information statistics table, the method further includes: Collecting facial images of employees at the places to be counted; Extracting feature values from the employee's face image to obtain the employee's face feature values; Saving the employee's facial feature value to the employee's facial feature data table; The step of saving the facial feature value of the first target head and the behavior status information to a passenger flow information statistics table includes: Comparing the facial feature value of the first target head with the facial feature value of the employee in the employee facial feature data table; If the comparison fails, the facial feature value of the first target head is repeatedly compared with the facial feature value in the passenger flow information statistics table; If the repeatability comparison is passed, the facial feature value of the first target head and the behavior status information are updated to the storage area corresponding to the first target head in the passenger flow information statistics table; If the repeatability comparison fails, a storage area for the first target head is created in the passenger flow information statistics table, and the facial feature value of the first target head and the behavior status information are saved in the storage area for the first target head.
6. The method according to claim 1, characterized in that The method further comprises: Acquire the second video data of the second camera in other areas of the place to be counted except the door; Performing head detection on the second video data to obtain a second target head; Tracking the second target head to obtain a second head image of the second target head; Based on the tracking route of the second target head, determining the tracking start time and the tracking end time; Determine the stay time of the second target head under the second camera based on the tracking start time and the tracking end time; If the second head image is of qualified quality, performing face recognition and feature extraction on the second head image to obtain a face feature value of the second target head; Comparing the facial feature value of the second target head with the facial feature value of the employee in the employee facial feature data table; If the comparison fails, the facial feature value of the second target head is repeatedly compared with the facial feature value in the passenger flow information statistics table; If the repeatability comparison is passed, the facial feature value of the second target head and the residence time of the second target head under the second camera are updated to the storage area corresponding to the second target head in the passenger flow information statistical table.
7. The method according to claim 1, characterized in that The method further comprises: For any target person in the customer flow information statistics table of the day, if the number of appearances of the target person within the historical preset time period reaches the appearance threshold, the facial feature value and behavior status information of the target person will be pushed to the employee terminal, so that the employee can provide targeted services to the corresponding customer based on the facial feature value and behavior status information of the target person.
8. A passenger flow counting device, characterized in that: The device comprises: A first acquisition module is used to acquire first video data of a first camera at the entrance of a place to be counted; A second acquisition module is used to perform head detection on the first video data to obtain a first target head; A third acquisition module is used to track the first target head and obtain a first head image of the first target head; A first determination module, configured to determine a behavior state of the first target head based on a tracking route of the first target head; A fourth acquisition module is used to perform face recognition and feature extraction on the first head image to obtain a face feature value of the first target head when the first head image is of qualified quality; A second determining module, configured to determine the behavior state information of the first target human head based on the behavior state of the first target human head; A first saving module, used for saving the facial feature value of the first target head and the behavior status information into a passenger flow information statistics table; The third determination module is used to determine the passenger flow information of the place to be counted based on the passenger flow information statistics table.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the passenger flow counting method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the passenger flow counting method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image processing method, apparatus and system, terminal, and storage medium
CN108831533A
A passenger flow statistics method and system based on head and shoulder detection
CN109448026A
Face image recognition method, device and equipment and readable storage medium
CN111626240A
Fusion duplicate removal method and device based on images captured by multiple cameras and readable medium
CN114627526A
Target passenger flow statistical method, electronic equipment and computer readable storage medium
CN115482569A