License plate recognition method and terminal device

By grayscale processing and edge extraction of vehicle images in harsh shooting environments, combined with license plate aspect ratio screening, the accuracy problem of plate recognition in harsh environments is solved, and the accuracy and recognition of vehicle detection and license plate positioning are achieved. improve.

CN109447074BInactive Publication Date: 2024-09-17CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201811020612.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-09-03
Publication Date
2024-09-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technology is difficult to achieve the accuracy of license plate recognition in harsh shooting environments. Especially in conditions such as haze, heavy rain, and snow, the quality of vehicle images decreases, resulting in difficulty in vehicle detection and license plate positioning, which in turn affects the accuracy of license plate recognition. .

Method used

By performing grayscale processing on the continuously captured target pictures, calculating the difference and mean value of the pixel grayscale values, intercepting the pixels with large grayscale value changes, performing grayscale binary edge extraction, and extracting the grayscale edges according to the rectangular width of the license plate. The license plate image is screened out with a high ratio to achieve accurate positioning and identification of the license plate.

Benefits of technology

In harsh shooting environments, the accuracy of vehicle detection and license plate positioning is improved, the accuracy of license plate recognition is improved, and the effectiveness of license plate recognition is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109447074B
    Figure CN109447074B
Patent Text Reader

Abstract

The present invention provides a license plate recognition method and terminal device, which are applicable to the field of data processing technology. The method comprises: graying two target images whose shooting time interval is less than a preset time threshold, and calculating the average of the grayscale value difference of the two target images after graying; based on the grayscale value difference and the average of the two target images, cutting out a vehicle image containing a vehicle from the two target images; graying the vehicle image and performing edge extraction, and finding a rectangular image whose boundary is closed to form a rectangle and whose aspect ratio is within a preset aspect ratio range; and character recognition is performed on the rectangular image to obtain a license plate recognition result. The embodiment of the present invention ensures the accuracy of vehicle detection and license plate positioning when recognizing license plates in harsh shooting environments, and improves the accuracy of license plate recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of data processing, and in particular relates to a vehicle license plate recognition method and terminal equipment. Background Art

[0002] License plate recognition is an important component of modern intelligent transportation and is widely used. It is based on digital image processing, pattern recognition, computer vision and other technologies to analyze the captured vehicle patterns or videos to determine the vehicle's license plate number.

[0003] License plate recognition usually includes three steps: vehicle detection in the captured image or video, license plate location, and license plate character recognition. The existing technology has a high accuracy rate for vehicle license plate recognition when the shooting environment is good, but for license plate recognition in some harsh shooting environments, such as haze, heavy rain, snow and other bad weather, the quality of the vehicle image / video that can be collected will drop rapidly due to factors such as weather, making it extremely difficult to detect the vehicle. It is difficult to accurately locate the license plate position, and it is even more difficult to accurately recognize the license plate. Therefore, in the existing technology, it is difficult to ensure accurate and effective license plate recognition in harsh shooting environments. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a license plate recognition method and a terminal device to solve the problem of low accuracy in the prior art when performing license plate recognition in a harsh shooting environment.

[0005] A first aspect of an embodiment of the present invention provides a license plate recognition method, comprising:

[0006] Grayscale processing is performed on two target images whose shooting time interval is less than a preset time threshold, and the average of the grayscale value differences of the pixels of the two target images after the grayscale processing is calculated;

[0007] Based on the pixel grayscale value difference and the mean value, extracting a vehicle image containing a vehicle from the two target images;

[0008] Performing grayscale binarization processing on the vehicle image and performing edge extraction to find a rectangular image whose border is closed to form a rectangle and whose aspect ratio is within a preset aspect ratio range;

[0009] Character recognition is performed on the rectangular image to obtain a license plate recognition result.

[0010] A second aspect of an embodiment of the present invention provides a terminal device, which includes a memory and a processor. The memory stores a computer program that can be run on the processor. When the processor executes the computer program, the following steps are implemented.

[0011] Grayscale processing is performed on two target images whose shooting time interval is less than a preset time threshold, and the average of the grayscale value differences of the pixels of the two target images after the grayscale processing is calculated;

[0012] Based on the pixel grayscale value difference and the mean value, extracting a vehicle image containing a vehicle from the two target images;

[0013] Performing grayscale binarization processing on the vehicle image and performing edge extraction to find a rectangular image whose border is closed to form a rectangle and whose aspect ratio is within a preset aspect ratio range;

[0014] Character recognition is performed on the rectangular image to obtain a license plate recognition result.

[0015] A third aspect of an embodiment of the present invention provides a computer-readable storage medium, comprising: storing a computer program, characterized in that when the computer program is executed by a processor, the steps of the license plate recognition method as described above are implemented.

[0016] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: in the embodiments of the present invention, by graying the target images continuously taken when the vehicle is moving, and calculating the grayscale value difference and the corresponding mean of the pixel points of the two target images, the grayscale value difference of the pixel points in the two target images is divided and processed according to the mean of the difference, so as to identify the pixel points with large grayscale value changes, thereby realizing accurate identification of the moving vehicle in a harsh shooting environment, ensuring the accuracy of vehicle detection, and then performing grayscale binarization edge extraction on the intercepted vehicle image, and screening the extracted rectangular image in combination with the aspect ratio of the license plate in actual conditions, thereby realizing accurate positioning of the license plate, thereby ensuring the accuracy of vehicle detection and license plate positioning when recognizing the license plate in a harsh shooting environment, and improving the accuracy of license plate recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 labor.

[0018] Figure 1 It is a schematic diagram of the implementation process of the license plate recognition method provided in the first embodiment of the present invention;

[0019] Figure 2 Schematic diagram of the implementation process of the license plate recognition method provided in the second embodiment of the present invention;

[0020] Figure 3 Schematic diagram of the implementation process of the license plate recognition method provided in the third embodiment of the present invention;

[0021] Figure 4 Schematic diagram of the implementation process of the license plate recognition method provided by the fourth embodiment of the present invention;

[0022] Figure 5 Schematic diagram of the implementation process of the license plate recognition method provided in the fifth embodiment of the present invention;

[0023] Figure 6 is a structural schematic diagram of a license plate recognition device provided in Embodiment 6 of the present invention;

[0024] Figure 7 It is a schematic diagram of a terminal device provided in Embodiment 7 of the present invention. DETAILED DESCRIPTION

[0025] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0026] In order to illustrate the technical solution of the present invention, a specific embodiment is provided below for illustration.

[0027] Figure 1 The following is a flowchart of the implementation of the license plate recognition method provided by the first embodiment of the present invention, which is described in detail as follows:

[0028] S101, grayscale processing is performed on two target images whose shooting time interval is less than a preset time threshold, and the average of the grayscale value differences of the pixels of the two target images after the grayscale processing is calculated.

[0029] The target image refers to an image containing a vehicle obtained when shooting a moving vehicle, which can be a directly taken photo or a frame extracted from a recorded video. At the same time, these target images can be manually taken by a user using a smart terminal such as a mobile phone, or taken by a set fixed camera, such as a fixed camera set up at a toll station.

[0030] When the shooting environment is relatively bad, the target images captured are prone to pixel loss and other problems, so the quality is often poor. For example, in heavy rain, the camera visibility is low and the clarity of the images captured is low. At this time, it is difficult to directly detect and identify vehicles from the target images. Considering that in actual situations, the pixel positions corresponding to moving objects in the continuously captured images will change, so that the grayscale values ​​of these pixels change more than those of static objects. Therefore, in order to accurately detect and identify vehicles from these target images of poor quality, the embodiment of the present invention adopts a method of continuously shooting moving vehicles, calculating the grayscale value of each pixel of the two target images, and then calculating the grayscale value difference of the pixel corresponding to each position in the two target images and the mean of the corresponding grayscale value difference, etc., to process the acquired target images containing moving vehicles, so as to provide a basis for subsequent vehicle detection of the target images.

[0031] Among them, the specific shooting time interval value can be set by the technical staff according to actual needs, but considering that the shooting environment may change greatly when the shooting interval is too long, such as the weather may change, this may cause the grayscale value of the pixels of the stationary objects in the two target images to change greatly, thereby making the subsequent grayscale value difference and corresponding mean calculation and vehicle detection difficult to achieve. Therefore, in order to ensure the validity of the two target images obtained, and to ensure the validity of the subsequent vehicle detection, in the embodiment of the present invention, the R&D personnel will pre-limit the maximum value of the shooting time interval between the two target images, such as setting the maximum value of the shooting time interval to 8 seconds or 10 seconds. At this time, the shooting time interval value set by the technician should be less than or equal to the pre-set maximum shooting time interval.

[0032] S102, based on the gray value difference and the mean value of the pixel points, extracting a vehicle image containing the vehicle from the two target images.

[0033] After obtaining the pixel grayscale value difference and the corresponding mean of all pixels of the two target images, it is only necessary to screen out the pixels whose pixel grayscale value difference is greater than the mean, and then determine the continuous closed image composed of the pixels whose pixel grayscale value difference is greater than the mean and cut it out, so as to realize the detection of the vehicle. Among them, when cutting out the vehicle image, the vehicle can be detected by taking any one of the target images as the object, or by taking two target images as the object at the same time. The specific selection can be made by the technicians themselves and is not limited here.

[0034] S103, performing grayscale binarization processing on the vehicle image and performing edge extraction to find a rectangular image whose border is closed to form a rectangle and whose aspect ratio is within a preset aspect ratio range.

[0035] After completing the vehicle detection and obtaining the required vehicle image, the license plate positioning of the vehicle image begins. In actual situations, license plates are all made according to a unified standard, are rectangular and have obvious rectangular border features, such as white borders. Therefore, the rectangular image in the captured vehicle image can be easily found by grayscale binarization and edge extraction. However, considering that in actual situations, there may be more than just license plates on the vehicle, such as some vehicles often have some rectangular slogan stickers, etc., the rectangular image found may be a license plate image or a specific image similar to a license plate. Therefore, after identifying these rectangular images, they need to be further screened to improve the accuracy of license plate image positioning, reduce the workload of subsequent license plate recognition, and improve the accuracy of recognition results.

[0036] Considering that the aspect ratio of the license plate is fixed in actual situations, and in actual applications, if the shooting angle is too biased when photographing the vehicle, the characters in the license plate will overlap, making the license plate number unrecognizable. Therefore, in order to ensure that the photographed vehicle image can be used for license plate recognition normally, the angle of the vehicle shooting in actual applications is set according to the vehicle situation, and there will be no extreme biased shooting angle. Therefore, the aspect ratio of the license plate image taken in actual applications has a certain ratio range. Therefore, in order to filter out the image of the license plate from the found rectangular image, the embodiment of the present invention will set the corresponding aspect ratio range according to the aspect ratio of the license plate rectangle in the actual application by the technician, and filter the aspect ratio of the rectangular image accordingly. The aspect ratio range can preferably be set to 3.5 to 5.

[0037] S104, performing character recognition on the rectangular image to obtain a license plate recognition result.

[0038] After the license plate is located, the character recognition of the license plate is started to determine the final license plate recognition result. The specific recognition method is not limited here, including but not limited to using some existing image character recognition methods for recognition, or using a recognition method designed by a technician for recognition. For details, please refer to Embodiment 2 to Embodiment 5 of the present invention.

[0039] It should be noted that in step S102, either a single target image or both target images can be selected for vehicle image capture. When a single target image is used, character recognition can be directly performed on the rectangular image and the license plate recognition result can be determined. When both target images are used for vehicle image capture, at least two rectangular images will need to be subjected to character recognition in step S104, and at least two corresponding character recognition results will be obtained. Therefore, the final license plate recognition result needs to be determined from these character recognition results. Among them, the specific method of determining the final license plate recognition result from multiple character recognition results is not limited here and can be set by technical personnel, including but not limited to randomly selecting one from the character recognition results that meet the license plate character format requirements as the license plate recognition result, or screening out the character recognition results that meet the license plate character format requirements, and identifying the difference characters in these character recognition results that meet the license plate character format requirements, and then cutting out the character image of the difference characters from the rectangular image, and performing character recognition on the character image to determine the character with the highest matching probability, and then replacing the difference characters, so as to determine the final character recognition result and obtain the license plate recognition result.

[0040] The embodiment of the present invention combines the characteristics of the factors affecting the shooting under the bad shooting environment, optimizes the vehicle detection and license plate positioning when the target image obtained under the bad shooting environment is used for license plate recognition, and ensures the accuracy of license plate recognition under the bad shooting environment. Since the target image obtained under the bad shooting environment is prone to pixel loss and poor quality, it is difficult to directly identify the location of the vehicle from it. In order to determine the vehicle from these poor quality target images, considering that in actual situations, the corresponding pixel positions of moving objects in the continuously shot images will change, so that the grayscale values ​​of these pixels are relatively large compared to the grayscale values ​​of the pixels of the objects that are stationary for a short time, the embodiment of the present invention adopts the method of continuously shooting the moving vehicle, and performing grayscale difference calculation based on the target image obtained by continuous shooting, and then dividing the grayscale value difference of the pixels in the two target images according to the difference mean to identify the pixels with large grayscale value changes, thereby realizing the accurate identification of the moving vehicle under the bad shooting environment, and ensuring the accuracy of the first step of vehicle detection in license plate recognition. After the vehicle is determined, the rectangular pattern in the vehicle is identified based on grayscale binary edge extraction. In combination with the fact that the aspect ratio of the license plate is fixed in actual situations, and the shooting position angle is also set according to the vehicle situation in actual applications, the extracted rectangle is screened for aspect ratio, eliminating the interference of some non-license plate rectangular images, thereby improving the accuracy of license plate positioning. Finally, character recognition is performed on the located license plate rectangular image to ensure the accuracy and effectiveness of the final license plate recognition result. Therefore, the embodiment of the present invention can ensure the accuracy and effectiveness of license plate recognition in harsh shooting environments.

[0041] As an embodiment of the present invention, since S102 intercepts the vehicle image, since there may be more than one moving object, there may be a continuous closed image consisting of multiple pixels that satisfy the requirement that the difference in pixel grayscale values ​​is greater than the mean, which will increase the workload of subsequent rectangular image extraction and character recognition, making the recognition work efficiency lower and the interference greater, and easily reducing the accuracy of the final recognition. Therefore, in order to reduce the interference of subsequent rectangular image extraction and character recognition and improve the efficiency and accuracy of recognition, in the embodiment of the present invention, after obtaining multiple vehicle images that meet the requirements, vehicle feature detection and recognition are performed on these vehicle images, and only the vehicle images that meet the vehicle recognition requirements are retained for subsequent rectangular image extraction and other operations. Among them, the specific vehicle feature detection and recognition method is not limited here, and can be set by the technician, including but not limited to the use of the common YOLO algorithm or HOG feature + linear SVM method.

[0042] As a specific implementation method of character recognition on a rectangular image in the first embodiment of the present invention, since the quality of license plate images taken in a harsh shooting environment is often poor, such as being blocked or blurred, it is often difficult to guarantee the accuracy of character recognition when directly performing character recognition on them. However, considering that the Chinese characters in the license plate are known and limited, such as Sichuan, Jiangxi, Guangdong, etc., that is, the actual recognized Chinese character result should be one of these license plate Chinese characters, therefore, in order to improve the accuracy of license plate recognition, in the embodiment of the present invention, the Chinese characters in the character recognition result will be optimized for recognition, such as Figure 2 As shown, the second embodiment of the present invention includes:

[0043] S201 , performing character recognition on a rectangular image, and matching a preset Chinese character library based on Chinese characters in the obtained character recognition results to determine at least one Chinese character with the highest character matching degree.

[0044] The Chinese character library refers to a character library set by technicians based on all Chinese characters that may exist in the license plate number, such as Sichuan, Jiangxi, Guangdong, etc. After obtaining the preliminary recognition result of the rectangular image, the Chinese characters contained therein are determined. The recognition method of the Chinese characters can be processed by some existing recognition methods. Considering that the first character of the Chinese characters in the actual license plate number is fixed, the first character can also be directly processed as a Chinese character.

[0045] After the Chinese characters are determined, the Chinese character library is matched to determine one or more Chinese characters with the highest matching degree as the characters to be processed. The specific number of Chinese characters determined can be set by the technicians according to their needs.

[0046] S202, based on the character images corresponding to the Chinese characters segmented from the rectangular image, matching is performed on a preset Chinese character image library, and a Chinese character set corresponding to at least one Chinese character image with the highest image matching degree is determined, wherein each Chinese character image in the Chinese character image library uniquely corresponds to a preset Chinese character.

[0047] The Chinese character image library refers to an image library composed of all standard images of Chinese characters in the license plate number provided by the Ministry of Public Security, wherein each Chinese character image uniquely corresponds to a Chinese character, so that the embodiment of the present invention can determine the corresponding Chinese character after matching the Chinese character image. Since the license plate number in actual situations does not use a standard font, but a special font set by the Ministry of Public Security, in order to ensure the accuracy and reliability of image matching, the embodiment of the present invention will construct the required Chinese character library based on the standard images of Chinese characters provided by the Ministry of Public Security. It is also possible to extract the standard image of each Chinese character by taking a photo of the actual license plate, and use it to construct the required Chinese character image library.

[0048] After the Chinese characters are determined, the accuracy of character recognition is often low when the quality of the license plate image is poor, and the Chinese character library needs to be matched again after character recognition, which makes it difficult to ensure the accuracy of the final recognition result obtained only by character recognition. In actual situations, since the standard image of the Chinese character corresponding to each Chinese character is known, and the overall image features of the captured Chinese character image can be directly obtained, the Chinese characters can be directly screened based on the overall character image features through image matching to achieve character matching in the image feature dimension. Therefore, in order to improve the accuracy of Chinese character recognition, the embodiment of the present invention will continue to segment the character images corresponding to the Chinese characters, and use the obtained character images to match the Chinese character image library to determine the corresponding Chinese characters with higher similarity, so as to match the Chinese character recognition results with higher similarity based on the overall character image features. The specific Chinese character images determined can be set by the technicians according to their needs.

[0049] S203, determining a character recognition result corresponding to the character image based on at least one Chinese character being the same as a Chinese character in the Chinese character set, and updating the character recognition result of the rectangular image.

[0050] When the matching of two dimensions both considers that a certain character has a high probability of being the character recognition result of a character image, it indicates that its recognition accuracy is high. Therefore, after obtaining two Chinese character recognition results determined by matching in different dimensions, the embodiment of the present invention will find out the same Chinese characters therein, and further determine the character recognition result of the final character image based on the same Chinese characters therein, and then update the Chinese characters in the rectangular image character recognition result to improve the accuracy of license plate recognition.

[0051] Among them, since there may be more than one identical Chinese characters, when the number of identical Chinese characters is greater than 1, it is necessary to determine the final character recognition result of a character image therefrom. The specific determination method is not limited in the embodiment of the present invention, and can be set by technical personnel according to actual needs. If technical personnel attach great importance to character image matching in actual needs, the Chinese character with the highest corresponding Chinese character image matching degree among the identical Chinese characters can be used as the final character recognition result of the character image according to the order of image matching degree.

[0052] As a specific implementation method for determining a final character recognition result of a character image from a plurality of identical Chinese characters in the second embodiment of the present invention, the embodiment of the present invention includes:

[0053] If the number of identical Chinese characters is greater than 1, the character matching degree and image matching degree corresponding to the identical Chinese characters are weighted based on a preset weight coefficient, and the Chinese character with the largest corresponding weight value is extracted as the character recognition result corresponding to the character image.

[0054] In the embodiment of the present invention, the Chinese character recognition results are screened by combining the two dimensions of Chinese character image recognition matching and character image matching. The weight value of the importance of each Chinese character is determined by calculating the weight of the character matching degree and the image matching degree for each Chinese character in the same Chinese character, and then the Chinese character with the largest weight value is determined as the character recognition result corresponding to the character image. Among them, the specific weight coefficient values ​​corresponding to the character matching degree and the image matching degree can be set by the technician according to the needs.

[0055] In an embodiment of the present invention, a method is provided for users to simultaneously filter the same Chinese characters by calculating the weights of both character matching and image matching. Users only need to set the corresponding weight coefficients according to their actual needs for text character image recognition matching and character image matching, and can filter the character image recognition results, which not only improves the recognition accuracy of character images, but also fully meets the actual needs of users.

[0056] As a specific implementation method of performing character recognition on a rectangular image and obtaining a license plate recognition result in the above embodiment of the present invention, Figure 3 As shown, the third embodiment of the present invention includes:

[0057] S105, if the number of Chinese characters in the character recognition result of the rectangular image is equal to 1, filter out the character recognition results that meet the preset license plate regular expression requirements from the character recognition results of the rectangular image to obtain the license plate recognition result.

[0058] The license plate regular expression is an expression generated according to the fixed format of the civil license plate number, such as: [Beijing, Tianjin, Shanghai, Chongqing, Hebei, Henan, Yunnan, Liaoning, Heilongjiang, Hunan, Anhui, Shandong, Xinjiang, Jiangsu, Zhejiang, Jiangxi, Hubei, Guangxi, Shanxi, Mongolia, Shaanxi, Jilin, Fujian, Guizhou, Guangdong, Qinghai, Tibet, Sichuan, Ningxia, Hainan]{1}[A-Z0-9]{5}. In real life, license plates include civil license plates and special license plates. The fixed format of civil license plates is: 1 Chinese character + 6 uppercase English letters and numbers, such as Guangdong B12345, while special license plates do not have a unified format. Different user institutions / organizations generally have different formats, but most of them contain at least two Chinese characters, and the number of license plate numbers that can be used to meet the format requirements is limited and known. For example, the format of airport shuttles or work vehicles is: Civil Aviation + 5 uppercase English letters and numbers.

[0059] In the embodiment of the present invention, in order to realize the rapid and accurate recognition of the license plate numbers of civilian license plates and special license plates with the same format as civilian license plates, after obtaining the character recognition results of the matrix image, the number of Chinese characters contained therein is determined, and when the number is 1, the character recognition results are screened using the license plate regular expression corresponding to the fixed format of the preset civilian license plate number, and the character recognition results that meet the format requirements are determined as the final license plate recognition results. Among them, since the specific Chinese character recognition method is not the invention point of this application, it will not be described and limited here, and some existing Chinese character recognition methods can be selected for processing.

[0060] As a specific implementation method of performing character recognition on a rectangular image and obtaining a license plate recognition result in the above embodiment of the present invention, Figure 4 As shown, the fourth embodiment of the present invention includes:

[0061] S106: If the number of Chinese characters in the character recognition result of the rectangular image is greater than 1, a preset license plate character string library is matched based on the character recognition result of the rectangular image to determine a license plate recognition result.

[0062] Among them, the license plate string library contains all license plate numbers with a number of Chinese characters greater than 1. Since most special license plates contain at least two Chinese characters, such as: special pass, there is a big difference between it and the fixed format of civilian license plates, and in actual situations, the number of special license plates containing multiple Chinese characters is relatively limited and known. Therefore, compared with civilian license plates whose formats are only known but the corresponding possible license plate numbers are unpredictable, these special license plates are easier to distinguish and identify. Therefore, in order to improve the accuracy and effectiveness of license plate recognition, the embodiment of the present invention processes the format characteristics of these special license plates, and after obtaining the recognition result of the rectangular image, it is determined whether it contains multiple Chinese characters. If it does, it means that it may belong to a special license plate. At this time, the set license plate string library is matched based on the character recognition result. If there is a successful match result, the license plate recognition result can be determined.

[0063] As a specific implementation method of performing character recognition on a rectangular image and obtaining a license plate recognition result in the above embodiment of the present invention, Figure 5 As shown, Embodiment 5 of the present invention includes:

[0064] S107, if the number of Chinese characters in the character recognition result of the rectangular image is greater than 1, match the preset license plate image library based on the rectangular image, and determine the license plate string corresponding to the license plate image with the highest matching degree, and obtain the license plate recognition result, wherein each license plate image in the license plate image library uniquely corresponds to a preset license plate string.

[0065] Among them, the license plate image library contains all license plate images with license plate numbers having a number of Chinese characters greater than 1, and in the embodiment of the present invention, in order to obtain the corresponding license plate number after the license plate image is determined, the license plate string (i.e., license plate number) corresponding to each license plate image is also stored. Although the fourth embodiment of the present invention can realize the recognition of license plate numbers with a number of Chinese characters greater than 1, it is found in actual applications that due to the relatively harsh shooting environment, the accuracy of character recognition is difficult to be guaranteed when the rectangular image is performed, and the inaccurate character recognition results lead to unsatisfactory matching results when the license plate string library is subsequently matched. Therefore, in order to ensure accurate recognition of license plate numbers with a number of Chinese characters greater than 1 in harsh shooting environments, the embodiment of the present invention adopts a method of performing license plate image matching on the entire rectangular image after determining that the rectangular image contains multiple Chinese characters, so as to realize the determination of the rectangular image license plate recognition result.

[0066] On the one hand, since the embodiment of the present invention does not require a high accuracy rate for the recognition result of a specific single character, as long as it is recognized as a Chinese character, it is more resistant to interference and has a higher accuracy rate than character matching based on character recognition results. On the other hand, the embodiment of the present invention compares the entire rectangular image, so the image matching refers to the features of the entire rectangular image. Compared with single character recognition, it has more reference feature points, so when the license plate image library is known, its recognition accuracy is bound to be higher. Therefore, the embodiment of the present invention can realize the accurate recognition of license plate numbers with more than 1 Chinese character.

[0067] It should be particularly noted that, since in step S102, either a single target image can be selected for vehicle image capture, or both target images can be selected for vehicle image capture, for embodiments 3 to 5 of the present invention, when a single target image is used, the final recognition result obtained can be directly used as the license plate recognition result, but when two target images are used, since at this time, whether it is character recognition matching or license plate image matching, there will be at least two recognition results. When the two recognition results are the same, that is, the character recognition results that are screened out and meet the requirements of the license plate regular expression are the same / the license plate strings that are matched are the same / the license plate images that are matched are the same, they can be directly used as the license plate recognition result. When the two recognition results are different, that is, the filtered character recognition results that meet the requirements of the license plate regular expression are different / the matched license plate strings are different / the matched license plate images are different, then it is necessary to determine the final license plate recognition result from the different recognition results. The embodiment of the present invention does not limit the specific method of determining the final license plate recognition result from the different recognition results, which can be set by the technicians, including but not limited to randomly selecting one as the license plate recognition result, or for the third embodiment of the present invention: for multiple character recognition results that meet the requirements of the license plate regular expression, identifying the difference characters in these character recognition results Characters, and then cut out character images of the difference characters from the rectangular image, and perform character recognition on the character image to determine the character with the highest matching probability, and then replace the difference characters to determine the final character recognition result and obtain the license plate recognition result. For Example 4 of the present invention / Example 5 of the present invention: license plate string library / license plate image library matching, the difference characters in these character recognition results are identified, and the character images corresponding to the difference characters in the two target images are compared to determine the character image containing more character features (that is, the difference characters are clearer), and the character recognition result of the rectangular image where the character image is located is used as the final license plate recognition result.

[0068] In the embodiment of the present invention, the vehicle detection, license plate positioning and license plate character recognition in the license plate recognition are respectively optimized accordingly, so that the embodiment of the present invention can adapt to various harsh shooting environments and ensure the accuracy and effectiveness of license plate recognition. Specifically, the vehicle is detected by utilizing the characteristic that the grayscale value of the pixels before and after the moving vehicle changes greatly, so that even if the target image quality is poor, the vehicle contained therein can be accurately detected. Then, the grayscale binarization edge extraction is performed on the intercepted vehicle image, and the aspect ratio of the extracted rectangular image is screened, so that the rectangular image corresponding to the license plate can be accurately screened and located. Finally, according to the format characteristics of different license plates, a variety of recognition processing schemes are proposed in a targeted manner, so that even if there is interference from non-license plate images in the rectangular image, the recognition result that meets the actual license plate number format and content requirements can be accurately and efficiently determined, ensuring that the embodiment of the present invention is accurate and effective in license plate recognition under harsh shooting environments.

[0069] Corresponding to the method of the above embodiment, Figure 6 A structural block diagram of a license plate recognition device provided by an embodiment of the present invention is shown. For ease of description, only the parts related to the embodiment of the present invention are shown. Figure 6 The exemplary license plate recognition device may be the execution subject of the license plate recognition method provided in the aforementioned first embodiment.

[0070] Reference Figure 6 , the license plate recognition device comprises:

[0071] The grayscale processing module 61 is used to perform grayscale processing on two target images whose shooting time interval is less than a preset time threshold, and calculate the average of the grayscale value differences of the pixels of the two target images after the grayscale processing.

[0072] The vehicle detection module 62 is used to extract a vehicle image containing a vehicle from the two target images based on the pixel gray value difference and the mean value.

[0073] The license plate positioning module 63 is used to perform grayscale binarization processing on the vehicle image and perform edge extraction to find a rectangular image whose border is closed to form a rectangle and whose aspect ratio is within a preset aspect ratio range.

[0074] The license plate recognition module 64 is used to perform character recognition on the rectangular image to obtain a license plate recognition result.

[0075] Furthermore, the license plate recognition module 64 includes:

[0076] The character recognition module is used to perform character recognition on the rectangular image, and match the Chinese characters in the obtained character recognition results with a preset Chinese character library to determine at least one Chinese character with the highest character matching degree.

[0077] An image matching module is used to match a preset Chinese character image library based on the character image corresponding to the Chinese character segmented from the rectangular image, and determine the Chinese character set corresponding to at least one Chinese character image with the highest image matching degree, wherein each Chinese character image in the Chinese character image library uniquely corresponds to a preset Chinese character.

[0078] The character determination module is used to determine the character recognition result corresponding to the character image based on the at least one Chinese character being the same as the Chinese character in the Chinese character set, and to update the character recognition result of the rectangular image.

[0079] Furthermore, the character determination module includes:

[0080] If the number of the same Chinese characters is greater than 1, the character matching degree and the image matching degree corresponding to the same Chinese characters are weighted based on a preset weight coefficient, and the Chinese character with the largest corresponding weight value is extracted as the character recognition result corresponding to the character image.

[0081] Furthermore, the license plate recognition module 64 further includes:

[0082] If the number of Chinese characters in the character recognition result of the rectangular image is equal to 1, the character recognition results that meet the preset license plate regular expression requirements are screened out from the character recognition results of the rectangular image to obtain the license plate recognition result.

[0083] Furthermore, the license plate recognition module 64 further includes:

[0084] If the number of Chinese characters in the character recognition result of the rectangular image is greater than 1, a preset license plate character string library is matched based on the character recognition result of the rectangular image to determine the license plate recognition result.

[0085] Furthermore, the license plate recognition module 64 further includes:

[0086] If the number of Chinese characters in the character recognition result of the rectangular image is greater than 1, a preset license plate image library is matched based on the rectangular image, and the license plate string corresponding to the license plate image with the highest matching degree is determined to obtain the license plate recognition result, wherein each license plate image in the license plate image library uniquely corresponds to a preset license plate string.

[0087] The process of each module in the license plate recognition device provided by the embodiment of the present invention realizing its own function can be specifically referred to the aforementioned Figure 1 The description of the first embodiment is not repeated here.

[0088] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0089] It should also be understood that, although the terms "first", "second" etc. are used to describe various elements in some embodiments of the present invention in the text, these elements should not be limited by these terms. These terms are only used to distinguish an element from another element. For example, the first contact can be named as the second contact, and similarly, the second contact can be named as the first contact, without departing from the scope of the various described embodiments. The first contact and the second contact are both contacts, but they are not the same contact.

[0090] Figure 7 Schematic diagram of a terminal device provided by an embodiment of the present invention. Figure 7 As shown, the terminal device 7 of this embodiment includes: a processor 70 and a memory 71, wherein the memory 71 stores a computer program 72 that can be run on the processor 70. When the processor 70 executes the computer program 72, the steps in the above-mentioned license plate recognition method embodiments are implemented, for example Figure 1 Alternatively, when the processor 70 executes the computer program 72, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 6 The functions of the modules 61 to 66 are shown.

[0091] The terminal device 7 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 It is only an example of the terminal device 7 and does not constitute a limitation on the terminal device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include an input sending device, a network access device, a bus, etc.

[0092] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0093] The memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or memory of the terminal device 7. The memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the terminal device 7. The memory 71 is used to store the computer program and other programs and data required by the terminal device. The memory 71 may also be used to temporarily store data that has been sent or is to be sent.

[0094] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0095] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0096] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A license plate recognition method, characterized in that: include: Grayscale processing is performed on two target images whose shooting time interval is less than a preset time threshold, and the average of the grayscale value differences of the pixels of the two target images after the grayscale processing is calculated; Based on the pixel grayscale value difference and the mean value, extracting a vehicle image containing a vehicle from the two target images; Performing grayscale binarization processing on the vehicle image and performing edge extraction to find a rectangular image whose border is closed to form a rectangle and whose aspect ratio is within a preset aspect ratio range; Performing character recognition on the rectangular image to obtain a license plate recognition result; The performing character recognition on the rectangular image includes: Performing character recognition on the rectangular image, and matching a preset Chinese character library based on Chinese characters in the obtained character recognition results to determine at least one Chinese character with the highest character matching degree; Based on the character images corresponding to the Chinese characters segmented from the rectangular image, matching is performed on a preset Chinese character image library, and a Chinese character set corresponding to at least one Chinese character image with the highest image matching degree is determined, wherein each Chinese character image in the Chinese character image library uniquely corresponds to a preset Chinese character; Based on the at least one Chinese character being the same as the Chinese character in the Chinese character set, determining a character recognition result corresponding to the character image, and updating the character recognition result of the rectangular image; The determining, based on the at least one Chinese character being the same as the Chinese character in the Chinese character set, a character recognition result corresponding to the character image comprises: If the number of the same Chinese characters is greater than 1, the character matching degree and the image matching degree corresponding to the same Chinese characters are weighted based on a preset weight coefficient, and the Chinese character with the largest corresponding weight value is extracted as the character recognition result corresponding to the character image.

2. The license plate recognition method according to claim 1, characterized in that: The performing character recognition on the rectangular image to obtain a license plate recognition result includes: If the number of Chinese characters in the character recognition result of the rectangular image is equal to 1, the character recognition results that meet the preset license plate regular expression requirements are screened out from the character recognition results of the rectangular image to obtain the license plate recognition result.

3. The license plate recognition method according to claim 1 or 2, characterized in that: The performing character recognition on the rectangular image to obtain a license plate recognition result also includes: If the number of Chinese characters in the character recognition result of the rectangular image is greater than 1, a preset license plate character string library is matched based on the character recognition result of the rectangular image to determine the license plate recognition result.

4. The license plate recognition method according to claim 1 or 2, characterized in that: The performing character recognition on the rectangular image to obtain a license plate recognition result also includes: If the number of Chinese characters in the character recognition result of the rectangular image is greater than 1, a preset license plate image library is matched based on the rectangular image, and the license plate string corresponding to the license plate image with the highest matching degree is determined to obtain the license plate recognition result, wherein each license plate image in the license plate image library uniquely corresponds to a preset license plate string.

5. A terminal device, characterized in that: The terminal device includes a memory and a processor, the memory stores a computer program that can be run on the processor, and the processor implements the following steps when executing the computer program: Grayscale processing is performed on two target images whose shooting time interval is less than a preset time threshold, and the average of the grayscale value differences of the pixels of the two target images after the grayscale processing is calculated; Based on the pixel grayscale value difference and the mean value, extracting a vehicle image containing a vehicle from the two target images; Performing grayscale binarization processing on the vehicle image and performing edge extraction to find a rectangular image whose border is closed to form a rectangle and whose aspect ratio is within a preset aspect ratio range; Performing character recognition on the rectangular image to obtain a license plate recognition result; The performing character recognition on the rectangular image includes: Performing character recognition on the rectangular image, and matching a preset Chinese character library based on Chinese characters in the obtained character recognition results to determine at least one Chinese character with the highest character matching degree; Based on the character images corresponding to the Chinese characters segmented from the rectangular image, matching is performed on a preset Chinese character image library, and a Chinese character set corresponding to at least one Chinese character image with the highest image matching degree is determined, wherein each Chinese character image in the Chinese character image library uniquely corresponds to a preset Chinese character; Based on the at least one Chinese character being the same as the Chinese character in the Chinese character set, determining a character recognition result corresponding to the character image, and updating the character recognition result of the rectangular image; The determining, based on the at least one Chinese character being the same as the Chinese character in the Chinese character set, a character recognition result corresponding to the character image comprises: If the number of the same Chinese characters is greater than 1, the character matching degree and the image matching degree corresponding to the same Chinese characters are weighted based on a preset weight coefficient, and the Chinese character with the largest corresponding weight value is extracted as the character recognition result corresponding to the character image.

6. The terminal device according to claim 5, characterized in that: The performing character recognition on the rectangular image to obtain a license plate recognition result includes: If the number of Chinese characters in the character recognition result of the rectangular image is greater than 1, a preset license plate image library is matched based on the rectangular image, and the license plate string corresponding to the license plate image with the highest matching degree is determined to obtain the license plate recognition result, wherein each license plate image in the license plate image library uniquely corresponds to a preset license plate string.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.