Vehicle passenger flow statistics methods, devices, electronic equipment and storage media

By frame-by-frame face detection and area division of video surveillance images in the vehicle, combined with overlap detection, the problem of inaccurate passenger flow statistics in the existing technology is solved, and more accurate statistics on passenger numbers are achieved.

CN112686177BActive Publication Date: 2024-11-19SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202011644268.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-31
Publication Date
2024-11-19
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

In the prior art, the passenger flow statistics of taxi or online car-hailing are inaccurate, which depends on the number of passengers selected by the passenger on the taxi-hailing software, which does not match the actual number of passengers, resulting in inaccurate statistics.

Method used

By obtaining video surveillance images in the vehicle, face detection is performed frame by frame, multiple face detection areas are divided, and overlap detection is performed on face detection areas in adjacent frames, and the number of passengers is calculated to improve the accuracy of passenger flow statistics. Spend.

Benefits of technology

Through area division and overlap detection, mutual interference between multiple face detection frames is avoided, and the accuracy of taxi/online car-hailing passenger flow statistics is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112686177B_ABST
    Figure CN112686177B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a vehicle passenger flow counting method, device, electronic device and storage medium, wherein the method comprises: acquiring a video surveillance image in a vehicle; performing face detection on the video surveillance image frame by frame, and dividing each frame into a plurality of face detection areas based on the face detection frame in each frame; the plurality of face detection areas in each frame correspond to each other one by one; performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result; and obtaining the number of passengers in the vehicle according to the overlap detection result. The embodiment of the present application is conducive to improving the accuracy of passenger flow counting of taxis or online car-hailing vehicles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a vehicle passenger flow counting method, device, electronic device and storage medium. Background Art

[0002] With the development of digital society, big data statistics are extremely important for both enterprises and individuals. For example, bus operations can use passenger flow statistics to dynamically plan bus routes, and taxis or online ride-hailing cars can use passenger flow statistics to analyze areas with rich order resources for drivers, etc. At present, the passenger flow statistics of taxis or online ride-hailing cars mostly depend on the number of passengers selected on the taxi app when the passenger places an order. However, when getting on the car, the actual number of people may not match the number in the order. Therefore, its passenger flow statistics are not accurate. Summary of the invention

[0003] In response to the above problems, the present application provides a vehicle passenger flow counting method, device, electronic device and storage medium, which are conducive to improving the accuracy of passenger flow counting.

[0004] To achieve the above-mentioned purpose, the first aspect of the embodiment of the present application provides a vehicle passenger flow counting method, the method comprising:

[0005] Acquire video surveillance images inside the vehicle;

[0006] Performing face detection on the video surveillance image frame by frame, and dividing each frame into a plurality of face detection areas based on a face detection frame in each frame; the plurality of face detection areas in each frame correspond to each other one by one;

[0007] Performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result;

[0008] The number of passengers in the vehicle is obtained according to the overlap detection result.

[0009] In combination with the first aspect, in a possible implementation manner, the multiple face detection areas include a first face detection area and a second face detection area; and the dividing each frame into the multiple face detection areas based on the face detection frame in each frame includes:

[0010] Dividing the face detection frame into a first area face detection frame and a second area face detection frame;

[0011] Dividing a first target area from each frame according to the first area face detection frame, and dividing a second target area from each frame according to the second area face detection frame;

[0012] The first face detection area is divided according to the area of ​​the first area face detection frame and the area of ​​the first target area, and the second face detection area is divided according to the area of ​​the second area face detection frame and the area of ​​the second target area.

[0013] In combination with the first aspect, in a possible implementation manner, dividing the face detection frame into a first area face detection frame and a second area face detection frame includes:

[0014] Obtaining the center point of the face detection frame;

[0015] Obtaining a first distance from the center point to a first tripwire and a second distance from the center point to a second tripwire;

[0016] Determine the face detection frame whose first distance is less than or equal to a first threshold as the first-region face detection frame;

[0017] The face detection frame whose second distance is less than or equal to a second threshold is determined as the second-region face detection frame.

[0018] In combination with the first aspect, in a possible implementation manner, dividing a first target area from each frame according to the first area face detection frame includes:

[0019] Determine a first face detection frame having the largest height value from the face detection frames in the first area;

[0020] Adding a first preset value to the height of the first face detection frame to obtain the height of the first target area;

[0021] dividing the first target area from each frame according to the height of the first target area;

[0022] The dividing the second target area from each frame according to the second area face detection frame includes:

[0023] Determine a second face detection frame having the largest height value from the face detection frames in the second region;

[0024] Adding a second preset value to the height of the second face detection frame obtains the height of the second target area;

[0025] The second target area is divided from each frame according to the height of the second target area.

[0026] In combination with the first aspect, in a possible implementation manner, performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result includes:

[0027] Obtaining the aspect ratio of the face detection frame in the corresponding face detection area in two adjacent frames;

[0028] Obtaining a first matching degree between the aspect ratios;

[0029] Obtaining the area of ​​the face detection frame in the corresponding face detection area in two adjacent frames;

[0030] Obtaining a second matching degree between the areas;

[0031] A matching score between the face detection frames in the corresponding face detection areas in two adjacent frames is calculated according to the first matching degree and the second matching degree, and the matching score is used as the overlap detection result.

[0032] In combination with the first aspect, in a possible implementation manner, obtaining the number of passengers in the vehicle according to the overlap detection result includes:

[0033] When the overlap detection result is greater than or equal to a third threshold, the face detection frames in the corresponding face detection areas in two adjacent frames are determined as detection frames of the same target, which is recorded as one passenger;

[0034] When the overlap detection result is less than the third threshold, the face detection frames in the corresponding face detection areas in two adjacent frames are determined as detection frames of two targets, which are recorded as two passengers;

[0035] After analyzing the video surveillance image, the number of passengers is obtained.

[0036] A second aspect of an embodiment of the present application provides a vehicle passenger flow counting device, the device comprising:

[0037] An image acquisition module, used to acquire video surveillance images inside the vehicle;

[0038] A region division module, used for performing face detection on the video surveillance image frame by frame, and dividing each frame into a plurality of face detection regions based on a face detection frame in each frame; the plurality of face detection regions in each frame correspond to each other one by one;

[0039] An overlap detection module is used to perform overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result;

[0040] The statistical module is used to obtain the number of passengers in the vehicle according to the overlap detection result.

[0041] A third aspect of an embodiment of the present application provides an electronic device, the electronic device comprising an input device and an output device, and further comprising a processor adapted to implement one or more instructions; and a computer storage medium, the computer storage medium storing one or more instructions, the one or more instructions being adapted to be loaded by the processor and executing the following steps:

[0042] Acquire video surveillance images inside the vehicle;

[0043] Performing face detection on the video surveillance image frame by frame, and dividing each frame into a plurality of face detection areas based on a face detection frame in each frame; the plurality of face detection areas in each frame correspond to each other one by one;

[0044] Performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result;

[0045] The number of passengers in the vehicle is obtained according to the overlap detection result.

[0046] A fourth aspect of an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the following steps:

[0047] Acquire video surveillance images inside the vehicle;

[0048] Performing face detection on the video surveillance image frame by frame, and dividing each frame into a plurality of face detection areas based on a face detection frame in each frame; the plurality of face detection areas in each frame correspond to each other one by one;

[0049] Performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result;

[0050] The number of passengers in the vehicle is obtained according to the overlap detection result.

[0051] The above scheme of the present application includes at least the following beneficial effects: Compared with the prior art, the embodiment of the present application obtains the video surveillance image in the vehicle; performs face detection on the video surveillance image frame by frame, and divides each frame into multiple face detection areas based on the face detection frame in each frame; the multiple face detection areas of each frame correspond to each other; performs overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain overlap detection results; and obtains the number of passengers in the vehicle based on the overlap detection results. In this way, each frame of the video surveillance image is divided into multiple face detection areas by area division to ensure that there is only one face detection frame in each face detection area, thereby avoiding mutual interference between multiple face detection frames during subsequent overlap detection. The number of passengers is counted based on area division and overlap, which is conducive to improving the accuracy of taxi / online car-hailing passenger flow statistics. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0053] Figure 1 A schematic diagram of an application environment provided for an embodiment of the present application;

[0054] Figure 2 A flow chart of a vehicle passenger flow statistics method provided in an embodiment of the present application;

[0055] Figure 3 A schematic diagram of determining a front / back row of face detection frames provided in an embodiment of the present application;

[0056] Figure 4 A schematic diagram of dividing the front / rear area provided in an embodiment of the present application;

[0057] Figure 5 A schematic diagram of a first face detection area and a second face detection area provided in an embodiment of the present application;

[0058] Figure 6 A flow chart of another vehicle passenger flow counting method provided in an embodiment of the present application;

[0059] Figure 7 A schematic diagram of the structure of a vehicle passenger flow counting device provided in an embodiment of the present application;

[0060] Figure 8A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0062] The terms "including" and "having" and any variations thereof that appear in the specification, claims and drawings of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In addition, the terms "first", "second" and "third" are used to distinguish different objects, rather than to describe a specific order.

[0063] The present application provides a vehicle passenger flow statistics method based on Figure 1 For the application environment implementation shown, see Figure 1 , the application environment includes an image acquisition device set in a taxi or online car-hailing vehicle, and a background server for passenger flow statistics, wherein the image acquisition device and the server communicate via a wireless network. Specifically, the image acquisition device is used to monitor the situation inside the vehicle and send the acquired video surveillance images to the server, and the server is used to call a pre-stored detector for face detection, analyze the video surveillance images frame by frame, perform face detection area division, face detection frame overlap detection and other operations to count the actual number of passengers in the vehicle, which is conducive to improving the accuracy of passenger flow statistics compared with the existing technology. Among them, the image acquisition device can be a mobile phone, tablet, camera, camera, etc., and the server can be an independent physical server, or a server cluster or distributed system, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and basic cloud computing services such as big data and artificial intelligence platforms.

[0064] based on Figure 1 The application environment shown is described in detail below in conjunction with other drawings to illustrate the vehicle passenger flow statistics method provided in the embodiment of the present application.

[0065] See also Figure 2 , Figure 2 A flow chart of a vehicle passenger flow statistics method provided in an embodiment of the present application, the method is applied to a server, such as Figure 2 As shown, steps S21-S25 are included:

[0066] S21, acquiring a video surveillance image inside the vehicle.

[0067] In a specific embodiment of the present application, the video surveillance image may be a video image captured in real time by an image capture device, or may be a video image segment that starts capturing when a passenger gets on the bus and stops capturing when the passenger gets off the bus.

[0068] S22, performing face detection on the video surveillance image frame by frame, and dividing each frame into a plurality of face detection areas based on a face detection frame in each frame; the plurality of face detection areas in each frame correspond to each other one by one.

[0069] In a specific embodiment of the present application, multiple face detection areas include a first face detection area and a second face detection area. It should be understood that taxis or online-hailing cars usually have two rows, front and back. Therefore, the first face detection area refers to the face detection area in the front row, and the second face detection area refers to the face detection area in the back row. This is the case for each frame of the video surveillance image, and the division method is also the same.

[0070] Exemplarily, dividing each frame into a plurality of face detection areas based on a face detection frame in each frame includes:

[0071] Dividing the face detection frame into a first area face detection frame and a second area face detection frame;

[0072] Dividing a first target area from each frame according to the first area face detection frame, and dividing a second target area from each frame according to the second area face detection frame;

[0073] The first face detection area is divided according to the area of ​​the first area face detection frame and the area of ​​the first target area, and the second face detection area is divided according to the area of ​​the second area face detection frame and the area of ​​the second target area.

[0074] Specifically, the first area face detection frame refers to the face detection frame of the front row, and the second area face detection frame refers to the face detection frame of the back row. That is, it is necessary to know which face detection frames in each frame are the face detection frames of the front row passengers and which face detection frames are the face detection frames of the back row passengers. Since the server does not know which area in the car is the front row and which area is the back row, it makes a judgment based on the center point of the face detection frame and the preset trip wire. Figure 3In the frame of image shown, the first tripwire is a horizontal line set on the front row of seats, and the second tripwire is a horizontal line set on the back row of seats. For each face detection frame in the frame of image, the distance from its center point to the first tripwire is obtained, recorded as the first distance, and the distance from its center point to the second tripwire is obtained, recorded as the second distance. The face detection frame whose first distance is less than or equal to the first threshold is determined as the face detection frame of the front row, and the face detection frame whose second distance is less than or equal to the first threshold is determined as the face detection frame of the back row. The first threshold and the second threshold can be determined according to the space size of the vehicle or an empirical value.

[0075] Exemplarily, the first target area is the divided front area, and the second target area is the divided back area. After determining the face detection frame of the front row, a face detection frame (i.e., the first face detection frame) with the largest height value is found from the face detection frame of the front row, and the height value of the face detection frame is added to the first preset value to obtain the height of the front area to be divided, and the front area is divided from the frame image according to the height of the front area. In one example, the area other than the front area in the frame image can be determined as the back area; in another example, after determining the face detection frame of the back row, a face detection frame (i.e., the second face detection frame) with the largest height value is found from the face detection frame of the back row, and the height value of the face detection frame is added to the second preset value to obtain the height of the back area to be divided, and the back area is divided from the frame image according to the height of the back area. Optionally, the height of the front area + the height of the back area can be less than the height of the frame image, or can be equal to the height of the frame image, which is specifically determined by the first preset value and the second preset value. The divided front area and back area can be as follows. Figure 4 As shown. Among them, since the image acquisition device in the car is usually set in the front of the vehicle, such as on the rearview mirror in the middle, this will cause the objects in the front row in the video surveillance image to be larger and the objects in the back row to be relatively smaller. Therefore, the first preset value can be set larger than the second preset value.

[0076] Exemplarily, dividing the first face detection area from the first target area according to the horizontal distance between the face detection frames in the first area includes:

[0077] Determine a distance point that is half of the horizontal distance between the face detection frames in the first area;

[0078] The first face detection area is divided from the first target area at the half distance point.

[0079] Specifically, Figure 5As shown, for the two face detection frames in the front row, find a point that is half of their horizontal distance, and use this point to draw a vertical line segment of the horizontal distance line. The vertical line segment divides the front row area into two first face detection areas, namely, the face detection area in the front row.

[0080] Exemplarily, dividing the second face detection area from the second target area according to the horizontal distance between the face detection frames in the second area includes:

[0081] Determine a point that is half the horizontal distance between the face detection frames in the second area;

[0082] The second face detection area is divided from the second target area at the half distance point.

[0083] The division of the second face detection area can refer to the first face detection area, such as Figure 5 The three second face detection areas divided in the figure are the face detection areas in the back row.

[0084] S23, performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result.

[0085] In the specific embodiment of the present application, in terms of passenger flow statistics, a method of comparing adjacent frames in pairs is adopted, and for the face detection frame of the corresponding face detection area in two adjacent frames, the aspect ratio of the face detection frame is obtained, such as Figure 5 For a frame of image shown, the aspect ratio of the face detection frame in each face detection area is obtained, and for the next frame of image, the aspect ratio of the face detection frame in each face detection area is also obtained, and the difference in the aspect ratio of the face detection frame in the face detection area corresponding to the two frames of images is calculated, and the absolute value of the difference is taken as the first matching degree, and the area of ​​the face detection frame in each face detection area is obtained, and the difference in the area of ​​the face detection frame in the face detection area corresponding to the two frames of images is calculated, and the absolute value of the difference is taken as the second matching degree, and the first matching degree is multiplied by a preset weight A, and the second matching degree is multiplied by a preset weight B, and then summed to obtain the matching score of the face detection frame in the face detection area corresponding to the two frames of images, and the matching score is used as the overlap detection result. Because the face detection frames of the same person in two adjacent frames of images will not change too much in aspect ratio and area, that is, the overlap will be relatively high, this method can be used to determine whether the corresponding face detection areas in two adjacent frames of images are the same person.

[0086] S24, obtaining the number of passengers in the vehicle according to the overlap detection result.

[0087] In a specific embodiment of the present application, according to the overlap detection result in step S23, if the overlap detection result is greater than or equal to the third threshold, the face detection frame in the corresponding face detection area in two adjacent frames is determined as the detection frame of the same target and counted as one passenger. If the overlap detection result is less than the third threshold, the face detection frame in the corresponding face detection area in two adjacent frames is determined as the detection frame of two targets and counted as two passengers. The entire video surveillance image is analyzed by comparing adjacent frames in pairs to obtain the number of passengers in the vehicle.

[0088] Exemplarily, when performing passenger counting, for each frame of image, a target first face detection area is first determined from the first face detection area. The target first face detection area is the area where the driver's face detection frame is located. For the target first face detection area in two adjacent frames, the overlap detection operation is not performed to reduce the detection amount, thereby improving the efficiency of passenger flow counting to a certain extent.

[0089] It can be seen that the embodiment of the present application obtains the video surveillance image in the vehicle; performs face detection on the video surveillance image frame by frame, and divides each frame into multiple face detection areas based on the face detection frame in each frame; the multiple face detection areas in each frame correspond to each other one by one; performs overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain overlap detection results; and obtains the number of passengers in the vehicle based on the overlap detection results. In this way, each frame of the video surveillance image is divided into multiple face detection areas by area division to ensure that there is only one face detection frame in each face detection area, thereby avoiding mutual interference between multiple face detection frames during subsequent overlap detection. The number of passengers is counted based on area division and overlap, which is conducive to improving the accuracy of taxi / online car-hailing passenger flow statistics.

[0090] See also Figure 6 , Figure 6 A flow chart of another vehicle passenger flow counting method provided in an embodiment of the present application is as follows: Figure 6 As shown, steps S61-S66 are included:

[0091] S61, acquiring a video surveillance image inside the vehicle;

[0092] S62, performing face detection on the video surveillance image frame by frame, and dividing the obtained face detection frame into a first area face detection frame and a second area face detection frame;

[0093] S63, dividing each frame into a first target region according to the first region face detection frame, and dividing each frame into a second target region according to the second region face detection frame;

[0094] S64, dividing a first face detection area from the first target area according to the horizontal distance between the face detection frames in the first area, and dividing a second face detection area from the second target area according to the horizontal distance between the face detection frames in the second area;

[0095] S65, performing overlap detection on the face detection frames in the first face detection area and the second face detection area corresponding to two adjacent frames to obtain an overlap detection result;

[0096] S66, obtaining the number of passengers in the vehicle according to the overlap detection result.

[0097] The specific implementation of steps S61-S66 is as follows: Figure 2-Figure 5 The embodiments shown have been described in detail and can achieve the same or similar beneficial effects. To avoid repetition, they will not be described again here.

[0098] Based on the description of the above vehicle passenger flow counting method embodiment, please refer to Figure 7 , Figure 7 A schematic diagram of a vehicle passenger flow counting device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device comprises:

[0099] An image acquisition module 71 is used to acquire video surveillance images inside the vehicle;

[0100] A region division module 72, configured to perform face detection on the video surveillance image frame by frame, and divide each frame into a plurality of face detection regions based on a face detection frame in each frame; the plurality of face detection regions in each frame correspond to each other one by one;

[0101] An overlap detection module 73 is used to perform overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result;

[0102] The statistical module 74 is used to obtain the number of passengers in the vehicle according to the overlap detection result.

[0103] In a possible implementation, in terms of dividing each frame into a plurality of face detection regions based on a face detection frame in each frame, the region division module 72 is specifically configured to:

[0104] Dividing the face detection frame into a first area face detection frame and a second area face detection frame;

[0105] Dividing a first target area from each frame according to the first area face detection frame, and dividing a second target area from each frame according to the second area face detection frame;

[0106] A first face detection area is divided from the first target area according to the horizontal distance between the face detection frames in the first area, and a second face detection area is divided from the second target area according to the horizontal distance between the face detection frames in the second area.

[0107] In a possible implementation, in terms of dividing the face detection frame into a first area face detection frame and a second area face detection frame, the area division module 72 is specifically used to:

[0108] Obtaining the center point of the face detection frame;

[0109] Obtaining a first distance from the center point to a first tripwire and a second distance from the center point to a second tripwire;

[0110] Determine the face detection frame whose first distance is less than or equal to a first threshold as the first-region face detection frame;

[0111] The face detection frame whose second distance is less than or equal to a second threshold is determined as the second-region face detection frame.

[0112] In a possible implementation, in terms of dividing the first target area from each frame according to the first regional face detection frame, the area dividing module 72 is specifically configured to:

[0113] Determine a first face detection frame having the largest height value from the face detection frames in the first area;

[0114] Adding a first preset value to the height of the first face detection frame to obtain the height of the first target area;

[0115] dividing the first target area from each frame according to the height of the first target area;

[0116] In terms of dividing the second target area from each frame according to the second area face detection frame, the area dividing module 72 is specifically used for:

[0117] Determine a second face detection frame having the largest height value from the face detection frames in the second region;

[0118] Adding a second preset value to the height of the second face detection frame obtains the height of the second target area;

[0119] The second target area is divided from each frame according to the height of the second target area.

[0120] In a possible implementation, in performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result, the overlap detection module 73 is specifically used to:

[0121] Obtaining the aspect ratio of the face detection frame in the corresponding face detection area in two adjacent frames;

[0122] Obtaining a first matching degree between the aspect ratios;

[0123] Obtaining the area of ​​the face detection frame in the corresponding face detection area in two adjacent frames;

[0124] Obtaining a second matching degree between the areas;

[0125] A matching score between the face detection frames in the corresponding face detection areas in two adjacent frames is calculated according to the first matching degree and the second matching degree, and the matching score is used as the overlap detection result.

[0126] In a possible implementation, in terms of obtaining the number of passengers in the vehicle according to the overlap detection result, the statistical module 74 is specifically used to:

[0127] When the overlap detection result is greater than or equal to a third threshold, the face detection frames in the corresponding face detection areas in two adjacent frames are determined as detection frames of the same target, which is recorded as one passenger;

[0128] When the overlap detection result is less than the third threshold, the face detection frames in the corresponding face detection areas in two adjacent frames are determined as detection frames of two targets, which are recorded as two passengers;

[0129] After analyzing the video surveillance image, the number of passengers is obtained.

[0130] According to one embodiment of the present application, Figure 6 The various units of the vehicle passenger flow counting device shown can be separately or completely combined into one or several other units to form, or one (some) of the units can be further divided into multiple functionally smaller units to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above units are divided based on logical functions. In practical applications, the functions of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present application, the vehicle passenger flow counting device can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0131] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 or Figure 6 A computer program (including program code) for each step involved in the corresponding method shown in Figure 7 The vehicle passenger flow counting device shown in the figure and the vehicle passenger flow counting method of the embodiment of the present application are implemented. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above-mentioned computing device through the computer-readable recording medium and run therein.

[0132] Based on the description of the above method embodiment and device embodiment, the present application embodiment also provides an electronic device. Figure 8 The electronic device at least includes a processor 81, an input device 82, an output device 83, and a computer storage medium 84. The processor 81, the input device 82, the output device 83, and the computer storage medium 84 in the electronic device can be connected via a bus or other means.

[0133] The computer storage medium 84 may be stored in the memory of the electronic device, the computer storage medium 84 is used to store a computer program, the computer program includes program instructions, and the processor 81 is used to execute the program instructions stored in the computer storage medium 84. The processor 81 (or CPU (Central Processing Unit)) is the computing core and control core of the electronic device, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function.

[0134] In one embodiment, the processor 81 of the electronic device provided in the embodiment of the present application can be used to perform a series of passenger flow statistics:

[0135] Acquire video surveillance images inside the vehicle;

[0136] Performing face detection on the video surveillance image frame by frame, dividing each frame into a plurality of face detection areas based on a face detection frame in each frame; the plurality of face detection areas in each frame correspond to each other one by one;

[0137] Performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result;

[0138] The number of passengers in the vehicle is obtained according to the overlap detection result.

[0139] In another embodiment, the plurality of face detection areas include a first face detection area and a second face detection area; the processor 81 executes the division of each frame into the plurality of face detection areas based on the face detection frame in each frame, including:

[0140] Dividing the face detection frame into a first area face detection frame and a second area face detection frame;

[0141] Dividing a first target area from each frame according to the first area face detection frame, and dividing a second target area from each frame according to the second area face detection frame;

[0142] The first face detection area is divided from the first target area according to the horizontal distance between the face detection frames in the first area, and the second face detection area is divided from the second target area according to the horizontal distance between the face detection frames in the second area.

[0143] In another embodiment, the processor 81 executes the step of dividing the face detection frame into a first area face detection frame and a second area face detection frame, including:

[0144] Obtaining the center point of the face detection frame;

[0145] Obtaining a first distance from the center point to a first tripwire and a second distance from the center point to a second tripwire;

[0146] Determine the face detection frame whose first distance is less than or equal to a first threshold as the first-region face detection frame;

[0147] The face detection frame whose second distance is less than or equal to a second threshold is determined as the second-region face detection frame.

[0148] In another embodiment, the processor 81 executes the step of dividing the first target area from each frame according to the first area face detection frame, including:

[0149] Determine a first face detection frame having the largest height value from the face detection frames in the first area;

[0150] Adding a first preset value to the height of the first face detection frame to obtain the height of the first target area;

[0151] dividing the first target area from each frame according to the height of the first target area;

[0152] The processor 81 executes the step of dividing the second target area from each frame according to the second area face detection frame, including:

[0153] Determine a second face detection frame having the largest height value from the face detection frames in the second region;

[0154] Adding a second preset value to the height of the second face detection frame obtains the height of the second target area;

[0155] The second target area is divided from each frame according to the height of the second target area.

[0156] In yet another embodiment, the processor 81 performs the overlapping detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain the overlapping detection result, including:

[0157] Obtaining the aspect ratio of the face detection frame in the corresponding face detection area in two adjacent frames;

[0158] Obtaining a first matching degree between the aspect ratios;

[0159] Obtaining the area of ​​the face detection frame in the corresponding face detection area in two adjacent frames;

[0160] Obtaining a second matching degree between the areas;

[0161] A matching score between the face detection frames in the corresponding face detection areas in two adjacent frames is calculated according to the first matching degree and the second matching degree, and the matching score is used as the overlap detection result.

[0162] In another embodiment, the processor 81 executes the step of obtaining the number of passengers of the vehicle according to the overlap detection result, including:

[0163] When the overlap detection result is greater than or equal to a third threshold, the face detection frames in the corresponding face detection areas in two adjacent frames are determined as detection frames of the same target, which is recorded as one passenger;

[0164] When the overlap detection result is less than the third threshold, the face detection frames in the corresponding face detection areas in two adjacent frames are determined as detection frames of two targets, which are recorded as two passengers;

[0165] After analyzing the video surveillance image, the number of passengers is obtained.

[0166] Exemplarily, the electronic device includes but is not limited to a processor 81, an input device 82, an output device 83, and a computer storage medium 84. Those skilled in the art will appreciate that the schematic diagram is merely an example of an electronic device and does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or different components.

[0167] It should be noted that, since the processor 81 of the electronic device implements the steps in the above-mentioned vehicle passenger flow counting method when executing the computer program, the embodiments of the above-mentioned vehicle passenger flow counting method are all applicable to the electronic device and can achieve the same or similar beneficial effects.

[0168] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the terminal and the extended storage medium supported by the terminal. The computer storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor 81 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory; optionally, it can also be at least one computer storage medium located away from the aforementioned processor 81. In one embodiment, the processor 81 can load and execute one or more instructions stored in the computer storage medium to implement the corresponding steps of the above-mentioned vehicle passenger flow statistics method; in a specific implementation, one or more instructions in the computer storage medium are loaded by the processor 81 and the following steps are executed:

[0169] Acquire video surveillance images inside the vehicle;

[0170] Performing face detection on the video surveillance image frame by frame, dividing each frame into a plurality of face detection areas based on a face detection frame in each frame; the plurality of face detection areas in each frame correspond to each other one by one;

[0171] Performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result;

[0172] The number of passengers in the vehicle is obtained according to the overlap detection result.

[0173] In another example, when one or more instructions in the computer storage medium are loaded by the processor 81, the following steps are also performed:

[0174] Dividing the face detection frame into a first area face detection frame and a second area face detection frame;

[0175] Dividing a first target area from each frame according to the first area face detection frame, and dividing a second target area from each frame according to the second area face detection frame;

[0176] The first face detection area is divided from the first target area according to the horizontal distance between the face detection frames in the first area, and the second face detection area is divided from the second target area according to the horizontal distance between the face detection frames in the second area.

[0177] In another example, when one or more instructions in the computer storage medium are loaded by the processor 81, the following steps are also performed:

[0178] Obtaining the center point of the face detection frame;

[0179] Obtaining a first distance from the center point to a first tripwire and a second distance from the center point to a second tripwire;

[0180] Determine the face detection frame whose first distance is less than or equal to a first threshold as the first-region face detection frame;

[0181] The face detection frame whose second distance is less than or equal to a second threshold is determined as the second-region face detection frame.

[0182] In another example, when one or more instructions in the computer storage medium are loaded by the processor 81, the following steps are also performed:

[0183] Determine a first face detection frame having the largest height value from the face detection frames in the first area;

[0184] Adding a first preset value to the height of the first face detection frame to obtain the height of the first target area;

[0185] The first target area is divided from each frame according to the height of the first target area.

[0186] In another example, when one or more instructions in the computer storage medium are loaded by the processor 81, the following steps are also performed:

[0187] Determine a second face detection frame having the largest height value from the face detection frames in the second region;

[0188] Adding a second preset value to the height of the second face detection frame obtains the height of the second target area;

[0189] The second target area is divided from each frame according to the height of the second target area.

[0190] In another example, when one or more instructions in the computer storage medium are loaded by the processor 81, the following steps are also performed:

[0191] Obtaining the aspect ratio of the face detection frame in the corresponding face detection area in two adjacent frames;

[0192] Obtaining a first matching degree between the aspect ratios;

[0193] Obtaining the area of ​​the face detection frame in the corresponding face detection area in two adjacent frames;

[0194] Obtaining a second matching degree between the areas;

[0195] A matching score between the face detection frames in the corresponding face detection areas in two adjacent frames is calculated according to the first matching degree and the second matching degree, and the matching score is used as the overlap detection result.

[0196] In another example, when one or more instructions in the computer storage medium are loaded by the processor 81, the following steps are also performed:

[0197] When the overlap detection result is greater than or equal to a third threshold, the face detection frames in the corresponding face detection areas in two adjacent frames are determined as detection frames of the same target, which is recorded as one passenger;

[0198] When the overlap detection result is less than the third threshold, the face detection frames in the corresponding face detection areas in two adjacent frames are determined as detection frames of two targets, which are recorded as two passengers;

[0199] After analyzing the video surveillance image, the number of passengers is obtained.

[0200] Exemplarily, the computer program of the computer storage medium includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0201] It should be noted that, since the computer program of the computer storage medium implements the steps in the above-mentioned vehicle passenger flow counting method when executed by the processor, all embodiments of the above-mentioned vehicle passenger flow counting method are applicable to the computer storage medium and can achieve the same or similar beneficial effects.

[0202] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A vehicle passenger flow statistics method, applied to a server, characterized in that: The method comprises: Acquire video surveillance images inside the vehicle; Performing face detection on the video surveillance image frame by frame, dividing each frame into a plurality of face detection areas based on a face detection frame in each frame; wherein the plurality of face detection areas in each frame correspond to each other one by one; Performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result; Obtaining the number of passengers in the vehicle according to the overlap detection result; The performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result includes: Obtaining the aspect ratio of the face detection frame in the corresponding face detection area in two adjacent frames; Obtaining a first matching degree between the aspect ratios; obtaining the first matching degree between the aspect ratios includes: taking an absolute value of a difference between the aspect ratios as the first matching degree; Obtaining the area of ​​the face detection frame in the corresponding face detection region in two adjacent frames; Obtaining a second matching degree between the areas; obtaining the second matching degree between the areas includes: taking an absolute value of a difference between the areas as the second matching degree; A matching score between the face detection frames in the corresponding face detection areas in two adjacent frames is calculated based on the first matching degree and the second matching degree, and the matching score is used as the overlap detection result.

2. The method according to claim 1, characterized in that The multiple face detection areas include a first face detection area and a second face detection area; and the dividing each frame into multiple face detection areas based on the face detection frame in each frame includes: Dividing the face detection frame into a first area face detection frame and a second area face detection frame; Dividing each frame into a first target area according to the first area face detection frame, and dividing each frame into a second target area according to the second area face detection frame; The first face detection area is divided from the first target area according to the horizontal distance between the face detection frames in the first area, and the second face detection area is divided from the second target area according to the horizontal distance between the face detection frames in the second area.

3. The method according to claim 2, characterized in that The dividing the face detection frame into a first area face detection frame and a second area face detection frame comprises: Obtaining the center point of the face detection frame; Obtaining a first distance from the center point to a first tripwire and a second distance from the center point to a second tripwire; Determine the face detection frame whose first distance is less than or equal to a first threshold as the first-region face detection frame; The face detection frame whose second distance is less than or equal to a second threshold is determined as the second-region face detection frame.

4. The method according to claim 2, characterized in that The step of dividing each frame into a first target area according to the first area face detection frame includes: Determine a first face detection frame with the largest height value from the face detection frames in the first area; Adding a first preset value to the height of the first face detection frame to obtain the height of the first target area; dividing the first target area from each frame according to the height of the first target area; The dividing of the second target area from each frame according to the second area face detection frame includes: Determine a second face detection frame having the largest height value from the face detection frames in the second area; Adding a second preset value to the height of the second face detection frame to obtain the height of the second target area; The second target area is divided from each frame according to the height of the second target area.

5. The method according to claim 1, wherein Obtaining the number of passengers in the vehicle according to the overlap detection result includes: When the overlap detection result is greater than or equal to a third threshold, determining the face detection frames in the corresponding face detection areas in two adjacent frames as detection frames of the same target, and recording them as one passenger; When the overlap detection result is less than the third threshold, the face detection frames in the corresponding face detection areas in two adjacent frames are determined as detection frames of two targets, which are recorded as two passengers; After analyzing the video surveillance image, the number of passengers is obtained.

6. A vehicle passenger flow counting device, characterized in that: The device comprises: An image acquisition module, used to acquire video surveillance images inside the vehicle; a region division module, configured to perform face detection on the video surveillance image frame by frame, and divide each frame into a plurality of face detection regions based on a face detection frame in each frame; the plurality of face detection regions in each frame correspond one to one; An overlap detection module is used to perform overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result; A statistics module, configured to obtain the number of passengers in the vehicle based on the overlap detection result; In terms of performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result, the overlap detection module is specifically configured to: The performing overlap detection on the face detection frames in the corresponding face detection areas in two adjacent frames to obtain an overlap detection result includes: Obtaining the aspect ratio of the face detection frame in the corresponding face detection area in two adjacent frames; Obtaining a first matching degree between the aspect ratios; in obtaining the first matching degree between the aspect ratios, the overlap detection module is specifically configured to: use an absolute value of a difference between the aspect ratios as the first matching degree; Obtaining the area of ​​the face detection frame in the corresponding face detection region in two adjacent frames; Obtaining a second matching degree between the areas; in terms of obtaining the second matching degree between the areas, the overlap detection module is specifically configured to: use an absolute value of a difference between the areas as the second matching degree; A matching score between the face detection frames in the corresponding face detection areas in two adjacent frames is calculated based on the first matching degree and the second matching degree, and the matching score is used as the overlap detection result.

7. The device according to claim 6, characterized in that The multiple face detection areas include a first face detection area and a second face detection area; and the dividing each frame into multiple face detection areas based on the face detection frame in each frame includes: Dividing the face detection frame into a first area face detection frame and a second area face detection frame; Dividing each frame into a first target area according to the first area face detection frame, and dividing each frame into a second target area according to the second area face detection frame; The first face detection area is divided according to the area of ​​the first area face detection frame and the area of ​​the first target area, and the second face detection area is divided according to the area of ​​the second area face detection frame and the area of ​​the second target area.

8. An electronic device comprising an input device and an output device, characterized in that: Also includes: a processor adapted to implement one or more instructions; as well as, A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the method according to any one of claims 1 to 5.

9. A computer storage medium, characterized in that The computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Vehicle passenger flow statistical method and system

    CN108280387A

  • Personnel flow statistics method and device and computer device

    CN110263703A

  • Face tracking method and device

    CN111612813A

  • Face tracking method and device, computer equipment and storage device thereof

    CN111640134A

  • Passenger state analysis method and apparatus, vehicle, electronic device and storage medium

    US20200285870A1