A method, device, equipment and medium for eliminating hysteresis of vehicle anti-glare system

By using target object detection model and motion analysis in the vehicle anti-glare system, the final shading position of the target object is determined, which solves the problem of beam adjustment lag in traditional systems and improves driving safety.

CN119359757BActive Publication Date: 2025-03-28ELECTRICITY FACILITIES GUANGRI GUANGZHOU CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411918583.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-03-28
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

When traditional vehicle anti-glare systems deal with high-speed moving targets, there is a problem of insufficient dynamic response speed, resulting in lag in beam adjustment and affecting driving safety.

Method used

By obtaining the captured image of the current moment, using the trained target object detection model for detection, matching the target object at the current moment and the previous moment, performing motion analysis, determining the speed of the target object, and determining the final masking position based on the position, speed and masking position of the target object to eliminate lag.

Benefits of technology

It effectively solves the problem of beam adjustment lag caused by insufficient dynamic response speed, reduces the glare phenomenon on the target object, and improves driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359757B_ABST
    Figure CN119359757B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for eliminating lag of a vehicle anti-glare system, and relates to the technical field of vehicle anti-glare systems. The method uses a trained target detection model to detect the captured image at the current moment to obtain the target detection result at the current moment, and further combines the target detection result at the previous moment to match the target at the current moment with the target at the previous moment to determine the matching target at the current moment, and performs motion analysis on the matching target at the current moment to determine the speed of the matching target at the current moment. When lag elimination is required, the final shielding position of the matching target is determined based on the position, speed and corresponding shielding position of the matching target. The present application combines target detection, target tracking and target motion analysis to determine a reasonable shielding position, and can solve the problem of beam adjustment lag caused by insufficient dynamic response speed through lag elimination, thereby improving driving safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of vehicle anti-glare systems, and in particular to a method, device, equipment and medium for eliminating hysteresis of a vehicle anti-glare system. Background Art

[0002] Traditional headlights can dazzle drivers of oncoming vehicles at night, affecting their vision and increasing the risk of traffic accidents. The vehicle anti-glare system reduces the glare effect and improves the safety of night driving by adjusting the direction and intensity of the headlight beam. However, traditional anti-glare systems (such as the existing ADB technology (Adaptive Driving Beam)) have the problem of insufficient dynamic response speed when dealing with high-speed moving targets, which makes the beam adjustment unable to keep up with the rapid movement of the target in time, that is, the beam adjustment lags, resulting in short-term glare and affecting driving safety. For example, after the anti-glare system detects the target, it needs to go through calculations and mechanical adjustments to change the direction and intensity of the beam. This process may involve multiple links. Due to the time delay of each link, the anti-glare system cannot respond immediately, resulting in insufficient dynamic response speed, resulting in a lag in beam adjustment. Summary of the invention

[0003] The purpose of the present application is to provide a hysteresis elimination method, device, equipment and medium for a vehicle anti-glare system, which can solve the problem of beam adjustment lag caused by insufficient dynamic response speed through hysteresis elimination, thereby improving driving safety.

[0004] To achieve the above objectives, this application provides the following solutions.

[0005] In a first aspect, the present application provides a method for eliminating hysteresis of a vehicle anti-glare system, the method comprising:

[0006] Acquire a captured image at the current moment; the captured image is an image obtained by capturing the traffic environment in front of the vehicle;

[0007] Taking the captured image as input, the captured image is detected using a trained object detection model to obtain an object detection result at the current moment; the object detection result includes the position of each object in the captured image and the shielding position corresponding to the object, the shielding position corresponding to the object includes the center point offset of the object and the length, width and height of the shielding object boundary box; the object includes vehicles and pedestrians;

[0008] Based on the target detection result at the current moment and the target detection result at the previous moment, the target at the current moment and the target at the previous moment are matched to determine the matching target at the current moment, and the motion analysis of the matching target at the current moment is performed to determine the speed of the matching target at the current moment; the matching target is a target at the current moment that can match the target at the previous moment, and the matching is based on the constant speed model to predict the lateral movement and longitudinal movement of the target, and then the intersection-over-union calculation method is used to preliminarily determine the matching targets at the current moment and the previous moment, and finally the optimal match is selected to determine the matching targets;

[0009] For each matching target at the current moment, determine whether hysteresis elimination is required based on the shielding position corresponding to the matching target; if so, determine the final shielding position of the matching target based on the position, speed and corresponding shielding position of the matching target; if not, determine the final shielding position of the matching target based on the shielding position corresponding to the matching target;

[0010] Among them, the shielding position corresponding to the matching target object includes an x-axis offset, a y-axis offset and a z-axis offset, and the x-axis offset, the y-axis offset and the z-axis offset are respectively the offsets of the center point of the matching target object at the current moment compared to the center point of the final shielding position of the first target object at the previous moment on the x-axis, y-axis and z-axis, and the first target object is a target object at the previous moment that matches the matching target object at the current moment. Based on the shielding position corresponding to the matching target object, determining whether lag elimination is needed, specifically includes: judging whether the x-axis offset, the y-axis offset and the z-axis offset are all less than a preset threshold; if so, lag elimination is not needed; if not, lag elimination is needed.

[0011] In a second aspect, the present application provides a hysteresis elimination device for a vehicle anti-glare system, the hysteresis elimination device for the vehicle anti-glare system comprising:

[0012] An image acquisition module is used to acquire a captured image at the current moment; the captured image is an image obtained by photographing the traffic environment in front of the vehicle;

[0013] An object detection module is used to use the captured image as input, detect the captured image using a trained object detection model, and obtain an object detection result at a current moment; the object detection result includes the position of each object in the captured image and the shielding position corresponding to the object, the shielding position corresponding to the object includes the center point offset of the object and the length, width and height of the shielding object boundary box; the object includes vehicles and pedestrians;

[0014] A motion analysis module is used to match the target at the current moment with the target at the previous moment based on the target detection result at the current moment and the target detection result at the previous moment, determine the matching target at the current moment, and perform motion analysis on the matching target at the current moment to determine the speed of the matching target at the current moment; the matching target is a target at the current moment that can match the target at the previous moment, and the matching is based on the constant speed model to predict the lateral movement and longitudinal movement of the target, and then use the intersection-to-union ratio calculation method to preliminarily determine the matching target at the current moment and the previous moment, and finally determine it by selecting the best match;

[0015] A hysteresis elimination module is used to determine whether hysteresis elimination is required for each matching target at the current moment based on the shielding position corresponding to the matching target; if so, determine the final shielding position of the matching target based on the position, speed and corresponding shielding position of the matching target; if not, determine the final shielding position of the matching target based on the shielding position corresponding to the matching target;

[0016] Among them, the shielding position corresponding to the matching target object includes an x-axis offset, a y-axis offset and a z-axis offset, and the x-axis offset, the y-axis offset and the z-axis offset are respectively the offsets of the center point of the matching target object at the current moment compared to the center point of the final shielding position of the first target object at the previous moment on the x-axis, y-axis and z-axis, and the first target object is a target object at the previous moment that matches the matching target object at the current moment. Based on the shielding position corresponding to the matching target object, determining whether lag elimination is needed, specifically includes: judging whether the x-axis offset, the y-axis offset and the z-axis offset are all less than a preset threshold; if so, lag elimination is not needed; if not, lag elimination is needed.

[0017] In a third aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned lag elimination method of the vehicle anti-glare system.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for eliminating lag of a vehicle anti-glare system.

[0019] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0020] The present application provides a lag elimination method, device, equipment and medium for a vehicle anti-glare system, which uses a trained target detection model to detect the captured image at the current moment to obtain the target detection result at the current moment, and further combines the target detection result at the previous moment to match the target at the current moment with the target at the previous moment to determine the matching target at the current moment, and performs motion analysis on the matching target at the current moment to determine the speed of the matching target at the current moment. When lag elimination is required, the final shielding position of the matching target is determined based on the position, speed and corresponding shielding position of the matching target. The present application combines target detection, target tracking and target motion analysis to determine a reasonable shielding position, and can solve the problem of beam adjustment lag caused by insufficient dynamic response speed through lag elimination, no longer causing glare to the target, and improve driving safety. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 This is an application environment diagram of a hysteresis elimination method for a vehicle anti-glare system provided in Example 1 of the present application.

[0023] Figure 2 A schematic flow chart of a method for eliminating hysteresis in a vehicle anti-glare system provided in Example 1 of the present application.

[0024] Figure 3 A detailed flow chart of a method for eliminating lag in a vehicle anti-glare system provided in Example 1 of the present application.

[0025] Figure 4 A schematic diagram of the structure of the image enhancement network provided in Example 1 of the present application.

[0026] Figure 5 This is a schematic diagram of the structure of the detection head of the improved YOLOV5 model provided in Example 1 of the present application.

[0027] Figure 6 A schematic diagram of the functional modules of a hysteresis elimination device of a vehicle anti-glare system provided in Example 2 of the present application.

[0028] Figure 7 A schematic diagram of the structure of a computer device provided in Example 3 of the present application. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0030] Example 1.

[0031] The hysteresis elimination method of the vehicle anti-glare system provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be set up separately, integrated on the server, or placed on the cloud or other servers. The terminal can send the captured image to be processed to the server. After the server receives the captured image to be processed, for the captured image to be processed, the server uses the captured image as input, and uses the trained target detection model to detect the captured image to obtain the target detection result at the current moment; based on the target detection result at the current moment and the target detection result at the previous moment, the target at the current moment and the target at the previous moment are matched to determine the matching target at the current moment, and the matching target at the current moment is analyzed for motion to determine the speed of the matching target at the current moment; for each matching target at the current moment, whether hysteresis elimination is required based on the corresponding shielding position of the matching target; if so, the final shielding position of the matching target is determined based on the position, speed and corresponding shielding position of the matching target; if not, the final shielding position of the matching target is determined based on the corresponding shielding position of the matching target. The server can feedback the final shielding position of each matching target at the current moment to the terminal.

[0032] In addition, in some embodiments, the lag elimination method of the vehicle anti-glare system can also be implemented independently by a server or a terminal. For example, the terminal can directly process the captured images to be processed, or the server can obtain the captured images to be processed from the data storage system and process the captured images to be processed.

[0033] The terminal may be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The server may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.

[0034] like Figure 2 and Figure 3As shown, a method for eliminating hysteresis of a vehicle anti-glare system is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The following steps are used to illustrate the server in the example.

[0035] Step S1, obtaining a captured image at the current moment; the captured image is an image obtained by capturing the traffic environment in front of the vehicle.

[0036] Step S2, taking the captured image as input, using the trained target detection model to detect the captured image, and obtaining the target detection result at the current moment; the target detection result includes the position of each target in the captured image and the corresponding shielding position of the target, the corresponding shielding position of the target includes the center point offset of the target and the length, width and height of the shielding boundary box; the target includes vehicles and pedestrians.

[0037] Step S3, based on the target detection result at the current moment and the target detection result at the previous moment, the target at the current moment and the target at the previous moment are matched to determine the matching target at the current moment, and the motion analysis of the matching target at the current moment is performed to determine the speed of the matching target at the current moment; the matching target is a target at the current moment that can be matched with the target at the previous moment, and the matching is based on the constant speed model to predict the lateral movement and longitudinal movement of the target, and then the intersection-over-union calculation method is used to preliminarily determine the matching targets at the current moment and the previous moment, and finally it is determined by selecting the optimal match.

[0038] Step S4, for each matching target at the current moment, determine whether lag elimination is needed based on the shielding position corresponding to the matching target; if so, determine the final shielding position of the matching target based on the position, speed and corresponding shielding position of the matching target; if not, determine the final shielding position of the matching target based on the shielding position corresponding to the matching target.

[0039] By implementing the above-mentioned steps S1 to S4, this embodiment provides a lag elimination method for a vehicle anti-glare system based on target object motion analysis. By continuously tracking the target object and further continuously analyzing the target object's motion state, a more reasonable shielding position is provided for the anti-glare system. The lag elimination can solve the problem of insufficient dynamic response speed, avoid glare to the target object, and improve driving safety.

[0040] In S1, the traffic environment in front of the vehicle is collected by a forward-looking camera installed on the vehicle to obtain a captured video, and the captured image at the current moment is subsequently obtained through the captured video; or, a high-performance image sensor is used to collect the traffic environment in front of the vehicle to obtain image data, which is the captured image at the current moment. The image sensor should have low-light performance to ensure that clear images can be captured at night or in poor lighting conditions.

[0041] When acquiring the current image by shooting a video, the collected video is framed at fixed intervals to improve the processing speed and meet the real-time requirements. The specific formula for fixed interval frame extraction is as follows:

[0042] (1)

[0043] In formula (1), The first Take an image, Indicates the index of fixed interval frame extraction, =0, 1, 2...; round means rounding operation; The frame rate of the video. The interval for extracting frames at fixed intervals.

[0044] By controlling the interval of fixed-interval frame extraction, the frame rate of the captured image obtained by frame extraction is adjusted to 8 Hz to adapt to the sampling frequency of the front-view camera. Of course, 8 Hz can also be replaced by other values, and the optimal value is about 10 Hz to meet the real-time requirements.

[0045] The occlusion lag detection of the anti-glare system needs to have strong dynamic response capabilities, while the traditional Retinex-based image enhancement algorithm runs slowly. In view of this, this embodiment proposes a Retinex night fast image enhancement algorithm based on high-speed downsampling illumination extraction and low-speed high-resolution detail supplementation, that is, an image enhancement network for image enhancement under poor lighting conditions is designed to process low-light video streams in real time, thereby achieving rapid enhancement of low-light video streams. The captured image is taken as input, and the captured image is detected using a trained target detection model to obtain the target detection result at the current moment, specifically including: using an image enhancement network to enhance the captured image to obtain an enhanced image, using the enhanced image as input, and using a trained target detection model to detect the enhanced image to obtain the target detection result at the current moment.

[0046] Among them, Figure 4 As shown, the image enhancement network includes the following modules.

[0047] The downsampling module is used to downsample the captured image to obtain a first downsampling feature map and a second downsampling feature map, wherein the downsampling multiple corresponding to the first downsampling feature map is smaller than the downsampling multiple corresponding to the second downsampling feature map.

[0048] The local feature extraction module is used to extract features from the first down-sampled feature map to obtain local features.

[0049] The global feature extraction module is used to extract features from the second down-sampled feature map to obtain global features.

[0050] The feature fusion module is used to fuse local features and global features to obtain fused features.

[0051] The enhancement module is used to calculate the product of the inverse of the fused feature and the captured image to obtain the enhanced image.

[0052] The following is a detailed introduction to the specific structure and function of each module.

[0053] (1) Downsampling module.

[0054] The downsampling module includes a pooling module and multiple convolutional layers connected in sequence. The pooling module includes a maximum pooling layer, an average pooling layer and a splicing layer. The maximum pooling layer and the average pooling layer are connected in parallel. The input end of the maximum pooling layer and the input end of the average pooling layer are the input end of the downsampling module, which are used to receive the captured image. The output end of the maximum pooling layer and the output end of the average pooling layer are connected to the input end of the splicing layer. The splicing layer is used to perform channel addition on the output of the maximum pooling layer and the output of the average pooling layer, and input them into the first convolutional layer among the multiple convolutional layers. The ath convolutional layer among the multiple convolutional layers is used to output the first downsampling feature map, and the bth convolutional layer is used to output the second downsampling feature map. Both a and b are positive integers, and a is less than b. Figure 4 As shown, the downsampling module of this embodiment is designed with a total of 4 convolutional layers, the second convolutional layer is used to output the first downsampling feature map, that is, to obtain high-resolution feature information, and the fourth convolutional layer is used to output the second downsampling feature map, that is, to obtain low-resolution feature information.

[0055] This embodiment uses a downsampling module to input the captured image Downsampling is performed to reduce the amount of calculation. The downsampling process is divided into two resolutions, 8x downsampling and 32x downsampling, which are used to save the image details and the image global information respectively, to obtain the first downsampling feature map and the second downsampling feature map. The specific formula is as follows:

[0056] (2)

[0057] (3)

[0058] In the above formula, It is the first down-sampled feature map obtained after 8 times down-sampling; It is 8 times downsampled; To capture images; It is the second down-sampled feature map obtained after 32 times down-sampling; The sampling is 32 times.

[0059] The downsampling module extracts features through dynamic convolution. Taking the parameters of the captured image as h, w, 3, (640, 640) as an example, h is the height of the captured image, w is the width of the captured image, 3 is the number of channels of the captured image, and (640, 640) is the number of pixels in the height and width of the captured image respectively. The output of each network layer in the downsampling module is shown in Table 1 below.

[0060] Table 1 Output of each network layer in the downsampling module

[0061]

[0062] In Table 1, AvgPool represents the average pooling layer, MaxPool represents the maximum pooling layer, AvgPool+MaxPool represents the concatenation layer, Conv1 represents the first convolutional layer in multiple convolutional layers, Conv2 represents the second convolutional layer in multiple convolutional layers, Conv3 represents the third convolutional layer in multiple convolutional layers, and Conv4 represents the fourth convolutional layer in multiple convolutional layers.

[0063] In this embodiment, the output of Conv2 is selected as the first down-sampled feature map , select the output of Conv4 as the second down-sampled feature map .

[0064] (2) Local feature extraction module.

[0065] The local feature extraction module includes a convolutional layer, a mask layer, an attention mechanism layer and a convolutional neural network layer connected in sequence. The input end of the convolutional layer is connected to the first output end of the downsampling module. The input end of the attention mechanism layer is also connected to the first output end of the downsampling module. The first output end of the downsampling module is the output end of the ath convolutional layer among the multiple convolutional layers.

[0066] This embodiment performs feature extraction on the first down-sampled feature map and outputs local feature information. The specific formula is as follows:

[0067] (4)

[0068] In formula (4), It is a local feature; It is a local feature extraction module; is the first down-sampled feature map.

[0069] In the local feature extraction module, the image enhancement network pays more attention to the brightness information of local features, which is used to balance the local brightness and avoid overexposure. Specifically, CNN (Convolutional Neural Network) is combined with transformer to extract image information of local similar brightness. CNN uses convolutional layers to extract low-dimensional features again, and uses transformers with masks to enable the image enhancement network to pay more attention to local information. The specific process is as follows.

[0070] (2.1) Convolutional layer.

[0071] (5)

[0072] In formula (5), The mask matrix is ​​h / 8, w / 8. It is the convolution layer in the local feature extraction module.

[0073] (2.2) Mask layer.

[0074] Using the step activation function, the mask matrix is ​​rounded down to an integer multiple of 0.125 to obtain 8 values: 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, and 0.875. For each value, use Generate a binary mask matrix, specifically The elements that are equal to the value are set to 1, and the elements that are not equal to the value are set to 0, so that Generate 8 binary mask matrices so that each binary mask matrix only focuses on the feature blocks with the same value as itself.

[0075] (2.3) Attention mechanism layer and convolutional neural network layer.

[0076] The 8 binary mask matrices are respectively combined with the first down-sampled feature map Multiply them to obtain the local feature information map, and then use the attention mechanism to obtain the local brightness features of h / 8, w / 8, 256. The calculation mechanism of the attention mechanism is the product, and then the 8 local brightness features are spliced. The obtained 8 32-channel local brightness features are combined, and finally the convolutional neural network layer is used to reduce the channel dimension, and the number of channels is adjusted to 32 to obtain the local features. The specific formula is as follows:

[0077] (6)

[0078] In formula (6), It is a local feature; is the convolutional neural network layer; For splicing; For the A binary mask matrix.

[0079] (3) Global feature extraction module.

[0080] The global feature extraction module includes a first branch, a second branch, a third branch and a multiplication layer. The input ends of the first branch, the second branch and the third branch are all connected to the second output end of the downsampling module. The second output end of the downsampling module is the output end of the bth convolution layer in the multiple convolution layers. The output ends of the first branch, the second branch and the third branch are all connected to the input end of the multiplication layer. The first branch includes a deformable convolution layer, the second branch includes multiple convolution layers connected in sequence, and the third branch includes multiple convolution layers and a maximum pooling layer connected in sequence. Figure 4 As shown, the second branch may include two convolutional layers, and the third branch may include two convolutional layers.

[0081] This embodiment extracts features from the captured image and outputs global feature information. The specific formula is as follows:

[0082] (7)

[0083] In formula (7), It is a global feature; It is the global feature extraction module; is the second down-sampled feature map.

[0084] This embodiment processes the second down-sampled feature map through the spatiotemporal attention mechanism, and the specific process is as follows.

[0085] For spatial features, use 3 3 convolution kernel for feature extraction, and perform two dimensionality reduction on the second downsampled feature map, from h / 32, w / 32, 256 to h / 32, w / 32, 64, and then to h / 32, w / 32, 1, to obtain the spatial attention map. The specific formula of the spatial attention mechanism is as follows:

[0086] (8)

[0087] In formula (8), It is a tensor of h / 32, w / 32, 256, which is also the spatial attention map; For 3 3 The convolution layer with a convolution kernel of 1, that is, the second convolution layer in the second branch; For 3 3 The convolution layer with a convolution kernel of 64 is the first convolution layer in the second branch. Formula (8) is the processing formula of the second branch.

[0088] For channel features, two convolutional layers plus a maximum pooling layer are used to obtain the channel attention map. The specific formula of the channel attention mechanism is as follows:

[0089] (9)

[0090] In formula (9), is 1 1 256 feature vector, also known as channel attention map; is the maximum pooling layer in the third branch; For 5 1 The convolution layer with a convolution kernel of 256, that is, the second convolution layer in the third branch; For having 1 5 The convolution layer with a convolution kernel of 256 is the first convolution layer in the third branch. Formula (9) is the processing formula of the third branch.

[0091] Multiply the channel attention map and the spatial attention map to obtain the global attention map, and multiply it with the feature output by processing the second downsampled feature map using the first branch to obtain the final global feature map .

[0092] The specific formula of the global attention mechanism is as follows:

[0093] (10)

[0094] In formula (10), is the global attention map.

[0095] The specific formula of the global feature is as follows:

[0096] (11)

[0097] In formula (11), is the deformable convolution layer in the first branch. Equations (10) and (11) are the processing formulas of the multiplication layer.

[0098] (4) Feature fusion module.

[0099] The feature fusion module includes a fourth branch, a fifth branch, a first addition layer and a sixth branch. The input ends of the fourth branch and the fifth branch are connected to the output end of the local feature extraction module. The output end of the local feature extraction module is the output end of the convolutional neural network layer. The output ends of the fourth branch and the fifth branch are connected to the input end of the first addition layer. The output end of the first addition layer is connected to the input end of the sixth branch. The fourth branch includes a plurality of downsampling layers, a second addition layer, a convolution layer and a plurality of upsampling layers connected in sequence, such as Figure 4 As shown, the fourth branch may include two downsampling layers and two upsampling layers, the input end of the second addition layer is also connected to the output end of the global feature extraction module, and the output end of the global feature extraction module is the output end of the multiplication layer. The fifth branch includes a convolution layer. The sixth branch includes a plurality of upsampling layers connected in sequence and a convolution layer, as shown in FIG. Figure 4 As shown, the sixth branch may include three upsampling layers.

[0100] Local and global features are combined and passed through a convolutional layer to predict a low-resolution illumination map. , the specific formula is as follows:

[0101] (12)

[0102] In formula (12), is the convolutional layer in the fourth branch; is the second addition layer in the fourth branch; are downsampling blocks, i.e., the two downsampling layers in the fourth branch.

[0103] Obtain full-resolution illumination map in the form of a feature pyramid , the specific formula is as follows:

[0104] (13)

[0105] In formula (13), It is the convolutional layer in the sixth branch, used for illumination compensation; and is the upsampling block, are the three upsampling layers in the sixth branch, are the two upsampling layers in the fourth branch; is the adaptive parameter; is the convolutional layer in the fifth branch.

[0106] (5) Enhancement module.

[0107] Through pixel-level multiplication, the input captured image With full resolution lightmap The inverse multiplication of generates the enhanced image , the specific formula is as follows:

[0108] (14)

[0109] In formula (14), The enhanced image.

[0110] In S2, object detection is a key task in computer vision, which aims to identify and locate target objects of a specific category in an image. Object detection not only identifies the target object, but also determines its position in the image (usually represented by a bounding box). In this embodiment, the anti-glare targets include pedestrians and other vehicles. When performing object detection, the YOLOV5 model is used, and the detection head of the YOLOV5 model is modified to adapt to multi-task processing of object detection. The detection head is modified to a Decoupled Head (multi-coupled head) structure, focusing on classification information, 3D target bounding box information, 3D occluder bounding box information and IOU confidence information respectively, thereby avoiding the problem of unstable target occlusion effect caused by repeated matching and missed matching due to the separate detection of 3D target bounding box information and 3D occluder bounding box information. The detection head includes a conventional 3D target detection head, and outputs the position information of the target to be occluded and the occlusion position information corresponding to the target to be occluded. The input of the detection head is the output (H / X, W / X, 256) of the YOLOV5 model after FPN (Feature Pyramid Networks) processing and CNN channel dimension adjustment, and the above four information are obtained through convolutional layers respectively.

[0111] like Figure 5 As shown, the trained object detection model adopts the improved YOLOV5 model, and the improved YOLOV5 model is a model obtained by improving the detection head of the YOLOV5 model. The detection head of the improved YOLOV5 model includes a first convolutional layer, a second convolutional layer, a third convolutional layer and a fourth convolutional layer, which are connected in parallel. The first convolutional layer is used to output the category of the object, the second convolutional layer is used to output the object bounding box information, and the object bounding box information includes the position of the object, the third convolutional layer is used to output the occluder bounding box information, and the occluder bounding box information includes the occlusion position corresponding to the object, and the fourth convolutional layer is used to output the confidence of the object bounding box information and the confidence of the occluder bounding box information.

[0112] The specific formula for the processing of the first convolutional layer is as follows:

[0113] (15)

[0114] In formula (15), is the category of the target object; is the convolutional layer; It is the feature map output after FPN processing and CNN channel dimension adjustment.

[0115] The specific formula for the processing of the second convolutional layer is as follows:

[0116] (16)

[0117] In formula (16), is the 3D target bounding box information, including the location of the target, specifically including the center point coordinates of the target ( , , ), the length, width and height of the target object’s bounding box ( , , ) and the heading angle, is the x-coordinate of the center point of the target, is the y coordinate of the center point of the target, is the z coordinate of the center point of the target, is the length of the target object’s bounding box, is the width of the target bounding box, is the height of the object’s bounding box.

[0118] The specific formula for the processing of the third convolutional layer is as follows:

[0119] (17)

[0120] In formula (17), is the 3D occluder bounding box information, including the occluded position corresponding to the target object, that is, the position information of the target object that needs to be occluded, specifically including the center point offset of the target object ( , , ) and the length, width and height of the occluder's bounding box ( , , ), the center point offset includes the x-axis offset , y-axis offset and z-axis offset , the x-axis offset, y-axis offset, and z-axis offset are the x-axis, y-axis, and z-axis offsets of the center point of the target at the current moment compared to the center point of the final shielding position of the specific target at the previous moment, respectively. The specific target is the target at the previous moment that matches the target at the current moment. is the length of the occluder bounding box, is the width of the occluder bounding box, is the height of the occluder's bounding box.

[0121] The specific formula for the processing of the fourth convolutional layer is as follows:

[0122] (18)

[0123] In formula (18), It is the IOU confidence information, including the confidence of the 3D target bounding box information and the confidence of the 3D occluder bounding box information.

[0124] When training the improved YOLOV5 model, Reg Loss, Reg1 Loss, obj_Loss, and cls_Loss of the sample and the true value are calculated and weighted together. The weights of Reg Loss, Reg1 Loss, obj_Loss, and cls_Loss are 2:2:1:1.

[0125] Reg Loss and Reg1 Loss are calculated in the same way. They are used to calculate the distance between the detected target object to be shielded and the true value and the distance between the detected shielding object and the true value. 3D DIoU (DistanceIoU, considering the overlapping area and the IoU of the center point distance) is used for calculation. Taking Reg Loss as an example, the specific calculation formula is as follows:

[0126] (19)

[0127] In formula (19), is the loss value; IoU is the IoU (Intersection over Union) value between the predicted box and the real box of the target object; The center point of the predicted box of the target object and the center point of the ground truth box The Euclidean distance between The length of the diagonal of the minimum bounding box containing the predicted box and the real box of the target object; is a weight coefficient used to adjust the effect of rotation angle on DIoU; and are the rotation angles of the predicted box and the real box of the target object respectively.

[0128] IoU refers to the intersection-over-union ratio between the predicted box and the true box, which is calculated as the ratio of the intersection area of ​​the two boxes to the union area. It indicates the degree of overlap between the two boxes, and the value range is 0 to 1, where 1 represents complete overlap.

[0129] (20)

[0130] In formula (20), A is the real box and B is the predicted box.

[0131] (twenty one)

[0132] In formula (21), ( , , ) are the x-coordinate, y-coordinate and z-coordinate of the center point of the prediction box respectively; ( , , ) are the x-coordinate, y-coordinate and z-coordinate of the center point of the real frame respectively.

[0133] (twenty two)

[0134] In formula (22), , , , , , They are the maximum x-coordinate, minimum x-coordinate, maximum y-coordinate, minimum y-coordinate, maximum z-coordinate and minimum z-coordinate of the boundary points in the predicted box and the real box, respectively.

[0135] obj_loss and cls_Loss are the same as those in the YoloV5 model, so they are not repeated here.

[0136] After obtaining the trained object detection model, the captured image is taken as input and detected by the trained object detection model to obtain the object detection result at the current moment. The object detection result includes the position of each object in the captured image and the corresponding occlusion position of the object. The corresponding occlusion position of the object includes the center point offset of the object and the length, width and height of the occlusion boundary box.

[0137] This embodiment first performs image enhancement, and then detects the target in the enhanced image through the improved YOLOV5 model, so as to realize the recognition of the target that needs to be shielded at night and the shield that needs to be adjusted, thereby improving the recognition accuracy at night and the recognition speed. The improved YOLOV5 model can be deployed on an industrial computer.

[0138] This embodiment tracks the target based on a constant velocity (CV) model. Target tracking is an important task in computer vision and image processing, and aims to continuously track the target detected by a camera or other sensors through a specific tracking algorithm. In S3, based on the target detection result at the current moment and the target detection result at the previous moment, the target at the current moment and the target at the previous moment are matched to determine the matching target at the current moment. The matching target is a target at the current moment that can match the target at the previous moment. The matching is based on the constant velocity model to predict the lateral movement and longitudinal movement of the target, and then the intersection-over-union calculation method is used to preliminarily determine the matching targets at the current moment and the previous moment, and finally the optimal match is selected to determine the matching target, which specifically includes the following contents.

[0139] The motion information of the target object can be predicted by tracking and transforming its coordinates. The specific process is as follows.

[0140] Lateral Movement:

[0141] (twenty three)

[0142] (twenty four)

[0143] In the above formula, For the prediction The x-coordinate of the center point of the target object at the moment; for The x-coordinate of the center point of the target object at the moment; for The x-axis component of the target object’s velocity at time ; is the detection cycle; For the prediction The x-axis component of the target object's velocity at time .

[0144] Longitudinal Movement:

[0145] (25)

[0146] (26)

[0147] In the above formula, For the prediction The y coordinate of the center point of the target object at the moment; for The y coordinate of the center point of the target object at the moment; for The y-axis component of the target object’s velocity at time ; For the prediction The y-axis component of the target object's velocity at that moment.

[0148] This embodiment uses the intersection-over-union ratio calculation method to track the target object. The specific formula is as follows:

[0149] (27)

[0150] (28)

[0151] In the above formula, for The first detected The x coordinate of the center point of the target object; for The first detected The x coordinate of the center point of the target object; is the maximum allowable error width; for The first detected The y coordinate of the center point of the target object; for The first detected The y coordinate of the center point of the target object; is the maximum allowable error length.

[0152] After screening through the above formula (27) and formula (28), the matching targets at the current moment and the previous moment are preliminarily determined. Then, for the problem of multi-target matching, the calculation is performed by setting the optimal matching method. The specific formula is as follows:

[0153] (29)

[0154] In formula (29), is the matching difference; is the proportionality coefficient, ; for The x-coordinate of the center point of the target object predicted at each moment and the matched The difference in the x-coordinate of the center point of the target object at the moment; for The y coordinate of the center point of the target object predicted at the moment and the matched The difference in the y coordinates of the center point of the target object at the moment; for The x-axis component of the target object's velocity predicted at each moment and the matching The difference in the x-axis component of the target object’s velocity at time ; for The y-axis component of the target object's velocity predicted at each moment and the matching The difference in the y-axis component of the target object's velocity at time .

[0155] Based on formula (29), let formula (29) The minimum value can determine the matching target.

[0156] Target object motion information analysis is an important field in computer vision and autonomous driving, which mainly involves extracting and analyzing the motion characteristics of the tracked target in a specific coordinate system. This embodiment combines the vehicle speed and steering wheel angle obtained on the vehicle bus to determine the speed of the target at the current moment. Specifically, the motion of the target is decoupled into the speed perpendicular to the lane line and the speed parallel to the lane line to provide more accurate target object motion information. In S3, the motion analysis of the matching target at the current moment is performed to determine the speed of the matching target at the current moment, which specifically includes the following steps.

[0157] (1) Based on the vehicle's steering wheel angle, vehicle speed, and detection period, determine the translation matrix and rotation matrix corresponding to the transformation from the vehicle coordinate system at the previous moment to the vehicle coordinate system at the current moment.

[0158] Translation Matrix for:

[0159] = (30)

[0160] In formula (30), is the longitudinal displacement; is the lateral displacement.

[0161] Rotation Matrix for:

[0162] = (31)

[0163] In formula (31), is the yaw angle.

[0164] The specific formulas for lateral displacement, longitudinal displacement and yaw angle are as follows:

[0165] (32)

[0166] In formula (32), is the steering wheel angle; is the detection cycle; For vehicle speed.

[0167] (2) Based on the translation matrix and the rotation matrix, the position of the first target object at the previous moment is transformed to obtain the transformed position of the first target object at the previous moment in the vehicle coordinate system at the current moment. The first target object is the target object at the previous moment that matches the matching target object at the current moment.

[0168] (33)

[0169] In formula (33), For the previous moment The first target object at the current moment The y coordinate of the center point of the transformed position in the vehicle coordinate system; For the previous moment The first target object at the current moment The x coordinate of the center point of the transformed position in the vehicle coordinate system; For the previous moment The y coordinate of the center point of the first target object; For the previous moment The x coordinate of the center point of the first target object.

[0170] (3) Based on the position of the matching target object at the current moment and the transformed position of the first target object at the previous moment, the speed of the matching target object at the current moment is calculated.

[0171] The lateral and longitudinal speeds of the vehicle can be calculated based on the position relationship between the current and previous moments of the target object in the unified space-time coordinate system. The specific formula is as follows:

[0172] (34)

[0173] (35)

[0174] In the above formula, is the lateral velocity, i.e., the x-axis component of the velocity of the matching target; For the current moment The x coordinate of the center point of the matching target object; is the longitudinal velocity, i.e., the y-axis component of the velocity of the matching target; For the current moment The y coordinate of the center point of the matching target object.

[0175] In order to solve the hysteresis problem, a hysteresis elimination algorithm is used. The specific process is as follows: compare the position that should be shielded at the current moment with the position that has been shielded at the current moment, and calculate the position error. If the position error is within the allowable range, it proves that the target object has good hysteresis elimination and no compensation is required. If it is not within the allowable range, it proves that the target object is lagging or ahead, and the target object needs to be compensated. Specifically, the current position error and the target object speed are combined with the headlight control cycle to output the final shielding position of the target object. In S4, the shielding position corresponding to the matching target object includes the x-axis offset and the y-axis offset. The x-axis offset, y-axis offset and z-axis offset are respectively the x-axis, y-axis and z-axis offsets of the center point of the matching target at the current moment compared to the center point of the final shielding position of the first target at the previous moment, the first target is the target at the previous moment that matches the matching target at the current moment, and whether lag elimination is needed is determined based on the shielding position corresponding to the matching target, specifically including: judging whether the x-axis offset, y-axis offset and z-axis offset are all less than a preset threshold; if so, lag elimination is not needed; if not, lag elimination is needed.

[0176] In S4, if yes, then the final shielding position of the matching target is determined based on the position, speed and corresponding shielding position of the matching target. The position of the matching target includes the x-coordinate, y-coordinate and z-coordinate of the center point of the matching target, and the shielding position corresponding to the matching target includes the x-axis offset, y-axis offset and z-axis offset, and the x-axis offset, y-axis offset and z-axis offset are respectively the x-axis, y-axis and z-axis offsets of the center point of the matching target at the current moment compared to the center point of the final shielding position of the first target at the previous moment, and the first target is the target that matches the matching target at the current moment in the previous moment, then the final shielding position of the matching target is determined based on the position, speed and corresponding shielding position of the matching target, specifically including: using the position, speed and corresponding shielding position of the matching target, and using the shielding position calculation formula to determine the final shielding position of the matching target.

[0177] The calculation formula for the shielding position is:

[0178] (36)

[0179] (37)

[0180] (38)

[0181] In the above formula, The x coordinate of the center point of the final occluded position of the matching target; is the x-axis component of the velocity that matches the target object; It is the average time required for the actuator to run, which needs to be calibrated in advance; is the overall lag time; The y coordinate of the center point of the final occluded position of the matching target; The y-axis component of the velocity that matches the target object; The z coordinate of the center point of the final occluded position of the matching target; is the z coordinate of the center point of the matching target; The z-axis offset of the occlusion position corresponding to the matching target.

[0182] (39)

[0183] In formula (39), is the lag time in the x-axis direction; is the lag time in the y-axis direction.

[0184] (40)

[0185] In formula (40), The x coordinate of the center point of the matching target; The x-axis offset of the occlusion position corresponding to the matching target.

[0186] (41)

[0187] in, The y coordinate of the center point of the matching target; The y-axis offset of the occlusion position corresponding to the matching target.

[0188] After using the above formula to determine the x-coordinate, y-coordinate, and z-coordinate of the center point of the final shielding position of the matching target object, the final shielding position can be determined by combining the length, width, and height of the predicted shielding object bounding box.

[0189] In S4, if not, the final shielding position of the matching target is determined based on the shielding position corresponding to the matching target. The x-coordinate, y-coordinate and z-coordinate of the center point of the final shielding position of the matching target are obtained by directly adding the offset of the shielding position corresponding to the matching target to the center point of the final shielding position of the first target at the previous moment, and further combining the length, width and height of the predicted shielding object boundary box to determine the final shielding position.

[0190] In traditional ADB technology, ADB technology is a kind of automotive lighting technology that can automatically adjust the intensity and direction of the vehicle headlights according to traffic conditions and surrounding environment to ensure the optimization of lighting effects and avoid dazzling other vehicles. Its essence is to control the opening and closing of the pixel light source of the headlights according to the detected target information, realize partial shielding and anti-glare function of the front illumination area, and then achieve the purpose of preventing the anti-glare target from being directly illuminated by high beam or strong light. This anti-glare method usually has a lag because the beam adjustment cannot keep up with the rapid movement of the target in time. In view of this, this embodiment proposes a target lag detection model based on YOLOV5, by detecting the lag between the shielded part and the actual shielded part, and further adjusting the position of the actual shielded part through the target motion information, so as to eliminate the lag, avoid glare, improve driving safety, and enable the driver to drive more attentively and safely, improve driving efficiency, and improve driving safety and experience. It can be applied to the field of vehicle intelligent driving and used for different types of vehicles to play an intelligent driving assistance role.

[0191] The anti-glare system hysteresis elimination method is applicable to various types of vehicles, including but not limited to private cars, commercial vehicles and self-driving vehicles, and can be flexibly applied to various road environments such as urban roads, highways and rural roads. This embodiment takes the application of the method on a certain family SUV (Sport Utility Vehicle) as an example, and the specific implementation is as follows.

[0192] (1) The camera is installed at the front of the car to ensure that it has sufficient field of view in the direction of the car's travel. The camera can also obtain image information from the front camera of the car by reading the vehicle's Ethernet signal, so that high-quality images of the surrounding environment can be collected in real time at night, in tunnels, or in poor lighting conditions.

[0193] (2) For the acquired images with low brightness, the image enhancement technology is used to process the low-light images in real time. The processing process is as follows: the video stream is interpolated to obtain a video stream with a lower frame rate. Then, the image is transformed into a 640×640 low-light image through an interpolation algorithm for image enhancement. The transformed low-light image is placed in the memory corresponding to the model storage location for inference to obtain a full-resolution illumination map. The enhanced image is generated by multiplying the low-light image with the inverse of the full-resolution illumination map. Specifically, the image is reduced in dimension by 8 times and 32 times respectively to preserve the image details and global information. Then, the CNN encoding network is used to extract features from the downsampled images to separate local feature information and global feature information. The local features and global features are combined and used to predict the low-resolution illumination map through the convolution layer. Then, the full-resolution illumination map is obtained in the form of a feature pyramid. The input low-light image is multiplied with the inverse of the full-resolution illumination map through pixel-level multiplication to generate the enhanced image.

[0194] (3) In the target detection stage, the improved YOLOV5 model is used. YOLOV5 has high detection accuracy and real-time performance, and is suitable for real-time target detection applications. The model detects other vehicles and pedestrians in the video stream after illumination processing in real time, obtains their location information, occlusion location information, category, and detection confidence, and then performs anti-glare projection adjustment.

[0195] (4) Use the vehicle speed and steering wheel angle obtained from the vehicle bus to obtain the transformation relationship between the current position and the previous position. Based on the constant speed model, the position of the target object in the vehicle coordinate system at the previous moment is converted to the vehicle coordinate system at the current moment through the obtained space-time transformation matrix, and then the position of the target object is tracked by threshold matching and optimal matching. For unmatched targets, a new ID is assigned if it is a new target, and the ID of the matched target is inherited so that it has a unique ID within the cycle. The ID is stored in longlong format to avoid memory overflow.

[0196] (5) In the lag elimination stage, the position of the target object that should be shielded and the position of the target object that has been shielded at the current moment are matched, and the position that should be shielded at the current moment is compared with the position that has been shielded at the current moment to calculate the position error. If the position error is within the allowable range, it proves that the target object has good lag elimination and no compensation is required. If the position error is not within the allowable range, it proves that lag or advance occurs and the target object needs to be compensated. Combine the current position error and the target object speed with the headlight control cycle to calculate the final shielding position of the target object, and give the calculated final shielding position of the target object to the lighting control module to adjust the headlights.

[0197] This embodiment draws on the concept of adaptive high beam technology, but considering that ADB technology often encounters the problem of insufficient dynamic response speed when dealing with high-speed moving targets, to solve this problem, this embodiment adopts an advanced anti-glare system shielding lag elimination algorithm to eliminate the lag of the vehicle anti-glare system. The algorithm can timely detect the lag of the current shielding, and combine the motion information of the target object to predict the possible future position of the target object, aiming to prevent pedestrians or other drivers from being affected by the glare caused by lag. Compared with traditional adaptive high beam technology, the shielding lag detection and elimination algorithm of this embodiment has significant technical advantages. It can effectively prevent the light of the high beam from directly hitting the retina of pedestrians or other drivers, reduce the glare, improve the driving safety of drivers, and provide an innovative solution for the intelligent development of road traffic systems.

[0198] The anti-glare system lag elimination algorithm based on target motion information analysis has a very broad application prospect in the future. It is expected to become an important part of the driver assistance system in the future, and it is expected to improve the reaction speed and accuracy of the perception system, ensure that the vehicle can respond quickly in various complex traffic scenarios, and avoid traffic accidents. With the continuous development of intelligent transportation technology, the system is expected to effectively reduce the driver's reaction delay caused by glare and make positive contributions to improving the safety and efficiency of road traffic. Through technological innovation, this embodiment has significant application prospects in improving road traffic safety, improving the reliability of autonomous driving technology, and improving driving experience.

[0199] The embodiment of the present application also provides an application scenario, which applies the above-mentioned hysteresis elimination method of the vehicle anti-glare system. Specifically, the hysteresis elimination method of the vehicle anti-glare system provided by the present embodiment can be applied in the vehicle light adjustment scenario, which includes a data acquisition link, a data processing link and an adjustment link. The data acquisition link is used to acquire the captured image at the current moment, and the data processing link is used to process the captured image at the current moment to obtain the final shielding position of each matching target object at the current moment. The adjustment link is used to control the direction and intensity of the vehicle light based on the final shielding position of each matching target object at the current moment, so as to achieve the purpose of anti-glare and improve driving safety. The hysteresis elimination method of the vehicle anti-glare system provided by the present embodiment belongs to the data processing link.

[0200] Example 2.

[0201] Based on the same inventive concept, the embodiment of the present application also provides a hysteresis elimination device for a vehicle anti-glare system for implementing the hysteresis elimination method for a vehicle anti-glare system. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the hysteresis elimination device for a vehicle anti-glare system provided below can refer to the limitations of the hysteresis elimination method for a vehicle anti-glare system above, and will not be repeated here.

[0202] like Figure 6 As shown, a hysteresis elimination device for a vehicle anti-glare system is provided, and the hysteresis elimination device for the vehicle anti-glare system includes the following modules.

[0203] The image acquisition module M1 is used to acquire the captured image at the current moment; the captured image is an image obtained by photographing the traffic environment in front of the vehicle.

[0204] The target detection module M2 is used to take the captured image as input, use the trained target detection model to detect the captured image, and obtain the target detection result at the current moment; the target detection result includes the position of each target in the captured image and the corresponding shielding position of the target, the corresponding shielding position of the target includes the center point offset of the target and the length, width and height of the shielding boundary box; the target includes vehicles and pedestrians.

[0205] The motion analysis module M3 is used to match the target at the current moment with the target at the previous moment based on the target detection result at the current moment and the target detection result at the previous moment, determine the matching target at the current moment, and perform motion analysis on the matching target at the current moment to determine the speed of the matching target at the current moment; the matching target is a target at the current moment that can match the target at the previous moment, and the matching is based on predicting the lateral and longitudinal movements of the target object based on a constant velocity model, and then using the intersection-over-union calculation method to preliminarily determine the matching targets at the current moment and the previous moment, and finally determine it by selecting the optimal match.

[0206] The lag elimination module M4 is used to determine whether lag elimination is needed for each matching target at the current moment based on the shielding position corresponding to the matching target; if so, the final shielding position of the matching target is determined based on the position, speed and corresponding shielding position of the matching target; if not, the final shielding position of the matching target is determined based on the shielding position corresponding to the matching target.

[0207] Among them, the shielding position corresponding to the matching target object includes an x-axis offset, a y-axis offset and a z-axis offset, and the x-axis offset, the y-axis offset and the z-axis offset are respectively the offsets of the center point of the matching target object at the current moment compared to the center point of the final shielding position of the first target object at the previous moment on the x-axis, y-axis and z-axis, and the first target object is a target object at the previous moment that matches the matching target object at the current moment. Based on the shielding position corresponding to the matching target object, determining whether lag elimination is needed, specifically includes: judging whether the x-axis offset, the y-axis offset and the z-axis offset are all less than a preset threshold; if so, lag elimination is not needed; if not, lag elimination is needed.

[0208] Example 3.

[0209] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the captured images to be processed. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a lag elimination method for a vehicle anti-glare system is implemented.

[0210] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0211] In an exemplary embodiment, a computer device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the lag elimination method of the vehicle anti-glare system described in Example 1.

[0212] Example 4.

[0213] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for eliminating hysteresis of a vehicle anti-glare system described in Embodiment 1 is implemented.

[0214] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0215] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0216] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for eliminating hysteresis of a vehicle anti-glare system, characterized in that: The hysteresis elimination method of the vehicle anti-glare system comprises: Acquire a captured image at the current moment; the captured image is an image obtained by capturing the traffic environment in front of the vehicle; Taking the captured image as input, the captured image is detected using a trained object detection model to obtain an object detection result at the current moment; the object detection result includes the position of each object in the captured image and the shielding position corresponding to the object, the shielding position corresponding to the object includes the center point offset of the object and the length, width and height of the shielding object boundary box; the object includes vehicles and pedestrians; Based on the target detection result at the current moment and the target detection result at the previous moment, the target at the current moment and the target at the previous moment are matched to determine the matching target at the current moment, and the motion analysis of the matching target at the current moment is performed to determine the speed of the matching target at the current moment; the matching target is a target at the current moment that can match the target at the previous moment, and the matching is based on the constant speed model to predict the lateral movement and longitudinal movement of the target, and then the intersection-over-union calculation method is used to preliminarily determine the matching targets at the current moment and the previous moment, and finally the optimal match is selected to determine the matching targets; For each matching target at the current moment, determine whether hysteresis elimination is required based on the shielding position corresponding to the matching target; if so, determine the final shielding position of the matching target based on the position, speed and corresponding shielding position of the matching target; if not, determine the final shielding position of the matching target based on the shielding position corresponding to the matching target; Among them, the shielding position corresponding to the matching target object includes an x-axis offset, a y-axis offset and a z-axis offset, and the x-axis offset, the y-axis offset and the z-axis offset are respectively the offsets of the center point of the matching target object at the current moment compared to the center point of the final shielding position of the first target object at the previous moment on the x-axis, y-axis and z-axis, and the first target object is a target object at the previous moment that matches the matching target object at the current moment. Based on the shielding position corresponding to the matching target object, determining whether lag elimination is needed, specifically includes: judging whether the x-axis offset, the y-axis offset and the z-axis offset are all less than a preset threshold; if so, lag elimination is not needed; if not, lag elimination is needed.

2. The method for eliminating hysteresis of a vehicle anti-glare system according to claim 1, characterized in that: Taking the captured image as input, the trained object detection model is used to detect the captured image to obtain the object detection result at the current moment, which specifically includes: Performing image enhancement on the captured image using an image enhancement network to obtain an enhanced image; Taking the enhanced image as input, using the trained object detection model to detect the enhanced image, and obtaining the object detection result at the current moment; Wherein, the image enhancement network comprises: A downsampling module, used to downsample the captured image to obtain a first downsampling feature map and a second downsampling feature map; the downsampling multiple corresponding to the first downsampling feature map is smaller than the downsampling multiple corresponding to the second downsampling feature map; A local feature extraction module, used to extract features from the first down-sampled feature map to obtain local features; A global feature extraction module, used for performing feature extraction on the second down-sampled feature map to obtain a global feature; A feature fusion module, used for fusing the local feature with the global feature to obtain a fused feature; The enhancement module is used to calculate the product of the inverse of the fusion feature and the captured image to obtain an enhanced image.

3. The method for eliminating hysteresis of a vehicle anti-glare system according to claim 2, characterized in that: The downsampling module includes a pooling module and multiple convolutional layers connected in sequence; the pooling module includes a maximum pooling layer, an average pooling layer and a splicing layer, the maximum pooling layer and the average pooling layer are connected in parallel, and the output end of the maximum pooling layer and the output end of the average pooling layer are both connected to the input end of the splicing layer; the ath convolutional layer in the multiple convolutional layers is used to output a first downsampling feature map, and the bth convolutional layer is used to output a second downsampling feature map, where a and b are both positive integers, and a is less than b; The local feature extraction module includes a convolution layer, a mask layer, an attention mechanism layer and a convolutional neural network layer connected in sequence, the input end of the attention mechanism layer is also connected to the first output end of the downsampling module, and the first output end of the downsampling module is the output end of the ath convolution layer among the multiple convolution layers; The global feature extraction module includes a first branch, a second branch, a third branch and a multiplication layer, the input ends of the first branch, the second branch and the third branch are all connected to the second output end of the downsampling module, and the output ends of the first branch, the second branch and the third branch are all connected to the input end of the multiplication layer; the first branch includes a deformable convolution layer; the second branch includes a plurality of convolution layers connected in sequence; the third branch includes a plurality of convolution layers and a maximum pooling layer connected in sequence; the second output end of the downsampling module is the output end of the bth convolution layer among the plurality of convolution layers; The feature fusion module includes a fourth branch, a fifth branch, a first addition layer and a sixth branch; the input ends of the fourth branch and the fifth branch are both connected to the output end of the local feature extraction module, the output ends of the fourth branch and the fifth branch are both connected to the input end of the first addition layer, and the output end of the first addition layer is connected to the input end of the sixth branch; the fourth branch includes a plurality of downsampling layers, a second addition layer, a convolutional layer and a plurality of upsampling layers connected in sequence, and the input end of the second addition layer is also connected to the output end of the global feature extraction module; the fifth branch includes a convolutional layer; the sixth branch includes a plurality of upsampling layers and a convolutional layer connected in sequence; the output end of the local feature extraction module is the output end of the convolutional neural network layer; the output end of the global feature extraction module is the output end of the multiplication layer.

4. The method for eliminating hysteresis of a vehicle anti-glare system according to claim 1, characterized in that: The trained target object detection model adopts an improved YOLOV5 model, where the improved YOLOV5 model is a model obtained by improving the detection head of the YOLOV5 model; The detection head of the improved YOLOV5 model includes a first convolutional layer, a second convolutional layer, a third convolutional layer and a fourth convolutional layer, and the first convolutional layer, the second convolutional layer, the third convolutional layer and the fourth convolutional layer are connected in parallel; the first convolutional layer is used to output the category of the target object; the second convolutional layer is used to output the target object bounding box information, and the target object bounding box information includes the position of the target object; the third convolutional layer is used to output the occlusion bounding box information, and the occlusion bounding box information includes the occlusion position corresponding to the target object; the fourth convolutional layer is used to output the confidence of the target object bounding box information and the confidence of the occlusion bounding box information.

5. The method for eliminating hysteresis of a vehicle anti-glare system according to claim 1, characterized in that: Perform motion analysis on the matching target at the current moment to determine the speed of the matching target at the current moment, specifically including: Based on the vehicle's steering wheel angle, vehicle speed and detection period, determine the translation matrix and rotation matrix corresponding to the transformation from the vehicle coordinate system at the previous moment to the vehicle coordinate system at the current moment; Based on the translation matrix and the rotation matrix, the position of the first target object at the previous moment is transformed to obtain the transformed position of the first target object at the previous moment in the vehicle coordinate system at the current moment; the first target object is the target object at the previous moment that matches the matching target object at the current moment; The speed of the matching target object at the current moment is calculated based on the position of the matching target object at the current moment and the transformed position of the first target object at the previous moment.

6. The method for eliminating hysteresis of a vehicle anti-glare system according to claim 1, characterized in that: The position of the matching target object includes the x-coordinate, y-coordinate and z-coordinate of the center point of the matching target object, and based on the position, speed and corresponding shielding position of the matching target object, determining the final shielding position of the matching target object specifically includes: taking the position, speed and corresponding shielding position of the matching target object as input, and using a shielding position calculation formula to determine the final shielding position of the matching target object; The shielding position calculation formula is: ; ; ; in, The x coordinate of the center point of the final occluded position of the matching target; is the x-axis component of the velocity that matches the target object; The average time required for the actuator to run; is the overall lag time; The y coordinate of the center point of the final occluded position of the matching target; The y-axis component of the velocity that matches the target object; The z coordinate of the center point of the final occluded position of the matching target; is the z coordinate of the center point of the matching target; The z-axis offset of the mask position corresponding to the matching target; ; in, is the lag time in the x-axis direction; is the lag time in the y-axis direction; ; in, The x coordinate of the center point of the matching target; The x-axis offset of the mask position corresponding to the matching target; ; in, The y coordinate of the center point of the matching target; The y-axis offset of the occlusion position corresponding to the matching target.

7. A hysteresis elimination device for a vehicle anti-glare system, characterized in that: The hysteresis elimination device of the vehicle anti-glare system comprises: An image acquisition module is used to acquire a captured image at the current moment; the captured image is an image obtained by photographing the traffic environment in front of the vehicle; An object detection module is used to use the captured image as input, detect the captured image using a trained object detection model, and obtain an object detection result at a current moment; the object detection result includes the position of each object in the captured image and the shielding position corresponding to the object, the shielding position corresponding to the object includes the center point offset of the object and the length, width and height of the shielding object boundary box; the object includes vehicles and pedestrians; A motion analysis module is used to match the target at the current moment with the target at the previous moment based on the target detection result at the current moment and the target detection result at the previous moment, determine the matching target at the current moment, and perform motion analysis on the matching target at the current moment to determine the speed of the matching target at the current moment; the matching target is a target at the current moment that can match the target at the previous moment, and the matching is based on the constant speed model to predict the lateral movement and longitudinal movement of the target, and then use the intersection-to-union ratio calculation method to preliminarily determine the matching target at the current moment and the previous moment, and finally determine it by selecting the best match; A hysteresis elimination module is used to determine whether hysteresis elimination is required for each matching target at the current moment based on the shielding position corresponding to the matching target; if so, determine the final shielding position of the matching target based on the position, speed and corresponding shielding position of the matching target; if not, determine the final shielding position of the matching target based on the shielding position corresponding to the matching target; Among them, the shielding position corresponding to the matching target object includes an x-axis offset, a y-axis offset and a z-axis offset, and the x-axis offset, the y-axis offset and the z-axis offset are respectively the offsets of the center point of the matching target object at the current moment compared to the center point of the final shielding position of the first target object at the previous moment on the x-axis, y-axis and z-axis, and the first target object is a target object at the previous moment that matches the matching target object at the current moment. Based on the shielding position corresponding to the matching target object, determining whether lag elimination is needed, specifically includes: judging whether the x-axis offset, the y-axis offset and the z-axis offset are all less than a preset threshold; if so, lag elimination is not needed; if not, lag elimination is needed.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the hysteresis elimination method for a vehicle anti-glare system according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the hysteresis elimination method of the vehicle anti-glare system according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method for reducing glare from light sources through windscreens

    US20120126099A1

  • Device and method for locking and tracking human body target

    WO2014131252A1