License plate recognition method and system in strong backlight environment

By performing grayscale processing and histogram analysis on the backlight images, high-quality images are screened and stitched, and the degree of backlight and edge characteristics are evaluated, the problem of license plate recognition under backlight conditions is solved, and efficient and accurate license plate recognition is achieved.

CN119478914AActive Publication Date: 2025-02-18SHAANXI HIGH SPEED ELECTRONIC ENG CO LTD

Patent Information

Application Number
CN202510074111.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-02-18
Estimated Expiration
2045-01-17

AI Technical Summary

Technical Problem

Under backlight conditions, it is difficult for the camera to clearly capture license plate information, resulting in the strong light emitted by the car lights directly illuminating the camera during the vehicle's driving, and the sensor is saturated, making it difficult to obtain a clear license plate image.

Method used

By collecting vehicle backlight images, performing grayscale processing, obtaining grayscale histograms of grayscale backlight images, extracting maximum value points, determining grayscale separation points, performing threshold segmentation, obtaining foreground and background areas, filtering high-quality images, and performing Sort and splice, evaluate the degree of backlight and edge characteristics, and finally identify the license plate character encoding.

Benefits of technology

It significantly improves the accuracy and efficiency of license plate recognition in backlight environments, enhances the robustness of the system, and ensures the clear extraction and identification of license plate information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478914A_ABST
    Figure CN119478914A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image data processing, in particular to a license plate recognition method and system in a strong backlight environment, and the method comprises the steps: carrying out the graying of a collected image, and obtaining a gray backlight image; extracting a grey level histogram of each image, determining a maximum value point, evaluating a peak value attribute through a grey level difference and a pixel quantity of the maximum value point, and further determining a grey level separation point; performing threshold segmentation on the image, extracting foreground and background regions, calculating a reference value index, and screening out high-quality foreground and background images through threshold judgment; sorting the high-quality images to obtain a retention index, and performing threshold judgment again to determine foreground and background images which are preferentially retained; and the license plates are arranged and combined to form a spliced image, the backlight degree and the edge features of the spliced image are evaluated, finally, the adaptation degree is obtained through sorting, license plate character codes are extracted, a complete license plate number is formed, and license plate recognition under strong backlight is achieved. The invention aims to improve the accuracy of license plate recognition in a backlight environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and in particular to a method and system for recognizing a license plate in a strong backlight environment. Background Art

[0002] With the rapid development of urbanization, the number of vehicles has increased significantly, leading to traffic congestion and increased difficulty in management. License plate recognition technology can monitor vehicle flow in real time, assist traffic management departments in optimizing signal light settings and planning roads, and thus improve traffic efficiency. With the advancement of smart city construction, license plate recognition technology also plays an important role in parking management. Car owners can quickly enter the parking lot through the automatic recognition system. At the same time, the system can update parking space information in real time to improve parking efficiency. Under backlight conditions, the main challenge faced by license plate recognition technology is that it is difficult for the camera to clearly capture the license plate information under strong light. The strong light emitted by the headlights during vehicle driving directly shines on the camera, causing its sensor to become saturated, making it difficult to obtain a clear license plate image.

[0003] Existing methods mainly achieve image restoration by uniformly adjusting the grayscale of the entire backlit image, but this method is often not ideal in adjusting the contrast between the foreground and background. Although the overall brightness of the image is improved, the restoration effect of detailed areas such as license plates is poor, which makes it difficult to meet the needs of high-precision recognition. Summary of the invention

[0004] The present invention provides a license plate recognition method and system in a strong backlight environment using the following technical solutions: An embodiment of the present invention provides a method for license plate recognition in a strong backlight environment, the method comprising the following steps: Collect the backlit image of the vehicle, grayscale the image, and obtain a grayscale backlit image; Obtain the grayscale histogram of each grayscale backlit image and extract the maximum point in the grayscale histogram; obtain the peak attribute evaluation of any two maximum points in the grayscale histogram and determine the grayscale separation point based on the grayscale value difference between the two maximum points in the grayscale histogram and the number of corresponding pixels; perform threshold segmentation on all grayscale backlit images according to the grayscale value of the grayscale separation point to obtain the foreground area and background area of ​​each grayscale backlit image; According to the distribution of the gray values ​​of the pixels in the foreground area and the background area of ​​each gray backlight image, the reference value index of the foreground area and the reference value index of the background area of ​​each gray backlight image are obtained respectively, and threshold judgment is performed respectively to obtain a high-quality gray foreground image and a high-quality gray background image; Sorting all high-quality grayscale foreground images and high-quality grayscale background images, obtaining the retention index of each high-quality grayscale foreground image and the retention index of each high-quality grayscale background image according to the distribution of pixels in adjacent high-quality grayscale foreground images and high-quality grayscale background images, and obtaining the priority retention foreground image and the priority retention background image through threshold judgment; The obtained priority-retained foreground images and priority-retained background images are arranged and combined to obtain a plurality of stitched images; the backlight degree of each stitched image is obtained according to the distribution of gray levels in each stitched image, the difference in the number of pixels contained in the maximum maximum point and other maximum points in the gray histogram, and the retention index of the foreground and background in each stitched image; Obtain the edge detection image of each stitched image and the number of closed curves and corner points in the edge detection image, obtain the fitness of each stitched image according to the backlight degree of each stitched image, the number of pixels contained in the closed curve in the edge detection image, and the number of corner points, and sort them to obtain the license plate recognition image; Get the character codes in each license plate recognition image, take the code with the most occurrences as the final recognition result, and concatenate the recognized character codes to form a complete license plate number.

[0005] Furthermore, obtaining the peak attribute evaluation of any two maximum value points in the grayscale histogram and determining the grayscale separation point includes: Grayscale histogram and The specific calculation formula for the peak attribute evaluation of the maximum value point is: in, Indicates the grayscale histogram and Peak attribute evaluation of maximum points; Indicates the grayscale histogram The number of pixels corresponding to the maximum point; Indicates the grayscale histogram The number of pixels corresponding to the maximum point; Indicates the number of all pixels; Indicates the grayscale histogram and The absolute value of the difference in grayscale values ​​corresponding to the maximum points; It represents the maximum absolute value of the difference between the gray values ​​corresponding to any two maximum points in the gray histogram; The two maximum value points corresponding to the maximum value in the peak attribute evaluation of all arbitrary two maximum value points are recorded as two peak points.

[0006] Furthermore, the specific method of obtaining the foreground area and the background area of ​​each grayscale backlit image is: The peak point with the least number of pixels among the two peak points is recorded as the grayscale separation point between the foreground area and the background area; The side of the grayscale histogram that is less than or equal to the grayscale value corresponding to the grayscale separation point is recorded as the grayscale distribution of the foreground area, and the side that is greater than the grayscale value corresponding to the grayscale separation point is recorded as the grayscale distribution of the background area; All grayscale backlit images are threshold segmented according to the grayscale value of the grayscale separation point of each grayscale backlit image, and the threshold segmentation result is made into a mask to obtain the foreground area and background area of ​​each grayscale backlit image.

[0007] Furthermore, the step of obtaining a reference value index of the foreground area of ​​each grayscale backlit image includes: No. The specific calculation formula for the reference value index of the foreground area of ​​the grayscale backlit image is: in, Indicates A reference value index of the foreground area of ​​a grayscale backlit image; Indicates The grayscale values ​​of all pixels in the foreground area of ​​the grayscale backlit image; Represents the mean grayscale value of all pixels in the foreground area of ​​all grayscale backlit images; Indicates The maximum value of the grayscale value of the pixel points in the foreground area of ​​the grayscale backlit image; Indicates The minimum value of the grayscale value of the pixels in the foreground area of ​​the grayscale backlit image; Indicates The number of pixels in the foreground area of ​​the grayscale backlit image; Indicates The number of pixels in a grayscale backlit image; represents the absolute value function.

[0008] Furthermore, the specific method of obtaining the high-quality grayscale foreground image and the high-quality grayscale background image is: When When the ratio of the reference value index of the foreground area of ​​the grayscale backlight image to the maximum value of the reference value index of the foreground area of ​​all grayscale backlight images is greater than the preset reference threshold, The foreground area of ​​the grayscale backlit image is recorded as A high-quality grayscale foreground image; When When the ratio of the reference value index of the background area of ​​the grayscale backlight image to the maximum value of the reference value index of the background area of ​​all grayscale backlight images is greater than the preset reference threshold, The background area of ​​the grayscale backlit image is recorded as A high-quality grayscale background image.

[0009] Furthermore, the step of sorting all high-quality grayscale foreground images and high-quality grayscale background images and obtaining a retention index of each high-quality grayscale foreground image and a retention index of each high-quality grayscale background image according to the distribution of pixels in adjacent high-quality grayscale foreground images and high-quality grayscale background images includes: All high-quality grayscale foreground images are sorted according to the acquisition time of the vehicle backlight image, and each high-quality grayscale foreground image is logically ANDed with the previous adjacent high-quality grayscale foreground image to obtain the number of overlapping pixels of the two images; No. The specific calculation method of the retention index of a high-quality grayscale foreground image is: in, Indicates The retention index of high-quality grayscale foreground images; Indicates A high-quality grayscale foreground image and The number of overlapping pixels in the high-quality grayscale foreground image; Indicates The number of overlapping pixels in the high-quality grayscale foreground image; Indicates A high-quality grayscale foreground image and The number of overlapping pixels in the high-quality grayscale foreground image; Indicates The number of overlapping pixels in the high-quality grayscale foreground image; Represents the number of high-quality grayscale foreground images; Indicates A reference value index of the foreground area of ​​a grayscale backlit image; represents the absolute value function; Represents the sigmoid function; Based on the distribution of pixels in adjacent high-quality gray background images and the reference value index corresponding to the high-quality gray background image, the retention index of each high-quality gray background image is obtained.

[0010] Furthermore, the specific method of obtaining the foreground image and the background image is as follows: When When the retention index of the first high-quality grayscale foreground image is greater than the preset retention threshold, the The high-quality grayscale foreground image is recorded as Prioritize the foreground image; When When the retention index of the first high-quality grayscale background image is greater than the preset retention threshold, the The high-quality gray background image is recorded as Prioritize the background image.

[0011] Further, the obtained priority-retained foreground image and priority-retained background image are arranged and combined to obtain a plurality of stitched images; according to the distribution of gray levels in each stitched image, the difference in the number of pixels contained in the maximum maximum point and other maximum points in the gray histogram, and the retention index of the foreground and background in each stitched image, the backlight degree of each stitched image is obtained, which includes: Will obtain Prioritize foreground images and The background image is retained first to be arranged and combined to obtain the total spliced ​​images; The specific calculation formula for the backlight degree of the stitched image is: in, Indicates The degree of backlighting of the stitched image; Indicates The standard deviation of the gray level distribution of the stitched images; Represents the maximum value of the standard deviation of the gray level distribution of all stitched images; Indicates The gray value of the maximum maximum point in the gray histogram of the stitched image; Represents the mean of the grayscale values ​​of all the maximum maximum points in the grayscale histogram of all the stitched images; Indicates The number of pixels corresponding to the maximum maximum point in the grayscale histogram of the stitched image; Indicates The grayscale histogram of the stitched image except the maximum maximum point The number of pixels corresponding to the maximum point; Indicates The number of maximum points in the grayscale histogram of the stitched image except the maximum maximum point; Indicates A retention index that prioritizes the foreground image in the stitched images; Indicates A retention index that prioritizes the background image in the stitched images; represents the absolute value function.

[0012] Further, the edge detection image of each stitched image and the number of closed curves and corner points in the edge detection image are obtained, and the fitness of each stitched image is obtained according to the backlight degree of each stitched image, the number of pixels contained in the closed curve in the edge detection image, and the number of corner points, and the license plate recognition image is obtained by sorting. The license plate recognition image includes: Use the canny edge detection algorithm on each stitched image to obtain an edge detection image; Identify closed curves in edge detection images using Green’s formula; Use the corner detection algorithm to obtain the number of corner points of the edge detection image; No. The specific calculation formula for the fitness of the spliced ​​images is: in, Indicates The fitness of the stitched images; Indicates The number of corner points in the edge detection image of the stitched image; Represents the maximum number of corner points in the edge detection images of all stitched images; Indicates The number of pixels contained in all closed curves in the stitched images; Indicates The number of all pixels in the stitched image; Indicates The degree of backlighting of the stitched image; Sort the fitness of all the stitched images from large to small, and sort the first The spliced ​​image is recorded as the license plate recognition image. is the preset judgment threshold.

[0013] The present invention also proposes a license plate recognition system in a strong backlight environment, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program stored in the memory to implement the steps of the aforementioned license plate recognition method in a strong backlight environment.

[0014] The beneficial effects of the technical solution of the present invention are as follows: graying the collected images to obtain gray backlit images, extracting the gray histogram of each image and determining the maximum point, evaluating its peak attribute by the gray difference and the number of pixels of the maximum point, and then determining the gray separation point, which can evaluate the significance of image features and help determine the appropriate separation point; performing threshold segmentation on the image, extracting the foreground and background areas, and calculating the reference value index, which can screen out the foreground and background areas useful for license plate recognition, and provide a basis for the subsequent judgment of high-quality images; screening out high-quality foreground and background images by threshold judgment, ensuring that the selected images are of high quality, and enhancing the reliability of subsequent processing; sorting the high-quality images, obtaining the retention index, and performing the segmentation again. Threshold judgment is used to determine the foreground and background images that should be retained first. This arrangement can better identify and compare the differences between adjacent images and reduce the inconsistency caused by aperture changes. After screening and arrangement, it can ensure that the selected foreground and background images have better compatibility when stitching, significantly improving the efficiency and effect of post-processing; they are arranged and combined to form a stitched image, and their backlight degree and edge features are evaluated. Finally, the degree of adaptation is obtained by sorting, which can understand the clarity of the image after being affected by strong light and judge the quality of the image; the license plate character code is extracted to form a complete license plate number, realizing license plate recognition under strong backlight, enhancing the robustness of the system under backlight conditions, and improving the accuracy and efficiency of license plate recognition. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0016] Figure 1 A flowchart of the steps of a license plate recognition method in a strong backlight environment of the present invention; Figure 2 It is a grayscale backlit image. DETAILED DESCRIPTION

[0017] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a license plate recognition method and system in a strong backlight environment proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0018] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0019] The specific scheme of a license plate recognition method and system in a strong backlight environment provided by the present invention is described in detail below with reference to the accompanying drawings.

[0020] See also Figure 1 , which shows a flowchart of a method for license plate recognition in a strong backlight environment provided by an embodiment of the present invention, the method comprising the following steps: Step S001: Capture a backlit image of a vehicle, and grayscale the image to obtain a grayscale backlit image.

[0021] When taking photos of vehicles with a high-speed camera, the diameter of the camera lens cannot be changed at will, but the flux of light can be effectively controlled by installing a variable hole-shaped grating inside the lens. This device is called an aperture. The aperture is composed of several extremely thin metal sheets, which can form an opening in the middle for light to pass through. By adjusting the size of this opening, the amount of light entering the lens can be precisely controlled.

[0022] The larger the aperture is, the more light can enter the lens, thus affecting the brightness and clarity of the image. The size of the aperture is usually expressed as an f-number, such as f / 1, f / 2. In this representation, the smaller the number, the larger the aperture is, and the more light passes through; and the larger the number, the smaller the aperture is, and the amount of light allowed to pass through is correspondingly reduced.

[0023] A high-speed camera is used to take photos of the vehicle with an aperture value of f / 1. The aperture value of the camera is increased by 0.1 every 0.1 second, and the vehicle is photographed once. When the aperture value gradually increases to f / 50, several vehicle backlight images are collected at all times. In this embodiment, a total of 491 vehicle backlight images are obtained.

[0024] Grayscale several vehicle backlight images, and record the grayscale vehicle images as grayscale backlight images. Figure 2 shown.

[0025] Step S002: Obtain the grayscale histogram of each grayscale backlit image and extract the maximum points in the grayscale histogram; obtain the peak attribute evaluation of any two maximum points in the grayscale histogram and determine the grayscale separation point based on the grayscale value difference between the two maximum points in the grayscale histogram and the number of corresponding pixels; perform threshold segmentation on all grayscale backlit images according to the grayscale values ​​of the grayscale separation points to obtain the foreground area and background area of ​​each grayscale backlit image.

[0026] It should be noted that different aperture values ​​affect the amount of light passing through during shooting, resulting in brightness differences between the foreground and background in the final image. In order to obtain a clearer restored image, it is necessary to screen images taken with different aperture values. When the aperture value is small and the aperture is opened wider, the amount of light entering the lens will increase. In the backlit image of the vehicle taken, the foreground vehicle will usually appear clearer, but the background will often be overexposed, resulting in loss of details. On the contrary, when the aperture value is large and the aperture is opened smaller, the amount of light entering the lens is reduced. In the backlit image of the vehicle taken, the foreground vehicle may appear darker, while the background is relatively clearer. In order to make the foreground area and background area of ​​the backlit image of the vehicle taken more valuable for reference when evaluating, the grayscale histogram of the grayscale backlit image is analyzed.

[0027] It should be further explained that the grayscale contrast between the foreground and background of the grayscale backlit image is very obvious, so the grayscale value interval of the double peak in the grayscale histogram is usually large. By extracting the maximum value points in the grayscale histogram, when two maximum value points are found to be large and the corresponding grayscale values ​​are significantly different, these two maximum values ​​can be regarded as the two peak points of the foreground and background in the grayscale backlit image.

[0028] Specifically, the grayscale histogram of each grayscale backlit image is obtained, the maximum points in the grayscale histogram are extracted, and the peak attribute evaluation of any two maximum points in the grayscale histogram is obtained according to the grayscale value difference between the two maximum points in the grayscale histogram and the number of pixels corresponding to the two maximum points.

[0029] Furthermore, the grayscale histogram and The specific calculation formula for the peak attribute evaluation of the maximum value point is: in, Indicates the grayscale histogram and Peak attribute evaluation of maximum points; Indicates the grayscale histogram The number of pixels corresponding to the maximum point; Indicates the grayscale histogram The number of pixels corresponding to the maximum point; Indicates the number of all pixels; Indicates the grayscale histogram and The absolute value of the difference in grayscale values ​​corresponding to the maximum points; It represents the maximum absolute value of the difference between the grayscale values ​​corresponding to any two maximum points in the grayscale histogram.

[0030] It should be noted that Indicates and The ratio of the sum of the number of pixels corresponding to the two maximum points to the number of all pixels reflects the importance of the two maximum points in the entire image. The larger the value, the more pixels correspond to the two maximum points, which occupy a more important position in the image, are more representative, and are more visually significant. It reflects the relative distance between the two maximum points. The larger the value is, the closer the and The grayscale value difference between the maximum points is relatively large, and they are separated far apart in the grayscale space, which means that the foreground and background are more clearly distinguished. Combining a high pixel number ratio with a large grayscale value difference, The larger the value, the and The greater the possibility that a maximum point is a peak point, the more likely it is to effectively represent the important features in the image.

[0031] Furthermore, the two maximum points corresponding to the maximum value in the peak attribute evaluation of all two arbitrary extreme points are recorded as two peak points, the peak point with the least number of pixels among the two peak points is recorded as the grayscale separation point between the foreground area and the background area, the side of the grayscale histogram that is less than or equal to the grayscale value corresponding to the grayscale separation point is recorded as the grayscale distribution of the foreground area, and the side that is greater than the grayscale value corresponding to the grayscale separation point is recorded as the grayscale distribution of the background area. All grayscale backlit images are threshold segmented by the grayscale value of the grayscale separation point of each grayscale backlit image, and the threshold segmentation result is made into a mask to obtain the foreground area and background area of ​​each grayscale backlit image.

[0032] Step S003: According to the distribution of grayscale values ​​of pixels in the foreground area and background area of ​​each grayscale backlit image, obtain the reference value index of the foreground area and the reference value index of the background area of ​​each grayscale backlit image respectively, and perform threshold judgment respectively to obtain a high-quality grayscale foreground image and a high-quality grayscale background image.

[0033] It should be noted that grayscale backlit images usually show obvious bimodal characteristics in the grayscale histogram due to the significant grayscale contrast between the foreground and background areas. The grayscale values ​​of pixels in the background area are often higher, while the grayscale values ​​of pixels in the foreground area are relatively low. In grayscale backlit images, the grayscale value interval of the bimodal in the grayscale histogram is usually larger. In order to obtain a more valuable foreground and background area, the grayscale values ​​of the foreground and background areas should be located in the middle of the histogram. At the same time, the grayscale values ​​representing the pixels in the foreground area and the pixels in the background area should be concentrated.

[0034] Further, The specific calculation formula for the reference value index of the foreground area of ​​the grayscale backlit image is: in, Indicates A reference value index of the foreground area of ​​a grayscale backlit image; Indicates The grayscale values ​​of all pixels in the foreground area of ​​the grayscale backlit image; Represents the mean grayscale value of all pixels in the foreground area of ​​all grayscale backlit images; Indicates The maximum value of the grayscale value of the pixel points in the foreground area of ​​the grayscale backlit image; Indicates The minimum value of the grayscale value of the pixels in the foreground area of ​​the grayscale backlit image; Indicates The number of pixels in the foreground area of ​​the grayscale backlit image; Indicates The number of pixels in a grayscale backlit image; represents the absolute value function.

[0035] It should be noted that Indicates The absolute difference between the foreground area of ​​the grayscale backlit image and the mean grayscale value of all pixels in the foreground area of ​​all grayscale backlit images. The larger the value, the greater the deviation between the foreground grayscale value of the image and the overall mean. Indicates The difference between the maximum and minimum grayscale values ​​in the foreground area of ​​a grayscale backlit image reflects the grayscale range in the foreground area. The larger the value, the higher the contrast of the foreground area. The larger the value, the The grayscale features of the foreground area of ​​the grayscale backlit image are more obvious. Not only is there a large difference with the overall grayscale mean, but there is also a high contrast inside the foreground area. It has low reference value for license plate recognition in a strong backlit environment. It represents the ratio of the number of pixels in the foreground area to the number of pixels in the entire image. The larger the value, the higher the proportion of the foreground area in the entire image, and the greater the significance of the foreground area. The significance of the grayscale features of the foreground area and the proportion of the foreground in the entire image are combined. The larger the value, the The higher the reference value of the foreground area of ​​the grayscale backlit image.

[0036] Similarly, based on the distribution of grayscale values ​​of pixels in the background area of ​​the grayscale backlit image, a reference value index of the background area of ​​each grayscale backlit image is obtained.

[0037] Furthermore, the reference threshold value preset in this embodiment is , which is described as an example, can be set to other values ​​in other implementations, and this embodiment does not limit it. Reference value index of the foreground area of ​​the grayscale backlit image The maximum value of the reference value index of the foreground area of ​​all grayscale backlit images The ratio of When The foreground area of ​​the grayscale backlit image is recorded as A high-quality grayscale foreground image. Reference value index of the background area of ​​the grayscale backlit image The maximum value of the reference value index of the background area of ​​all grayscale backlit images The ratio of When The background area of ​​the grayscale backlit image is recorded as A high-quality grayscale background image.

[0038] Step S004: Sort all high-quality grayscale foreground images and high-quality grayscale background images, obtain the retention index of each high-quality grayscale foreground image and the retention index of each high-quality grayscale background image according to the distribution of pixels in adjacent high-quality grayscale foreground images and high-quality grayscale background images, and obtain the priority foreground image and the priority background image through threshold judgment.

[0039] It should be noted that due to the change of aperture during the shooting process, the grayscale value of the grayscale backlit image will fluctuate accordingly, resulting in significant differences between the foreground and background segmented from each image, which not only affects the overall quality of the image, but also poses a challenge to the subsequent image stitching, resulting in unsatisfactory final stitching effect.

[0040] It should be further explained that in order to reduce the significant difference between the foreground and background of each image segmented due to aperture changes, it is necessary to sort all high-quality grayscale foreground images and high-quality grayscale background images. If the pixel distribution in adjacent high-quality grayscale foreground images is relatively uniform, it means that the foreground object is consistent in different images, which helps to reduce the problems of unnatural seams and transitions during stitching. The final stitching effect will be better, and the foreground part can be smoothly integrated to form a continuous visual effect. If there are significant differences in the distribution of pixels in the foreground image, it may cause obvious seams, color differences or inconsistent shapes during the stitching process. The final stitching effect may appear fragmented, affecting the overall image quality. If the pixel distribution of adjacent high-quality grayscale background images is consistent, it will help the fusion and stitching of the later images, and the background can transition naturally, so that the foreground is prominent and the background does not cause interference. If the pixel distribution of the background image is relatively different, it may cause the background to appear abrupt during stitching, which will affect the continuity of the image and cause visual confusion. According to the distribution of pixels in adjacent high-quality grayscale foreground images or high-quality grayscale background images, the high-quality grayscale foreground images and high-quality grayscale background images are further screened.

[0041] Specifically, all high-quality grayscale foreground images and high-quality grayscale background images are sorted according to the acquisition time of the vehicle backlight image, and each high-quality grayscale foreground image is logically ANDed with the previous adjacent high-quality grayscale foreground image to obtain the number of overlapping pixels of the two images; each high-quality grayscale background image is logically ANDed with the previous adjacent high-quality grayscale background image to obtain the number of overlapping pixels of the two images. The logical AND operation is a well-known technology, and the specific method is not introduced here.

[0042] Further, The specific calculation method of the retention index of a high-quality grayscale foreground image is: in, Indicates The retention index of high-quality grayscale foreground images; Indicates A high-quality grayscale foreground image and The number of overlapping pixels in the high-quality grayscale foreground image; Indicates The number of overlapping pixels in the high-quality grayscale foreground image; Indicates A high-quality grayscale foreground image and The number of overlapping pixels in the high-quality grayscale foreground image; Indicates The number of overlapping pixels in the high-quality grayscale foreground image; Represents the number of high-quality grayscale foreground images; Indicates A reference value index of the foreground area of ​​a grayscale backlit image; represents the absolute value function; Represents the sigmoid function, which is used for normalization processing, that is, normalizing the data value to Within the range.

[0043] It should be noted that Indicates Zhang Yudi The overlap ratio of the first high-quality grayscale foreground image, and the Zhang Yudi The difference between the overlap ratios of the first and second high-quality grayscale foreground images. The larger the value, the Zhang Yudi The overlap between the first high-quality grayscale foreground images is significantly different from that of the Zhang Yudi The overlap between the high-quality grayscale foreground images means that A high-quality grayscale foreground image is unique to some extent and may have a higher retention value. Reflects the The difference between the overlap ratio of the first high-quality grayscale foreground image and the overlap ratio of other images. The larger the value, the higher the The overlap between the first high-quality grayscale foreground image and the other images is quite different, which may mean that the The features of the high-quality grayscale foreground image are more prominent or unique, thereby improving the retention value. The larger the value, the A high-quality grayscale foreground image should be retained, which means that the characteristics of this image in terms of overlapping area and reference value are more representative than those of other images.

[0044] Similarly, based on the distribution of pixels in adjacent high-quality gray background images and the reference value index corresponding to the high-quality gray background image, the retention index of each high-quality gray background image is obtained.

[0045] Furthermore, the retention threshold preset in this embodiment , which is described as an example, can be set to other values ​​in other implementations, and this embodiment does not limit it. The retention index of high-quality grayscale foreground images is greater than When A high-quality grayscale foreground image. The high-quality grayscale foreground image is recorded as The foreground image is kept first. The retention index of high-quality grayscale background images is greater than When A high-quality grayscale background image. The high-quality gray background image is recorded as It is particularly noted that the first high-quality grayscale foreground image and the first high-quality grayscale background image are not subjected to the calculation of the above-mentioned retention index and are directly used as the priority retention foreground image and the priority retention background image.

[0046] Step S005: Arrange and combine the obtained priority foreground images and priority background images to obtain a plurality of stitched images; obtain the backlight degree of each stitched image according to the distribution of gray levels in each stitched image, the difference in the number of pixels contained in the maximum maximum point and other maximum points in the gray histogram, and the retention index of the foreground and background in each stitched image.

[0047] It should be noted that in order to ensure that the stitched image supports the recognition of license plates more effectively, it is necessary not only to ensure the reference value of the foreground and background, but also to consider the overall suitability of the new image formed by stitching the foreground and background. The pixel grayscale of the backlit image is usually concentrated in the too dark or too bright area, resulting in its grayscale histogram showing obvious bimodal characteristics and a relatively large standard deviation of the grayscale distribution. This characteristic makes the backlit image susceptible to interference during recognition, affecting the readability of the license plate. In contrast, the pixel grayscale of the non-backlit image is mainly concentrated under normal light conditions, forming a unimodal grayscale histogram, and the standard deviation of the grayscale distribution is small. This distribution helps to improve the clarity and readability of the image, making the license plate information more obvious.

[0048] It should be further explained that when stitching images, the grayscale distribution in the whole image is more uniform, which can better reflect the characteristics under normal light. In addition, if the number of pixels contained in the maximum maximum point and other maximum points in the grayscale histogram of the stitched image is greatly different, and the closer the position of these maximum points is to the normal light part, it means that the backlight degree of the stitched image is smaller. In this case, the stitched image will better meet the requirements of license plate restoration, thereby improving the accuracy and efficiency of license plate recognition.

[0049] Specifically, the Prioritize foreground images and The background image is retained first to be arranged and combined to obtain the total spliced ​​images; The specific calculation formula for the backlight degree of the stitched image is: in, Indicates The degree of backlighting of the stitched image; Indicates The standard deviation of the gray level distribution of the stitched images; Represents the maximum value of the standard deviation of the gray level distribution of all stitched images; Indicates The gray value of the maximum maximum point in the gray histogram of the stitched image; Represents the mean of the grayscale values ​​of all the maximum maximum points in the grayscale histogram of all the stitched images; Indicates The number of pixels corresponding to the maximum maximum point in the grayscale histogram of the stitched image; Indicates The grayscale histogram of the stitched image except the maximum maximum point The number of pixels corresponding to the maximum point; Indicates The number of maximum points in the grayscale histogram of the stitched image except the maximum maximum point; Indicates A retention index that prioritizes the foreground image in the stitched images; Indicates A retention index that prioritizes the background image in the stitched images; represents the absolute value function.

[0050] It should be noted that Indicates The ratio of the standard deviation of the grayscale distribution of a stitched image to the maximum standard deviation of all stitched images. The larger the value, the more dispersed the grayscale distribution of the image is, which means the contrast is higher, which may increase the impact of backlight and make license plate recognition more difficult. Measured the The difference between the gray value of the maximum maximum point of the stitched image and the mean gray value of the maximum points of all stitched images is relative to the sum of the number of pixels of other maximum points except the maximum maximum point. The larger the value, the smaller the gray value of the stitched image. The maximum maximum point of the stitched image deviates from the mean of all stitched images, indicating that the image is abnormal in lighting conditions and increases the degree of backlighting. Indicates The priority degree of foreground and background preservation in the stitched image. A larger value means that both the foreground and the background are relatively weak, resulting in insufficient overall information of the stitched image, thereby increasing the impact of backlighting. The larger the value, the The greater the backlighting degree of the stitched image, the more difficult it is to recognize the license plate.

[0051] Step S006: Obtain the edge detection image of each stitched image and the number of closed curves and corner points in the edge detection image, obtain the fitness of each stitched image according to the backlight degree of each stitched image, the number of pixels contained in the closed curve in the edge detection image, and the number of corner points, and sort them to obtain the license plate recognition image.

[0052] It should be noted that in order to improve the accuracy of image restoration during license plate recognition, the generated stitched image must be able to clearly show the complex texture details in the license plate area. Therefore, when processing the image, especially in the special texture and character areas of the license plate, it is necessary to ensure that these details are preserved so that the recognition process can accurately capture each character and symbol. In addition, the edges in the image should be smoother and more continuous to avoid recognition errors caused by blurred or broken edges. By optimizing the clarity and edge coherence of the image, the overall performance of the recognition system can be significantly improved, thereby ensuring the accurate extraction and recognition of license plate information.

[0053] Specifically, the canny edge detection algorithm is used for each stitched image to obtain an edge detection image, the closed curve in the edge detection image is identified by the Green's formula, and the number of corner points in the edge detection image is obtained by the corner detection algorithm. Among them, the canny edge detection algorithm, the Green's formula and the corner detection algorithm are well-known technologies, and the specific methods are not introduced here. The specific calculation formula for the fitness of the spliced ​​images is: in, Indicates The fitness of the stitched images; Indicates The number of corner points in the edge detection image of the stitched image; Represents the maximum number of corner points in the edge detection images of all stitched images; Indicates The number of pixels contained in all closed curves in the stitched images; Indicates The number of all pixels in the stitched image; Indicates The backlighting degree of the stitched images.

[0054] It should be noted that Indicates that this is the The ratio of the number of corner points in the first stitched image to the maximum number of corner points in all stitched images. Corner points usually represent significant features in an image. A larger value indicates that the first stitched image has a larger number of corner points. The features of the stitched image are richer and the corner points are better distributed, which means that the details of the image are more obvious, which is helpful for the subsequent recognition process. No. The ratio of the number of pixels contained in all closed curves in a stitched image to the number of all pixels in the image. Closed curves are usually associated with license plate characters. A larger value means a higher proportion of closed curves in the image, which indicates that the structure of the image in the license plate area is more complete, which is conducive to character recognition. Larger values ​​usually mean more significant backlighting effects, which may result in reduced image quality and thus have a negative impact on the fit. The larger the value, the The stitched images perform well in terms of feature richness, structural integrity and lighting conditions, thereby improving the overall performance of the recognition system, which means that the images are more suitable for license plate recognition and improves the accuracy and efficiency of recognition.

[0055] Similarly, obtain the fitness of all stitched images, sort the fitness of all stitched images from large to small, and sort the fitness of the first The spliced ​​image is recorded as the license plate recognition image. The judgment threshold preset in this embodiment is , this is used as an example for description, and other values ​​may be set in other implementation modes, and this embodiment does not limit this.

[0056] Step S007: Obtain the character codes in each license plate recognition image, take the code with the most occurrences as the final recognition result, and concatenate the recognized character codes to form a complete license plate number.

[0057] In the license plate recognition image, the contour matching algorithm is first used to accurately locate the position of the license plate. This process can effectively extract the license plate area from the complex background by analyzing the contour features of the image. After locating the license plate, the feature matching method based on the character shape is then applied to further perform detailed character segmentation on the license plate area. This step aims to eliminate individual characters from the entire license plate to ensure that the subsequent recognition process can focus on the clear character area.

[0058] After segmenting the character regions, the system will perform feature extraction on these regions to obtain unique feature vectors for each character. These feature vectors contain the shape, size, and other important attributes of the character, allowing the character recognition algorithm to more accurately identify the encoding of each character. Through this process, the recognition system can identify the encoding corresponding to each character.

[0059] The system will then count the character codes obtained in each license plate recognition image and use the code with the most occurrences as the final recognition result. This selection strategy helps ensure the accuracy and reliability of the recognition result. The recognized character codes will be spliced ​​to form a complete license plate number, and the final license plate number will be displayed or output to the user for subsequent query and processing.

[0060] Among them, the contour matching algorithm, the feature matching method based on character shape and the character recognition algorithm are well-known technologies, and the specific methods are not introduced here.

[0061] During the image acquisition process, the system uses the aperture controller to precisely adjust the aperture of the camera to ensure the best image quality. The acquired images are uploaded to the processor for the above analysis. After the processor performs in-depth analysis of the image, the acquired license plate information is transmitted to the subsequent analysis system. In this system, the license plate information will be used for further scene demand analysis, such as detecting whether the currently identified vehicle has a violation record, or verifying whether the license plate is a legal license plate. The design of this series of processes not only improves the efficiency of license plate recognition, but also ensures the accuracy of information, which facilitates timely response in practical applications.

[0062] At this point, this embodiment is completed.

[0063] To sum up, in an embodiment of the present invention, the present invention also provides a license plate recognition system in a strong backlight environment, 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 stored in the memory to implement the steps of the aforementioned license plate recognition method in a strong backlight environment.

[0064] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A license plate recognition method in a strong backlight environment, characterized in that: The method comprises the following steps: Collect the backlit image of the vehicle, grayscale the image, and obtain a grayscale backlit image; Obtain the grayscale histogram of each grayscale backlit image and extract the maximum point in the grayscale histogram; obtain the peak attribute evaluation of any two maximum points in the grayscale histogram and determine the grayscale separation point based on the grayscale value difference between the two maximum points in the grayscale histogram and the number of corresponding pixels; perform threshold segmentation on all grayscale backlit images according to the grayscale value of the grayscale separation point to obtain the foreground area and background area of ​​each grayscale backlit image; According to the distribution of the gray values ​​of the pixels in the foreground area and the background area of ​​each gray backlight image, the reference value index of the foreground area and the reference value index of the background area of ​​each gray backlight image are obtained respectively, and threshold judgment is performed respectively to obtain a high-quality gray foreground image and a high-quality gray background image; Sorting all high-quality grayscale foreground images and high-quality grayscale background images, obtaining the retention index of each high-quality grayscale foreground image and the retention index of each high-quality grayscale background image according to the distribution of pixels in adjacent high-quality grayscale foreground images and high-quality grayscale background images, and obtaining the priority retention foreground image and the priority retention background image through threshold judgment; The obtained priority-retained foreground images and priority-retained background images are arranged and combined to obtain a plurality of stitched images; the backlight degree of each stitched image is obtained according to the distribution of gray levels in each stitched image, the difference in the number of pixels contained in the maximum maximum point and other maximum points in the gray histogram, and the retention index of the foreground and background in each stitched image; Obtain the edge detection image of each stitched image and the number of closed curves and corner points in the edge detection image, obtain the fitness of each stitched image according to the backlight degree of each stitched image, the number of pixels contained in the closed curve in the edge detection image, and the number of corner points, and sort them to obtain the license plate recognition image; Get the character codes in each license plate recognition image, take the code with the most occurrences as the final recognition result, and concatenate the recognized character codes to form a complete license plate number.

2. According to the method for license plate recognition in a strong backlight environment as described in claim 1, it is characterized in that: The step of obtaining the peak attribute evaluation of any two maximum value points in the grayscale histogram and determining the grayscale separation point comprises: Grayscale histogram and The specific calculation formula for the peak attribute evaluation of the maximum value point is: in, Indicates the grayscale histogram and Peak attribute evaluation of maximum points; Indicates the grayscale histogram The number of pixels corresponding to the maximum point; Indicates the grayscale histogram The number of pixels corresponding to the maximum point; Indicates the number of all pixels; Indicates the grayscale histogram and The absolute value of the difference in grayscale values ​​corresponding to the maximum points; It represents the maximum absolute value of the difference between the gray values ​​corresponding to any two maximum points in the gray histogram; The two maximum value points corresponding to the maximum value in the peak attribute evaluation of all arbitrary two maximum value points are recorded as two peak points.

3. According to the method for license plate recognition in a strong backlight environment as described in claim 2, it is characterized in that: The specific method of obtaining the foreground area and the background area of ​​each grayscale backlit image is: The peak point with the least number of pixels among the two peak points is recorded as the grayscale separation point between the foreground area and the background area; The side of the grayscale histogram that is less than or equal to the grayscale value corresponding to the grayscale separation point is recorded as the grayscale distribution of the foreground area, and the side that is greater than the grayscale value corresponding to the grayscale separation point is recorded as the grayscale distribution of the background area; All grayscale backlit images are threshold segmented according to the grayscale value of the grayscale separation point of each grayscale backlit image, and the threshold segmentation result is made into a mask to obtain the foreground area and background area of ​​each grayscale backlit image.

4. The method for license plate recognition in a strong backlight environment according to claim 1, characterized in that: The reference value index of the foreground area of ​​each grayscale backlit image is obtained as follows: No. The specific calculation formula for the reference value index of the foreground area of ​​the grayscale backlit image is: in, Indicates A reference value index of the foreground area of ​​a grayscale backlit image; Indicates The grayscale values ​​of all pixels in the foreground area of ​​the grayscale backlit image; Represents the mean grayscale value of all pixels in the foreground area of ​​all grayscale backlit images; Indicates The maximum value of the grayscale value of the pixel points in the foreground area of ​​the grayscale backlit image; Indicates The minimum value of the grayscale value of the pixel points in the foreground area of ​​the grayscale backlit image; Indicates The number of pixels in the foreground area of ​​the grayscale backlit image; Indicates The number of pixels in a grayscale backlit image; represents the absolute value function.

5. The method for license plate recognition in a strong backlight environment according to claim 4, characterized in that: The specific method of obtaining the high-quality grayscale foreground image and the high-quality grayscale background image is: When When the ratio of the reference value index of the foreground area of ​​the grayscale backlight image to the maximum value of the reference value index of the foreground area of ​​all grayscale backlight images is greater than the preset reference threshold, The foreground area of ​​the grayscale backlit image is recorded as A high-quality grayscale foreground image; When When the ratio of the reference value index of the background area of ​​the grayscale backlight image to the maximum value of the reference value index of the background area of ​​all grayscale backlight images is greater than the preset reference threshold, The background area of ​​the grayscale backlit image is recorded as A high-quality grayscale background image.

6. The method for license plate recognition in a strong backlight environment according to claim 1, characterized in that: The step of sorting all high-quality grayscale foreground images and high-quality grayscale background images and obtaining a retention index of each high-quality grayscale foreground image and a retention index of each high-quality grayscale background image according to the distribution of pixels in adjacent high-quality grayscale foreground images and high-quality grayscale background images includes: All high-quality grayscale foreground images are sorted according to the acquisition time of the vehicle backlight image, and each high-quality grayscale foreground image is logically ANDed with the previous adjacent high-quality grayscale foreground image to obtain the number of overlapping pixels of the two images; No. The specific calculation method of the retention index of a high-quality grayscale foreground image is: in, Indicates The retention index of high-quality grayscale foreground images; Indicates A high-quality grayscale foreground image and The number of overlapping pixels in the high-quality grayscale foreground image; Indicates The number of overlapping pixels in the high-quality grayscale foreground image; Indicates A high-quality grayscale foreground image and The number of overlapping pixels in the high-quality grayscale foreground image; Indicates The number of overlapping pixels in the high-quality grayscale foreground image; Represents the number of high-quality grayscale foreground images; Indicates A reference value index of the foreground area of ​​a grayscale backlit image; represents the absolute value function; Represents the sigmoid function; Based on the distribution of pixels in adjacent high-quality gray background images and the reference value index corresponding to the high-quality gray background image, the retention index of each high-quality gray background image is obtained.

7. The method for license plate recognition in a strong backlight environment according to claim 6, characterized in that: The specific method of obtaining the foreground image and the background image with priority is as follows: When When the retention index of the first high-quality grayscale foreground image is greater than the preset retention threshold, the The high-quality grayscale foreground image is recorded as Prioritize the foreground image; When When the retention index of the first high-quality grayscale background image is greater than the preset retention threshold, the The high-quality gray background image is recorded as Prioritize the background image.

8. The method for license plate recognition in a strong backlight environment according to claim 1, characterized in that: The obtained priority-retained foreground image and priority-retained background image are arranged and combined to obtain a plurality of stitched images; according to the distribution of gray levels in each stitched image, the difference in the number of pixels contained in the maximum maximum point and other maximum points in the gray histogram, and the retention index of the foreground and background in each stitched image, the backlight degree of each stitched image is obtained, which includes: Will obtain Prioritize foreground images and The background image is retained first to be arranged and combined to obtain the total spliced ​​images; The specific calculation formula for the backlight degree of the stitched image is: in, Indicates The degree of backlighting of the stitched image; Indicates The standard deviation of the gray level distribution of the stitched images; Represents the maximum value of the standard deviation of the gray level distribution of all stitched images; Indicates The gray value of the maximum maximum point in the gray histogram of the stitched image; Represents the mean of the grayscale values ​​of all the maximum maximum points in the grayscale histogram of all the stitched images; Indicates The number of pixels corresponding to the maximum maximum point in the grayscale histogram of the stitched image; Indicates The grayscale histogram of the stitched image except the maximum maximum point The number of pixels corresponding to the maximum point; Indicates The number of maximum points in the grayscale histogram of the stitched image except the maximum maximum point; Indicates A retention index that prioritizes the foreground image in the stitched images; Indicates A retention index that prioritizes the background image in the stitched images; represents the absolute value function.

9. The method for license plate recognition in a strong backlight environment according to claim 8, characterized in that: The step of obtaining the edge detection image of each stitched image and the number of closed curves and corner points in the edge detection image, obtaining the fitness of each stitched image according to the backlight degree of each stitched image, the number of pixels and corner points contained in the closed curve in the edge detection image, and sorting to obtain the license plate recognition image comprises: Use the canny edge detection algorithm on each stitched image to obtain an edge detection image; Identify closed curves in edge detection images using Green’s formula; Use the corner detection algorithm to obtain the number of corner points of the edge detection image; No. The specific calculation formula for the fitness of the spliced ​​images is: in, Indicates The fitness of the stitched images; Indicates The number of corner points in the edge detection image of the stitched image; Represents the maximum number of corner points in the edge detection images of all stitched images; Indicates The number of pixels contained in all closed curves in the stitched images; Indicates The number of all pixels in the stitched image; Indicates The degree of backlighting of the stitched image; Sort the fitness of all the stitched images from large to small, and sort the first The spliced ​​image is recorded as the license plate recognition image. is the preset judgment threshold.

10. A license plate recognition system in a strong backlight environment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of a method for license plate recognition in a strong backlight environment as described in any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Backlight image enhancement method based on foreground extraction

    CN112801896A

  • Image detection method and device and electronic equipment

    CN112950525A

  • Image acquisition method and device, equipment and storage medium

    CN117611483A

  • Image edge extraction method and device, and automated driving system

    US20190392585A1

Cited By

  • Washing and drying constant-temperature control method for cadmium plating production line

    CN120928882A

  • A water washing and drying constant temperature control method for a cadmium plating production line

    CN120928882B