Tunnel traffic flow detection method based on video cloud networking technology

By utilizing video cloud networking technology and edge computing node noise filtering, timestamp alignment, and coordinate transformation, combined with lightweight deep learning and Kalman filtering algorithms, the problems of noise interference and timestamp deviation in tunnel traffic flow detection were solved, achieving high-precision traffic flow detection.

CN121483046APending Publication Date: 2026-02-06贵州道坦坦科技股份有限公司

Patent Information

Application Number
CN202610026836.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-09
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing video traffic flow detection technologies cannot effectively filter out noise interference, and the video data from multiple cameras has timestamp deviations and spatial misalignments, which reduces the accuracy and reliability of tunnel traffic flow detection.

Method used

By using video cloud networking technology, edge computing nodes are used for noise filtering and frame synchronization preprocessing to establish a reference timeline, perform timestamp alignment and coordinate transformation, and combine a lightweight deep learning framework and asymmetric Kalman filtering algorithm to achieve spatiotemporal alignment of multi-camera videos and vehicle feature extraction.

Benefits of technology

It effectively filters out noise interference, ensures video data quality, eliminates timestamp deviations, achieves spatiotemporal consistency of multi-camera video, and improves the accuracy and reliability of traffic flow detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121483046A_ABST
    Figure CN121483046A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of traffic information collection, in particular to a tunnel traffic flow detection method based on a video cloud networking technology, and the method comprises the following steps: obtaining video flow data collected by each monitoring camera in a tunnel in real time; performing compression coding processing on the video stream data; performing noise filtering and frame synchronization preprocessing on the coded video data; in a preset edge computing node, inputting the structured video data into a vehicle flow detection model to extract vehicle feature parameters in the video frame; performing tracking association on the target vehicle in the video frame through an asymmetric Kalman filtering algorithm, and comparing the vehicle flow detection data with a preset vehicle flow threshold; and in the cloud analysis platform, analyzing the structured detection data through the tunnel traffic flow prediction model. According to the invention, noise filtering and time-space alignment can be carried out on the collected vehicle operation video data, and the accuracy of tunnel traffic flow detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic information collection technology, and in particular to a tunnel traffic flow detection method based on video cloud networking technology. Background Technology

[0002] As a crucial hub in transportation networks, accurate detection of traffic flow in tunnels is a core prerequisite for ensuring smooth traffic flow and mitigating safety risks. It is of great significance for traffic scheduling decisions, emergency response, and traffic efficiency optimization. With the widespread adoption of video surveillance technology, video-based traffic flow detection methods have become the mainstream technical solution for tunnel traffic monitoring due to their intuitiveness and real-time performance. This video-based traffic flow detection method collects video data through surveillance cameras deployed within the tunnel and extracts traffic flow parameters using algorithms such as image recognition and moving target detection, enabling the monitoring of indicators such as traffic volume, speed, and density. However, the tunnel environment is complex and unique. Affected by factors such as sudden changes in light, dust interference, equipment vibration, and electronic signal interference, the video data collected by the cameras is prone to various types of noise, among which Gaussian noise and salt-and-pepper noise are the most common. Gaussian noise is mostly caused by changes in light and thermal noise from electronic components, manifesting as random fluctuations in the grayscale values ​​of image pixels; salt-and-pepper noise is mostly caused by dust obstruction and transmission interference, appearing as randomly distributed black and white noise spots in the image. Current video traffic detection technologies generally lack targeted noise filtering mechanisms, failing to effectively remove the two types of noise mentioned above. This leads to a decline in the image quality of noisy video data, directly affecting the accuracy of subsequent vehicle target extraction and recognition. Furthermore, to achieve full-area traffic flow coverage detection in tunnels, multiple surveillance cameras need to be deployed to form a monitoring network in practical applications. However, due to differences in hardware parameters, asynchronous startup sequences, and dispersed installation locations among different cameras, multi-source video data naturally exhibits temporal and spatial deviations. Existing technologies struggle to achieve precise timestamp alignment of videos from multiple surveillance cameras, resulting in temporal misalignment of the same traffic flow event captured by different cameras. Moreover, the lack of an effective spatiotemporal alignment mechanism prevents the matching of spatial coordinates between multi-view video images, significantly reducing the accuracy and reliability of detection results and hindering the provision of accurate data support for tunnel traffic scheduling and emergency response.

[0003] Chinese Patent Publication No. CN117746649A discloses a tunnel traffic flow detection system and method based on the YOLOv8 algorithm. The method includes: S1, data acquisition: acquiring video data of traffic flow through monitoring cameras, including video images at the tunnel entrance and exit; S2, video image preprocessing: extracting image information required for target detection from the acquired video data, including video frame decoding, image scaling, and color space conversion, wherein the region of interest is marked with color, and other regions are completely cleared or blacked out; S3, target detection: using a pre-trained YOLOv8 model to perform target detection on each frame of the image inside the tunnel, and the YOLOv8 model returns each detected vehicle. The system includes: S4, vehicle tracking, which compares data from surveillance cameras at tunnel entrances and exits and uses a Kalman filter multi-target tracking algorithm to continuously track vehicles, eliminating duplicate and missed counts; S5, traffic flow counting and license plate recognition recording, which counts traffic flow based on the tracked vehicle bounding box information and records the license plate information accordingly; and updates the traffic flow based on the number of vehicles entering and leaving the tunnel each time the bounding box is used to determine whether a vehicle is entering or leaving the tunnel; and S6, data analysis and statistics, which analyzes and statistically analyzes the traffic flow data to obtain the time-period distribution of traffic flow in the tunnel and statistical information on different types of vehicles, and displays this information visually. However, this solution cannot filter noise from the collected vehicle operation video data and struggles to align the timestamps and time and space of videos from multiple surveillance cameras, resulting in noise interference in the vehicle operation video data and temporal and spatial misalignment between multiple video sources, reducing the accuracy of tunnel traffic flow detection. Summary of the Invention

[0004] To address this, the present invention provides a tunnel traffic flow detection method based on video cloud networking technology, which overcomes the problems in the prior art where noise filtering of collected vehicle operation video data is impossible, and it is also difficult to achieve timestamp and spatiotemporal alignment of multiple monitoring camera videos. This results in noise interference in vehicle operation video data, time deviation and spatial misalignment of multi-source videos, and reduces the accuracy of tunnel traffic flow detection.

[0005] To achieve the above objectives, the present invention provides a tunnel traffic flow detection method based on video cloud networking technology, comprising the following steps: S1. Connect each surveillance camera in the tunnel to the preset video cloud networking platform through a standardized interface, and obtain the video stream data collected in real time by each surveillance camera in the tunnel according to the preset video cloud networking platform. S2. Based on video coding technology, the video stream data is compressed and encoded to obtain encoded video data, and the encoded video data is sent to the preset edge computing node; S3. Noise filtering and frame synchronization preprocessing are performed on the encoded video data using preset edge computing nodes to obtain spatiotemporally aligned structured video data. Specifically, noise filtering and frame synchronization preprocessing include: The encoded video data is filtered for noise to obtain denoised video data. Based on the denoised video data, the timestamp of one of the surveillance cameras is determined as the reference time axis. The time deviation between the timestamps of other surveillance cameras and the reference time axis is calculated. The timestamps of the surveillance cameras with time deviation are aligned according to the acquisition time to obtain time-aligned video data. The video frames of each surveillance camera in the time-aligned video data are transformed by coordinates to obtain the corresponding transformed video frames. The pixel space coordinate ranges of each transformed video frame are compared, and the regions where the pixel space coordinate ranges intersect are selected as overlapping regions. Calculate the distance-light joint compensation coefficient for each pixel in the overlapping area, and optimize the pixel grayscale value of the video frame after coordinate transformation according to the distance-light joint compensation coefficient to obtain the corresponding optimized video frame. The optimized video frames are spatially superimposed according to the target Cartesian coordinate system, and the pixel data of the overlapping area are merged using the nearest neighbor interpolation method. S4. Construct a vehicle traffic detection model based on a lightweight deep learning framework in a preset edge computing node, and input structured video data into the vehicle traffic detection model to extract vehicle feature parameters from the video frames. S5. Input the vehicle feature parameters into the asymmetric Kalman filter algorithm to track and associate the target vehicles in the video frame, generate vehicle traffic detection data, compare the vehicle traffic detection data with the preset vehicle traffic threshold, and output structured detection data containing anomaly identification fields.

[0006] Compared with the prior art, the beneficial effects of this application are as follows: Noise filtering of encoded video data effectively removes noise interference, improving the purity of the denoised video data and laying a high-quality data foundation for subsequent processing. By selecting a reference time axis based on the denoised video data, the time deviation values ​​of other surveillance camera timestamps are calculated and aligned, eliminating the time synchronization problem between multiple camera videos and ensuring the time consistency of time-aligned video data. By performing coordinate transformation on the time-aligned video data, overlapping areas are accurately screened, and then the distance and illumination joint compensation coefficient is calculated to compensate and optimize the pixel grayscale values ​​of the coordinate-transformed video frames. This effectively corrects pixel grayscale distortion caused by differences in illumination and distance, improving the quality of the compensated and optimized video frames. By spatially superimposing the compensated and optimized video frames according to the target Cartesian coordinate system and merging the pixel data of overlapping areas using the nearest neighbor interpolation method, precise spatial fusion of multi-camera videos is achieved, ensuring the spatiotemporal consistency of multi-source videos. This provides accurate data support for subsequent target detection, vehicle tracking, etc., significantly improving the accuracy and reliability of tunnel traffic flow detection and ensuring the accuracy of traffic flow counting, license plate recognition recording, and data analysis and statistics.

[0007] Furthermore, in S1, the process of connecting each surveillance camera in the tunnel to a preset video cloud networking platform via a standardized interface includes: The device identification information of each surveillance camera is obtained through a standardized interface, and the device identification information is authenticated to output a list of camera devices that have passed the authentication. Based on the segmented structure of the tunnel, the tunnel is divided into multiple monitoring areas, each monitoring area is assigned a unique area code, and a monitoring area division table containing the area codes is output. Establish a mapping rule base between device identification information in the list of surveillance cameras and area codes in the monitoring area division table. The mapping rule base includes the mapping relationship between the monitoring range parameters and area codes corresponding to each surveillance camera. The monitoring range parameters are determined by the installation location and lens angle of each surveillance camera. Extract the monitoring range parameters corresponding to the device identification information in the list of surveillance cameras, and match the monitoring range parameters with the area boundary parameters corresponding to the area codes in the monitoring area division table through the mapping relationship. Filter out the camera access configuration table whose matching degree meets the preset matching degree threshold, and import the camera access configuration table into the preset video cloud networking platform.

[0008] In this solution, by obtaining device identifiers and authenticating the output list, dividing the monitoring area output table, establishing a mapping rule base between device identifiers and area codes, and then extracting monitoring range parameters to match area boundary parameters to filter the access configuration table and import it into the platform, it can accurately locate the monitoring area to which each camera belongs, avoiding access confusion; and by filtering according to the preset matching degree threshold, it ensures that the monitoring range of the accessed cameras is highly adapted to the area, improving the effectiveness and targeting of monitoring.

[0009] Furthermore, the mathematical expression for the distance-illuminance joint compensation coefficient is: In the formula, This represents the pixels within the overlapping area corresponding to the i-th surveillance camera. The distance-illuminance joint compensation coefficient, Indicates the distance attenuation coefficient. This represents the average illumination value of the current video frame captured by the i-th surveillance camera. This indicates the preset standard reference illumination value inside the tunnel. , , This indicates the pixel distance from the installation position of the i-th surveillance camera. The straight-line distance to the corresponding real-world point. , Represents pixels The X-axis spatial coordinates in the target Cartesian coordinate system This represents the X-axis coordinate parameter of the installation location of the i-th surveillance camera in the target Cartesian coordinate system. Represents pixels Y-axis spatial coordinates in the target Cartesian coordinate system This represents the Y-axis coordinate parameter of the installation location of the i-th surveillance camera in the target Cartesian coordinate system. Represents pixels The Z-axis spatial coordinates in the target Cartesian coordinate system This represents the Z-axis coordinate parameter of the installation location of the i-th surveillance camera in the target Cartesian coordinate system.

[0010] In this solution, the overlapping monitoring areas are accurately compensated by a joint compensation coefficient of distance and illumination, which effectively reduces the image quality degradation caused by distance attenuation and uneven illumination, and improves the consistency and clarity of the video image.

[0011] Furthermore, the mathematical expression for compensating and optimizing the pixel grayscale values ​​of the video frame after coordinate transformation is as follows: In the formula, This represents the pixel corresponding to the i-th surveillance camera. The grayscale value after compensation and optimization This represents the pixel value of the video frame from the i-th surveillance camera after coordinate transformation. The original grayscale value.

[0012] In this solution, the grayscale values ​​of video frames after coordinate transformation are compensated and optimized to calibrate the original grayscale value deviation of corresponding pixels of the monitoring camera, thereby improving the consistency and accuracy of the grayscale data of each camera and ensuring the quality of video image presentation.

[0013] Furthermore, S4 includes: S41. Integrate the YOLO algorithm into a lightweight deep learning framework of preset edge computing nodes to build an initial network architecture. Use sample data containing vehicle location labels to train the initial network architecture. During the training process, iteratively optimize the model parameters of the initial network architecture through the backpropagation algorithm until the loss function value is lower than the preset loss function value for a consecutive preset number of rounds. Then output the vehicle traffic detection model that has been trained and converged. S42. Input the spatiotemporally aligned structured video data into the vehicle flow detection model, identify and label vehicle targets in the video frames using the YOLO algorithm, output detection boxes containing vehicle location information, input the detection boxes into the multi-target tracking algorithm for association matching, assign a unique virtual ID to each vehicle target, and output vehicle tracking features containing the virtual ID. S43. Based on vehicle tracking features including virtual IDs, perform real-time statistics on virtual IDs within the detection area and output vehicle feature parameters including virtual IDs, vehicle locations, and vehicle numbers.

[0014] In this solution, the YOLO algorithm is integrated into a lightweight deep learning framework of a preset edge computing node to build and train a vehicle traffic detection model. This enables rapid data processing using edge computing, improving detection efficiency. By inputting structured video data into the model, the YOLO algorithm identifies vehicle targets, and a multi-target tracking algorithm assigns a unique virtual ID, allowing for accurate vehicle tracking. Based on the virtual ID, vehicle information within the detection area is statistically analyzed in real time, and detailed vehicle feature parameters are output, achieving accurate, efficient, and comprehensive detection and tracking statistics of vehicle traffic.

[0015] Furthermore, in S41, the initial network architecture includes a feature extraction layer, a detection layer, and a tracking layer connected in sequence. The feature extraction layer adopts the MobileNetV3 lightweight network structure, the detection layer outputs vehicle location information, and the tracking layer outputs vehicle speed and number of vehicles through ID allocation and trajectory fusion.

[0016] In this solution, the feature extraction layer is constructed using the lightweight network structure of MobileNetV3 to reduce the computational load, the detection layer outputs vehicle location information, and the tracking layer outputs vehicle speed and quantity through ID allocation and trajectory fusion, thereby achieving efficient and accurate vehicle detection and tracking.

[0017] Furthermore, S5 includes: S51. Input the vehicle feature parameters into the asymmetric Kalman filter algorithm. Through the state transition matrix and observation matrix in the asymmetric Kalman filter algorithm, the vehicle feature parameters are estimated and the observation is updated to obtain the target vehicle state estimation result. The state transition matrix is ​​preset based on the vehicle kinematic model in the tunnel, and the observation matrix is ​​configured according to the spatial distribution parameters of the monitoring camera. S52. Using a preset association matching rule, target vehicles in the video frames of the target vehicle state estimation result are tracked and associated to generate vehicle traffic detection data containing vehicle position, vehicle speed, and vehicle trajectory information. The matching threshold of the association matching rule is obtained by training on historical vehicle trajectory data in the tunnel and is dynamically adjusted over time. S53. Input the vehicle flow detection data into the preset comparison module to extract the vehicle flow value from the vehicle flow detection data. S54. Compare the traffic flow value with the preset vehicle flow threshold, add an anomaly flag field to the vehicle flow detection data based on the comparison result, and output structured detection data containing the anomaly flag field.

[0018] In this scheme, the state transition matrix based on the tunnel vehicle kinematics model and the observation matrix configured according to the spatial distribution of the monitoring cameras are used to accurately estimate the vehicle state. Then, the traffic flow value is extracted by the preset comparison module and compared with the preset traffic flow threshold to add anomaly labels. The structured detection data with anomaly labels is output, which improves the accuracy of tunnel vehicle flow detection. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating the tunnel traffic detection method based on video cloud networking technology according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the GPU-accelerated decoding and multi-batch detection processing flow according to an embodiment of the present invention. Detailed Implementation

[0020] The following detailed description illustrates the specific implementation method: Please see Figure 1 As shown, this is a flowchart illustrating the tunnel traffic detection method based on video cloud networking technology according to an embodiment of the present invention, which includes the following steps: S1. Connect each surveillance camera in the tunnel to the preset video cloud networking platform through a standardized interface, and obtain the video stream data collected in real time by each surveillance camera in the tunnel according to the preset video cloud networking platform. S2. Based on video coding technology, the video stream data is compressed and encoded to obtain encoded video data, and the encoded video data is sent to the preset edge computing node; S3. By using preset edge computing nodes, noise filtering and frame synchronization preprocessing are performed on the encoded video data to obtain spatiotemporally aligned structured video data. S4. Construct a vehicle traffic detection model based on a lightweight deep learning framework in a preset edge computing node, and input structured video data into the vehicle traffic detection model to extract vehicle feature parameters from the video frames. S5. Input the vehicle feature parameters into the asymmetric Kalman filter algorithm to track and associate the target vehicles in the video frame, generate vehicle traffic detection data, compare the vehicle traffic detection data with the preset vehicle traffic threshold, and output structured detection data containing anomaly identification fields.

[0021] Specifically, in S1, the process of connecting each surveillance camera in the tunnel to a preset video cloud networking platform through a standardized interface includes: The device identification information of each surveillance camera is obtained through a standardized interface, and the device identification information is authenticated to output a list of camera devices that have passed the authentication. Based on the segmented structure of the tunnel, the tunnel is divided into multiple monitoring areas, each monitoring area is assigned a unique area code, and a monitoring area division table containing the area codes is output. Establish a mapping rule base between device identification information in the list of surveillance cameras and area codes in the monitoring area division table. The mapping rule base includes the mapping relationship between the monitoring range parameters and area codes corresponding to each surveillance camera. The monitoring range parameters are determined by the installation location and lens angle of each surveillance camera. Extract the monitoring range parameters corresponding to the device identification information in the list of surveillance cameras, and match the monitoring range parameters with the area boundary parameters corresponding to the area codes in the monitoring area division table through the mapping relationship. Filter out the camera access configuration table whose matching degree meets the preset matching degree threshold, and import the camera access configuration table into the preset video cloud networking platform.

[0022] In this embodiment, the standardized interface can take the form of a RESTful API. When a request is sent to this interface, it returns the device identification information of each surveillance camera in the tunnel, such as device ID, device model, and device serial number. The client sends the obtained device identification information as the request body to the interface. The interface server verifies this information and returns the authentication result. Digital certificate authentication is used: each surveillance camera is assigned a unique digital certificate at the time of manufacture or deployment. After obtaining the device identification information through the standardized interface, the digital certificate carried by the device is sent to the authentication server. The authentication server verifies the validity of the digital certificate, including whether the certificate was issued by a trusted certificate authority, whether the certificate is within its validity period, and whether the device identification information in the certificate is consistent with the identification information obtained from the interface. If the verification passes, the surveillance camera's identity is successfully authenticated.

[0023] Monitoring areas are divided based on mileage markers: The tunnel is divided into multiple monitoring areas at certain length intervals, for example, every 500 meters. The first area extends from 0 meters to 500 meters from the tunnel entrance, coded as "T0001". The second area extends from 500 meters to 1000 meters, coded as "T0002", and so on. The starting and ending mileage markers and corresponding area codes for each area are compiled into a table, which is the monitoring area division table including area codes. The overlap ratio between the camera's monitoring range and the monitored area is used as the matching index. The determination of the preset matching threshold needs to comprehensively consider the accuracy and practicality of tunnel monitoring. On the one hand, it is necessary to ensure that the camera monitoring range can effectively cover the target monitoring area and avoid monitoring blind spots; on the other hand, it is necessary to prevent too many irrelevant cameras from being connected, causing resource waste. It is advisable to first clarify the reasonable matching range between the camera monitoring range parameters and the area boundary parameters under different monitoring scenarios through actual measurement and simulation analysis. For example, in a straight tunnel, if the monitoring area is 100 meters long, it is appropriate for the camera lens angle to cover a range of 80-120 meters. In this case, the matching threshold can be set to an overlap of more than 75% between the monitoring range and the area boundary. Only when the matching degree between the camera monitoring range parameters and the area boundary parameters corresponding to the area code reaches or exceeds this preset matching threshold will the camera be included in the access configuration table. This ensures both monitoring effectiveness and reasonable utilization of video cloud networking platform resources, achieving efficient and accurate tunnel monitoring. During the matching process, for a certain camera, its installation location is at mileage marker 400 meters, and the horizontal viewing angle of the lens is 90 degrees. The corresponding monitoring area is from 0 meters to 500 meters, and the area code is "T0001". Calculations show that the overlap rate between the surveillance camera's monitoring range and the area between 0 and 500 meters is 80% (assuming the calculation method is: calculate the effective monitoring range based on the camera's position and viewing angle, and then calculate the overlap rate with the area's monitoring range). Since 80% > 75%, meaning the matching degree is greater than the preset matching degree threshold, the correspondence between this surveillance camera and area "T0001" will be retained in the camera access configuration table. Conversely, if the overlap rate between another surveillance camera's monitoring range and a certain area is only 60%, which is less than the preset matching degree threshold of 75%, then the correspondence between this surveillance camera and that area will be excluded from the configuration table.

[0024] The specific implementation process of S2 is as follows: A suitable video coding technology, such as H.264 or H.265, is selected, which can effectively compress data while ensuring a certain level of image quality. Intra-frame prediction is used to analyze the similarity of pixels within the current frame and remove spatial redundancy; inter-frame prediction is used to eliminate temporal redundancy by referencing information from previous and subsequent frames. The residual data generated by prediction is transformed and quantized to further reduce the data volume. Then, entropy coding is performed to represent the data in a more compact way. After compression coding is completed, the encoded video data is obtained. Next, the address and communication protocol of the preset edge computing node are determined. The edge computing node can be a server or dedicated device deployed near the data source. Through a network connection, the encoded video data is encapsulated according to the selected protocol, such as TCP or UDP. Finally, the encapsulated data packet is sent to the preset edge computing node. After receiving the data, the node stores or further processes it, thereby achieving efficient transmission and utilization of video data. In this embodiment, the preset edge computing node uses an NPU (Neural Processing Unit) edge device.

[0025] Specifically, S3 includes: S31. In the preset edge computing node, Gaussian noise filtering and salt-and-pepper noise filtering are performed on the encoded video data in sequence to obtain the denoised video data. Among them, Gaussian noise filtering adopts a filter with adaptive adjustment of filter coefficients based on local variance, and salt-and-pepper noise filtering adopts a median filter with a preset window size. S32. Extract the original timestamps of each surveillance camera from the denoised video data, establish a timestamp sequence, and select the timestamp of one surveillance camera as the reference time axis based on the timestamp sequence, and calculate the time deviation between the timestamps of other surveillance cameras and the reference time axis. S33. The timestamps of surveillance cameras with time deviations are aligned according to the acquisition time using a linear interpolation method to obtain time-aligned video data. S34. Map the video frames captured by each surveillance camera in the time-aligned video data to the target Cartesian coordinate system to obtain the spatiotemporally aligned structured video data.

[0026] In this embodiment, the specific process of performing Gaussian noise filtering on the encoded video data using a filter with adaptive adjustment of filtering coefficients based on local variance is as follows: The encoded video data is traversed frame by frame. For each pixel in each frame, a 3×3 local neighborhood centered on that pixel is selected, and the local variance of the pixel grayscale values ​​within the neighborhood is calculated. The filtering coefficients are adaptively adjusted according to the magnitude of the local variance. When the local variance is large, the filtering coefficients are decreased to preserve image details; when the local variance is small, the filtering coefficients are increased to enhance the denoising effect. The pixel grayscale values ​​are then weighted and smoothed using this filter to complete the Gaussian noise filtering. Salt-and-pepper noise filtering is performed using a median filter with a preset window size (usually a 5×5 window): Each frame of the image after Gaussian noise filtering is traversed. The grayscale values ​​of all pixels within the preset window corresponding to each pixel are sorted, and the median value after sorting is taken as the new grayscale value of that pixel, replacing the original pixel grayscale value. This process is repeated for all pixels to obtain the denoised video data.

[0027] In step S32, the bitstream information corresponding to the denoised video data is first parsed to extract the original timestamps generated when each surveillance camera captures video. Each timestamp precisely corresponds to the capture time of one frame of video data. The original timestamps of each camera are arranged in chronological order of capture time to establish their own independent timestamp sequences. Then, the continuity and stability of each timestamp sequence are analyzed. The timestamp of the surveillance camera with the most continuous timestamp sequence and the smallest frame rate fluctuation is selected as the reference time axis. Usually, the timestamp of the camera located in the middle area of ​​the tunnel with the widest field of view is selected as the reference. Then, the timestamp sequence of each other surveillance camera is traversed. For each timestamp, the closest reference timestamp in the reference time axis is found, and the time difference between the two is calculated. This time difference is the time deviation value between the corresponding timestamp of the surveillance camera and the reference time axis. All time deviation values ​​are recorded and associated with the corresponding video frames.

[0028] In step S33, the time deviation values ​​and corresponding video frames of each surveillance camera are first compiled to clarify the correspondence between the timestamp of each surveillance camera with a time deviation value and the reference time axis. Then, a linear interpolation method is used, with the time interval of the reference time axis as the interpolation step size, to perform interpolation operations on the timestamp sequence of the surveillance cameras with time deviation values. For the missing timestamp corresponding to the reference time axis in the surveillance camera timestamp sequence, a linear function is constructed based on the two adjacent valid timestamps before and after that moment and their corresponding time deviation values ​​to calculate the missing timestamp. The completed timestamps are then matched one-to-one with the timestamps of the reference time axis, and the playback and processing sequence of the corresponding video frames is adjusted so that different surveillance cameras have corresponding video frames at the same reference time point, resulting in time-aligned video data.

[0029] The target Cartesian coordinate system is a predefined rectangular coordinate system (such as a ground coordinate system or a global scene coordinate system) used to uniformly describe the spatial position of video frames from multiple cameras. The target Cartesian coordinate system includes: Coordinate axes: typically X (horizontal), Y (vertical), and Z (depth) axes, representing the actual physical space. Origin: can be set as a fixed point in a monitored area (such as the scene center). Units: consistent with the actual spatial scale (such as meters), ensuring that data from different cameras can be aligned to the same spatial reference system.

[0030] Specifically, S34 includes: S341. Obtain the spatial coordinate parameters, field of view direction parameters, and illumination intensity parameters of each surveillance camera in the target Cartesian coordinate system. The spatial coordinate parameters include the X-axis coordinate value, Y-axis coordinate value, and Z-axis coordinate value of the camera installation position. The field of view direction parameters include the angle values ​​between the center line of the camera's field of view and each axis of the coordinate system. The illumination intensity parameters include the average illumination value of the images captured by each surveillance camera. S342. Based on the spatial coordinate parameters and field of view direction parameters, perform coordinate transformation processing on the video frames of each monitoring camera in the time-aligned video data to obtain the corresponding coordinate-transformed video frames. The coordinate transformation process includes mapping the pixel coordinates of each video frame to the target Cartesian coordinate system through coordinate rotation and translation operations. S343. Compare the pixel spatial coordinate ranges of the video frames after coordinate transformation, select the regions where the pixel spatial coordinate ranges intersect as overlapping regions, and calculate the distance-illuminance joint compensation coefficient for each pixel in the overlapping region based on the spatial coordinate parameters and illumination intensity parameters. Then, compensate and optimize the pixel grayscale values ​​of the video frames after coordinate transformation according to the distance-illuminance joint compensation coefficient to obtain the corresponding compensated and optimized video frames. The mathematical expression for the distance-illuminance joint compensation coefficient is: In the formula, This represents the pixels within the overlapping area corresponding to the i-th surveillance camera. The distance-illuminance joint compensation coefficient, Indicates the distance attenuation coefficient. This represents the average illumination value of the current video frame captured by the i-th surveillance camera. This indicates the preset standard reference illumination value inside the tunnel. , , This indicates the pixel distance from the installation position of the i-th surveillance camera. The straight-line distance to the corresponding real-world point. , Represents pixels The X-axis spatial coordinates in the target Cartesian coordinate system This represents the X-axis coordinate parameter of the installation location of the i-th surveillance camera in the target Cartesian coordinate system. Represents pixels Y-axis spatial coordinates in the target Cartesian coordinate system This represents the Y-axis coordinate parameter of the installation location of the i-th surveillance camera in the target Cartesian coordinate system. Represents pixels The Z-axis spatial coordinates in the target Cartesian coordinate system This represents the Z-axis coordinate parameter of the installation location of the i-th surveillance camera in the target Cartesian coordinate system; The mathematical expression for compensating and optimizing the pixel grayscale values ​​of the video frame after coordinate transformation is as follows: In the formula, This represents the pixel corresponding to the i-th surveillance camera. The grayscale value after compensation and optimization This represents the pixel value of the video frame from the i-th surveillance camera after coordinate transformation. The original grayscale value; S344. The compensated and optimized video frames are spatially superimposed according to the target Cartesian coordinate system, and the pixel data of the overlapping area are merged using the nearest neighbor interpolation method to obtain spatiotemporally aligned structured video data.

[0031] In this embodiment, when obtaining spatial coordinate parameters, a global Cartesian coordinate system for the tunnel is first established, with the tunnel entrance center point as the origin, the tunnel extension direction as the X-axis, the direction perpendicular to the tunnel extension direction as the Y-axis, and the direction perpendicular to the ground as the Z-axis. A laser rangefinder and a total station are used to measure the installation positions of each surveillance camera, accurately obtaining the X-axis, Y-axis, and Z-axis coordinates of each camera's installation center point in the target Cartesian coordinate system, which serve as the spatial coordinate parameters. When obtaining the field of view direction parameters, an angle measuring instrument is used in conjunction with camera adjustment tools to adjust the camera's field of view angle. The angles between the camera's field of view center line and the X, Y, and Z axes of the target Cartesian coordinate system are measured, and the average value of multiple measurements is taken as the field of view direction parameter. When obtaining the illumination intensity parameters, grayscale analysis is performed on the video frames captured by each surveillance camera. The average grayscale value of all pixels in a single frame is calculated frame by frame, and the average grayscale value of 10 consecutive frames is averaged again to obtain the average illumination value of the current video frame captured by the camera, which serves as the illumination intensity parameter.

[0032] Based on the aforementioned spatial coordinate parameters and field-of-view direction parameters, the specific process of performing coordinate transformation processing on video frames from each surveillance camera in time-aligned video data includes: First, determining the position coordinates of each surveillance camera in the target Cartesian coordinate system according to the spatial coordinate parameters of each surveillance camera, calculating the relative displacement vector between the coordinates of each surveillance camera and the origin of the target Cartesian coordinate system, and obtaining the translation parameters required for the translation operation. Then, combining the angle values ​​between the camera's field-of-view centerline and each axis in the field-of-view direction parameters, a rotation matrix is ​​constructed. This rotation matrix includes rotation angle parameters around the X, Y, and Z axes, corresponding to the angle relationships between the field-of-view centerline and each axis. Subsequently, for each video frame from each surveillance camera in the time-aligned video data, the two-dimensional pixel coordinates of each pixel are extracted. The two-dimensional pixel coordinates of each pixel are multiplied by the rotation matrix to complete the rotation transformation of the pixel coordinates, making the pixel coordinate direction consistent with the target Cartesian coordinate system. Then, the rotated pixel coordinates are added to the translation parameters to complete the translation transformation. Finally, the two-dimensional pixel coordinates of each video frame are mapped to the three-dimensional spatial coordinates in the target Cartesian coordinate system, obtaining the corresponding coordinate-transformed video frame.

[0033] The specific process of comparing the pixel space coordinate ranges of each coordinate-transformed video frame and selecting the overlapping regions where these ranges intersect includes: First, extracting the pixel space coordinate ranges corresponding to each coordinate-transformed video frame; traversing the three-dimensional space coordinates of all pixels in each video frame to determine the maximum and minimum coordinate values ​​in the X-axis, Y-axis, and Z-axis directions, forming a unique three-dimensional space coordinate range for each video frame. Then, comparing the three-dimensional space coordinate ranges of all coordinate-transformed video frames pairwise: first comparing the coordinate ranges in the X-axis direction, finding the intersection of the X-axis ranges of all video frames, i.e., taking the maximum value among all minimum X-axis coordinate values ​​and the minimum value among all maximum X-axis coordinate values; similarly, finding the intersections in the Y-axis and Z-axis directions respectively. Combining the intersection ranges of the X-axis, Y-axis, and Z-axis yields the three-dimensional space intersection region, which is the overlapping region where the pixel space coordinate ranges of each coordinate-transformed video frame intersect.

[0034] Distance attenuation coefficient The value needs to be determined based on the air transparency and dust concentration inside the tunnel, and is usually in the range of 0.01-0.05. The upper limit is used in tunnel sections with high dust concentrations, and the lower limit is used in sections with clean air. The i-th monitoring camera collects the average illumination value of the current video frame. The value of is obtained by averaging the grayscale values ​​of all pixels in the current video frame of the surveillance camera. Specifically, the pixels of a single frame are traversed, the grayscale values ​​are accumulated, and then divided by the total number of pixels. This process is repeated for 10 frames, and the average value is taken as the final value. Value. Pre-set standard reference illumination value inside the tunnel. The value is determined according to the tunnel lighting design specifications, and is usually preset to 80 lux, corresponding to the standard illumination intensity required for normal tunnel passage. The method for implementing the compensated and optimized video frame spatial overlay is as follows: based on the three-dimensional spatial coordinates of pixels in each video frame in the target Cartesian coordinate system, the pixels of each video frame are precisely mapped to their corresponding three-dimensional spatial positions. Following the principle of spatial coordinate alignment, all compensated and optimized video frames are overlaid in the same target Cartesian coordinate system, so that pixels at the same spatial position captured by different cameras correspond to the same position in the same target Cartesian coordinate system. The method for merging pixel data in overlapping areas using nearest neighbor interpolation is as follows: for each three-dimensional spatial coordinate point in the overlapping area, the pixel grayscale values ​​corresponding to that three-dimensional spatial coordinate point in all overlaid video frames are traversed. The grayscale value corresponding to the nearest pixel to that three-dimensional spatial coordinate point is found, and this grayscale value is used as the final pixel grayscale value of that spatial coordinate point after merging. This process is repeated to complete the merging of all pixels in the overlapping area, resulting in spatiotemporally aligned structured video data.

[0035] Specifically, S4 includes: S41. Integrate the YOLO algorithm into a lightweight deep learning framework of preset edge computing nodes to build an initial network architecture. Use sample data containing vehicle location labels to train the initial network architecture. During the training process, iteratively optimize the model parameters of the initial network architecture through the backpropagation algorithm until the loss function value is lower than the preset loss function value for a consecutive preset number of rounds. Then output the vehicle traffic detection model that has been trained and converged. S42. Input the spatiotemporally aligned structured video data into the vehicle flow detection model, identify and label vehicle targets in the video frames using the YOLO algorithm, output detection boxes containing vehicle location information, input the detection boxes into the multi-target tracking algorithm for association matching, assign a unique virtual ID to each vehicle target, and output vehicle tracking features containing the virtual ID. S43. Based on vehicle tracking features including virtual IDs, perform real-time statistics on virtual IDs within the detection area and output vehicle feature parameters including virtual IDs, vehicle locations, and vehicle numbers.

[0036] Specifically, in S41, the initial network architecture includes a feature extraction layer, a detection layer, and a tracking layer connected in sequence. The feature extraction layer adopts the MobileNetV3 lightweight network structure, the detection layer outputs vehicle location information, and the tracking layer outputs vehicle speed and number of vehicles through ID allocation and trajectory fusion.

[0037] In this embodiment, the lightweight deep learning framework is a deep learning development tool designed for resource-constrained devices (such as edge computing nodes). By optimizing model structure and reducing computational and memory usage, it enables models to run efficiently on low-power, low-computing-capacity devices. In this embodiment, the lightweight deep learning framework uses TensorFlow Lite. TensorFlow Lite is optimized for mobile and embedded devices, enabling rapid deployment of deep learning models on devices such as smartphones and Raspberry Pis.

[0038] The YOLO algorithm is a deep learning-based object detection algorithm. It transforms the object detection problem into a regression problem, directly predicting the category and location of objects in an image through a neural network, achieving end-to-end object detection with high speed. The preset number of iterations refers to a pre-set threshold for the number of iterations during model training. During training, when the loss function value continuously falls below the preset loss function value for the specified number of iterations, the model is considered to have converged, and training can stop. The preset number of iterations usually needs to be experimentally adjusted based on the specific task and model complexity. Generally, a smaller number of iterations can be set initially for preliminary training to observe the model's convergence. If the model converges within a few iterations, the preset number of iterations can be reduced appropriately; if the model converges slowly, the preset number of iterations can be increased. For example, for a simple image classification task, a preset number of iterations can be set to 15 initially, and then adjusted based on the training results. A preset loss function value is a pre-defined threshold for the loss function. The loss function measures the difference between the model's prediction and the actual result. During training, when the loss function value remains below this preset threshold for a consecutive preset number of iterations, it indicates that the model's prediction is close to the actual result, and the model can be considered to have converged. Determining the preset loss function value requires experimental adjustment based on the specific task and data distribution. A reasonable range for the loss function value can be initially estimated by observing the initial performance of the training data and the model. Then, a suitable value can be selected within this range as the preset loss function value. In vehicle traffic detection tasks, determining the preset loss function value requires experimentation with data and model performance. Typically, initial training can be performed on a subset of labeled samples to observe the range of the loss function value's decrease. For example, by comparing manual labeling with predictions, it can be inferred that the loss function value is often in a low range (e.g., 0.01 to 0.1), and dynamically adjusted according to convergence. Multi-target tracking algorithms are used to track multiple targets simultaneously in a video sequence. It detects and matches targets in video frames, assigns a unique identifier (such as a virtual ID) to each target, and continuously tracks the position and state of these targets in subsequent frames. In this embodiment, the multi-target tracking algorithm adopts the SORT (Simple Online and Realtime Tracking) algorithm. The SORT algorithm predicts the position of the target in the next frame by combining the target detection results and the Kalman filter, and uses the Hungarian algorithm for data association to achieve multi-target tracking. MobileNetV3 is a lightweight convolutional neural network architecture that improves upon MobileNetV2 by introducing new modules and optimization strategies, further reducing the computational cost and number of parameters of the model while maintaining high model performance.

[0039] Integrating the YOLO algorithm into the lightweight deep learning framework of the preset edge computing node to construct the initial network architecture includes: Selecting the lightweight deep learning framework: According to the hardware resources and performance requirements of the edge computing node, select TensorFlowLite. Importing the YOLO algorithm module: In the selected lightweight deep learning framework, import the relevant modules and functions of the YOLO algorithm. Importing the relevant modules and functions of the YOLO algorithm usually includes operations such as the network structure definition, forward propagation, and backward propagation of the YOLO algorithm. Constructing the initial network architecture: According to the principle of the YOLO algorithm and the requirements of the edge computing node, construct the initial network architecture. The initial network architecture includes a feature extraction layer, a detection layer, and a tracking layer connected in sequence. The feature extraction layer adopts the MobileNetV3 lightweight network structure to extract features from the input image; the detection layer uses the core structure of the YOLO algorithm to output vehicle position information; the tracking layer is responsible for subsequent ID assignment and trajectory fusion.

[0040] Please refer to Figure 2 As shown, it is a schematic diagram of the GPU-accelerated decoding and multi-Batch detection processing flow of an embodiment of the present invention. Optimize the detection layer on the basis of the ordinary multi-process linkage detection mode and place it in a separate process. When reading data, abandon the structured video data reading method of space-time alignment and use FFmpeg decoding instead. Configure and compile FFmpeg to enable the GPU decoding function. In the process design, every four decoding processes are paired with one detection process to form a group of multi-Batch detections through a transmission queue. Assign corresponding IDs to video frames to facilitate transmitting the detected frames and detection information back to the corresponding processes for subsequent tracking and counting. Using queue transmission can add two cache pools to each process, enhance the overall anti-interference ability, and make the operation smoother. The multi-Batch frame processing method can improve the model detection speed, reduce the video memory occupancy, and help the algorithm complete the acquisition, processing, and visualization display of traffic flow data within milliseconds.

[0041] Training the initial network architecture using sample data containing vehicle location annotations includes: Preparing sample data: Collecting sample data containing vehicle location annotations. Sample data can be image frames from surveillance videos, each frame annotated with vehicle location information (e.g., bounding box coordinates). Data preprocessing: Preprocessing the sample data, including image scaling and normalization, to ensure it meets the input requirements of the initial network architecture. Forward propagation: Inputting the preprocessed sample data into the initial network architecture and calculating its predictions (detected vehicle location information) through forward propagation. Calculating the loss function: Comparing the predictions of the initial network architecture with the ground truth annotations in the sample data and calculating the loss function value. The loss function value reflects the difference between the predictions and the ground truth. Backpropagation: Based on the loss function value, calculating the gradient of the model parameters of the initial network architecture using the backpropagation algorithm, and updating the model parameters using an optimization algorithm (e.g., stochastic gradient descent) to reduce the loss function value. Iterative training: Repeat the above process of forward propagation, loss function calculation and backpropagation to iteratively train the initial network architecture until the stopping condition is met (such as the loss function value being lower than the preset loss function value for a preset number of consecutive rounds).

[0042] Inputting detection boxes into a multi-target tracking algorithm for association and matching includes: Extracting detection box information: Extracting detection box information from the output of the vehicle flow detection model, including the coordinates of the detection boxes, vehicle category, etc. Initializing the tracker: Initializing the tracker in the multi-target tracking algorithm, creating a tracking object for each detected target and assigning an initial virtual ID. Predicting target position: Using a prediction model in the tracker (such as a Kalman filter) to predict the position of each target in the next frame. Data association: Associating and matching the predicted target positions with the detected target positions in the next frame, typically using data association algorithms such as the Hungarian algorithm to find the optimal matching relationship. Updating the tracker: Based on the results of data association, updating the target state information in the tracker, including the target's position, velocity, etc., while maintaining the consistency of the virtual ID.

[0043] Based on vehicle tracking features containing virtual IDs, real-time statistics of virtual IDs within the detection area include: Determining the detection area: The scope of the detection area is determined according to actual needs, which can be achieved by setting a bounding box or defining specific area coordinates. Collecting vehicle tracking features: Vehicle tracking features containing virtual IDs are collected in real time. These features can be obtained from the output of multi-target tracking algorithms, including virtual IDs, vehicle positions, and other information. Filtering vehicles within the detection area: Based on the scope of the detection area, vehicle tracking features located within the detection area are filtered out. Counting virtual IDs: The virtual IDs in the filtered vehicle tracking features are counted to obtain the number of vehicles within the detection area. Simultaneously, the vehicle position information corresponding to each virtual ID can be recorded for further analysis and processing.

[0044] Specifically, S5 includes: S51. Input the vehicle feature parameters into the asymmetric Kalman filter algorithm. Through the state transition matrix and observation matrix in the asymmetric Kalman filter algorithm, the vehicle feature parameters are estimated and the observation is updated to obtain the target vehicle state estimation result. The state transition matrix is ​​preset based on the vehicle kinematic model in the tunnel, and the observation matrix is ​​configured according to the spatial distribution parameters of the monitoring camera. S52. Using a preset association matching rule, target vehicles in the video frames of the target vehicle state estimation result are tracked and associated to generate vehicle traffic detection data containing vehicle position, vehicle speed, and vehicle trajectory information. The matching threshold of the association matching rule is obtained by training on historical vehicle trajectory data in the tunnel and is dynamically adjusted over time. S53. Input the vehicle flow detection data into the preset comparison module to extract the vehicle flow value from the vehicle flow detection data. S54. Compare the traffic flow value with the preset vehicle flow threshold, add an anomaly flag field to the vehicle flow detection data based on the comparison result, and output structured detection data containing the anomaly flag field.

[0045] In this embodiment, the asymmetric Kalman filter algorithm, based on the traditional Kalman filter, considers the asymmetry that may exist in the state transition and observation process (such as differences in motion characteristics in different directions, asymmetric distribution of observation errors, etc.), and can more accurately handle the state estimation problem in complex dynamic systems. The preset association matching rule is a criterion used to track and associate target vehicles in video frames in the target vehicle state estimation result. Its core function is to establish the correspondence of the same target vehicle in consecutive video frames, and then generate vehicle flow detection data containing vehicle position, vehicle speed, and vehicle trajectory information. The determination of the preset association matching rule needs to be based on the target vehicle state estimation result output by the asymmetric Kalman filter algorithm. It focuses on three core dimensions: the position offset range of the target vehicle between video frames, the speed change amplitude, and the trajectory similarity. Combined with typical operating scenarios such as normal driving, lane changing, and following vehicles in the tunnel, the association judgment logic under different scenarios is divided, and differentiated weight ratios are set for each dimension. Then, the effectiveness of the rule is verified through multiple sets of tunnel vehicle tracking tests. The standard for achieving an association accuracy of over 95% is used as the benchmark. The weights and judgment thresholds of each dimension are repeatedly adjusted to finally form a preset association matching rule adapted to the tunnel scenario. The determination of the matching threshold for the association matching rule requires constructing a vehicle trajectory data training set using historical vehicle trajectory data within the tunnel. This training set must cover vehicle trajectory information under different time periods and traffic flow conditions. A gradient boosting tree algorithm is used to train the dataset and fit a critical threshold range that can effectively distinguish between the same vehicle and different vehicles. For example, the initial value of the matching threshold for the association matching rule is set to 0.72, corresponding to a critical threshold of 96% peak association accuracy in the vehicle trajectory data training set. Simultaneously, the matching threshold of this association matching rule is dynamically adjusted over time, based on the matching accuracy feedback from real-time collected vehicle operation data within the tunnel. When the real-time matching accuracy is below 92%, the matching threshold of the association matching rule adaptively fluctuates within ±15% of the initial value, with an adjustment step size of 0.02, thus ensuring stable tracking and association performance under different traffic flow scenarios.

[0046] A preset comparison module is a program or functional unit used to compare input data. For example, in an intelligent traffic management system, the preset comparison module can receive data from vehicle detection equipment, extract traffic flow information, and then compare it with a system-set threshold to determine whether the current traffic flow is normal. The preset comparison module is determined by designing corresponding data extraction and comparison logic based on the system's functional requirements and data format. This includes determining the fields and methods for extracting traffic flow values ​​from vehicle flow detection data, as well as the rules for comparing traffic flow values ​​with preset vehicle flow thresholds. The preset vehicle flow threshold is a critical value used to compare the traffic flow values ​​extracted from the vehicle flow detection data and determine whether the traffic flow is abnormal. The comparison result is used to add an anomaly flag field to the vehicle flow detection data, ultimately outputting structured detection data containing the anomaly flag field. The determination of the preset vehicle flow threshold requires combining basic parameters such as tunnel design capacity, number of lanes, and speed limits. Historical traffic flow data from different time periods over the past three years is collected to analyze the correlation between traffic flow and tunnel efficiency and congestion risk. Traffic flow simulation software is used to simulate tunnel operation under different thresholds, with a congestion rate below 5% as the core criterion to define the range of the preset vehicle flow threshold. The preset vehicle flow threshold is set with differentiated standards for different time periods. For example, it is set at 85% of the tunnel's design capacity during peak hours and 55% during off-peak hours. During special weather conditions or tunnel construction periods, the preset vehicle flow threshold is lowered by 12% to meet the needs of abnormal traffic flow judgment in different scenarios.

[0047] The state estimation of vehicle characteristic parameters using the state transition matrix and observation matrix in the asymmetric Kalman filter algorithm includes: the state transition matrix describes the change of vehicle state (such as position, speed, etc.) over time; based on the vehicle state estimate at the previous moment and the state transition matrix, the prior estimate of the vehicle state at the current moment can be predicted. For example, if the vehicle's position and speed at the previous moment are known, combined with the model of vehicle motion in the state transition matrix, the possible position and speed of the vehicle at the current moment can be predicted.

[0048] The observation update of vehicle feature parameters using the state transition matrix and observation matrix in the asymmetric Kalman filter algorithm includes: the observation matrix is ​​used to correlate the actual observed values ​​of the vehicle (such as vehicle position information obtained through surveillance cameras) with the state estimates. By calculating the difference between the observed values ​​and the prior estimates (i.e., innovation), and using the innovation and observation matrix to correct the prior estimates, the posterior estimate of the vehicle state at the current time is obtained, thereby improving the accuracy of the state estimation.

[0049] The state transition matrix is ​​pre-defined based on the vehicle kinematics model within the tunnel, including: analyzing vehicle kinematic characteristics: studying the motion patterns of vehicles within the tunnel, considering factors such as acceleration, deceleration, and turning radius. For example, when a vehicle travels in a tunnel, due to space constraints, its turning radius is usually large, and its acceleration and deceleration also have a certain range. Establishing a kinematic model: based on the vehicle's kinematic characteristics, establishing a mathematical model describing the change of the vehicle's state over time. For example, using a uniform motion model, a uniformly accelerated motion model, or a more complex motion model considering turning. Determining the state transition matrix: based on the established kinematic model, transforming it into the form of a state transition matrix. The elements in the state transition matrix reflect the transformation relationship between the vehicle's state at different times. For example, if a uniform motion model is used, the state transition matrix can be expressed as a linear transformation relationship between position and velocity at different times.

[0050] The observation matrix is ​​configured based on the spatial distribution parameters of the surveillance cameras, including: determining the spatial location and parameters of the cameras: understanding the installation location, shooting angle, resolution, and other spatial distribution parameters of the surveillance cameras within the tunnel, such as the camera's height above the ground and its field of view. Establishing an observation model: based on the spatial distribution parameters of the cameras, establishing a mapping model from the actual vehicle state to the camera observations, for example, converting the vehicle's actual position into pixel coordinates in the camera image through geometric relationships. Configuring the observation matrix: transforming the observation model into the form of an observation matrix. The elements in the observation matrix reflect the relationship between the actual vehicle state and the observed values, allowing the estimated vehicle state to be converted into a form comparable to the actual observed values, thus enabling observation updates.

[0051] The tracking and association of target vehicles in video frames from the target vehicle state estimation results using preset association matching rules includes: Extracting target vehicle features: Extracting feature information of the target vehicle in each frame from the target vehicle state estimation results, such as position and speed. Calculating feature similarity: Calculating the similarity between target vehicle features in different frames according to preset association matching rules. For example, calculating the difference in distance or speed between target vehicle positions in two frames. Determining association relationship: Comparing the calculated feature similarity with a preset matching threshold. If the similarity meets the matching threshold requirement, the two target vehicles are considered to be the same vehicle and are associated; otherwise, they are considered to be different vehicles. Generating tracking trajectory: Connecting the position information of the same vehicle in different frames according to the association relationship to generate the vehicle's tracking trajectory.

[0052] The matching thresholds for the association matching rules are trained using historical vehicle trajectory data within the tunnel and dynamically adjusted over time. The training phase includes: collecting a large amount of historical vehicle trajectory data within the tunnel, including vehicle position and speed information in different frames; manually labeling the historical data to determine which frames contain the same target vehicle, forming a labeled dataset; using the labeled dataset, continuously adjusting the matching thresholds through machine learning or statistical methods to achieve high accuracy and recall when performing association matching according to the preset association matching rules and the current thresholds. For example, grid search, genetic algorithms, etc., can be used to find the optimal threshold combination. The dynamic adjustment phase includes: monitoring traffic conditions within the tunnel, such as changes in traffic flow and vehicle speed, using real-time collected vehicle flow detection data; dynamically adjusting the matching thresholds based on changes in traffic conditions. For example, when traffic flow increases, the distance between vehicles decreases, so the position distance threshold can be appropriately reduced; when vehicle speed changes significantly, the speed difference threshold can be adjusted to ensure the accuracy of association matching.

[0053] If the preset vehicle flow threshold is a single upper limit vehicle flow threshold, the currently extracted vehicle flow value is directly compared with this upper limit vehicle flow threshold to determine if the current vehicle flow value is greater than the upper limit vehicle flow threshold. If the preset vehicle flow threshold is a normal flow range threshold (e.g., [Qmin, Qmax], where Qmin is the lower limit of normal flow and Qmax is the upper limit of normal flow), the current vehicle flow value is compared with both Qmin and Qmax to determine if the current vehicle flow value is less than Qmin, within the range of [Qmin, Qmax], or greater than Qmax. If the comparison result is that the current vehicle flow value is within the preset normal range (e.g., less than the single upper limit vehicle flow threshold or within the range of [Qmin, Qmax]), an "abnormal identifier field = normal" or "abnormal identifier field = 0" (0 represents normal status) is added to the vehicle flow detection data. If the comparison result is that the current vehicle flow value exceeds the normal range (e.g., greater than the single upper limit vehicle flow threshold), the current vehicle flow value is considered normal. If the current vehicle flow threshold is less than Qmin or greater than Qmax, then an anomaly flag is added according to the type of exceedance. For example, if the current vehicle flow value is greater than Qmax, add "Anomaly Flag Field = Anomaly - Exceeding the Flow Limit" or "Anomaly Flag Field = 1". If the current vehicle flow value is less than Qmin, add "Anomaly Flag Field = Anomaly - Below the Flow Limit" or "Anomaly Flag Field = 2" (1 represents anomaly - exceeding the flow limit, and 2 represents anomaly - below the flow limit). Finally, the vehicle flow detection data with the added anomaly flag fields (including the original vehicle location, vehicle speed, vehicle trajectory information, and the newly added anomaly flag fields) is integrated according to a preset structured format (such as a fixed field order and a unified data type specification) to form complete structured detection data containing anomaly flag fields. This structured detection data is then output according to the system's subsequent processing requirements (such as transmitting to the tunnel traffic control platform, storing in the database for subsequent query and analysis, or pushing to the anomaly warning module).

[0054] The above are merely embodiments of the present invention. Commonly known structures and characteristics are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are aware of all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.

Claims

1. A tunnel traffic flow detection method based on video cloud networking technology, characterized in that: Includes the following steps: S1. Connect each surveillance camera in the tunnel to the preset video cloud networking platform through a standardized interface, and obtain the video stream data collected in real time by each surveillance camera in the tunnel according to the preset video cloud networking platform. S2. Based on video coding technology, the video stream data is compressed and encoded to obtain encoded video data, and the encoded video data is sent to the preset edge computing node; S3. Noise filtering and frame synchronization preprocessing are performed on the encoded video data using preset edge computing nodes to obtain spatiotemporally aligned structured video data. Specifically, noise filtering and frame synchronization preprocessing include: The encoded video data is filtered for noise to obtain denoised video data. Based on the denoised video data, the timestamp of one of the surveillance cameras is determined as the reference time axis. The time deviation between the timestamps of other surveillance cameras and the reference time axis is calculated. The timestamps of the surveillance cameras with time deviation are aligned according to the acquisition time to obtain time-aligned video data. The video frames of each surveillance camera in the time-aligned video data are transformed by coordinates to obtain the corresponding transformed video frames. The pixel space coordinate ranges of each transformed video frame are compared, and the regions where the pixel space coordinate ranges intersect are selected as overlapping regions. Calculate the distance-light joint compensation coefficient for each pixel in the overlapping area, and optimize the pixel grayscale value of the video frame after coordinate transformation according to the distance-light joint compensation coefficient to obtain the corresponding optimized video frame. The optimized video frames are spatially superimposed according to the target Cartesian coordinate system, and the pixel data of the overlapping area are merged using the nearest neighbor interpolation method. S4. Construct a vehicle traffic detection model based on a lightweight deep learning framework in a preset edge computing node, and input structured video data into the vehicle traffic detection model to extract vehicle feature parameters from the video frames. S5. Input the vehicle feature parameters into the asymmetric Kalman filter algorithm to track and associate the target vehicles in the video frame, generate vehicle traffic detection data, compare the vehicle traffic detection data with the preset vehicle traffic threshold, and output structured detection data containing anomaly identification fields.

2. The tunnel traffic flow detection method based on video cloud networking technology according to claim 1, characterized in that: In step S1, the process of connecting each surveillance camera in the tunnel to a pre-set video cloud networking platform via a standardized interface includes: The device identification information of each surveillance camera is obtained through a standardized interface, and the device identification information is authenticated to output a list of camera devices that have passed the authentication. Based on the segmented structure of the tunnel, the tunnel is divided into multiple monitoring areas, each monitoring area is assigned a unique area code, and a monitoring area division table containing the area codes is output. Establish a mapping rule base between device identification information in the list of surveillance cameras and area codes in the monitoring area division table. The mapping rule base includes the mapping relationship between the monitoring range parameters and area codes corresponding to each surveillance camera. The monitoring range parameters are determined by the installation location and lens angle of each surveillance camera. Extract the monitoring range parameters corresponding to the device identification information in the list of surveillance cameras, and match the monitoring range parameters with the area boundary parameters corresponding to the area codes in the monitoring area division table through the mapping relationship. Filter out the camera access configuration table whose matching degree meets the preset matching degree threshold, and import the camera access configuration table into the preset video cloud networking platform.

3. The tunnel traffic flow detection method based on video cloud networking technology according to claim 1, characterized in that: The mathematical expression for the distance-illuminance joint compensation coefficient is: In the formula, This represents the pixels within the overlapping area corresponding to the i-th surveillance camera. The distance-illuminance joint compensation coefficient, Indicates the distance attenuation coefficient. This represents the average illumination value of the current video frame captured by the i-th surveillance camera. This indicates the preset standard reference illumination value inside the tunnel. , , This indicates the pixel distance from the installation position of the i-th surveillance camera. The straight-line distance to the corresponding real-world point. , Represents pixels The X-axis spatial coordinates in the target Cartesian coordinate system This represents the X-axis coordinate parameter of the installation location of the i-th surveillance camera in the target Cartesian coordinate system. Represents pixels Y-axis spatial coordinates in the target Cartesian coordinate system This represents the Y-axis coordinate parameter of the installation location of the i-th surveillance camera in the target Cartesian coordinate system. Represents pixels The Z-axis spatial coordinates in the target Cartesian coordinate system This represents the Z-axis coordinate parameter of the installation location of the i-th surveillance camera in the target Cartesian coordinate system.

4. The tunnel traffic flow detection method based on video cloud networking technology according to claim 3, characterized in that: The mathematical expression for compensating and optimizing the pixel grayscale values ​​of the video frame after coordinate transformation is as follows: In the formula, This represents the pixel corresponding to the i-th surveillance camera. The grayscale value after compensation and optimization This represents the pixel value of the video frame from the i-th surveillance camera after coordinate transformation. The original grayscale value.

5. The tunnel traffic flow detection method based on video cloud networking technology according to claim 1, characterized in that: S4 includes: S41. Integrate the YOLO algorithm into a lightweight deep learning framework of preset edge computing nodes to build an initial network architecture. Use sample data containing vehicle location labels to train the initial network architecture. During the training process, iteratively optimize the model parameters of the initial network architecture through the backpropagation algorithm until the loss function value is lower than the preset loss function value for a consecutive preset number of rounds. Then output the vehicle traffic detection model that has been trained and converged. S42. Input the spatiotemporally aligned structured video data into the vehicle flow detection model, identify and label vehicle targets in the video frames using the YOLO algorithm, output detection boxes containing vehicle location information, input the detection boxes into the multi-target tracking algorithm for association matching, assign a unique virtual ID to each vehicle target, and output vehicle tracking features containing the virtual ID. S43. Based on vehicle tracking features including virtual IDs, perform real-time statistics on virtual IDs within the detection area and output vehicle feature parameters including virtual IDs, vehicle locations, and vehicle numbers.

6. The tunnel traffic flow detection method based on video cloud networking technology according to claim 5, characterized in that: In S41, the initial network architecture includes a feature extraction layer, a detection layer, and a tracking layer connected in sequence. The feature extraction layer adopts the MobileNetV3 lightweight network structure, the detection layer outputs vehicle location information, and the tracking layer outputs vehicle speed and number of vehicles through ID allocation and trajectory fusion.

7. The tunnel traffic flow detection method based on video cloud networking technology according to claim 1, characterized in that: S5 includes: S51. Input the vehicle feature parameters into the asymmetric Kalman filter algorithm. Through the state transition matrix and observation matrix in the asymmetric Kalman filter algorithm, the vehicle feature parameters are estimated and the observation is updated to obtain the target vehicle state estimation result. The state transition matrix is ​​preset based on the vehicle kinematic model in the tunnel, and the observation matrix is ​​configured according to the spatial distribution parameters of the monitoring camera. S52. Using a preset association matching rule, target vehicles in the video frames of the target vehicle state estimation result are tracked and associated to generate vehicle traffic detection data containing vehicle position, vehicle speed, and vehicle trajectory information. The matching threshold of the association matching rule is obtained by training on historical vehicle trajectory data in the tunnel and is dynamically adjusted over time. S53. Input the vehicle flow detection data into the preset comparison module to extract the vehicle flow value from the vehicle flow detection data. S54. Compare the traffic flow value with the preset vehicle flow threshold, add an anomaly flag field to the vehicle flow detection data based on the comparison result, and output structured detection data containing the anomaly flag field.

Citation Information

Patent Citations

  • Scene-adaptive face recognition system in medical insurance applications

    CN106250825A

  • Tunnel traffic flow detection system and method based on YOLOv8 algorithm

    CN117746649A

  • Video fusion method and fusion system of fisheye camera

    CN119067842A

  • Video monitoring data processing system based on cloud computing

    CN119583764A

  • Traffic data analysis method and device based on multi-channel video fusion

    CN121033780A

Cited By

  • Liquid rocket engine simulation test run video noise reduction system and noise reduction method

    CN121724862A