A video monitoring method and system for preventing tailgating of a barrier gate

By performing frame-by-frame processing and removing specular highlights from the monitoring video stream of the barrier gate, a complete contour model is generated, which solves the problem that the barrier gate anti-following system cannot identify following vehicles under strong reflections, and realizes accurate vehicle identification and following behavior judgment in complex environments.

CN121861575BActive Publication Date: 2026-07-31NANZE (GUANGDONG) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANZE (GUANGDONG) TECH CO LTD
Filing Date
2025-12-23
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

The existing anti-following system for road barriers generates strong specular reflection interference in the monitoring image due to the reflection of the highly smooth metal tanks of hazardous chemical vehicles. This causes the pixel areas of the vehicles in front and behind to become blurred, making it impossible for the system to accurately identify the independent existence of the following vehicle. It then misjudges that the vehicle in front has not passed, resulting in the failure of the anti-following function.

Method used

By performing frame-by-frame processing on the monitoring video stream of the barrier gate, the specular highlight area of ​​the foreground target is extracted and a complete contour model is generated. The vehicle motion trajectory is constructed based on the residual area of ​​the target in multiple frames, and the relationship between the trajectories is used to determine whether there is following behavior.

Benefits of technology

Under strong reflection interference, the system can accurately identify vehicle shape and movement trajectory, reduce release delay, improve the recognition accuracy and stability of the anti-following system, and prevent potential following behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121861575B_ABST
    Figure CN121861575B_ABST
Patent Text Reader

Abstract

This invention relates to the field of video surveillance processing technology, specifically disclosing a video surveillance method and system for preventing vehicle following at a barrier gate. The method includes the following steps: extracting a foreground target from a video frame; extracting a residual region of the target based on the specular highlight area of ​​the foreground target; generating a complete contour model of the foreground target based on the residual region; determining the position points of the complete contour model in each video frame, and connecting the position points to form the motion trajectory of the foreground target; sorting the foreground targets according to their order of appearance in the monitoring area, obtaining the motion trajectories A1 and A2 of two adjacent foreground targets in the sorted sequence, and determining whether vehicle following behavior exists based on the motion trajectories A1 and A2. This invention improves the accuracy of vehicle following detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video surveillance processing technology, specifically to a video surveillance method and system for preventing vehicles from following another vehicle at a barrier gate. Background Technology

[0002] The anti-following system at the entrance and exit of the chemical industrial park relies on visual monitoring for accurate identification and tracking of vehicle targets. When a hazardous chemical vehicle produces a strong specular reflection due to the highly polished metal tank, a bright environmental image is dynamically superimposed on the monitoring screen, forming a constantly changing interference layer.

[0003] In close-range following scenarios, the frontal features of the following vehicle are completely obscured or blended with the reflected light from the tank of the preceding vehicle. This causes the pixel areas of both vehicles to lose clear boundaries in the image, appearing as a visually continuous unified target. This makes the system's multi-object tracking algorithm lose its ability to distinguish the contours and feature differences of individual objects, rendering it unable to perceive the independent existence of the following vehicle. More importantly, because the reflected image lags behind the moving preceding vehicle, the system may misjudge whether the preceding vehicle has completely moved away, mistakenly believing that the vehicle has not yet passed and thus keeping the barrier gate in the raised state. This series of perceptual confusions and judgment delays caused by reflections ultimately renders the core interception function of the anti-following system ineffective, providing a window of opportunity for potentially dangerous following behaviors. Summary of the Invention

[0004] The purpose of this invention is to provide a video monitoring method and system for preventing vehicles from following each other at a barrier gate, thereby solving the above-mentioned technical problems.

[0005] The objective of this invention can be achieved through the following technical solutions:

[0006] A video surveillance method for preventing vehicles from following each other at a barrier gate includes the following steps:

[0007] The monitoring video stream of the barrier gate area is processed into several video frames, and the foreground target in the video frames is extracted.

[0008] Extract the specular highlight region from the surface of the foreground target, and obtain the target residue region based on the specular highlight region and the original pixel region of the foreground target;

[0009] Based on the residual region of the foreground target in multiple consecutive video frames, a complete contour model of the foreground target is generated.

[0010] Determine the position points of the complete contour model in each video frame, and connect the position points to form the motion trajectory of the foreground target;

[0011] Sort the foreground targets according to the order in which they appear in the monitoring area, obtain the motion trajectories A1 and A2 of two adjacent foreground targets in the sort, and determine whether there is following behavior based on the motion trajectories A1 and A2.

[0012] As a further aspect of the present invention: obtaining the target residual region includes:

[0013] The original pixel region of the foreground target is converted to the HSV color space. In the HSV color space, pixels with saturation lower than a first preset threshold and brightness higher than a second preset threshold are marked as target points.

[0014] The original pixel region of the foreground target is converted to the RGB color space, and the standard deviation of the red, green and blue channel values ​​of each pixel is calculated. Pixels with a standard deviation lower than a third preset threshold are also marked as target points.

[0015] Perform connected component analysis on all target points, and merge the spatially connected target points into a region, which is denoted as the specular highlight region.

[0016] The portion remaining after removing all specular highlight areas from the original pixel region is referred to as the target residual region.

[0017] As a further aspect of the present invention: generating a complete contour model includes:

[0018] The residual area of ​​the foreground target in N consecutive video frames is denoted as the target region. The center point of the target region is obtained and sorted according to the time axis order. N is an integer greater than three.

[0019] Calculate the translation vector from the center point of the kth position in the sort to the center point of the (k+1)th position in the sort, and align the target region of the kth video frame with the target region of the (k+1)th video frame based on the translation vector;

[0020] Perform a pixel-wise logical OR operation on the aligned target regions to obtain the fused region. Calculate the convex hull of the fused region, and the region enclosed by the convex hull is denoted as the complete contour model of the foreground target.

[0021] As a further aspect of the present invention, generating a complete contour model further includes:

[0022] Identify all edge pixels in the fusion region, and find the pixel with the smallest ordinate among all edge pixels as the starting point;

[0023] Calculate the angle between the line connecting the starting point and all other edge pixels and the horizontal direction, and sort the edge pixels in ascending order according to the size of the angle.

[0024] Traverse the edge pixels in sorted order, use the cross product to determine the direction of the current edge pixel, and remove the edge pixels that cause non-convex turning.

[0025] The polygon formed by connecting the remaining pixels in sequence is the convex hull.

[0026] As a further aspect of the present invention: determining the location point includes:

[0027] Obtain the target residual region C of the foreground target in the current video frame;

[0028] The complete contour model is translated within the image plane of the current video frame. For each translation position of the complete contour model, the overlapping area between the complete contour model region and the target residual region C at that translation position is calculated.

[0029] The translation position that maximizes the overlapping area is selected as the matching position of the complete contour model in the current video frame;

[0030] The center point of the complete contour model corresponding to the matching position is recorded as the position point of the foreground target in the current video frame.

[0031] As a further aspect of the present invention: calculating the overlapping area includes:

[0032] For each translation position, obtain the logical AND operation result of the complete contour model region and the target residual region C on the image plane;

[0033] The total number of pixels with a true value in the result of the statistical logical AND operation is the overlapping area.

[0034] As a further aspect of the present invention: determining whether following behavior exists includes:

[0035] Obtain the positions of motion trajectories A1 and A2 at the current moment, and denote them as the first position point and the second position point, respectively. Calculate the distance D between the first position point and the second position point.

[0036] The moving speeds V1 and V2 of the first position point on the motion trajectory A1 and the second position point on the motion trajectory A2 are obtained respectively, and the difference between V1 and V2 is recorded as the relative speed;

[0037] If the distance D is less than the preset distance threshold, the absolute value of the relative speed is less than the preset speed threshold, and the distance D corresponding to multiple consecutive video frames is less than the preset distance threshold, then it is determined that there is a following behavior.

[0038] A video surveillance system for preventing vehicles from following another vehicle at a barrier gate includes:

[0039] Acquisition module: Performs frame segmentation on the monitoring video stream of the barrier gate area to obtain several video frames, and extracts foreground targets from the video frames;

[0040] Extraction module: Extracts the specular highlight area on the surface of the foreground target, and obtains the target residue area based on the specular highlight area and the original pixel area of ​​the foreground target;

[0041] Reconstruction module: Based on the residual region of the foreground target in multiple consecutive video frames, generate a complete outline model of the foreground target;

[0042] Analysis module: Determines the position points of the complete contour model in each video frame, and connects the position points to form the motion trajectory of the foreground target;

[0043] Judgment module: Sort the foreground targets according to the order in which they appear in the monitoring area, obtain the motion trajectories A1 and A2 of two adjacent foreground targets in the sort, and determine whether there is following behavior based on the motion trajectories A1 and A2.

[0044] The beneficial effects of this invention compared to the prior art are as follows:

[0045] This invention removes parts of the vehicle's foreground region susceptible to specular reflection and constructs a complete vehicle contour model based on the target area stably retained across multiple video frames. This allows the system to obtain a relatively reliable vehicle morphology representation even under strong reflection interference conditions. By using the matching position of this contour model in each video frame to determine the vehicle's trajectory, the system effectively reduces the offset caused by reflection trails in vehicle position judgment, enabling accurate identification of the preceding vehicle's passage when it actually leaves, thus reducing release delays caused by high-brightness residue. Simultaneously, the spatial and motion relationships between trajectories can be clearly distinguished when vehicles enter the monitoring area sequentially, allowing the system to maintain trajectory independence even when the distance between vehicles is close and the reflection effects are complex, facilitating the identification of abnormally close following behavior. Through the above processing, this invention improves the contour stability, trajectory continuity, and reliability of behavior judgment of vehicles in strong specular reflection scenarios, thereby enhancing the overall operational stability and recognition accuracy of the gate anti-following system under reflection interference scenarios. Attached Figure Description

[0046] The invention will now be further described with reference to the accompanying drawings.

[0047] Figure 1 This is a flowchart illustrating a video monitoring method for preventing vehicles from following each other at a barrier gate, according to the present invention. Detailed Implementation

[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0049] Please see Figure 1 As shown, the present invention is a video surveillance method for preventing vehicles from following each other at a barrier gate, comprising the following steps:

[0050] Images are captured frame by frame in chronological order from the continuous video signal output by the camera device, according to the original sampling rate of the image sensor. This converts the originally continuous video sequence into static image frames that can be processed sequentially. Each frame is then sent to the foreground extraction process. Utilizing the characteristic that the background of the barrier gate area is relatively stable in a short time and that vehicles entering the area create a significant pixel difference from the background, a background model is constructed, including the barrier gate ground, fixed facilities, and the surrounding environment. The current video frame is then compared with this background model at the pixel level. By setting a grayscale difference threshold that can separate changes in vehicle shape, areas that are significantly different from the background and have a coherent structure are identified as foreground candidate regions. Morphological processing is then applied to the foreground candidate regions to eliminate scattered noise and weak connections, forming clearly defined foreground regions. Considering that vehicles typically exhibit a continuous shape within the barrier gate area, connectivity rules are used to select connected regions whose area and morphological features match the vehicle's shape as foreground targets. For example, when a vehicle enters the barrier gate, there is a significant pixel difference between its body outline and the ground background. After differential processing, a complete foreground area will appear at the corresponding position. Through the above processing, the vehicle can be separated from the background and used as a foreground target for subsequent recognition and processing.

[0051] Extract the specular highlight region from the surface of the foreground target, and obtain the target residue region based on the specular highlight region and the original pixel region of the foreground target;

[0052] In a preferred embodiment of the present invention, obtaining the target residual region includes:

[0053] The original pixel region of the foreground target is mapped to the HSV color space according to the color model conversion rules. By analyzing the hue, saturation, and brightness of each pixel, pixels exhibiting high brightness and low chromaticity characteristics are filtered out using pre-set saturation and brightness thresholds. When the saturation of a pixel is lower than a first preset threshold and the brightness is higher than a second preset threshold, that pixel is marked as a target point. For example, when a hazardous chemical tanker reflects ambient light to form a bright area in a video, these areas are usually represented by pixels with low saturation and high brightness in the HSV color space, and can be marked by threshold filtering.

[0054] To further identify areas with uniform surface brightness and obvious reflective properties, the original pixel area of ​​the foreground target is converted to the RGB color space. By analyzing the fluctuation of pixel values ​​in the red, green and blue channels of each pixel, the consistency of these channel values ​​is judged. When the value difference of a pixel in the three color channels is small and lower than the set third preset threshold, the pixel is also marked as a target point.

[0055] After the above marking operations, connected component analysis is performed on all marked target points. By detecting whether pixels are spatially adjacent, consecutively distributed target points are aggregated into the same connected region, and this region is recorded as a specular highlight region. Once the specular highlight region is determined, the pixels corresponding to these highlight regions are removed from the original pixel region, so that the remaining part forms an information region that can represent the non-reflective part of the vehicle, thus completing the acquisition of the target residual region.

[0056] Understandably, the basis for identifying specular highlight areas in foreground targets and removing them from the original pixel area stems from the inherent physical characteristics of specular reflection in imaging. Specifically, reflective areas often exhibit uniform color composition, significantly reduced saturation, and brightness considerably higher than the non-reflective parts of the vehicle's surface material. Specular reflection occurs when light is reflected from a metallic or smooth surface into the camera in a near-mirror manner, causing the pixel value differences in different color channels to converge, resulting in a visual characteristic close to a bright, light color. Therefore, it exhibits low saturation and high brightness in the HSV color space, and relatively small differences in the three channel values ​​in the RGB color space. The threshold setting relies on statistical analysis of the actual imaging of the vehicle surface and its reflective areas in the monitored image. A specific threshold is determined by finding a stable boundary condition in the samples that separates highlight and non-highlight areas, thus ensuring that the reflective parts can still be identified based on color consistency and brightness characteristics under different lighting conditions. The specular highlight areas identified using this imaging principle are essentially interference layers formed by ambient light reflection. Their presence can disrupt the representation of the vehicle's true outline in the image. By removing the highlight areas and retaining the target residual areas, the relatively stable structures in the vehicle's shape can be extracted and utilized in subsequent processing steps, providing a more consistent foundation for constructing a contour model that reflects the vehicle's true shape.

[0057] Based on the residual region of the foreground target in multiple consecutive video frames, a complete contour model of the foreground target is generated.

[0058] In another preferred embodiment of the present invention, generating a complete contour model includes:

[0059] The residual regions of the foreground target in multiple consecutive video frames are extracted sequentially. The residual region of the target in each frame is regarded as an independent target region. The geometric center position of each target region is calculated based on the pixel distribution. The horizontal and vertical coordinates of the center position in the image coordinate system are recorded as the center point of that frame. All center points are sorted according to the time order of the video frames.

[0060] For the two center points located at the k-th and k+1-th positions after sorting, obtain the difference between their horizontal and vertical coordinates. Combine these two differences into a translation vector between the current two frames. Then apply this translation vector to the target region of the k-th video frame, so that the corresponding difference is added to the horizontal and vertical coordinates of each pixel coordinate in the target region of the k-th video frame. This translates the target region in the k-th video frame to a position aligned with the target region in the k+1-th video frame.

[0061] The above alignment operation is performed sequentially on the target regions of each consecutive frame to align all target regions in the same image coordinate system. Then, a pixel-level logical OR operation is performed on the aligned target regions. If there is a foreground pixel in any frame's target region at each pixel position, that position is marked as the foreground, resulting in a fused region containing the superposition of information from multiple frames.

[0062] To extract the complete contour from the fused region, all pixels located at the region's edges are first identified within the fused region. These edge pixels are determined by scanning the image boundary and detecting foreground pixels adjacent to the background. Among these edge pixels, the pixel with the smallest vertical coordinate and the smallest horizontal coordinate under the same vertical coordinate is selected as the starting point. Using this starting point as a reference point, lines are drawn to each of the other edge pixels, and the angle between each line and the horizontal direction is calculated. All edge pixels are then sorted according to the angle from smallest to largest. When visiting edge pixels sequentially along the sorted order, two adjacent line segments are formed by the currently visited pixel, the previously retained pixel, and the pixel before that. The sign of the cross product of these two line segments is determined. If the current pixel's orientation is determined to be an inward concave non-convex orientation, the current pixel is removed from the candidate sequence. Only when an outward convex orientation is found is the pixel retained. As the traversal progresses and all edge pixels are filtered out, the remaining pixels are connected sequentially in the traversal order to form a closed polygon. This polygon is the convex hull of the fusion region, and the internal region it encloses is determined as the complete outline model of the foreground target.

[0063] It is worth noting that aligning and fusing the target residual area in consecutive video frames is based on the imaging characteristics of vehicles moving in a stable posture along a fixed direction in the gate monitoring. The shape difference of the same vehicle in different frames mainly comes from position changes rather than structural changes. By translating the target area of ​​adjacent frames through the displacement between the center points, the residual parts representing the real surface of the vehicle in each frame overlap under the same image coordinates, which can make the local defects caused by reflection or occlusion in different frames complement each other.

[0064] When performing pixel OR operations on the aligned region, check whether there are pixels considered as target remnants in the multi-frame aligned region at the same image coordinate position. As long as any frame contains target remnants at this position, the position is retained in the fusion result, thereby forming a fusion region containing effective information from multiple frames.

[0065] The boundary of the fusion region may contain minor depressions. To extract an outer contour that better represents the overall shape of the vehicle, all edge pixels in the fusion region are sorted according to their geometric relationship with the reference point. The traversal order is determined by the direction of the line connecting the reference point and the edge point. During the traversal, the cross product sign of two adjacent line segments formed by three consecutive edge points is used to determine the direction of the boundary. A positive or negative cross product represents geometric convexity or concavity. By removing pixels that produce concave direction and retaining pixels in the convex direction, a completely outward-opening contour can be obtained.

[0066] This method relies on the basic principles of steering and cross product relationships in plane geometry, enabling the convex hull to stably surround the outer edges of all fusion regions, forming a complete contour model. This provides a clear and unaffected morphological description for determining the vehicle's position in subsequent new video frames through contour matching, and provides a coherent and reliable foundation for continuously tracking the vehicle's motion.

[0067] Determine the position points of the complete contour model in each video frame, and connect the position points to form the motion trajectory of the foreground target;

[0068] In another preferred embodiment of the present invention, determining the location point includes:

[0069] After obtaining the target residual region C of the foreground target in the current video frame, a search area is set around the approximate location of the target residual region C in the image plane of the video frame. Multiple sets of translation displacements are generated in the search area according to the preset horizontal translation step size and vertical translation step size. Each set of translation displacements consists of a horizontal offset and a vertical offset. All pixel coordinates of the complete contour model are simultaneously added with the corresponding integer displacement in the horizontal and vertical directions according to the offset, so as to obtain a translation position of the complete contour model in the current video frame.

[0070] For each translation position, the translated complete contour model region is superimposed on the target residual region C in the current video frame in the same coordinate system. For each pixel coordinate in the image plane, the marker value of the coordinate in the complete contour model region and the marker value in the target residual region C are checked. When both marker values ​​indicate that the coordinate belongs to the corresponding region, the result of the logical AND operation is recorded as true at that coordinate; otherwise, it is recorded as false. By traversing all pixel coordinates in the entire search area, the number of pixels marked as true in the logical AND result is counted, and this number is recorded as the overlapping area value corresponding to the translation position. As the above overlapping area calculation is completed for all preset translation positions, the translation displacement with the largest overlapping area value is selected. The position of this translation displacement in the current video frame after being applied to the complete contour model is used as the matching position. The center point of the complete contour model is obtained at this matching position according to its geometric definition. This center point is used as the position point of the foreground target in the current video frame for subsequent trajectory construction and analysis.

[0071] It should be noted that translating the complete contour model within the image plane of the current video frame and calculating the overlapping area with the target residual area at each translation position relies on the imaging principle that the shape of the same vehicle remains basically unchanged in a short period of time while the overall displacement mainly occurs. The shape of the same vehicle abstracted by the complete contour model in different frames and the shape of the target residual area in the current frame should have the largest possible common coverage area at the ideal alignment position. Therefore, by changing the position of the complete contour model in the image coordinates and examining the number of pixel positions occupied by the two, the degree of matching between the two can be characterized by the size of the overlapping area.

[0072] The logical AND operation here is to determine whether each pixel coordinate belongs to both the complete contour model region and the target residual region. Only when both sides are identified as the target part is the overlapping region counted. This is equivalent to realizing the intersection statistics of two region sets at the discrete pixel level. The total number of pixels obtained by traversing and accumulating all pixel coordinates directly corresponds to the overlapping area.

[0073] The translation position with the largest overlapping area represents the position where the complete contour model and the residual area of ​​the target in the current frame have the most complete spatial shape overlap. This indicates that the position is closest to the vehicle's true position in the current frame. By using the center point of the complete contour model corresponding to this position as the position point of the foreground target, matching and positioning can be performed based on the pre-constructed stable contour shape even in the presence of continuous specular reflection interference and local defects. This allows the position point sequence between different video frames to more accurately reflect the actual movement trajectory of the vehicle, providing a reliable geometric basis for subsequent trajectory-based distance judgment and vehicle following behavior recognition.

[0074] Sort the foreground targets according to the order in which they appear in the monitoring area, obtain the motion trajectories A1 and A2 of two adjacent foreground targets in the sort, and determine whether there is following behavior based on the motion trajectories A1 and A2.

[0075] In a preferred embodiment of the present invention, determining whether following behavior exists includes:

[0076] Obtain the positions of motion trajectories A1 and A2 at the current moment, and denote them as the first position point and the second position point, respectively. Calculate the distance D between the first position point and the second position point.

[0077] The moving speeds V1 and V2 of the first position point on the motion trajectory A1 and the second position point on the motion trajectory A2 are obtained respectively, and the difference between V1 and V2 is recorded as the relative speed;

[0078] If the distance D is less than the preset distance threshold, the absolute value of the relative speed is less than the preset speed threshold, and the distance D corresponding to multiple consecutive video frames is less than the preset distance threshold, then it is determined that there is a following behavior.

[0079] It should be noted that this invention, by separating the specular reflection area from the vehicle's actual surface area and geometrically fusing residual information from multiple frames, enables the vehicle to obtain a complete contour model with stable shape features even under conditions of strong reflection interference, temporary loss of local features, and blurred boundaries between vehicles. Based on this, the vehicle's position is recovered in each video frame through shape matching. The resulting stability is difficult to achieve with traditional tracking methods that rely on single-frame appearance or connected component morphology. Even with large bright spots or ghosting caused by reflections, the vehicle's actual shape can still be reconstructed as a consistent contour representation centered on the residual area, thus maintaining trajectory continuity under complex imaging conditions. This enables continuous capture of the vehicle's actual motion and reliable differentiation of relationships between multiple vehicles.

[0080] In addressing issues such as fragmented vehicle outlines due to specular reflection, visual fusion of front and rear vehicles, and residual misjudgments caused by motion blur in barrier gate scenarios, this invention identifies and removes highlight areas to obtain target residual regions that represent the true structure of the vehicle. This isolates interfering features from subsequent modeling. By aligning residual regions across multiple frames to construct a complete outline model, scattered local information across frames can be unified and integrated into a stable shape. Thus, even when the vehicle outline cannot be fully represented in a single frame, the outline model can still be used for positioning. By searching for the optimal overlap position between the outline model and the residual region in each frame, the true position of the vehicle under different levels of interference can still be recovered. The trajectory thus possesses continuity and distinguishability, providing a reliable basis for further using the distance and relative motion between trajectories to judge following behavior. This allows the barrier gate to accurately judge the vehicle's entry and exit status and maintain its anti-following capability even under severe reflection interference.

[0081] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the present invention should still fall within the scope of the present invention.

Claims

1. A video monitoring method for barrier anti-tailgating, characterized in that, Includes the following steps: The monitoring video stream of the barrier gate area is processed into several video frames, and the foreground target in the video frames is extracted. Extract the specular highlight region from the surface of the foreground target, and obtain the target residue region based on the specular highlight region and the original pixel region of the foreground target; Based on the residual region of the foreground target in multiple consecutive video frames, a complete contour model of the foreground target is generated. Determine the position points of the complete contour model in each video frame, and connect the position points to form the motion trajectory of the foreground target; Sort the foreground targets according to the order in which they appear in the monitoring area, obtain the motion trajectories A1 and A2 of two adjacent foreground targets in the sort, and determine whether there is following behavior based on the motion trajectories A1 and A2; Generating a complete contour model includes: The residual area of ​​the foreground target in N consecutive video frames is denoted as the target region. The center point of the target region is obtained and sorted according to the time axis order. N is an integer greater than three. Calculate the translation vector from the center point of the kth position in the sort to the center point of the (k+1)th position in the sort, and align the target region of the kth video frame with the target region of the (k+1)th video frame based on the translation vector; Perform a pixel-wise logical OR operation on the aligned target regions to obtain the fused region. Calculate the convex hull of the fused region, and the region enclosed by the convex hull is denoted as the complete contour model of the foreground target. Generating a complete contour model also includes: Identify all edge pixels in the fusion region, and find the pixel with the smallest ordinate among all edge pixels as the starting point; Calculate the angle between the line connecting the starting point and all other edge pixels and the horizontal direction, and sort the edge pixels in ascending order according to the size of the angle. Traverse the edge pixels in sorted order, use the cross product to determine the direction of the current edge pixel, and remove the edge pixels that cause non-convex turning. The polygon formed by connecting the remaining pixels in sequence is the convex hull. Determining the location points includes: Obtain the target residual region C of the foreground target in the current video frame; The complete contour model is translated within the image plane of the current video frame. For each translation position of the complete contour model, the overlapping area between the complete contour model region and the target residual region C at that translation position is calculated. The translation position that maximizes the overlapping area is selected as the matching position of the complete contour model in the current video frame; The center point of the complete contour model corresponding to the matching position is recorded as the position point of the foreground target in the current video frame; Determining whether following behavior exists includes: Obtain the positions of motion trajectories A1 and A2 at the current moment, and denote them as the first position point and the second position point, respectively. Calculate the distance D between the first position point and the second position point. The moving speeds V1 and V2 of the first position point on the motion trajectory A1 and the second position point on the motion trajectory A2 are obtained respectively, and the difference between V1 and V2 is recorded as the relative speed; If the distance D is less than the preset distance threshold, the absolute value of the relative speed is less than the preset speed threshold, and the distance D corresponding to multiple consecutive video frames is less than the preset distance threshold, then it is determined that there is a following behavior.

2. The video monitoring method for anti-tailgating of a barrier gate according to claim 1, characterized in that, Obtaining the target residual area includes: The original pixel region of the foreground target is converted to the HSV color space. In the HSV color space, pixels with saturation lower than a first preset threshold and brightness higher than a second preset threshold are marked as target points. The original pixel region of the foreground target is converted to the RGB color space, and the standard deviation of the red, green and blue channel values ​​of each pixel is calculated. Pixels with a standard deviation lower than a third preset threshold are also marked as target points. Perform connected component analysis on all target points, and merge the spatially connected target points into a region, which is denoted as the specular highlight region. The portion remaining after removing all specular highlight areas from the original pixel region is referred to as the target residual region.

3. The video monitoring method for anti-tailgating of a barrier gate according to claim 1, characterized in that, Calculating the overlapping area includes: For each translation position, obtain the logical AND operation result of the complete contour model region and the target residual region C on the image plane; The total number of pixels with a true value in the result of the statistical logical AND operation is the overlapping area.

4. A video monitoring system for barrier anti-tailgating, for implementing a video monitoring method for barrier anti-tailgating according to any one of claims 1-3, characterized in that, include: Acquisition module: Performs frame segmentation on the monitoring video stream of the barrier gate area to obtain several video frames, and extracts foreground targets from the video frames; Extraction module: Extracts the specular highlight area on the surface of the foreground target, and obtains the target residue area based on the specular highlight area and the original pixel area of ​​the foreground target; Reconstruction module: Based on the residual region of the foreground target in multiple consecutive video frames, generate a complete outline model of the foreground target; Analysis module: Determines the position points of the complete contour model in each video frame, and connects the position points to form the motion trajectory of the foreground target; Judgment module: Sort the foreground targets according to the order in which they appear in the monitoring area, obtain the motion trajectories A1 and A2 of two adjacent foreground targets in the sort, and determine whether there is following behavior based on the motion trajectories A1 and A2.