Search

CN-121982636-A - Passenger flow statistics realization method

CN121982636ACN 121982636 ACN121982636 ACN 121982636ACN-121982636-A

Abstract

The invention provides a passenger flow statistics realization method, which comprises the steps of judging the position relation between a tracking frame and a preset line segment, and quantifying the position relation into three discrete states, namely, a state 1 at the left side of the line segment, a state 2 intersecting the line segment, and a state 3 at the right side of the line segment. The core logic of passenger flow statistics is based on analysis of continuous state change of the same target, namely, the current state, the last state and the last state of the target are recorded, and in-out behaviors are judged according to a preset state transition sequence. Specifically, it is determined to enter once when the state is detected to change in order of 1→2→3, and it is determined to leave once when the state is changed in order of 3→2→1. Through clear state definition and strict sequence judgment logic, false statistics caused by jitter or repeated crossing of a target near a line segment is effectively avoided, accuracy, reliability and anti-interference performance of passenger flow counting are improved, the method is particularly suitable for real-time analysis of a camera deployed at a terminal, and system deployment is simple and convenient.

Inventors

  • YAN SHAOFU

Assignees

  • 北京君正集成电路股份有限公司

Dates

Publication Date
20260505
Application Date
20220512

Claims (5)

  1. 1. The method is characterized in that the method is based on state logic, and comprises the steps of judging the position relation between a tracking target and a designated line segment, and counting the passenger flow based on the state change of a tracking frame, wherein the state change judgment and update logic is as follows: Judging whether the tracking frame is intersected with the appointed line segment, if so, setting the state of the intersected tracking frame to be 2; If the tracking frames are not intersected, and if the tracking frames are on the left side of the line segment, the state of the tracking frames is set to be 1; If the tracking frames are not intersected, and if the tracking frames are on the right side of the line segment, setting the state of the tracking frames to be 3; the final passenger flow data is counted through the state change of the tracking frame, and the method specifically comprises the following steps: initializing record state values, namely firstly setting three record values and initializing the record values to be 0:1. Non_state=0, wherein the record values represent the current state, 2. Last_state=0, the last state, 3. Last 2_state=0 and the last state; The statistical logic is set as follows: non_state=state of detection result; If last state= 0, last state =now_state; If last 2_state= 1 and last_state= 2 and now_state= 3, then the number of entries in_number+=1; If last 2_state= 3 and last_state= 2 and now_state= 1, the number of exits out_number+=1; If last state |=now state, last2 state=last state, and last_state =now_state; When the previous state is different from the current state, the state is judged to be in by the change of the state sequence 1- >2- >3, and the state is judged to be out by the change of the state sequence 3- >2- > 1.
  2. 2. The method of claim 1, wherein, when setting a tracking frame state that does not intersect a specified line segment: The coordinates of the tracking frame are expressed as upper left corner coordinates (x 1, y 1), and lower right corner coordinates (x 2, y 2); Calculating the center point coordinate of the coordinate, wherein the abscissa C.x = (x1+x2)/2, and the ordinate C.y = (y1+y2)/2; obtaining a vector from a center point C to a line segment end point A and a vector from a line segment AB, and calculating vector cross multiplication, wherein the vector cross multiplication is X1-vector-Y2-vector-Y1-vector; When the calculation result is positive number, namely >0, setting the state of the tracking frame to be 1, and indicating that the tracking frame is on the left side of the line segment; when the calculation result is negative, that is, <0, the state of the tracking frame is set to 3, which indicates that the tracking frame is on the right side of the line segment.
  3. 3. The method of claim 1 or 2, wherein, in determining whether the trace box intersects a specified line segment: judging whether the four frames of the rectangular tracking frame are intersected with the appointed line segment through vector cross multiplication respectively, namely judging whether the four frames AB, AC, BD, DC of the rectangular frame ABCD are intersected with the line segment FG through vector cross multiplication respectively; If any one side is intersected, the rectangular frame is intersected with the line segment, otherwise, the rectangular frame is not intersected, namely, the AB is intersected with the GF, the AC is intersected with the GF, the BD is intersected with the GF, and the DC is intersected with the GF, and if the rectangular frame is intersected with the line segment GF, the rectangular frame is judged to be intersected with the line segment GF, otherwise, the rectangular frame is not intersected with the line segment GF.
  4. 4. The method according to claim 1, wherein the method further comprises: Detecting an area where a human head is located in a video frame image through a convolutional neural network, and returning a detection result to an upper left coordinate (x 0, y 0) and a lower right coordinate (x 1, y 1) of a maximum external matrix of the human head area; and inputting the detection result information into a tracking algorithm, and tracking and matching according to the coordinate information of the human head in the video.
  5. 5. The method of claim 1, wherein the method is adapted for deployment to a terminal camera.

Description

Passenger flow statistics realization method The application discloses a divisional application of an application patent application with the name of passenger flow statistics realization method of application number 202210519841.8, and the application date is 2022, 05 and 12. Technical Field The invention relates to the technical field of intelligent video processing, in particular to a passenger flow statistics realization method. Background In recent 10 years, the neural network shows strong capability and activity in the field of Artificial Intelligence (AI), the most popular image algorithm is a deep convolution neural network at present, the deep convolution neural network plays an important role in object detection, image recognition and image segmentation, and along with the development of technology and the pushing of actual demands, more and more AI image algorithms are enabled on a video camera. The existing passenger flow statistical method mainly depends on a target detection and tracking algorithm, the prior art is used for counting the problems of false detection and high-density passenger flow missing detection existing in the passenger flow entering and exiting single-depending passenger shape detection, and the passenger flow in the statistical area needs to be formulated into an area, so that the use is complex. Disclosure of Invention In order to solve the above problems in the prior art, an object of the present application is to: The detection algorithm of the method is based on human head detection. Compared with human shape detection, human head detection has better adaptability to false detection and high-density people. In addition, the method mainly uses the established line segments as boundaries to count the flow of people entering and exiting according to the appointed line segments, and compared with the appointed area, the method is simpler and more convenient to use. Specifically, the invention provides a method for realizing passenger flow statistics, which is based on state logic and comprises the steps of judging the position relation between a tracking target and a designated line segment, and counting the passenger flow based on the state change of a tracking frame, wherein the state change judgment and update logic is as follows: Judging whether the tracking frame is intersected with the appointed line segment, if so, setting the state of the intersected tracking frame to be 2; S4, judging the state of the position relation between the tracking frame and the line segment by combining the judgment logic in the step S3, namely judging whether the tracking frame is intersected with the appointed line segment, and setting the state of the intersected tracking frame as 2 if the tracking frame is intersected with the appointed line segment; If the tracking frames are not intersected, and if the tracking frames are on the left side of the line segment, the state of the tracking frames is set to be 1; step S4 corresponding to the original text of the instruction book, wherein if the original text is not intersected and if the tracking frame is on the left side of the line segment, the state of the tracking frame is set to be 1; If the tracking frames are not intersected, and if the tracking frames are on the right side of the line segment, setting the state of the tracking frames to be 3; Step S4 corresponding to the original text of the instruction book, wherein if the original text is not intersected and if the tracking frame is on the right side of the line segment, the state of the tracking frame is set to be 3; the final passenger flow data is counted through the state change of the tracking frame, and the method specifically comprises the following steps: and S5, corresponding to the original text of the step S of the instruction book, knowing the position state of the current tracking frame through the steps, and counting the final passenger flow data through state change: initializing record state values, namely firstly setting three record values and initializing the record values to be 0:1. Non_state=0, wherein the record values represent the current state, 2. Last_state=0, the last state, 3. Last 2_state=0 and the last state; Corresponding to an original text in the S5.1 step of the instruction book, S5.1 is used for initializing a record state value, three record values are firstly set and initialized to be 0:1. No_state=0, the record value represents the current state, 2. Last_state=0, the record value represents the last state, 3. Last 2_state=0, and the record value represents the last state; The statistical logic is set as follows: non_state=state of detection result; corresponding to the step S5.2 of the specification, the original text is that "no_state=state of detection result". If last state= 0, last state =now_state; Corresponding to the step S5.2 of the instruction book, if last_state= =0, last_state=now_state, namely assigning the current state to the l