Foggy day license plate recognition optimization method

By constructing a real foggy license plate image dataset and an improved target detection model, combined with adaptive defogging filtering and a character recognition engine, the problem of low license plate recognition accuracy in foggy weather was solved, achieving efficient license plate number recognition and improving the accuracy and reliability of foggy recognition.

CN122090431APending Publication Date: 2026-05-26JIANGSU ANSHENG INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU ANSHENG INTELLIGENT TECHNOLOGY CO LTD
Filing Date
2026-03-04
Publication Date
2026-05-26

Smart Images

  • Figure CN122090431A_ABST
    Figure CN122090431A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, in particular to a foggy day license plate recognition optimization method, which comprises the following steps: acquiring real foggy day license plate images in various complex environments, and constructing a real data set; performing fog effect expansion processing on the fog-free license plate image based on the annotation information of the real foggy day license plate image in the real data set, generating a diversified foggy day sample, and constructing a training data set; detecting a foggy-day license plate image needing to be recognized based on the improved target detection model, and positioning a license plate area; performing adaptive defogging filtering and contrast enhancement processing on the positioned license plate area to obtain a clear license plate image; and analyzing the clear license plate image by adopting a character recognition engine, and outputting the license plate number. The method and the device have the advantage of effectively solving the problems of low precision and poor generalization caused by the fuzzy license plate and poor imaging quality of the license plate in the foggy weather.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of image recognition, and in particular to an optimized method for license plate recognition in foggy weather. Background Technology

[0002] As one of the core technologies in the field of intelligent transportation, license plate recognition technology has gradually evolved from the early stage of traditional algorithms based on manually designed features to the stage dominated by deep learning algorithms. Its recognition accuracy in real-world scenarios under normal weather conditions generally exceeds 95%, and it is widely used in many key areas such as traffic violation capture, unmanned management of smart parking lots, ETC-assisted toll collection on highways, and urban road security tracking. At the same time, it is gradually penetrating into lightweight scenarios such as mobile photo recognition and embedded edge computing devices, and the technology is highly mature.

[0003] However, the effectiveness of license plate recognition technology is severely limited in adverse weather conditions such as heavy fog. In foggy weather, fog droplets in the atmosphere scatter and absorb light, resulting in a significant reduction in contrast, blurred edge textures, and loss of character details in the captured license plate images, making it difficult to effectively extract the key features of the license plate.

[0004] In existing technologies, some solutions attempt to improve the accuracy of license plate character recognition and adaptability to complex scenes by modeling the contextual relationships between license plate characters. Other solutions indirectly improve recognition performance in foggy conditions through data augmentation techniques such as random blurring and random photometric distortion. While these methods improve the performance of license plate recognition algorithms in extreme weather conditions to some extent, they do not fully address the problems of low accuracy and poor generalization caused by blurred license plates and poor image quality in foggy conditions. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides an optimized method for license plate recognition in foggy weather.

[0006] This application provides an optimized method for license plate recognition in foggy weather, which adopts the following technical solution: An optimized method for license plate recognition in foggy weather includes the following steps: Acquire real foggy license plate images under various complex environments and construct a real dataset. The real foggy license plate images carry annotation information such as bounding boxes, vertex coordinates, license plate numbers, brightness, and blur. Based on the annotation information of real foggy license plate images in the real dataset, fog-free license plate images are subjected to fog effect augmentation processing to generate diverse foggy samples and construct a training dataset. The improved target detection model is used to detect and locate license plate regions in foggy license plate images; the improved target detection model is trained on a training dataset. Adaptive dehazing filtering and contrast enhancement processing are applied to the located license plate area to obtain a clear license plate image; The clear license plate image is analyzed using a character recognition engine, and the license plate number is output.

[0007] In one embodiment, the step of performing fog effect augmentation processing on fog-free license plate images to generate diverse foggy day samples and constructing a training dataset specifically includes: acquiring fog-free license plate images; based on an atmospheric scattering model, introducing a dynamic transmission map and Gaussian noise, and adjusting the fogging parameters in combination with the annotation information of real foggy license plate images to generate simulated foggy day samples with different fog concentrations corresponding to the fog-free license plate images; and mixing the simulated foggy day samples with real foggy license plate images according to a preset ratio to construct a training dataset.

[0008] In one embodiment, the step of generating the simulated foggy day sample specifically includes: Generate depth maps based on the geometric characteristics of fog-free license plate images; A location-dependent scattering mechanism is introduced, and the fogging parameters are adjusted by combining the annotation information of real foggy license plate images. The dynamic scattering coefficient of each fog-free license plate image is calculated based on the depth map. Based on the discretization approximation of Beer-Lambert's law, the dynamic transmittance of each pixel is calculated by combining path integral with dynamic scattering coefficient, depth map and Gaussian noise. Within the RGB color space, atmospheric brightness is sampled from fog-free license plate images, with the atmospheric brightness value being the independent mean of each channel; Based on the atmospheric scattering model, the fog-free image, dynamic transmittance, and atmospheric luminance are fused and calculated to generate the final fogged image.

[0009] In one embodiment: the improved target detection model is a YOLOv11 model that embeds an attention module in the backbone network and extends the shallow feature path in the detection head; wherein, the attention module is a channel-spatial serial attention module, which first performs channel weight allocation on the feature map output by the backbone network, and then performs spatial masking refinement on the feature map to suppress fog noise interference and enhance the edge texture features of the license plate; the shallow feature path is the P2 layer, which is multi-scale feature spliced ​​with the original P3-P5 layers of the model to form a multi-resolution feature pyramid.

[0010] In one embodiment: the step of performing adaptive dehazing filtering and contrast enhancement processing on the located license plate area to obtain a clear license plate image specifically includes: using a dehazing algorithm based on dark channel prior theory to perform preliminary restoration of the license plate area image; and then applying contrast-limited adaptive histogram equalization processing to the preliminarily restored image to obtain a clear license plate image.

[0011] In one embodiment: the step of coarsely estimating transmittance in the dehazing algorithm includes: cropping the located license plate area to obtain a target sub-image of a preset size; extracting the dark channel of the target sub-image within a preset local window; and calculating a coarsely estimated transmittance map based on the dark channel and a preset constant coefficient through a linear relationship; wherein the dark channel value is the minimum value of the RGB three channels within the local window of each pixel.

[0012] In one embodiment: when estimating the global atmospheric light value in the dehazing algorithm, a multi-scale sub-region filtering method is adopted, the filtering method specifically including: The license plate area image is divided into multiple sub-windows of different sizes; Within each sub-window, the distribution of pixel brightness values ​​is calculated, and the set of pixels whose brightness values ​​are between the first and third quantiles is selected as the stable brightness region; Calculate the median pixel brightness within the stable brightness region as the candidate atmospheric light value for that sub-window; By combining the candidate atmospheric light values ​​from all sub-windows of different sizes, the final global atmospheric light estimate is obtained by taking the median.

[0013] In one embodiment: in the guided filtering refinement step of the dehazing algorithm, a dynamic kernel adjustment mechanism is introduced to adaptively adjust the size of the filter kernel based on the texture complexity and gradient information of the local region of the image. Specifically, the dynamic kernel adjustment mechanism includes: calculating the gray-level variance of the local window containing the current pixel to be filtered in the license plate region image to characterize the flatness of the region; calculating the average gradient magnitude of the same local window to characterize the texture or edge intensity of the region; and dynamically determining the size of the filter kernel of the guided filter based on the ratio of the gray-level variance to the average gradient magnitude. In smooth regions with small gray-level variance and small average gradient magnitude, a larger filter kernel is used to achieve sufficient smoothing; in edge regions with large average gradient magnitude, a smaller filter kernel is used to protect the edges.

[0014] In one embodiment, the contrast-limited adaptive histogram equalization process specifically includes: The initially restored image is converted to a color space with independent luminance components; The brightness component image is divided into multiple non-overlapping local sub-blocks; The brightness histogram of each local sub-block is calculated independently, and the histogram is cropped using a preset clipping limit value to limit the excessive enhancement of local contrast. Equalization mapping is performed based on the cropped histogram to obtain the processed local brightness sub-blocks; All processed local luminance sub-blocks were fused using bilinear interpolation and merged with the original chrominance components, then converted back to the original color space to obtain a clear license plate image.

[0015] In one embodiment: before parsing the clear license plate image, a preprocessing operation is performed on the clear license plate image. The preprocessing method is as follows: the clear license plate image is upsampled using a bicubic interpolation algorithm; and the feature information output by multiple convolutions is aggregated through a feature pyramid network to form a sequence embedding feature for character recognition. In the step of parsing the clear license plate image using a character recognition engine, the character recognition engine adopts an end-to-end optical character recognition framework and is constructed based on a convolutional recurrent neural network and a bidirectional long short-term memory network. The parsing steps specifically include: inputting the sequence embedding features into the backbone network of the convolutional recurrent neural network to extract the spatiotemporal dimension features of the license plate characters; inputting the spatiotemporal dimension features into the decoder of the bidirectional long short-term memory network to model the contextual dependencies of the characters and output a feature sequence that integrates contextual information; inputting the feature sequence that integrates contextual information into a fully connected layer and converting it into a character probability distribution through a softmax function; and minimizing the alignment error between the input feature sequence and the output text sequence by connecting a temporal classification loss function to optimize the accuracy of the character probability distribution. The steps for outputting the license plate number include: performing a decoding operation on the optimized character probability distribution to obtain an initial text sequence; filtering out characters with probability values ​​higher than the preset character probability threshold based on a preset character probability threshold; removing duplicate characters and whitespace characters from the initial text sequence, and outputting the final license plate number text.

[0016] In summary, this application has the following beneficial effects: 1. By adding fog for augmentation and introducing dynamic transmission maps and Gaussian noise based on an atmospheric scattering model, an adjustable fogging algorithm is designed to generate diverse foggy images that fit real-world scenarios, effectively enriching the dataset and improving model adaptability; 2. The target detection algorithm suppresses fog noise by embedding a CBAM module in the backbone and optimizes small target detection by extending the detection head to P2 layer, thereby improving the AP value of small targets with an area less than 0.5% of the image by 3-5%. 3. An adaptive dehazing filter is applied to the extracted license plate area, and a dynamic kernel adjustment mechanism and quartile atmospheric light estimation are introduced to suppress edge artifacts. Then, the CLAHE algorithm is fused to enhance contrast and improve image clarity. 4. During recognition, preprocessing effectively compensates for the lack of detail in characters in foggy weather, and sampling an end-to-end optical character recognition framework improves the recognition accuracy of blurry characters. Finally, high-confidence characters are filtered by a preset character probability threshold. Combined with the removal of duplicate and blank characters, low-probability erroneous recognition results can be effectively filtered, improving the system's recognition reliability. Attached Figure Description

[0017] Figure 1 This is a flowchart of an embodiment of an optimized license plate recognition method for foggy weather; Figure 2 This is a process flow diagram of fog effect enhancement processing in an embodiment of a fog-day license plate recognition optimization method; Figure 3 This is a process flow diagram of the improved target detection algorithm in an embodiment of the foggy license plate recognition optimization method; Figure 4 This is a network structure of an improved target detection algorithm in an embodiment of a foggy license plate recognition optimization method; Figure 5 This is a process flow diagram of the defogging process in an embodiment of the foggy license plate recognition optimization method. Figure 6 This is a flowchart illustrating the character recognition process in an optimized license plate recognition method for foggy weather, as described in one embodiment. Detailed Implementation

[0018] To better understand the purpose, technical solutions, and advantages of this application, it has been described and illustrated below with reference to the accompanying drawings and embodiments. However, those skilled in the art should understand that this application can be implemented without these details. In some cases, to avoid obscuring various aspects of this application due to unnecessary description, well-known methods, processes, systems, components, and / or circuits already described at a higher level will not be elaborated upon. It will be apparent to those skilled in the art that various modifications can be made to the embodiments disclosed in this application, and the general principles defined in this application can be applied to other embodiments and application scenarios without departing from the principles and scope of this application. Therefore, this application is not limited to the illustrated embodiments, but conforms to the broadest scope consistent with the scope of protection claimed in this application.

[0019] It should be noted that the descriptions of these embodiments are for the purpose of aiding understanding the present invention, but do not constitute a limitation thereof. Furthermore, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0020] In the description of this application, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0021] In the description of this application, the terms "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples.

[0022] An optimized method for license plate recognition in foggy weather, such as Figure 1 As shown, it includes the following steps: S100. Acquire real foggy license plate images under various complex environments and construct a real dataset. The real foggy license plate images carry annotation information such as bounding boxes, vertex coordinates, license plate numbers, brightness and blur. S200. Based on the annotation information of real foggy license plate images in the real dataset, fog-free license plate images are subjected to fog effect augmentation processing to generate diverse foggy samples and construct a training dataset. S300. Based on the improved target detection model, the license plate image that needs to be identified in foggy weather is detected and the license plate region is located; wherein, the improved target detection model is trained on the training dataset; S400 performs adaptive dehazing filtering and contrast enhancement processing on the located license plate area to obtain a clear license plate image; The S500 uses a character recognition engine to parse clear license plate images and output the license plate number.

[0023] In one embodiment, step S200 specifically includes: acquiring fog-free license plate images; based on an atmospheric scattering model, introducing a dynamic transmission map and Gaussian noise, and adjusting the fogging parameters by combining the annotation information of real foggy license plate images, generating simulated foggy day samples with different fog concentrations corresponding to the fog-free license plate images; and mixing the simulated foggy day samples with real foggy license plate images according to a preset ratio to construct a training dataset.

[0024] Specifically, such as Figure 2 As shown, the specific steps for generating simulated foggy day samples include: First, a depth map is generated based on the geometric characteristics of the fog-free license plate image. The depth value of the depth map is obtained by calculating and normalizing the Euclidean distance from each pixel to the image center, and the depth value ranges from [0,1].

[0025] Secondly, a position-dependent scattering mechanism is introduced, and the fogging parameters are adjusted in combination with the annotation information of real foggy license plate images. The dynamic scattering coefficient of each fog-free license plate image is calculated based on the depth map.

[0026] The dynamic scattering coefficient is calculated using the formula: β(s) = β0 + γ · ||s||², where β0 is the base value, γ is the gradient term, s is the integral point on the path from the camera to the target, and ||s||² is the pixel location distance parameter based on the depth map. During calculation, the values ​​of β0 and γ are dynamically adjusted based on the fog density level markings of real fog license plate images to ensure that the scattering coefficient range corresponding to different fog density levels accurately matches the fog density characteristics marked in real fog images, thus ensuring that the scattering characteristics closely match the real scene. Specifically, β0 is set to 0.01~0.05, corresponding to fog densities of 0.1~0.6. The higher the brightness of the real fog license plate image, the smaller the value of γ, to avoid conflicts between fog effects and illumination.

[0027] Then, based on the discretization approximation of Beer-Lambert's law, the dynamic transmittance of each pixel is calculated by combining path integral with dynamic scattering coefficient, depth map and Gaussian noise.

[0028] The relationship between transmittance, scattering coefficient, and depth is: t0(x) = exp(-β·d), where t0(x) is the transmittance, β is the scattering coefficient, and d is the depth. To simulate non-uniform fog effects, a position-dependent dynamic scattering coefficient is introduced, resulting in the basic transmittance formula: b ase (x)=exp(-∫0 ᵈ β(s)ds), this path integral form is based on the discretization approximation of the Beer-Lambert law, and is used to represent the spatial gradient of the fog effect as "dense in the distance and light in the near".

[0029] To simulate the density fluctuations of local fog patches in real foggy weather, local random Gaussian noise N(x) is introduced and incorporated into the basic transmittance formula, resulting in the final dynamic transmittance formula: t(x) = exp(-∫0^t) ᵈ β(s)ds)·(1-N(x)), N(x) is local random Gaussian noise, which follows a Gaussian distribution with mean μ=0 and adjustable variance σ², i.e. N(x)~N(0,σ²).

[0030] Preferably, the value of σ is dynamically adjusted based on the brightness distribution annotations and license plate bounding box annotations of real foggy license plate images. Specifically, a smaller σ value is used for the license plate bounding box region, such as σ∈[0.005,0.01], to avoid excessive noise obscuring the license plate characters; a larger σ value is used for the background region, referencing the brightness fluctuation characteristics of the real annotations, such as σ∈[0.01,0.015], to simulate the irregular distribution of local fog patches in real foggy weather, ensuring that the generated fog effect is natural and realistic.

[0031] Meanwhile, by combining the annotation information of real fog license plate images, different fog concentration levels correspond to different noise variance σ ranges, so that the noise distribution accurately matches the fog characteristics of real fog, further improving the realism of the simulated samples. For example, light fog: σ∈[0.005,0.008]; moderate fog: σ∈[0.008,0.012]; heavy fog: σ∈[0.012,0.015].

[0032] Discretization of the path integral involves dividing the continuous path from 0 to d into N equally spaced segments, each segment having a length of d / N. Assuming the scattering coefficient β(s) is constant within each segment, the continuous integral is replaced by piecewise summation, i.e., ∫0 ᵈ β(s)ds≈K e=1 ⁿ β(s k )·(d / N), where s k Let be the path integration point of the k-th discrete segment.

[0033] Subsequently, atmospheric light intensity was sampled from the fog-free license plate image within the RGB color space, with the atmospheric light intensity value being an independent mean of each channel. Priority was given to sampling from the sky region or areas with uniform background brightness to avoid interference from the high brightness of the license plate character area on atmospheric light estimation.

[0034] Finally, based on the atmospheric scattering model, the fog-free image, dynamic transmittance, and atmospheric brightness are fused and calculated to generate the final fogged image.

[0035] The formula for generating the final fogged image is: I(x) = J(x)·t(x) + A·(1-t(x)), where I(x) is the final fogged image, J(x) is the fog-free license plate image, and A is the atmospheric luminance. During the calculation, the original luminance value of the fog-free license plate image is multiplied by the dynamic transmittance for attenuation adjustment, resulting in the attenuated luminance value. This ensures that areas with higher fog concentrations experience more significant light attenuation, resulting in lower contrast between the license plate characters and the background.

[0036] In one embodiment, the improved object detection model is a YOLOv11 model that embeds an attention module in the backbone network and extends shallow feature paths in the detection head. The process flow diagram of the improved object detection model is shown below. Figure 3As shown. The attention module is a channel-spatial serial attention module, which first assigns channel weights to the feature map output by the backbone network, and then refines the feature map by spatial masking to suppress fog noise interference and enhance the texture features of the license plate edge; the shallow feature path is the P2 layer, which is multi-scale feature spliced ​​with the original P3-P5 layers of the model to form a multi-resolution feature pyramid.

[0037] The core formula of the serial channel-spatial attention module includes: Channel weight calculation: Mc(F) = σ(MLP(Vanpools(F)) + MLP(MaxPool(F))) Spatial mask calculation: MPs(F)=σ(Conv7×7([AvgPool(F);MaxPool(F)])) Full feature update process: F'=MS(Mc(F)⊙F)⊙(Mc(F)⊙F) Wherein, Mc(F) is the channel attention weight map, used to assign weights to each channel of the input feature map F and filter globally important channels; MLP is a multilayer perceptron, used to perform dimensional transformation and nonlinear mapping on the pooled features to capture the dependencies between channels; vanpools(F) is a global average pooling operation on the input feature map F to extract the global average features of the channels; MaxPool(F) is a global max pooling operation on the input feature map F to extract the global maximum features of the channels.

[0038] Ms(F) is a spatial attention mask map, used to refine the spatial location of the channel-weighted feature map and enhance the target sensitive area; Conv7×7 is a 7×7 convolution operation, used to extract spatial information from the concatenated pooled features and generate a spatial mask; [AvgPool(F);MaxPool(F)] concatenates the global average pooling feature and the global max pooling feature along the channel dimension.

[0039] F' is the enhanced feature map output after processing by the CBAM module; ⊙ is element-wise multiplication, used to perform pixel-wise weighted fusion of attention weights / masks and feature maps; σ is Sigmoid activation, used to normalize the weight / mask values ​​to the [0,1] interval to achieve reasonable feature weighting.

[0040] Furthermore, shallow high-frequency detail compensation for deep semantic sparsity improves the AP of small targets in images with an area <0.5% by 3-5%. The loss function integrates CIOU boundary regression and BCE classification. The specific network structure is as follows: Figure 4 As shown.

[0041] In one embodiment, such as Figure 5As shown, step S400 specifically includes: using a dehazing algorithm based on dark channel prior theory to perform preliminary restoration of the license plate area image; and then applying contrast-limited adaptive histogram equalization processing to the preliminarily restored image to obtain a clear license plate image.

[0042] In this embodiment, the formula for the dehazing algorithm is: J~(p)=(I(p)-A·(1-t(p))) / max(t(p),t0)+A In the formula, J~(p) is the initially recovered fog-free license plate image at pixel p, I(p) is the pixel value of the foggy license plate image at pixel p, A is the global atmospheric brightness value, t(p) is the dynamic transmittance at pixel p, and t0 is the minimum transmittance threshold.

[0043] The steps for roughly estimating transmittance in the dehazing algorithm include: cropping the located license plate area to obtain a target sub-image of a preset size; extracting the dark channel of the target sub-image within a preset local window; and calculating a roughly estimated transmittance map based on the dark channel and a preset constant coefficient through a linear relationship; wherein the dark channel value is the minimum value of the RGB three channels within the local window of each pixel.

[0044] The formula for calculating the coarse transmittance map of image pixels is: t~(p)=1-ω·dark channel Dark channel = min c∈{R,G,B} min q∈Ω(p) J c (q) In the formula, p is the image pixel whose transmittance is to be calculated; ω is the fog density adjustment coefficient, a fixed value of 0.95, used to balance the rationality of the rough estimate of transmittance with the fog effect fit; c∈{R,G,B} represents traversing the red, green, and blue channels of the RGB color space; Ω(p) is a local window centered on pixel p, such as 15×15, used to statistically analyze the pixel value characteristics of the local area; q is any pixel within the local window Ω(p); J c (q) represents the pixel value at pixel q in the c channel of the image without a license plate, normalized to the interval [0,1]; min c∈{R,G,B} To minimize the calculation results for the three RGB channels, and to better reflect the channel statistical characteristics of fog scattering; min q∈Ω(p) To minimize the value of all pixels within a local window, the interference of local highlights / noise on the coarse estimation results is suppressed.

[0045] In addition, when estimating global atmospheric light values ​​in the dehazing algorithm, a multi-scale sub-region filtering method is adopted. The filtering method specifically includes: The license plate area image is divided into multiple sub-windows of different sizes; Within each sub-window, the distribution of pixel brightness values ​​is calculated, and the set of pixels whose brightness values ​​are between the first and third quantiles is selected as the stable brightness region; Calculate the median pixel brightness within the stable brightness region as the candidate atmospheric light value for that sub-window; By combining the candidate atmospheric light values ​​from all sub-windows of different sizes, the final global atmospheric light estimate is obtained by taking the median.

[0046] The formula for calculating the global atmospheric light estimate is as follows: A=median({max(R,G,B)|q {0.25} <I<q {0.75} ,in sub-windows}) In the formula, A is the global atmospheric brightness value, which is the base brightness value for unified / channel-specific estimation of the RGB three channels; median(⋅) is the median operation, which takes the median of the filtered pixel value set to avoid interference from extreme values ​​such as highlights / dark spots; max(R,G,B) is the maximum value of the red, green, and blue channel pixel values ​​of a pixel in the foggy image, which is used to extract the pixel highlight features; I is the pixel brightness value of the foggy image; q {0.25} <I<q {0.75} The quartile filtering condition is used to retain only the set of pixels whose brightness values ​​are between the first and third quartiles; sub-windows represent square sub-windows with scales of {3,5,7}, which cover different local areas of the image at multiple scales and improve the comprehensiveness of the statistics.

[0047] Furthermore, in the guided filtering refinement step of the dehazing algorithm, a dynamic kernel adjustment mechanism is introduced to adaptively adjust the size of the filter kernel based on the texture complexity and gradient information of the local image region.

[0048] The dynamic kernel adjustment mechanism specifically includes: calculating the gray-level variance of the local window where the current pixel to be filtered is located in the license plate area image to characterize the flatness of the area; calculating the average gradient magnitude of the same local window to characterize the texture or edge intensity of the area; dynamically determining the size of the filter kernel of the guiding filter based on the ratio of gray-level variance to average gradient magnitude; wherein, in smooth areas with small gray-level variance and small average gradient magnitude, a larger filter kernel is used to achieve sufficient smoothness; in edge areas with large average gradient magnitude, a smaller filter kernel is used to protect the edges.

[0049] The dynamic kernel calculation formula is: r = α·Var Ω(p) / (||∇J(p)||2+ε) In the formula, α is the weight, ε is the smoothing threshold dynamically adjusted from 0.8 to 1.5, Var is the gray-level variance, and ∇J is the Sobel gradient; ∇J is the Sobel gradient of the fog-free license plate image J.

[0050] Furthermore, the specific steps of contrast-limited adaptive histogram equalization processing include: The initially restored image is converted to a color space with independent luminance components; the luminance component image is divided into multiple non-overlapping local sub-blocks; the luminance histogram of each local sub-block is calculated independently, and the histogram is cropped using a preset cropping limit value to limit excessive enhancement of local contrast; equalization mapping is performed based on the cropped histogram to obtain the processed local luminance sub-blocks; all processed local luminance sub-blocks are fused using bilinear interpolation and merged with the original chrominance components, converted back to the original color space, and a clear license plate image is obtained.

[0051] The above method overcomes the problem of local over-enhancement or noise amplification that may be introduced by global histogram equalization when processing license plate images restored by uneven lighting. Its principle is to enhance the contrast of the license plate character area while suppressing noise amplification in the background area through local operations and contrast constraints, so as to achieve a more natural visual enhancement effect.

[0052] The CLAHE limiting formula for contrast equalization (CDF) in equalization processing is as follows: CDF clipped (c)=min(1,(CDF(c)-CDF(0)) / (1-α)) In the formula, CDF clipped (c) is the cumulative distribution function after CLAHE limiting, used to achieve equalization mapping of gray values; c is the gray level of the image; CDF(c) is the cumulative distribution function of the original image gray level, which characterizes the statistical distribution characteristics of gray values; CDF(0) is the cumulative distribution function value when the gray level is 0, which serves as the benchmark value for equalization calculation; min(1,⋅) is the limiting operation to ensure that the CDF value after equalization does not exceed 1, which conforms to the distribution function value specification; α is the equalization coefficient, used to adjust the magnitude of contrast enhancement and avoid over-enhancement.

[0053] In one embodiment, such as Figure 6 As shown, in step S500, before parsing the clear license plate image, a preprocessing operation is performed on the clear license plate image. The preprocessing method is as follows: the clear license plate image is upsampled using a bicubic interpolation algorithm; and the feature information output by multiple convolutions is aggregated through a feature pyramid network to form a sequence embedding feature for character recognition.

[0054] In the step of parsing a clear license plate image using a character recognition engine, in order to directly and accurately extract serialized character information from a clear license plate image that may still have residual blur or uneven contrast, and to avoid the error accumulation problem caused by the separation of character segmentation and recognition in traditional methods, this embodiment uses an end-to-end optical character recognition framework, and is built based on a convolutional recurrent neural network and a bidirectional long short-term memory network.

[0055] The specific steps of the analysis include: inputting the sequence embedding features into the backbone network of a convolutional recurrent neural network to extract the spatiotemporal dimension features of the license plate characters; inputting the spatiotemporal dimension features into a bidirectional long short-term memory decoder to model the contextual dependencies of the characters and output a feature sequence that incorporates contextual information; inputting the feature sequence that incorporates contextual information into a fully connected layer and converting it into a character probability distribution through a softmax function; and minimizing the alignment error between the input feature sequence and the output text sequence by connecting a temporal classification loss function to optimize the accuracy of the character probability distribution.

[0056] The above steps utilize a convolutional neural network to automatically extract deep feature maps from an image, then a recurrent neural network models this feature sequence as a context-dependent character probability sequence, and finally a sequence alignment algorithm directly outputs the most probable string, thus achieving end-to-end mapping from image to text.

[0057] The steps for outputting the license plate number include: performing a decoding operation on the optimized character probability distribution to obtain an initial text sequence; filtering out characters with probability values ​​higher than the preset character probability threshold based on the preset character probability threshold; removing duplicate characters and whitespace characters from the initial text sequence, and outputting the final license plate number text.

[0058] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. An optimized method for license plate recognition in foggy weather, characterized in that, Includes the following steps: Acquire real foggy license plate images under various complex environments and construct a real dataset. The real foggy license plate images carry annotation information such as bounding boxes, vertex coordinates, license plate numbers, brightness, and blur. Based on the annotation information of real foggy license plate images in the real dataset, fog-free license plate images are subjected to fog effect augmentation processing to generate diverse foggy samples and construct a training dataset. The improved target detection model is used to detect and locate license plate regions in foggy license plate images; the improved target detection model is trained on a training dataset. Adaptive dehazing filtering and contrast enhancement processing are applied to the located license plate area to obtain a clear license plate image; The clear license plate image is analyzed using a character recognition engine, and the license plate number is output.

2. The foggy license plate recognition optimization method according to claim 1, characterized in that: The steps of performing fog effect augmentation processing on fog-free license plate images to generate diverse foggy day samples and constructing a training dataset specifically include: acquiring fog-free license plate images; based on an atmospheric scattering model, introducing a dynamic transmission map and Gaussian noise, and adjusting the fogging parameters by combining the annotation information of real foggy license plate images to generate simulated foggy day samples with different fog concentrations corresponding to the fog-free license plate images; and mixing the simulated foggy day samples with real foggy license plate images according to a preset ratio to construct a training dataset.

3. The foggy license plate recognition optimization method according to claim 2, characterized in that, The specific steps for generating the simulated foggy day sample include: Generate depth maps based on the geometric characteristics of fog-free license plate images; A location-dependent scattering mechanism is introduced, and the fogging parameters are adjusted by combining the annotation information of real foggy license plate images. The dynamic scattering coefficient of each fog-free license plate image is calculated based on the depth map. Based on the discretization approximation of Beer-Lambert's law, the dynamic transmittance of each pixel is calculated by combining path integral with dynamic scattering coefficient, depth map and Gaussian noise. Within the RGB color space, atmospheric brightness is sampled from fog-free license plate images, with the atmospheric brightness value being the independent mean of each channel; Based on the atmospheric scattering model, the fog-free image, dynamic transmittance, and atmospheric luminance are fused and calculated to generate the final fogged image.

4. The foggy license plate recognition optimization method according to claim 1, characterized in that: The improved target detection model is a YOLOv11 model that embeds an attention module in the backbone network and extends the shallow feature path in the detection head. The attention module is a channel-spatial serial attention module, which first assigns channel weights to the feature map output by the backbone network, and then refines the feature map by spatial masking to suppress fog noise interference and enhance the texture features of license plate edges. The shallow feature path is layer P2, which is multi-scale feature concatenated with the original P3-P5 layers of the model to form a multi-resolution feature pyramid.

5. The foggy license plate recognition optimization method according to claim 1, characterized in that, The steps of performing adaptive dehazing filtering and contrast enhancement processing on the located license plate area to obtain a clear license plate image specifically include: using a dehazing algorithm based on dark channel prior theory to initially restore the license plate area image; and then applying contrast-limited adaptive histogram equalization processing to the initially restored image to obtain a clear license plate image.

6. The foggy license plate recognition optimization method according to claim 5, characterized in that, The step of coarsely estimating transmittance in the dehazing algorithm includes: cropping the located license plate area to obtain a target sub-image of a preset size; extracting the dark channel of the target sub-image within a preset local window; and calculating a coarsely estimated transmittance map based on the dark channel and a preset constant coefficient through a linear relationship; wherein the dark channel value is the minimum value of the RGB three channels within the local window of each pixel.

7. The foggy license plate recognition optimization method according to claim 6, characterized in that, When estimating global atmospheric light values ​​in the aforementioned dehazing algorithm, a multi-scale sub-region filtering method is employed. This filtering method specifically includes: The license plate area image is divided into multiple sub-windows of different sizes; Within each sub-window, the distribution of pixel brightness values ​​is calculated, and the set of pixels whose brightness values ​​are between the first and third quantiles is selected as the stable brightness region; Calculate the median pixel brightness within the stable brightness region as the candidate atmospheric light value for that sub-window; By combining the candidate atmospheric light values ​​from all sub-windows of different sizes, the final global atmospheric light estimate is obtained by taking the median.

8. The foggy license plate recognition optimization method according to claim 7, characterized in that: in In the guided filtering refinement step of the dehazing algorithm, a dynamic kernel adjustment mechanism is introduced to adaptively adjust the filter kernel size based on the texture complexity and gradient information of the local image region. Specifically, this dynamic kernel adjustment mechanism includes: calculating the gray-level variance of the local window containing the current pixel to be filtered in the license plate region image to characterize the flatness of the region; calculating the average gradient magnitude of the same local window to characterize the texture or edge intensity of the region; and dynamically determining the filter kernel size of the guided filter based on the ratio of gray-level variance to the average gradient magnitude. Specifically, in smooth regions with small gray-level variance and small average gradient magnitude, a larger filter kernel is used to achieve sufficient smoothing; in edge regions with large average gradient magnitude, a smaller filter kernel is used to protect the edges.

9. The foggy license plate recognition optimization method according to claim 5, characterized in that, The steps of the contrast-limited adaptive histogram equalization process specifically include: The initially restored image is converted to a color space with independent luminance components; The brightness component image is divided into multiple non-overlapping local sub-blocks; The brightness histogram of each local sub-block is calculated independently, and the histogram is cropped using a preset clipping limit value to limit the excessive enhancement of local contrast. Equalization mapping is performed based on the cropped histogram to obtain the processed local brightness sub-blocks; All processed local luminance sub-blocks were fused using bilinear interpolation and merged with the original chrominance components, then converted back to the original color space to obtain a clear license plate image.

10. The foggy license plate recognition optimization method according to claim 1, characterized in that, Before parsing the clear license plate image, a preprocessing operation is performed on the clear license plate image. The preprocessing method is to use a bicubic interpolation algorithm to upsample the clear license plate image. The feature pyramid network aggregates the feature information output from multiple convolutional layers to form sequence embedding features for character recognition. In the step of parsing the clear license plate image using a character recognition engine, the character recognition engine adopts an end-to-end optical character recognition framework and is constructed based on a convolutional recurrent neural network and a bidirectional long short-term memory network. The parsing steps specifically include: inputting the sequence embedding features into the backbone network of the convolutional recurrent neural network to extract the spatiotemporal dimension features of the license plate characters; inputting the spatiotemporal dimension features into the decoder of the bidirectional long short-term memory network to model the contextual dependencies of the characters and output a feature sequence that integrates contextual information; inputting the feature sequence that integrates contextual information into a fully connected layer and converting it into a character probability distribution through a softmax function; and minimizing the alignment error between the input feature sequence and the output text sequence by connecting a temporal classification loss function to optimize the accuracy of the character probability distribution. The steps for outputting the license plate number include: performing a decoding operation on the optimized character probability distribution to obtain an initial text sequence; filtering out characters with probability values ​​higher than the preset character probability threshold based on a preset character probability threshold; removing duplicate characters and whitespace characters from the initial text sequence, and outputting the final license plate number text.