Search

CN-122023456-A - Multi-fold line target line-passing counting method and system based on angle direction

CN122023456ACN 122023456 ACN122023456 ACN 122023456ACN-122023456-A

Abstract

The invention provides a multi-broken line target line-passing counting method and system based on an angle direction, wherein in the method, a target continuous position is obtained; determining a reference point and an associated vertex according to the geometric structure and the target position of a preset multi-fold line counting line, calculating the included angle difference between a reference vector and a target vector by taking the reference point as the vertex and normalizing to obtain a direction angle value, comparing the angle value with the reference angle to judge the entering or leaving direction of the target, detecting whether a target track is effectively intersected with the counting line and triggering multi-layer filtering when the intersecting counting state is an odd number, and generating an effective line passing event and updating the counting when the direction consistency and the target distance judgment are both passed. The invention can accurately adapt to complex broken line scenes, realizes bidirectional counting with high accuracy, and effectively solves the problem of repeated counting caused by target loitering.

Inventors

  • XUE CHAOBIN
  • WU YUELONG

Assignees

  • 厦门星纵物联科技有限公司

Dates

Publication Date
20260512
Application Date
20251231

Claims (9)

  1. 1. The multi-fold line target line passing counting method based on the angle direction is characterized by comprising the following steps of: acquiring position information of a tracked target in continuous video frames; Determining, for each preconfigured polyline count line, a reference point for calculating an angle and associated leading and trailing vertices based on a current position of the target and a geometry of the polyline count line; Calculating an included angle difference between a reference vector pointing to the reference point from the preamble vertex and a target vector pointing to the current position of the target from the reference point by taking the reference point as a vertex, and normalizing the included angle difference into a direction angle value in a preset range; Based on the comparison between the direction angle value and a preset reference angle, judging the current movement direction of the target relative to the multi-fold line counting line; Detecting whether the motion trail of the target effectively intersects with the multi-broken line counting line, and triggering multi-layer filtering judgment when the effective intersection is detected and the intersection counting state of the target is an odd number; And when the multi-layer filtering judgment is passed, generating a valid online event of the target, and updating a counting result.
  2. 2. The method of claim 1, wherein the determining a reference point and associated leading and trailing vertices for calculating an angle based on a current position of the target and a geometry of the polyline count line comprises: If the multi-broken line counting line is a two-point line segment, taking the midpoint of the line segment as the reference point, and respectively taking the two endpoints of the line segment as the front vertex and the rear vertex; And if the polyline counting line is a polyline with three or more points, selecting an intermediate vertex with the minimum Euclidean distance with the current position of the target from the intermediate vertices except for the head and tail endpoints as the reference point, and taking the former vertex directly connected with the reference point as the front vertex and the latter vertex as the rear vertex.
  3. 3. The method of claim 1, wherein determining the current direction of movement of the target relative to the polyline count line based on the direction angle value compared to a preset reference angle comprises: Calculating an included angle between a direction vector pointing to the subsequent vertex from the reference point and the reference vector as the reference angle; If the direction angle value is smaller than the reference angle, judging that the current movement direction of the target is an entering direction; and if the direction angle value is larger than the reference angle, judging that the current movement direction of the target is the departure direction.
  4. 4. The method of claim 1, wherein the multi-layer filtering decision comprises: the first layer of filtering verifies whether the current movement direction of the target is consistent with the movement direction recorded when the current movement direction of the target is effectively intersected for the first time; A second layer of filtering verifies whether the target has been far from the polyline count line, the verifying comprising determining whether a circle centered on a current position of the target and having a radius that is a radius of a circumscribed circle dynamically calculated based on a size of the target intersects any segment of the polyline count line; When both the first layer filtering and the second layer filtering pass, the multi-layer filtering is determined to pass.
  5. 5. The method of claim 4, wherein the radius of the circumscribed circle is calculated from an average of a bounding box width and height of the object.
  6. 6. The method of claim 1, further comprising the step of excluding end point intersection misjudgment, comprising: when the target is detected to be positioned in a preset sensitive area of an endpoint of the multi-fold line counting line, checking whether the position of the last frame before the target enters the sensitive area is positioned outside the sensitive area and whether the movement direction of the target is consistent; if the check is not passed, the end point is judged to be touched by mistake, and the cross counting state is not triggered or reset.
  7. 7. A multi-polyline target line count system based on angular orientation, the system comprising: The target tracking module is used for acquiring the position information of the tracked target in the continuous video frames; The direction calculation module is used for determining a reference point for calculating angles and associated leading vertexes and trailing vertexes according to the current position of the target and the geometric structure of the multi-broken line counting lines, calculating an included angle difference between a reference vector pointed by the leading vertexes to the reference point and a target vector pointed by the reference point to the current position of the target by taking the reference point as vertexes, normalizing the included angle difference into a direction angle value in a preset range, and comparing the direction angle value with a preset reference angle to determine the current movement direction of the target relative to the multi-broken line counting lines; The intersection detection module is used for detecting whether the motion trail of the target effectively intersects with the multi-broken line counting line and managing the intersection counting state of the target; The event judging module is used for executing multi-layer filtering judgment when detecting effective intersection and the intersection counting state is odd, and generating an effective line passing event when judging to pass; And the counting output module is used for updating and outputting a counting result according to the effective online event.
  8. 8. An electronic device, comprising a processor and a memory; the memory is used for storing instructions; the processor being configured to execute the instructions in the memory and to perform the method of any of claims 1-6.
  9. 9. A computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of any of the preceding claims 1-6.

Description

Multi-fold line target line-passing counting method and system based on angle direction Technical Field The invention relates to the technical field of computer vision and target tracking, in particular to a multi-fold line target line-passing counting method and system based on an angle direction. Background In application scenarios such as video monitoring, passenger flow statistics, traffic flow monitoring, etc., it is a core requirement to accurately count the number of times that a target (e.g., a pedestrian or a vehicle) crosses a specified virtual boundary (i.e., a count line). Most of the prior art is designed aiming at a simple single linear counting line, and counting is carried out by detecting the change of the position relation between the target center point and the straight line. However, such schemes have significant drawbacks in practical applications. Firstly, the existing method cannot flexibly adapt to the scene of the boundary of the polyline or the polyline commonly existing in reality, such as an irregular area entrance, a multichannel intersection or an L-shaped corridor, so that the counting range is limited, and the scene applicability is poor. Second, when the target moves around or wanders around the count line, the counting logic based on simple position changes is very prone to cause repeated counting, resulting in serious distortion of the statistics. Furthermore, most schemes can only judge whether the target passes through the line, so that two movement directions of 'entering' and 'leaving' are difficult to accurately distinguish, and the actual business requirement of independently counting the bidirectional flow cannot be met. Therefore, how to achieve high adaptive counting of complex boundaries, accurate direction identification, and robust loitering filtering is a need for a person skilled in the art to solve. Disclosure of Invention The embodiment of the invention provides a multi-polyline target line-passing counting method and system based on an angle direction, which can realize high-adaptability counting, accurate direction recognition and robust loitering filtering of complex boundaries. The first aspect of the invention provides a multi-fold line target line passing counting method based on an angle direction, which comprises the following steps: acquiring position information of a tracked target in continuous video frames; Determining, for each preconfigured polyline count line, a reference point for calculating an angle and associated leading and trailing vertices based on a current position of the target and a geometry of the polyline count line; Calculating an included angle difference between a reference vector pointing to the reference point from the leading vertex and a target vector pointing to the current position of the target from the reference point by taking the reference point as the vertex, and normalizing the included angle difference into a direction angle value in a preset range; Based on the comparison of the direction angle value and a preset reference angle, judging the current movement direction of the target relative to the multi-fold line counting line; Detecting whether a motion track of a target effectively intersects with a multi-fold line counting line, and triggering multi-layer filtering judgment when the effective intersection is detected and the intersecting counting state of the target is an odd number; When the multi-layer filtering judgment is passed, a valid online event of the target is generated, and the counting result is updated. Optionally, determining the reference point for calculating the angle and associated leading vertex and trailing vertex based on the current position of the target and the geometry of the polyline count line includes: If the multi-fold line counting line is a two-point line segment, taking the middle point of the line segment as a reference point, and taking two end points of the line segment as a front vertex and a rear vertex respectively; If the polyline count line is a polyline of three or more points, then selecting an intermediate vertex with the minimum Euclidean distance from the current position of the target from the intermediate vertices except the head and tail end points as a reference point, and taking the former vertex directly connected with the reference point as a front vertex and the latter vertex as a rear vertex. Optionally, determining the current movement direction of the target relative to the polyline count line based on comparing the direction angle value with a preset reference angle includes: calculating an included angle between a direction vector pointing to a subsequent vertex from a reference point and a reference vector to serve as a reference angle; if the direction angle value is smaller than the reference angle, judging that the current movement direction of the target is the entering direction; if the direction angle value is larger than the reference angle, th