Bus passenger flow statistical analysis system and method based on TOF camera
Technical Field
The invention belongs to the field of image recognition, and particularly relates to a bus passenger flow statistical analysis system and method based on a TOF camera.
Background
The bus passenger flow statistics is to replace manual work with machines, and the number statistics of each bus stop and each bus line is achieved. The obtained people number statistical data can support bus route optimization, real-time dynamic analysis and prediction of bus passenger flow and decision and regulation of bus scheduling.
Reviewing the development history of bus passenger flow statistics, solutions such as an IC card, a pressure pedal, infrared rays and image recognition based on a common camera have been used for detecting the passenger flow, but some problems are found in the practical process.
In terms of the IC card, the proportion of the number of passengers who take a card in most cities to the total number of passengers is not high, the passenger flow counting method intelligently reflects the riding rule of the passengers who take the card, but the riding conditions of all the passengers cannot be covered, and the whole passenger flow cannot be calculated from a sample.
The number of people is judged by the pressure pedal according to the treading times and the weight, due to the fact that the flow of a bus is huge, the contact type testing equipment is short in fault-free working time and high in maintenance cost, a large number of false detections are generated under the conditions of weight difference, single/double-leg treading, in-situ treading, multi-person treading and the like, and the detection precision is not high.
The infrared technology uses a correlation or reflection principle, infrared rays are blocked when people pass through the infrared technology, a count is formed, the situation that multiple people arrive in parallel and in succession is common in the peak period of people flow, under the situation, the missing rate is high, and the installation and calibration of the whole set of infrared equipment are complex.
The image recognition scheme based on the common camera judges the number of people getting on or off the bus by recognizing the head of the people, can effectively avoid the problems in the method, greatly improves the accuracy, but influences the counting accuracy due to light change, hair color, hats, portable articles and the like.
Disclosure of Invention
The purpose of the invention is as follows: the invention is improved aiming at the problems in the prior art, namely, the first purpose of the invention is to disclose a bus passenger flow statistical analysis system based on a TOF camera, which is not interfered by light rays and shadow, hair color, cap decorations, hand-held articles and the like, is not influenced by the crowding degree of people, and can achieve higher accuracy in passenger flow statistics and feature recognition. The invention discloses a bus passenger flow statistical analysis method based on a TOF camera.
The technical scheme is as follows: bus passenger flow statistical analysis system based on TOF camera includes:
the system comprises n TOF cameras, a monitoring system and a monitoring system, wherein the TOF cameras are arranged above vehicle doors and vertically downwards and are used for collecting images of passengers getting on and off the vehicle in real time, and n is a positive integer which is the same as the number of the vehicle doors of the bus and is not less than 1;
the central processing unit is respectively connected with the n TOF cameras through signal lines and is used for reading and processing video information of the TOF cameras, identifying characteristic points on images acquired by the TOF cameras and realizing passenger flow statistics according to the contours and height characteristics of the heads and shoulders of passengers;
the RS485 serial port is connected with the central processing unit;
the RJ45 network port is connected with the central processing unit;
the switching value input/output module is connected with the central processing unit and is used for acquiring the switching value of the door of the bus;
and the read-only memory is connected with the central processing unit and is used for storing the getting-on/off database.
Further, the characteristic points on the image acquired by the TOF camera include height characteristics of the passenger, a size of a head region of the passenger, a size of a shoulder region of the passenger, and posture characteristics of the passenger.
Furthermore, the switching value input and output module is a digital value I/O module.
The bus passenger flow statistical analysis method based on the TOF camera comprises the following steps:
(1) judging whether the pre-arrived station is an initial station, if so, resetting all the counts, and then entering the step (2); if not, directly entering the step (2)
(2) Judging whether the vehicle door is opened or not, if the vehicle door is opened, entering the step (3), and if the vehicle door is closed, entering the step (6);
(3) respectively extracting head, shoulder contour and height characteristics of passengers at the entrance/exit, then storing the characteristics extracted at the entrance/exit into an entrance/exit database, and then entering the step (4);
(4) counting the number of passengers getting on/off the bus at the station, judging whether the passengers get on the bus or get off the bus according to the extracted features, if the passengers get on the bus, storing the features of the passengers into a data base of the getting on bus and adding one to the total number of the passengers getting on the bus, if the passengers get off the bus, storing the features of the passengers into a data base of the getting off bus and adding one to the total number of the passengers getting off the bus, and entering the step (5) after counting the number of the passengers getting on/off the bus at the station is completed;
(5) judging whether the station is a terminal station, if so, entering a step (9), and if not, entering a step (1);
(6) judging whether the number of people getting on/off the bus at the station before the closing of the car door is counted, and if so, entering the step (1); if not, entering the step (7);
(7) counting the total number of people in the vehicle and the total number of people getting on/off the vehicle at the station, clearing the number of people getting on/off the vehicle at the station after the counting is finished, and then entering the step (8), wherein:
the new total number of people in the bus is the old total number of people in the bus + the total number of people getting on the bus at the station-the total number of people getting off the bus at the station;
(8) correcting the characteristics of passengers getting on/off the bus, performing characteristic identification in a characteristic database of the passengers getting on/off the bus, recording the information of the stations of the passengers getting on/off the bus, and entering the step (5) after the information is finished;
(9) and finishing the operation.
Further, the features of the passengers getting on/off the vehicle are corrected using a deep learning algorithm in step (8).
Further, the deep learning algorithm in step (8) comprises:
(a) learning according to the degree of pronation of the head and the upper body of a passenger when the passenger gets on or off the vehicle, wherein the degree of pronation of the body of the passenger is relatively large when the passenger gets off the vehicle under the normal condition, and adjusting the pronation characteristic of the passenger according to the characteristic when the characteristics of the passenger are identified and matched;
(b) and judging whether the heights of the upper and lower doors of the current bus are consistent according to the parameters, and if not, adjusting the height characteristics when the characteristics of the upper and lower passengers are identified and matched.
And (3) further, judging whether the vehicle door is opened or not according to the state of the switching value input and output module in the step (2).
Further, the get-on/get-off database in the step (3) is located in a read-only memory.
Further, before judging whether the passenger is an entering passenger or a getting-off passenger in the step (4), judging whether the passenger entering or getting-off the vehicle door is the passenger one by one, if not, entering the step (1), if the passenger is the passenger, entering and then judging whether the passenger is the entering passenger or the getting-off passenger.
Has the advantages that: the bus passenger flow statistical analysis system and method based on the TOF camera disclosed by the invention have the following beneficial effects:
1. the accuracy of passenger flow statistics is improved, and data are provided for bus route optimization, real-time dynamic analysis and prediction of bus passenger flow and decision and regulation of bus scheduling;
2. a large amount of basic data of one hand is provided for traffic investigation of the starting point and the stopping point;
3. the scheme adopts a TOF camera, the TOF camera adopts a flight method 3D imaging technology, human body characteristics are detected and analyzed, and interference of light rays and shadow, hair color, headwear, hand-held articles and the like is avoided.
Drawings
FIG. 1 is a schematic structural diagram of a bus passenger flow statistical analysis system based on TOF cameras disclosed by the present invention;
FIG. 2 is a flow chart of a bus passenger flow statistical analysis method based on TOF cameras disclosed by the invention.
The specific implementation mode is as follows:
the following describes in detail specific embodiments of the present invention.
As shown in fig. 1, the system for analyzing the bus passenger flow statistics based on TOF camera includes:
the system comprises n TOF cameras, a monitoring system and a monitoring system, wherein the TOF cameras are arranged above vehicle doors and vertically downwards and are used for collecting images of passengers getting on and off the vehicle in real time, and n is a positive integer which is the same as the number of the vehicle doors of the bus and is not less than 1;
the central processing unit is respectively connected with the n TOF cameras through signal lines and is used for reading and processing video information of the TOF cameras, identifying characteristic points on images acquired by the TOF cameras and realizing passenger flow statistics according to the contours and height characteristics of the heads and shoulders of passengers;
the RS485 serial port is connected with the central processing unit;
the RJ45 network port is connected with the central processing unit;
the switching value input/output module is connected with the central processing unit and is used for acquiring the switching value of the door of the bus;
and the read-only memory is connected with the central processing unit and is used for storing the getting-on/off database.
Further, the characteristic points on the image acquired by the TOF camera include height characteristics of the passenger, a size of a head region of the passenger, a size of a shoulder region of the passenger, and posture characteristics of the passenger.
Furthermore, the switching value input and output module is a digital value I/O module.
As shown in fig. 2, the bus passenger flow statistical analysis method based on the TOF camera includes the following steps:
(1) judging whether the pre-arrived station is an initial station, if so, resetting all the counts, and then entering the step (2); if not, directly entering the step (2)
(2) Judging whether the vehicle door is opened or not, if the vehicle door is opened, entering the step (3), and if the vehicle door is closed, entering the step (6);
(3) respectively extracting head, shoulder contour and height characteristics of passengers at the entrance/exit, then storing the characteristics extracted at the entrance/exit into an entrance/exit database, and then entering the step (4);
(4) counting the number of passengers getting on/off the bus at the station, judging whether the passengers get on the bus or get off the bus according to the extracted features, if the passengers get on the bus, storing the features of the passengers into a data base of the getting on bus and adding one to the total number of the passengers getting on the bus, if the passengers get off the bus, storing the features of the passengers into a data base of the getting off bus and adding one to the total number of the passengers getting off the bus, and entering the step (5) after counting the number of the passengers getting on/off the bus at the station is completed;
(5) judging whether the station is a terminal station, if so, entering a step (9), and if not, entering a step (1);
(6) judging whether the number of people getting on/off the bus at the station before the closing of the car door is counted, and if so, entering the step (1); if not, entering the step (7);
(7) counting the total number of people in the vehicle and the total number of people getting on/off the vehicle at the station, clearing the number of people getting on/off the vehicle at the station after the counting is finished, and then entering the step (8), wherein:
the new total number of people in the bus is the old total number of people in the bus + the total number of people getting on the bus at the station-the total number of people getting off the bus at the station;
(8) correcting the characteristics of passengers getting on/off the bus, performing characteristic identification in a characteristic database of the passengers getting on/off the bus, recording the information of the stations of the passengers getting on/off the bus, and entering the step (5) after the information is finished;
(9) and finishing the operation.
Further, the features of the passengers getting on/off the vehicle are corrected using a deep learning algorithm in step (8).
Further, the deep learning algorithm in step (8) comprises:
(a) learning according to the degree of pronation of the head and the upper body of a passenger when the passenger gets on or off the vehicle, wherein the degree of pronation of the body of the passenger is relatively large when the passenger gets off the vehicle under the normal condition, and adjusting the pronation characteristic of the passenger according to the characteristic when the characteristics of the passenger are identified and matched;
(b) and judging whether the heights of the upper and lower doors of the current bus are consistent according to the parameters, and if not, adjusting the height characteristics when the characteristics of the upper and lower passengers are identified and matched.
And (3) further, judging whether the vehicle door is opened or not according to the state of the switching value input and output module in the step (2).
Further, the get-on/get-off database in the step (3) is located in a read-only memory.
Further, before judging whether the passenger is an entering passenger or a getting-off passenger in the step (4), judging whether the passenger entering or getting-off the vehicle door is the passenger one by one, if not, entering the step (1), if the passenger is the passenger, entering and then judging whether the passenger is the entering passenger or the getting-off passenger.
The embodiments of the present invention have been described in detail. However, the present invention is not limited to the above-described embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the spirit of the present invention.