Traffic monitoring video compression method under millimeter wave radar cooperative positioning

By using millimeter-wave radar to collaboratively locate and determine the Region of Interest (ROI), and combining dynamic filtering and gradient masking techniques to optimize video encoding resource allocation, the problem of ROI identification and transmission in complex environments under traditional traffic monitoring video encoding is solved, achieving efficient compression and stability of key areas.

CN122349014APending Publication Date: 2026-07-07ZHEJIANG UNIVIEW TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG UNIVIEW TECH CO LTD
Filing Date
2026-03-23
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Traditional traffic monitoring video coding methods struggle to accurately extract Regions of Interest (ROIs) in complex environments, leading to delays in the transmission of critical information or excessive resource consumption by redundant background data. Furthermore, the H.264 coding standard has high requirements for ROI identification and tracking, making it difficult to meet real-time and stability requirements.

Method used

The ROI region is determined by co-location using millimeter-wave radar. Non-ROI regions are smoothed by dynamic filtering and gradient masking. Dynamic QP quantization parameters are adjusted to optimize resource allocation and achieve high-quality transmission in the ROI region.

Benefits of technology

It improves the subjective visual quality of the video, optimizes the allocation of encoding resources, ensures high definition and bit rate stability in key areas, solves the limitations of traditional encoding in terms of clarity and real-time performance, and provides an efficient traffic monitoring video compression solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122349014A_ABST
    Figure CN122349014A_ABST
Patent Text Reader

Abstract

The application provides a traffic monitoring video compression method under millimeter wave radar cooperative positioning, and belongs to the technical field of intelligent traffic and video coding; position information of a target is obtained through a millimeter wave radar, the target position in a radar coordinate system is mapped into a pixel coordinate system of a video frame, a boundary box of an ROI region is determined, and the ROI region and a non-ROI region are distinguished; for the non-ROI region, on the one hand, a gradual mask technology is used to create a smooth transition region from the ROI to the non-ROI, and on the other hand, dynamic filtering is used to adaptively apply differentiated filtering strength to different regions of the video frame, so that seamless connection of the non-ROI and detail reservation of the ROI are realized; for the smoothed video frame, dynamic QP adjustment is performed according to a bit resource allocation strategy, and more bits are allocated to the ROI region. The application solves the problems of difficulty in dynamically extracting an ROI region and how to improve overall code rate stability while ensuring the definition of a key region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent transportation and video coding technology, and particularly relates to a method for compressing traffic monitoring videos under millimeter-wave radar cooperative positioning. Background Technology

[0002] In traffic monitoring systems, real-time transmission of high-definition video places extremely high demands on bandwidth and transmission stability. When identifying target information in traffic monitoring, traditional visual methods are greatly affected by environmental factors such as lighting and weather, leading to frequent errors in ROI extraction. Traditional video coding algorithms often struggle to balance high-definition quality of key areas (such as vehicles and pedestrians) with overall bitrate control when processing traffic monitoring video, resulting in delayed transmission of critical information or excessive resource consumption by redundant background data.

[0003] Traditional methods for extracting Regions of Interest (ROIs) include fixed-region segmentation based on manual rules and feature extraction based on basic image processing. The former can quickly define the ROI range by manually pre-setting key areas in the monitoring image (such as lanes and zebra crossings) without additional computing power, but its disadvantage is extremely poor flexibility and inability to accurately cover the ROI area. The latter can automatically identify moving areas or areas with different features in the image by using basic algorithms such as frame difference, background modeling, and brightness texture segmentation, achieving preliminary screening of dynamic targets. However, this method has weak anti-interference ability, and factors such as changes in light, shadows, and falling leaves can easily lead to misjudgment of ROI areas, making it difficult to meet the needs of accurately extracting key targets in complex traffic scenarios.

[0004] As a video coding standard, H.264 provides a theoretical basis for ROI region bit allocation through its bitrate control and parameter configuration. However, ROI region bit allocation based on H.264 requires accurate and real-time identification and tracking of ROI regions. Otherwise, it may lead to misalignment of bitrate allocation, which in turn may cause a decrease in the quality of key targets or excessive blurring of the background. This places high demands on the stability and computational efficiency of detection algorithms. Summary of the Invention

[0005] To address the above problems, this invention proposes a traffic monitoring video compression method based on millimeter-wave radar cooperative positioning, comprising the following steps: S1. Obtain the target's position information through millimeter-wave radar, map the target's position in the radar coordinate system to the pixel coordinate system of the video frame, determine the bounding box of the ROI region, and distinguish between the ROI region and the non-ROI region. S2, For the obtained non-ROI region, calculate the distance between each pixel in the non-ROI region and the boundary of the ROI region, create a transition region from the ROI region to the non-ROI region and design a gradient mask to obtain a gradient mask suitable for the smooth transition region. S3 uses a gradient mask to control the filtering weights, performs adaptive dynamic filtering on the transition region, and mixes it with the original image to obtain a smoothed complete video frame. S4. For the smoothed video frame, record the number of macroblocks in different regions and the previous frame background skipping statistics. Use a bit resource allocation strategy to adjust the dynamic QP quantization parameters to obtain the updated dynamic QP value for each region. S5 performs region-adaptive encoding on the smoothed video frames based on the dynamic QP values ​​of different regions, resulting in the final optimized and compressed traffic monitoring video.

[0006] Preferably, the process of mapping the target position in the radar coordinate system to the pixel coordinate system of the video frame is as follows: The system acquires the original target information collected by millimeter-wave radar. Based on the physical location of the radar sensor, a coordinate system centered on the radar is established to obtain the target's position in the radar coordinate system. Subsequently, the radar coordinates of the target are transformed into the camera coordinate system with the camera's optical center as the origin. Finally, combined with the camera's focal length, the camera coordinates of the target are converted into pixel coordinates, completing the mapping of the target's position information to pixel coordinates.

[0007] Preferably, the specific process of determining the bounding box of the ROI region and distinguishing between the ROI region and non-ROI regions is as follows: After obtaining the initial pixel coordinates of the target, these coordinates are used as the center point of the Region of Interest (ROI). Combined with the actual size of the target, the pixel range occupied by the target on the image is calculated. Then, pixel expansion is performed, with the expansion size equal to the pixel size of the target. The expanded boundary is the ROI bounding box. Based on the obtained ROI bounding box, the ROI region and non-ROI regions are divided.

[0008] Preferably, the specific process of S2 is as follows: Based on the principle of Gaussian function, the coordinates are calculated step by step according to the distance between each pixel in the non-ROI region and the boundary of the ROI region. Standard deviation of Gaussian function The calculation formula is:

[0009] in, These represent the Gaussian standard deviations of non-ROI pixels from the nearest and farthest points on the ROI boundary, respectively. This represents the distance from each pixel in the non-ROI region to the boundary of the ROI region. This represents the maximum distance from a non-ROI pixel to the ROI boundary. This distance is used as a normalized distance weight and pixel expansion is performed. The expanded region is the transition region. Subsequently, a mask value was designed, with pixels in the ROI region set to 1 to preserve the original content, and pixels in the non-ROI region decreasing to 0 with distance; Finally, a gradient mask is constructed to smoothly transition between ROI and non-ROI regions:

[0010] in, Let be the standard deviation of the Gaussian function, and e be the natural constant.

[0011] Preferably, the specific process of S3 is as follows: First, based on the ROI region bounding box and the target size, calculate the distance from each non-ROI region pixel to the ROI region boundary. Subsequently, the mask value for each pixel is calculated to obtain a smoothed image of the transition region from the ROI region to the non-ROI region.

[0012] in The coordinates in the original image are Pixel value at that location, Let the radius be the Gaussian kernel. yes The gradient mask value at the location controls the degree of transition, resulting in a smooth gradient processing of the non-ROI region; By blending the original image with the smoothed image, the final pixel values ​​are obtained as follows:

[0013] in Coordinates The gradient mask value at that location, The original image is in Pixel value at that location, The image after smoothing is in The pixel value at that location.

[0014] Preferably, the specific process of S4 is as follows: First, based on the ROI region, transition region, and non-ROI region, the number of macroblocks in each region is recorded as N1, N2, and N3, respectively, along with frame skipping statistics. The boundary information of regions 1 and 2 is stored using macroblock indexes; Subsequently, a model incorporating frame skipping statistics and QP correlation is established to calculate the increment of the current macroblock quantization parameters:

[0015]

[0016]

[0017] and These represent the current macroblock quantization parameters relative to the average quantization parameters of the previous frame in the ROI region, transition region, and non-ROI region, respectively. The degree of deviation, according to Allocate bits appropriately, giving more bits to the ROI region; It is a proportionality constant; These are dynamic parameters obtained through real-time sampling during the encoding process, used to adjust the quantization weights of each region; Finally, before encoding each frame, calculations are performed based on region statistics and the results of the previous frame. The quantization parameters for each region are obtained according to the following formula. : .

[0018] Preferably, the specific process of performing region adaptive coding on the smoothed video frame is as follows: First, traverse all macroblocks in the current frame and label each macroblock with a region to obtain a macroblock-region mapping; label 1 represents a ROI region macroblock, label 2 represents a transition region macroblock, and label 3 represents a non-ROI region macroblock; Based on different tags, QP1 is assigned to ROI region macroblocks, QP2 to transition region macroblocks, and QP3 to non-ROI region macroblocks. Subsequently, regional QP control parameters are configured in the H.264 encoder, and the QP value is dynamically adjusted according to the tag of each macroblock to encode the current frame, ultimately resulting in an optimized and compressed video.

[0019] Compared with the prior art, the present invention has the following beneficial effects: The method proposed in this invention fully leverages the advantages of dynamic filtering and gradient masking techniques to achieve a smooth transition between ROI and non-ROI areas, avoiding hard boundary effects and improving the subjective visual quality of the video. Simultaneously, it fully utilizes the technical advantages of dynamically adjusting QP quantization parameters to optimize encoding resource allocation. With limited bandwidth, more bits are allocated to ROI areas, achieving high-quality transmission and bitrate stability in critical areas. This solves the problem of improving overall bitrate stability while ensuring the clarity of critical areas, effectively overcoming the limitations of traditional encoding in terms of clarity and real-time performance, and providing an efficient solution for traffic monitoring systems. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the overall process flow of the present invention.

[0021] Figure 2 for A diagram illustrating the relationship between the number of encoded bits and the number of bits.

[0022] Figure 3 for A diagram illustrating the relationship between quantity and influence factor.

[0023] Figure 4 This is a schematic diagram illustrating the hierarchical classification of ROI regions.

[0024] Figure 5 This is a screenshot of traffic monitoring video taken in a simple testing environment in the embodiment.

[0025] Figure 6 This is a screenshot of traffic monitoring video taken in a complex environment during the test in this embodiment.

[0026] Figure 7 This is a screenshot from a traffic monitoring video at a multi-vehicle intersection tested in the embodiment.

[0027] Figure 8 This is a screenshot from a traffic monitoring video taken during nighttime testing in an example embodiment. Detailed Implementation

[0028] This invention proposes a traffic monitoring video compression algorithm based on millimeter-wave radar cooperative positioning. It utilizes millimeter-wave radar to collect target information, dynamically extracts Regions of Interest (ROIs), smooths non-ROI areas through dynamic filtering and gradient masking to reduce bit consumption, and employs dynamic QP adjustment to optimize resource allocation and improve the quality of ROI areas. This method improves the clarity, bit rate stability, and real-time performance of key areas, providing an efficient compression solution for traffic monitoring and possessing practical value. The overall process is as follows: Figure 1 As shown: S1: Obtain the location information of the target (vehicle, pedestrian, etc.) through millimeter-wave radar, map the target position in the radar coordinate system to the pixel coordinate system of the video frame, determine the bounding box of the ROI region, and distinguish between ROI regions and non-ROI regions. If there is no ROI region, proceed directly to S5.

[0029] Based on images acquired by millimeter-wave radar, target objects in the images are detected, a Cartesian coordinate system centered on the radar is established, and the position of the target objects in the radar coordinate system is obtained. The target's radar coordinates are transformed into the camera coordinate system with the camera's optical center as the origin. The transformed coordinates are: The transformation relationship between the two coordinates is as follows:

[0030] here Let R represent the homogeneous coordinates of the target in the radar coordinate system, and M1 be the external parameter matrix, where R w It is a 3×3 orthogonal rotation matrix, T w It is a 3×1 translation vector.

[0031] Convert the target's camera coordinates to pixel coordinates The conversion formula is as follows:

[0032] Here, K is the camera's 3×3 intrinsic parameter matrix. , where f x and f y It's the camera's focal length, c x and c y This refers to the position of the origin in the pixel coordinate system. After obtaining the pixel coordinates of all targets in the detection area, the pixel size W is calculated. p H p as follows;

[0033] Typically, W=1.5m and H=1.5m are chosen. The ROI bounding box is then obtained by combining the pixel coordinates of the target. This yields the ROI region, and the remaining region is the non-ROI region.

[0034]

[0035] S2, for the acquired non-ROI region, calculate the distance between each pixel in the non-ROI region and the boundary of the ROI region, create a transition region from the ROI region to the non-ROI region and design a gradient mask to obtain a gradient mask suitable for the smooth transition region.

[0036] Please see Figure 2 , Figure 2 The experimental results are for the standard test sequence. It exhibits a significant positive correlation with the number of encoded bits, increasing with the number of bits within a macroblock. As the coefficient increases, the number of required encoding bits increases linearly. This experiment yielded... It is a key factor affecting bit rate.

[0037] Further reading Figure 3 Experiments were conducted to control variables, adjusting two variables: quantization parameter and filter strength, and variance parameter. By controlling the filtering strength, a Gaussian low-pass filter is used for image smoothing, and the result is as follows: Figure 3 As shown. The smoothed image is obtained. Significantly reduced, and at a fixed QP value, Increase, The results show a significant reduction and a decreasing trend, stabilizing after reaching a critical value. This demonstrates the beneficial effect of moderate smoothing in reducing bit rate and improving compression efficiency, especially in ROI region compression by optimizing resource allocation by reducing bit consumption in non-ROI regions. However, under different QP values... The difference between the initial value and the decrease magnitude reflects the interaction between QP and the filtering intensity. Furthermore, excessive smoothing will result in the loss of high-frequency information, so dynamic QP adjustment is required to balance coding efficiency and image quality.

[0038] Based on the principle of Gaussian function, the coordinates are calculated step by step according to the distance between each pixel in the non-ROI region and the boundary of the ROI region. Standard deviation of Gaussian function The mask value is directly affected Control determines the smoothness of different locations in the image, and varies with the distance of each pixel from the ROI boundary. It increases linearly with increasing size, and the calculation formula is:

[0039] in, These represent the Gaussian standard deviations of non-ROI pixels from the nearest and farthest points on the ROI boundary, respectively. This represents the distance from each pixel in the non-ROI region to the boundary of the ROI region. This represents the maximum distance from non-ROI pixels to the boundary of the ROI region. This distance is used to normalize the smoothing intensity, ensuring that a smaller smoothing intensity is applied near the ROI region within the transition area. Preserve details, use larger sizes in areas far from the ROI. Enhance the smoothing effect. Then, use this distance as the size for pixel expansion, perform pixel expansion, and obtain the transition region.

[0040] Next, the mask values ​​are designed such that pixels within the ROI region are set to 1 to preserve the original content, while pixels in the non-ROI region decrease to 0 with distance. Finally, a gradient mask is constructed to create a smooth transition between the ROI and non-ROI regions:

[0041] in, Let be the standard deviation of the Gaussian function, and e be the natural constant.

[0042] S3 uses a gradient mask to control the filtering weights, performs adaptive dynamic filtering on the transition region, and mixes it with the original image to obtain a smoothed complete video frame.

[0043] Based on the ROI region bounding box and the target size, calculate the distance from each non-ROI region pixel to the ROI region boundary. Subsequently, the mask value of each pixel is calculated to obtain a smoothed image of the transition area from the ROI region to the non-ROI region.

[0044]

[0045] in The coordinates in the original image are Pixel value at that location, Let the radius be the Gaussian kernel. yes The gradient mask value at the location controls the degree of transition.

[0046] By blending the original image with the smoothed image, the final pixel values ​​are obtained as follows:

[0047] in Coordinates The gradient mask value at that location, The original image is in Pixel value at that location, The image after smoothing is in The pixel value at that location. It controls the degree of transition in different regions of the image. When the mask value is 1, the pixel values ​​of the original image are preserved; when the mask value is 0, the smoothed image... The pixel values ​​will be used.

[0048] This method achieves gradual smoothing of non-ROI regions, with weaker filtering intensity in regions closer to the ROI and stronger filtering intensity in regions farther from the ROI.

[0049] S4 records the number of macroblocks and the previous frame background skipping statistics in different regions of the smoothed video frame. A bit resource allocation strategy is used to dynamically adjust the QP (quantization parameter) to obtain the updated dynamic QP value for each region.

[0050] Please see Figure 4 , Figure 4 The diagram illustrates the hierarchical regions of a video frame, dividing it into three regions: Region 1 is the core ROI region, which is the area where targets (vehicles, pedestrians, etc.) detected by millimeter-wave radar are located, directly mapping the target position in the radar coordinate system; Region 2 is the transition buffer, which is the transition area between the ROI and the background, used to smooth quality changes; Region 3 is the background area, i.e., the non-ROI region, which is the non-critical background area in the video frame, usually not containing moving targets.

[0051] After obtaining the three regions of the video frame, record the number of macroblocks in each region, N1, N2, and N3, respectively, and the frame skipping statistics. (Number of macroblocks encoded in Skip mode in the background region of the previous frame), with macroblock indexes used to store the boundary information of regions 1 and 2.

[0052] Subsequently, a model incorporating frame skipping statistics and QP correlation is established to calculate the increment of the current macroblock quantization parameters:

[0053]

[0054]

[0055] and These represent the current macroblock quantization parameters relative to the average quantization parameters of the previous frame in the ROI region, transition region, and non-ROI region, respectively. Based on the degree of deviation, bits are allocated reasonably, with more bits assigned to the ROI region. It is a proportionality constant.

[0056] These are dynamic parameters obtained through real-time sampling during the encoding process. They control the allocation of encoding resources in the core ROI region, transition region, and non-ROI region, and adjust the quantization weights of each region. Dynamic adjustment is employed. Resource allocation: If the video ROI is small, it needs to be increased. To ensure the quality of the ROI area while reducing and Save bit resources in non-ROI regions. If the ROI region is large, the size can be reduced appropriately. Increase the weight and To maintain a balance in overall quality.

[0057] Before encoding each frame, calculations are performed based on region statistics and the results of the previous frame. The quantization parameters for each region are continuously updated according to the following formula.

[0058]

[0059] S5 performs region-adaptive encoding on the smoothed video frames based on the dynamic QP values ​​of different regions, resulting in the final optimized and compressed traffic monitoring video.

[0060] The process iterates through all macroblocks in the current frame, assigning a region label to each macroblock to obtain a macroblock-region mapping. Label 1 represents a ROI (Return on Illusion) macroblock, label 2 represents a transition region macroblock, and label 3 represents a non-ROI region macroblock. Based on the different labels, QP1 is assigned to ROI region macroblocks, QP2 to transition region macroblocks, and QP3 to non-ROI region macroblocks. Subsequently, regionalized QP control parameters are configured in the H.264 encoder, and the QP value is dynamically adjusted according to the label of each macroblock to encode the current frame, ultimately resulting in the optimized and compressed video.

[0061] In this embodiment, the following is adopted: The pixel-level traffic monitoring video sequence was used for verification. Targets located by millimeter-wave radar were simulated by manually calibrating key observation areas, and simple environmental scenarios were tested. Figure 5 As shown, the test environment scenario is complex. Figure 6 As shown, the test scenario at a multi-vehicle intersection is as follows: Figure 7 As shown, the test was conducted in a nighttime scenario. Figure 8 As shown in the figure, the red box area represents the ROI, and the black box area represents the transition area. The video quality evaluation metric used is PSNR (Peak Signal-to-Noise Ratio), which represents the difference between the original video and the compressed video, measuring the degree of distortion during the encoding process. The test results are shown in Table 1.

[0062] Table 1. Comparison of PSNR between ROI and non-ROI regions in various scenarios.

[0063] The ROI-based video coding strategy, through millimeter-wave radar-assisted localization and dynamic resource allocation, achieved high-quality ROI areas in various scenarios, outperforming non-ROI areas and validating the effectiveness of the method. While the method's performance slightly degraded in complex scenarios and low-light conditions, it still met the requirements for clarity in key areas during traffic monitoring.

[0064] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

[0065] While the specific embodiments of the present invention have been described above, they are not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A method for compressing traffic monitoring videos using millimeter-wave radar cooperative positioning, characterized in that, Includes the following steps: S1. Obtain the target's position information through millimeter-wave radar, map the target's position in the radar coordinate system to the pixel coordinate system of the video frame, determine the bounding box of the ROI region, and distinguish between the ROI region and the non-ROI region. S2, For the obtained non-ROI region, calculate the distance between each pixel in the non-ROI region and the boundary of the ROI region, create a transition region from the ROI region to the non-ROI region and design a gradient mask to obtain a gradient mask suitable for the smooth transition region. S3 uses a gradient mask to control the filtering weights, performs adaptive dynamic filtering on the transition region, and mixes it with the original image to obtain a smoothed complete video frame. S4. For the smoothed video frame, record the number of macroblocks in different regions and the previous frame background skipping statistics. Use a bit resource allocation strategy to adjust the dynamic QP quantization parameters to obtain the updated dynamic QP value for each region. S5 performs region-adaptive encoding on the smoothed video frames based on the dynamic QP values ​​of different regions, resulting in the final optimized and compressed traffic monitoring video.

2. The traffic monitoring video compression method under millimeter-wave radar cooperative positioning as described in claim 1, characterized in that: The specific process of mapping the target position in the radar coordinate system to the pixel coordinate system of the video frame is as follows: The system acquires the original target information collected by millimeter-wave radar. Based on the physical location of the radar sensor, a coordinate system centered on the radar is established to obtain the target's position in the radar coordinate system. Subsequently, the radar coordinates of the target are transformed into the camera coordinate system with the camera's optical center as the origin. Finally, combined with the camera's focal length, the camera coordinates of the target are converted into pixel coordinates, completing the mapping of the target's position information to pixel coordinates.

3. The traffic monitoring video compression method under millimeter-wave radar cooperative positioning as described in claim 2, characterized in that: The specific process of determining the bounding box of the ROI region and distinguishing between the ROI region and non-ROI regions is as follows: After obtaining the initial pixel coordinates of the target, these coordinates are used as the center point of the Region of Interest (ROI). Combined with the actual size of the target, the pixel range occupied by the target on the image is calculated. Then, pixel expansion is performed, with the expansion size equal to the pixel size of the target. The expanded boundary is the ROI bounding box. Based on the obtained ROI bounding box, the ROI region and non-ROI regions are divided.

4. The traffic monitoring video compression method under millimeter-wave radar cooperative positioning as described in claim 1, characterized in that: The specific process of S2 is as follows: Based on the principle of Gaussian function, the coordinates are calculated step by step according to the distance between each pixel in the non-ROI region and the boundary of the ROI region. Standard deviation of Gaussian function The calculation formula is: in, These represent the Gaussian standard deviations of non-ROI pixels from the nearest and farthest points on the ROI boundary, respectively. This represents the distance from each pixel in the non-ROI region to the boundary of the ROI region. This represents the maximum distance from a non-ROI pixel to the ROI boundary. This distance is used as a normalized distance weight and pixel expansion is performed. The expanded region is the transition region. Subsequently, a mask value was designed, with pixels in the ROI region set to 1 to preserve the original content, and pixels in the non-ROI region decreasing to 0 with distance; Finally, a gradient mask is constructed to smoothly transition between ROI and non-ROI regions: in, Let be the standard deviation of the Gaussian function, and e be the natural constant.

5. The traffic monitoring video compression method under millimeter-wave radar cooperative positioning as described in claim 1, characterized in that: The specific process of S3 is as follows: First, based on the ROI region bounding box and the target size, calculate the distance from each non-ROI region pixel to the ROI region boundary. ; Subsequently, the mask value of each pixel is calculated to obtain a smoothed image of the transition region from the ROI region to the non-ROI region: in The coordinates in the original image are Pixel value at that location, Let the radius be the Gaussian kernel. yes The gradient mask value at the location controls the degree of transition, resulting in a smooth gradient processing of the non-ROI region; By blending the original image with the smoothed image, the final pixel values ​​are obtained as follows: in Coordinates The gradient mask value at that location, The original image is in Pixel value at that location, The image after smoothing is in The pixel value at that location.

6. The traffic monitoring video compression method under millimeter-wave radar cooperative positioning as described in claim 1, characterized in that: The specific process of S4 is as follows: First, based on the ROI region, transition region, and non-ROI region, the number of macroblocks in each region is recorded as N1, N2, and N3, respectively, along with frame skipping statistics. The boundary information of regions 1 and 2 is stored using macroblock indexes; Subsequently, a model incorporating frame skipping statistics and QP correlation is established to calculate the increment of the current macroblock quantization parameters: and These represent the current macroblock quantization parameters relative to the average quantization parameters of the previous frame in the ROI region, transition region, and non-ROI region, respectively. The degree of deviation, according to Allocate bits appropriately, giving more bits to the ROI region; It is a proportionality constant; These are dynamic parameters obtained through real-time sampling during the encoding process, used to adjust the quantization weights of each region; Finally, before encoding each frame, calculations are performed based on region statistics and the results of the previous frame. The quantization parameters for each region are obtained according to the following formula. : 。 7. The traffic monitoring video compression method under millimeter-wave radar cooperative positioning as described in claim 6, characterized in that: The specific process of performing region adaptive coding on the smoothed video frame is as follows: First, traverse all macroblocks in the current frame and label each macroblock with a region to obtain a macroblock-region mapping; label 1 represents a ROI region macroblock, label 2 represents a transition region macroblock, and label 3 represents a non-ROI region macroblock; Based on different labels, QP1 is assigned to ROI region macroblocks, QP2 is assigned to transition region macroblocks, and QP3 is assigned to non-ROI region macroblocks. Subsequently, regional QP control parameters are configured in the H.264 encoder, and the QP value is dynamically adjusted according to the label of each macroblock to encode the current frame, ultimately resulting in an optimized and compressed video.