CN112614155B - Passenger flow tracking method - Google Patents

Passenger flow tracking method Download PDF

Info

Publication number
CN112614155B
CN112614155B CN202011479757.5A CN202011479757A CN112614155B CN 112614155 B CN112614155 B CN 112614155B CN 202011479757 A CN202011479757 A CN 202011479757A CN 112614155 B CN112614155 B CN 112614155B
Authority
CN
China
Prior art keywords
track
point
euclidean distance
tracking
dimensional array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011479757.5A
Other languages
Chinese (zh)
Other versions
CN112614155A (en
Inventor
张少锋
张先旺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Tumin Intelligent Video Co ltd
Original Assignee
Shenzhen Tumin Intelligent Video Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Tumin Intelligent Video Co ltd filed Critical Shenzhen Tumin Intelligent Video Co ltd
Priority to CN202011479757.5A priority Critical patent/CN112614155B/en
Publication of CN112614155A publication Critical patent/CN112614155A/en
Application granted granted Critical
Publication of CN112614155B publication Critical patent/CN112614155B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • G06V20/53Recognition of crowd images, e.g. recognition of crowd congestion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Human Computer Interaction (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a method for tracking passenger flow, which belongs to the technical field of image processing and specifically comprises the following steps: acquiring multiple frames of continuous images shot by a camera, and solving a depth map through stereo matching; eliminating background interference, and dividing each human head into an independent communication area; constructing a structure of a plurality of people statistics; calculating the minimum value of the sum of best matching different rows and different columns of bipartite graphs of the two-dimensional arrays by using a KM algorithm; solving the Euclidean distance between the center coordinate of the traversing previous frame communication region and the first point of the track point of the structural body; the method tracks passenger flow, even if passengers get on the bus and shake in a visible area, the tracking algorithm can still track all the time and cannot be lost easily, the method is not only suitable for linear motion, but also suitable for tracking curvilinear motion and random motion, even if the passengers get on the bus and get off the bus very crowded, the algorithm can realize real-time and accurate tracking of multiple persons, and the missing of counting is reduced.

Description

Passenger flow tracking method
Technical Field
The invention relates to the technical field of image processing, in particular to a passenger flow tracking method.
Background
Buses are important public transport means for people to go out. Through the statistics of the passenger flow, the passenger flow of each time period, each bus, each station and the like can be known, public resources are more fully utilized by utilizing the data intelligent scheduling, and the accuracy of the passenger flow statistics directly influences the operation of an intelligent transportation system and the bus operation benefit. By displaying the current passenger number state and change situation, the bus station can take measures for preventing emergencies and the like under the condition of more passengers.
The existing passenger flow statistics technology mainly comprises weighing statistics, monocular image statistics and binocular image statistics, wherein the binocular image technology is most accurate due to the fact that three-dimensional height (distance) information is added on the basis of monocular two-dimensional images, but binocular passenger flow still has some problems in bus application, and therefore the passenger flow statistics accuracy rate still has some errors.
Specifically, because the passenger rocks in the discernment region in the car, current tracking algorithm arouses the miscounting easily, for example someone is with the tracking of Kalman filtering, the tracking of Kalman filtering is only fit for linear tracking, the random motion that people's rocking is, because of a little, go to track the rocking of discernment region with the tracking of Kalman filtering this time, often intermittent and continuous, arouse many counts very easily, the rate of accuracy is not high.
In addition, under the condition of heavy congestion, the effect of the depth map or the black-and-white binary map is not ideal due to the mutual interference among passengers and tracking such as particle filtering and TLD, the power consumption of the algorithm is high, and the real-time effect cannot be achieved on a common embedded board.
Disclosure of Invention
In order to solve the problems, the invention provides a method for accurately tracking and counting passengers getting on and off the train.
In order to achieve the purpose, the technical scheme provided by the invention is as follows: a method of tracking passenger flow, comprising the steps of:
acquiring multiple continuous images shot by a camera, and solving a depth map through stereo matching;
eliminating background interference, and dividing each human head into an independent connected area;
constructing a structural body for counting a plurality of people, wherein the structural body comprises an X-axis central coordinate, a Y-axis central coordinate, the area of a head area, a track point coordinate set, a total Euclidean distance of track points and a Y-axis vector distance of the track points;
solving Euclidean distance between the central coordinate of the traversed current frame communicated region and the first track point coordinate of the structural body, and storing the Euclidean distances between all the traversed current frame communicated regions and the track points in a two-dimensional array;
calculating the minimum value of the sum of best matching different rows and different columns of the bipartite graph of the two-dimensional array by using a KM algorithm, and storing the optimal solution into a one-dimensional array with the length of N;
solving the Euclidean distance between the center coordinate of the connected region of the previous frame and the first point of the track point of the structural body, circularly performing difference operation on the solved Euclidean distance and the one-dimensional array, if the difference between the Euclidean distance and the one-dimensional array is smaller than a first threshold value, considering that the head of the person is a person on the track of the structural body, adding the connected region into the track of the structural body, otherwise, continuously solving until the one-dimensional array is completely traversed, and if the difference is still not smaller than the first threshold value, considering the connected region as a person just below a video, and adding the coordinate of the person in the connected region into the structural body which is reset again;
setting an original track on the matching of each frame, and temporarily not entering counting and zero clearing when at most 1 frame cannot be matched, namely the original track cannot find a matchable connected region in the current frame.
Optionally, the first threshold is 0.001-0.002.
Optionally, when the original track still cannot be found to be matched in the 2 nd frame, the point enters statistical zero clearing, if the point meets the condition that the euclidean distance from the starting point to the end point is greater than 25, the vector euclidean distance from the starting point to the end point is greater than 15, and the number of points of the track is greater than 4, the point enters a statistical in-out people number queue, otherwise, the structure body is emptied.
Optionally, the camera is a binocular camera.
Compared with the prior art, the invention has the beneficial effects that: by the method, the passenger flow is tracked, even if passengers get on the bus to shake in a visual area, the tracking algorithm can still track all the time and cannot lose the passengers, the method is not only suitable for linear motion, but also can track curve running and random motion, even if the passengers get on the bus and get off the bus very crowded, the algorithm can realize real-time and accurate tracking of multiple persons, and the missing of counting is greatly reduced.
In addition, under the condition that the passenger just gets on the bus and closes the door without touching the line, the tracking algorithm can count in the visible area when the passenger detects that the door is closed, and therefore meter leakage is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow diagram of a method for tracking passenger flow in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a method for tracking passenger flow in this embodiment, and this embodiment provides a method for tracking passenger flow, which specifically includes the following steps:
s10: acquiring multi-frame continuous images shot by a camera, importing calibration parameters, and solving a depth map through a stereo matching algorithm.
It should be noted that the camera that adopts in this embodiment is binocular camera, has infrared light filling, and like this night, binocular camera has the infrared light to carry out the light filling, and people's passing through is still clear visible on the video, and the disparity map that obtains like this also can normal use night to the tracking on being fit for public transport that can be all-weather guarantees all-weather rate of accuracy all-weather all the day.
S20: background interference is eliminated, and each person on the depth map is divided into each independent connected area and is not adhered to each other;
specifically, in this embodiment, front and rear door binocular cameras are calibrated, calibration parameters are led into an algorithm board, a depth map Img0 is obtained through a stereo matching algorithm, the background is eliminated, a black-and-white binary map Img1 without the background is obtained, the black-and-white binary map Img1 and the depth map Img0 are integrated, each person is divided into independent communicating areas, the communicating areas are not adhered to each other, and the black-and-white binary map obtained in this way has no background interference, and the communicating areas of each person are independent and separated from each other.
S30: the method comprises the following steps of constructing a structural body for counting a plurality of people, wherein the structural body comprises a central coordinate of an X axis and a Y axis, the area of a head area, a track point coordinate set, the total Euclidean distance of track points and the Y axis vector distance of the track points.
In this embodiment, 10 arrays are defined for such a structure, and the structure is initialized.
S40: and calculating the Euclidean distance between the center coordinate of each connected region of the traversal current frame black-and-white binary image and the current track point coordinate of each structural body, and storing the Euclidean distances between all the connected regions of the traversal current frame and the center coordinate of the track point in a two-dimensional array H1.
Specifically, in this embodiment, the euclidean distance between the center coordinates of the connected region of the current frame and the first point of the track points of the 10 structural bodies is calculated and stored in a two-dimensional array, and if the current frame has N connected regions, a two-dimensional array of N × 10 is required to store the calculation result.
S50: calculating the minimum value of the sum of best matching different rows and different columns of the bipartite graph of the two-dimensional array by using a KM algorithm, and storing the optimal solution into a one-dimensional array minval [ N ] with the length of N;
specifically, the KM algorithm is used to find the minimum value of the sum of the bipartite graph of the two-dimensional array in step S40, which best matches different rows and different columns, and the value on different rows and different columns corresponding to the minimum value of the sum is the optimal solution of the minimum value of the sum. S60: calculating the Euclidean distance between the central coordinate of a connected region of a previous frame and a first point of a track point of the structural body, circularly performing difference operation on the calculated Euclidean distance and the one-dimensional array minval [ N ], if the difference between the Euclidean distance and the one-dimensional array minval [ N ] is smaller than a certain threshold value, such as 0.00001, determining that the connected region is a person on the track of the structural body, adding the connected region into the track of the structural body, if the difference is not smaller than the threshold value, continuing calculating until the minval [ N ] is completely traversed, regarding the connected region as a person just entering the video, adding the coordinate of the person in the connected region into the structural body which is reset again, wherein m is m +1 and m% 10, m is a bottom mark in the array, and if the connected region of the current frame cannot be matched with the structural body, adding the central coordinate of the connected region into the structural body TrackBlock [ m ], and simultaneously, m is added by 1, and simultaneously, m is updated to be equal to m% 10.
S70: in the matching of each frame, an original track is set, and when at most 1 frame cannot be matched, namely the original track cannot find a connected region which can be matched in the current frame, counting zero clearing is temporarily not carried out, so that the system can still continue tracking under the condition that 1 frame is lost in tracking.
S80: when the original track still cannot be matched in the 2 nd frame, the track point set enters statistical zero clearing, if the point meets the condition that the Euclidean distance from the starting point to the end point is more than 25, the vector Euclidean distance from the starting point to the end point is more than 15, and the number of points of the track is more than 4, the statistical in-out number queue is entered, otherwise, the structure body is directly emptied.
In the queue for counting the number of people entering and exiting, in an XOY coordinate system of pixels, the direction is recorded as the number of people entering +1 from top to bottom and the number of people exiting +1 from bottom to top, and then the structure is emptied, so that the number of people entering and exiting the bus in each frame is counted.
The passenger flow can be completely tracked by repeatedly circulating the steps S40-S80, so that the method is obviously enhanced in environmental adaptability, can accurately track and count the crowds and improve the identification accuracy; meanwhile, the identification accuracy of the bus mobile passenger flow is ensured, the accuracy of passenger flow statistics is greatly improved, and the method has higher practical value and is suitable for wide popularization.
An exemplary flow chart of a method for enabling passenger flow tracking according to an embodiment of the invention is described above with reference to the accompanying drawings. It should be noted that the numerous details included in the above description are merely exemplary of the invention and are not limiting of the invention. In other embodiments of the invention, the method may have more, fewer, or different steps, and the order, inclusion, function, etc. of the steps may be different than that described or illustrated.

Claims (4)

1. A method for tracking passenger flow, characterized by:
acquiring multiple continuous images shot by a camera, and solving a depth map through stereo matching;
eliminating background interference, and dividing each human head into an independent communication area;
constructing a structural body for counting a plurality of people, wherein the structural body comprises an X-axis central coordinate, a Y-axis central coordinate, the area of a head area, a track point coordinate set, a total Euclidean distance of track points and a Y-axis vector distance of the track points;
calculating Euclidean distance between the center coordinate of the traversing current frame communication region and the first track point coordinate of the structural body, and storing the Euclidean distance between all the traversing current frame communication regions and the track points in a two-dimensional array;
calculating the minimum value of the sum of best matching different rows and different columns of the bipartite graph of the two-dimensional array by using a KM algorithm, and storing the optimal solution into a one-dimensional array with the length of N;
solving the Euclidean distance between the central coordinate of the connected region of the previous frame and the first point of the track point of the structure body, circularly performing difference operation on the solved Euclidean distance and the one-dimensional array, if the difference between the Euclidean distance and the one-dimensional array is smaller than a first threshold value, considering that the head of the person is a person on the track of the structure body, adding the connected region into the track of the structure body, otherwise, continuously solving until the one-dimensional array is traversed, and if the difference is still not smaller than the first threshold value, considering the connected region as a person just entering the lower part of the video, and adding the coordinate of the person in the connected region into the structure body which is cleared again;
setting an original track on the matching of each frame, and temporarily not entering counting and zero clearing when at most 1 frame cannot be matched, namely the original track cannot find a matchable connected region in the current frame.
2. The tracking method according to claim 1, characterized in that: the first threshold value is 0.001-0.002.
3. The tracking method according to claim 1, characterized in that: when the original track is still not found to be matched in the 2 nd frame, the point enters counting and zero clearing, if the point meets the condition that the Euclidean distance from the starting point to the end point is more than 25, the vector Euclidean distance from the starting point to the end point is more than 15, and the number of points of the track is more than 4, the point enters a counting in-out people number queue, otherwise, the structure is emptied.
4. The tracking method according to any one of claims 1 to 3, characterized in that: the camera is a binocular camera.
CN202011479757.5A 2020-12-16 2020-12-16 Passenger flow tracking method Active CN112614155B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011479757.5A CN112614155B (en) 2020-12-16 2020-12-16 Passenger flow tracking method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011479757.5A CN112614155B (en) 2020-12-16 2020-12-16 Passenger flow tracking method

Publications (2)

Publication Number Publication Date
CN112614155A CN112614155A (en) 2021-04-06
CN112614155B true CN112614155B (en) 2022-07-26

Family

ID=75239310

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011479757.5A Active CN112614155B (en) 2020-12-16 2020-12-16 Passenger flow tracking method

Country Status (1)

Country Link
CN (1) CN112614155B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150550A (en) * 2013-02-05 2013-06-12 长安大学 Road pedestrian event detecting method based on movement trajectory analysis
CN103903278A (en) * 2012-12-28 2014-07-02 重庆凯泽科技有限公司 Moving target detection and tracking system
CN108446611A (en) * 2018-03-06 2018-08-24 深圳市图敏智能视频股份有限公司 A kind of associated binocular image bus passenger flow computational methods of vehicle door status

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111476817A (en) * 2020-02-27 2020-07-31 浙江工业大学 Multi-target pedestrian detection tracking method based on yolov3

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103903278A (en) * 2012-12-28 2014-07-02 重庆凯泽科技有限公司 Moving target detection and tracking system
CN103150550A (en) * 2013-02-05 2013-06-12 长安大学 Road pedestrian event detecting method based on movement trajectory analysis
CN108446611A (en) * 2018-03-06 2018-08-24 深圳市图敏智能视频股份有限公司 A kind of associated binocular image bus passenger flow computational methods of vehicle door status

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Adaboost和码本模型的手扶电梯出入口视频监控方法;杜启亮等;《计算机应用》;20170910(第09期);全文 *

Also Published As

Publication number Publication date
CN112614155A (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN108320510B (en) Traffic information statistical method and system based on aerial video shot by unmanned aerial vehicle
Luo et al. Fast and furious: Real time end-to-end 3d detection, tracking and motion forecasting with a single convolutional net
EP4152204A1 (en) Lane line detection method, and related apparatus
CN112417953B (en) Road condition detection and map data updating method, device, system and equipment
CN108959321A (en) Parking lot map constructing method, system, mobile terminal and storage medium
Perrollaz et al. Probabilistic representation of the uncertainty of stereo-vision and application to obstacle detection
Pantilie et al. Real-time obstacle detection in complex scenarios using dense stereo vision and optical flow
CN106127137A (en) A kind of target detection recognizer based on 3D trajectory analysis
CN103164711A (en) Regional people stream density estimation method based on pixels and support vector machine (SVM)
CN112162297A (en) Method for eliminating dynamic obstacle artifacts in laser point cloud map
CN114325634A (en) Method for extracting passable area in high-robustness field environment based on laser radar
CN103325115A (en) Pedestrian counting monitoring method based on head top camera
CN103646254A (en) High-density pedestrian detection method
CN106022458A (en) People fast counting method for school bus safety
Lin et al. Fall Prevention Shoes Using Camera‐Based Line‐Laser Obstacle Detection System
Huang Real-time multi-vehicle detection and sub-feature based tracking for traffic surveillance systems
WO2022166606A1 (en) Target detection method and apparatus
Geiger et al. Object flow: A descriptor for classifying traffic motion
CN112614155B (en) Passenger flow tracking method
Guo et al. 3d detection and pose estimation of vehicle in cooperative vehicle infrastructure system
CN112732860B (en) Road extraction method, device, readable storage medium and equipment
CN102063726B (en) Moving target classification method and system
US20220245831A1 (en) Speed estimation systems and methods without camera calibration
CN113569652A (en) Method for detecting short obstacles by automatic parking all-round looking camera
CN115994925B (en) Multi-row person rapid tracking method based on key point detection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant