License plate recognition method, device, equipment and storage medium
By preprocessing, edge detection and character cutting of license plate images and combining them with BP neural network recognition technology, the problems of low license plate recognition accuracy and efficiency are solved, and efficient license plate recognition is achieved.
Patent Information
- Application Number
- CN202211625661.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-12-16
AI Technical Summary
Existing license plate recognition technology is affected by the uneven quality and diversity of license plate images, and its accuracy and efficiency are low.
The original license plate image is obtained for image preprocessing, the license plate area is located and the characters are cut, and edge detection is performed using wavelet transform and Radon transform, and character recognition is performed in combination with BP neural network.
It improves the accuracy and efficiency of license plate recognition, achieves precise positioning and character cutting of license plates, and improves the overall recognition effect.
Smart Images

Figure CN116052144B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a license plate recognition method, apparatus, device and storage medium. Background Art
[0002] License plate recognition systems have become a crucial component of traffic management systems. License plate recognition technology can be applied to various areas, including road traffic monitoring, traffic accident scene investigation, automatic traffic violation recording, highway speeding management systems, and intelligent residential management, providing efficient and practical services for intelligent traffic management. However, due to factors such as varying license plate image quality and the diverse range of license plate types, license plate recognition is currently difficult, with low accuracy and efficiency.
[0003] Therefore, how to improve the accuracy and efficiency of license plate recognition has become an urgent problem to be solved. Summary of the Invention
[0004] The embodiments of the present application provide a license plate recognition method, apparatus, device, and storage medium, which can improve the accuracy and efficiency of license plate recognition.
[0005] In a first aspect, an embodiment of the present application provides a license plate recognition method, the license plate recognition method comprising:
[0006] Obtain the original license plate image of the license plate to be recognized;
[0007] Performing image preprocessing on the original license plate image to obtain a processed license plate image;
[0008] performing license plate area positioning on the processed license plate image to obtain a target image corresponding to the license plate area;
[0009] Performing character segmentation on the target image to obtain a plurality of license plate characters;
[0010] Character recognition is performed on the plurality of license plate characters respectively, and license plate recognition is completed according to the character recognition results.
[0011] In a second aspect, an embodiment of the present application further provides a license plate recognition device, which includes a processor and a memory, wherein a computer program is stored in the memory, and the processor executes the above-mentioned license plate recognition method when calling the computer program in the memory.
[0012] In a third aspect, an embodiment of the present application further provides a device comprising the license plate recognition device as described above.
[0013] In a fourth aspect, an embodiment of the present application further provides a storage medium, which is used to store a computer program. When the computer program is executed by a processor, the processor implements the above-mentioned license plate recognition method.
[0014] The embodiments of the present application provide a license plate recognition method, apparatus, device and storage medium, which obtains the original license plate image of the license plate to be recognized, performs image preprocessing on the original license plate image to obtain a processed license plate image, and then locates the license plate area of the processed license plate image to obtain a target image corresponding to the license plate area, performs character segmentation on the target image to obtain multiple license plate characters, and then performs character recognition on the multiple license plate characters respectively, and completes license plate recognition based on the character recognition results, thereby improving the accuracy and efficiency of license plate recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0016] Figure 1 This is a flowchart showing the steps of a license plate recognition method provided by an embodiment of the present application;
[0017] Figure 2 This is a schematic flow chart of the steps for locating the license plate area of the processed license plate image provided by an embodiment of the present application;
[0018] Figure 3 It is a three-layer decomposition process diagram of a wavelet decomposition algorithm;
[0019] Figure 4 It is a schematic diagram of rotation processing using Radon transform method;
[0020] Figure 5 This is a schematic diagram of segmenting the character "Liao" provided in an embodiment of the present application;
[0021] Figure 6 This is a schematic diagram of a BP network provided in an embodiment of the present application;
[0022] Figure 7 This is a schematic diagram of a BP network training and recognition process provided by an embodiment of the present application;
[0023] Figure 8 This is a schematic block diagram of a license plate recognition device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of this application more clear, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0025] It should be noted that the terms "first," "second," etc., in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, features specified as "first" or "second" may explicitly or implicitly include at least one of these features.
[0026] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of the present application include a particular feature, structure, or characteristic described in conjunction with that embodiment. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in some embodiments" appearing in different places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0027] In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that ordinary technicians in this field can implement them. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0028] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0029] License plate recognition is a core component of the Intelligent Traffic System (ITS). With the widespread adoption and expansion of ITS, it has played a vital role in all aspects of life. For example, in travel, digital management makes traffic smoother and more efficient; in assisting management, vehicle images can be used to quickly locate vehicles; and it also provides a critical source of data for systems. The following are common applications of license plate recognition technology:
[0030] (1) Electronic eyes at urban traffic intersections
[0031] The surveillance equipment installed at intersections, known as the "Intelligent Traffic Violation Monitoring and Management System," monitors drivers' behavior and identifies license plates of vehicles violating traffic rules. These electronic eyes save labor costs and reduce the pressure on managers. Tighter oversight also reduces violations at the source, ensuring smoother and safer traffic.
[0032] (2) Parking lot fee management system
[0033] The essence of a parking lot management system is to use license plate recognition technology to charge, control and divert vehicles entering and leaving the lot, thereby reducing the cost of manual management and improving the efficiency of vehicle entry and exit.
[0034] (3) ETC (Electronic Toll Collection) system at highway toll stations
[0035] The ETC system on highways is essentially a toll collection system built on the basis of the license plate recognition system. It calculates the toll by taking into account the vehicle's entry and exit information, thus reducing the time consumption in manual links such as card issuance and collection from the source, and improving the traffic efficiency of vehicles during peak hours.
[0036] (4) Campus car speed reminder device
[0037] On university campuses, the population is dense and there should be strict speed limits on cars. Therefore, the car speed measuring device determines whether the vehicle is speeding by testing the speed at the detection point, and then notifies the owner to slow down based on the information logged when the vehicle enters the school, thereby playing an automatic and efficient role and ensuring the safety of school students.
[0038] Due to various factors such as uneven license plate image quality and diverse license plate types, license plate recognition is currently difficult, with low accuracy and efficiency.
[0039] In order to solve the above problems, the embodiments of the present application provide a license plate recognition method, device, equipment and storage medium, wherein the method obtains the original license plate image of the license plate to be identified, performs image preprocessing on the original license plate image, obtains a processed license plate image, and then locates the license plate area of the processed license plate image to obtain a target image corresponding to the license plate area, performs character cutting on the target image to obtain multiple license plate characters, and then performs character recognition on the multiple license plate characters respectively, and completes the license plate recognition according to the character recognition results, thereby improving the accuracy and efficiency of license plate recognition.
[0040] See also Figure 1 , Figure 1 : is a flow chart of the license plate recognition method provided in an embodiment of the present application. The method can be applied to a device, wherein the device can be any one of a mobile phone, a camera, a tablet computer, a wearable device, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, a personal computer (PC), a netbook, and a personal digital assistant (PDA), without any limitation in the embodiments of the present application.
[0041] like Figure 1 As shown, the license plate recognition method provided in the embodiment of the present application includes steps S101 to S105.
[0042] S101: Obtain an original license plate image of a license plate to be recognized.
[0043] For example, a camera is used to capture a vehicle to be identified, and a corresponding license plate image is obtained. For ease of description, the license plate image of the vehicle to be identified is referred to as an original license plate image.
[0044] For example, when a vehicle approaches a parking lot, it triggers a ground sensor and a vehicle sensor. Vehicle sensors in parking lot recognition systems typically use electromagnetic or infrared detection, which offer good interference resistance and stability. The vehicle sensor detects the approaching vehicle and activates a high-resolution camera to capture the vehicle. For example, the camera automatically adjusts the aperture based on environmental factors, such as light sensitivity, to obtain a high-quality, original license plate image.
[0045] It is understandable that it is also possible to collect license plate images corresponding to a large number of vehicles and save the license plate images corresponding to each vehicle, such as saving them in a corresponding database, and obtain the license plate image of the vehicle to be identified by querying the database.
[0046] Exemplarily, the license plate image may be in different types of picture formats, including but not limited to various formats such as *.JPG, *.PNG, etc. For example, in this embodiment, the original license plate image in *.JPG format is obtained.
[0047] S102: performing image preprocessing on the original license plate image to obtain a processed license plate image.
[0048] The original license plate image may contain image noise. Therefore, after obtaining the original license plate image of the license plate to be recognized, the original license plate image is subjected to image preprocessing. Image preprocessing includes but is not limited to image grayscale enhancement, image grayscale stretching, and image smoothing. By performing image preprocessing on the original license plate image, the image quality of the original license plate image is improved while preserving image details.
[0049] Exemplarily, grayscale processing is performed on the original license plate image to obtain a grayscale image. For example, grayscale processing is performed on the original license plate image using formula (1) to obtain a grayscale image.
[0050] Gray=α R R+α G G+α B B (1)
[0051] where α R , α G , α B They are the weights of R, G, and B, using different α R , α G , α B The value of will produce different grayscale images. For example, G =0.587,α R =0.299,α B =0.114, it should be noted that α R , α G , α B The specific value of can be flexibly set according to actual conditions and is not specifically limited in this application.
[0052] The grayscale image obtained by grayscale processing has grayscale values concentrated in a small range, with low boundary contrast and blurred boundaries, which affects the accuracy of license plate recognition. Therefore, according to the grayscale distribution of the grayscale histogram of the grayscale image, the grayscale image is grayscale stretched. For example, the grayscale image is grayscale stretched according to the following formula (2):
[0053] G(x,y)=[(t2-t1) / (s2-s1)]g(x,y)+t (2)
[0054] Where g(x,y) is the grayscale value at a point (x,y) in the image before grayscale stretching, G(x,y) is the grayscale value at the same point (x,y) after grayscale stretching, [s1,s2] is the range of g(x,y), [t1,t2] is the range of G(x,y), and t is the grayscale variable parameter. After grayscale stretching, a grayscale image with clearer contrast is obtained.
[0055] Afterwards, the grayscale image is enhanced to obtain a grayscale enhanced image. Exemplarily, the image enhancement is performed using a morphological processing method.
[0056] There may still be some individual noise points in the grayscale enhanced image. In order to eliminate or suppress these noise points, an image smoothing filter is used to perform image smoothing processing on the grayscale enhanced image to remove the noise points.
[0057] For example, an 8-neighborhood is used to sort the 8 grayscale pixels around the center point, and the median is taken as the new pixel point in the middle. The sliding window is moved up, down, left, and right on the image to traverse the entire image and obtain a good image smoothing effect.
[0058] S103 , performing license plate area positioning on the processed license plate image to obtain a target image corresponding to the license plate area.
[0059] In many images, the license plate does not occupy the entire image. To account for this, we locate the license plate region in the processed license plate image and obtain the image corresponding to the license plate region. For ease of description, the image corresponding to the license plate region is referred to as the target image below.
[0060] In some embodiments, as Figure 2 As shown, step S103 may include sub-step S1031 and sub-step S1032.
[0061] S1031. Perform edge detection on the license plate area of the processed license plate image to preliminarily locate the license plate area.
[0062] Edges exist between regions, including regional decomposition caused by different colors, between background and target, and between targets. The purpose of edge detection is mainly to accurately detect edges. For example, edge enhancement operators are used to detect the edge of the license plate area, highlight the boundary of the license plate area in the image, and perform preliminary positioning of the license plate area.
[0063] In some embodiments, the edge detection of the license plate area of the processed license plate image to preliminarily locate the license plate area includes: using wavelet transform to perform edge detection of the license plate area of the processed license plate image, obtaining high-frequency components of the processed license plate image in different scales and directions, and preliminarily locating the license plate area based on the high-frequency components.
[0064] For example, the license plate region edge detection based on wavelet transform mainly uses the multiresolution analysis property of wavelet transform and the Mallat wavelet decomposition algorithm.
[0065] In multi-resolution analysis, orthogonal wavelets can be regarded as a set of mirror filtering processes, that is, the signal is passed through a high-pass filter and a low-pass filter respectively. The result obtained by the high-pass filter is the high-frequency part of the output signal, also called the detail component. Similarly, the result obtained by the low-pass filter is the low-frequency part of the output signal, also called the approximate component. The algorithm corresponding to this process is the Mallat wavelet decomposition algorithm.
[0066] For example, Figure 3 As shown, Figure 3 It is the three-level decomposition process of the wavelet decomposition algorithm, where S is the total frequency band space of the original signal, CA is the approximate component (low-frequency information), CD is the detail component (high-frequency information), CA1 and CD1 represent the two subspaces of the first-level decomposition, CA2 and CD2 represent the two subspaces of the second-level decomposition, and CA3 and CD3 represent the two subspaces of the third-level decomposition.
[0067] according to Figure 3 It can be seen that the multi-frequency analysis of the next level only decomposes the approximate components of the previous level, and no longer decomposes the detailed components. The decomposition process can be obtained as follows:
[0068] S=CD1+CD2+CD3+CA3 (3)
[0069] The Mallat wavelet decomposition algorithm is used to decompose the license plate image into two components: an approximate component and a detail component. Because the vertical details of the license plate area are richer than the horizontal details, and interference information is often richer in horizontal information, the detail component (high-frequency portion) of the image should contain the license plate area. The Mallat wavelet decomposition algorithm obtains high-frequency and low-frequency components of the license plate image at different scales and directions. The high-frequency component, also known as the detail component, can be used to locate the license plate.
[0070] The license plate region obtained by wavelet transform has clear edges, but the license plate region is not continuous. For example, a license plate region positioning algorithm based on morphological processing is performed to obtain a connected license plate region.
[0071] S1032. Performing horizontal and vertical positioning on the license plate area based on the preliminary positioning result to accurately position the license plate area.
[0072] The license plate area is initially positioned, and the non-license plate area is basically removed. In order to locate the license plate more accurately, based on the preliminary positioning results, the license plate area is further positioned horizontally and vertically to achieve precise positioning of the license plate area.
[0073] In some embodiments, the license plate area is laterally and longitudinally positioned based on the preliminary positioning results to accurately position the license plate area, including: using a projection method to laterally and longitudinally position the license plate area, and combining the lateral positioning results and the longitudinal positioning results to accurately position the license plate area.
[0074] The lateral positioning of the license plate is exemplarily performed by a first-order difference operation in the horizontal direction. For example, the grayscale image f(i, j) is subjected to a first-order difference operation according to the following formula (4) to obtain g(i, j):
[0075] g(i,j)=|f(i,j)-f(i,j+1)| (4)
[0076] Wherein, i=1,2,3,...,m, m is the height of the image; j=1,2,3,...,n, n is the width of the image.
[0077] The image obtained after the first-order difference operation is projected onto the value after the horizontal summation. For example, the function T(i) is obtained by projecting the value after the horizontal summation using the following formula (5):
[0078]
[0079] For example, the image is further smoothed. For example, the smoothing process is performed by taking the average of the three values before and after. That is, the smoothing process is performed by the following formula (6):
[0080] T(i)=(T(i-1)+T(i)+T(i+1)) / 3 (6)
[0081] Perform up and down searches to obtain horizontal edges. When searching for the upper edge, search the data from top to bottom. When the first non-zero value is found, this point is the upper boundary. When searching for the lower boundary, perform a search from bottom to top to obtain the lower boundary.
[0082] The longitudinal positioning of the license plate is essentially the same as the lateral positioning method. The first step is to perform a first-order difference operation. For example, the grayscale image f(i, j) is subjected to a first-order difference operation using the following formula (7) to obtain g(i, j):
[0083] g(i,j)=|f(i,j)-f(i+1,j)| (7)
[0084] The image obtained after the first-order difference operation is then projected onto the summed value in the vertical direction.
[0085] Compared with the horizontal projection, the vertical projection has more peak groups rather than a single peak, and there is a clear gap. The peaks in the non-license plate area are significantly different from those in the license plate area. The license plate area has a higher peak. The highest peak multiplied by parameter a is selected as the left threshold, and the highest peak multiplied by parameter b is selected as the right threshold, where a and b are values within 1. For example, a is 0.6 and b is 0.5. The specific values of a and b are not limited in this application. Analogously to the horizontal projection method, find the first point that appears above the left threshold as the left boundary, and the last point that appears above the right threshold as the right boundary.
[0086] The area obtained by determining the upper boundary, lower boundary, left boundary, and right boundary is the located license plate area.
[0087] In some embodiments, the license plate may have a certain tilt angle, in which case rotation processing is required. For example, the tilt angle is calculated using Radon transform method, and the rotation processing is performed based on the tilt angle. For example, Figure 4 As shown, Figure (a) is the image IM tilted at an angle of θ, and Figure (b) is the image IM' after the image IM is rotated by the Radon transform method.
[0088] S104: Perform character segmentation on the target image to obtain a plurality of license plate characters.
[0089] After obtaining a target image with the license plate area accurately located, the target image is segmented, that is, the license plate is segmented to separate each individual character in the license plate. For example, different characters are distinguished based on their corresponding size, shape, color, grayscale, structure, and other characteristics. Then, segmentation is performed based on character boundary features to obtain multiple license plate characters corresponding to the license plate to be recognized.
[0090] In some embodiments, performing character cutting on the target image to obtain a plurality of license plate characters includes: performing character cutting on the target image using a projection segmentation method to obtain a plurality of license plate characters; or performing character cutting on the target image according to corresponding proportions to obtain a plurality of license plate characters.
[0091] In one implementation, the target image is directly cut into characters according to corresponding proportions to obtain a plurality of license plate characters.
[0092] Directly cutting characters in proportion may result in inaccurate character cutting. In order to perform accurate character cutting, the projection segmentation method is used to cut the target image into characters to obtain multiple license plate characters corresponding to the license plate.
[0093] The characters in the target image are all composed of white pixels, while there are no white pixels or very few in the interval part. The projection method is used to segment characters. First, the vertical projection is calculated, that is, the sum of the number of white pixels in each column. The obtained projection image has many concentrated peaks, and the width of each peak is the width of the corresponding character. Therefore, the position and boundary of each character can be obtained, and then segmentation can be carried out.
[0094] In some embodiments, the projection segmentation method is used to cut the characters of the target image to obtain a plurality of the license plate characters, including: performing vertical projection on the target image by using the projection segmentation method; if the interval between adjacent connected components in the projection is greater than a preset interval threshold, then cutting the corresponding area of the adjacent connected components to obtain a plurality of the license plate characters.
[0095] In the actual scenario, non-character objects such as screws and license plate frames that are very close to the license plate characters may also be located in the license plate area. Or, there are non-connected areas in a character. For example, characters such as "川" and "辽" may be cut into multiple characters. For example, Figure 5 As shown in the "辽" character, it may be cut into two characters, "辶" and "了".
[0096] In order to perform accurate character cutting, a preset interval threshold between compliant characters is set. After the vertical projection operation is completed, the interval between each connected component is obtained, and the interval between each connected component and the preset interval threshold is compared. When the interval between two adjacent connected components is greater than the preset interval threshold, it means that the corresponding area contains two characters, and the area is cut; on the contrary, when the interval between two adjacent connected components is less than or equal to the preset interval threshold, it means that the corresponding area is a whole and only contains one character, and the area is not cut, so as to achieve accurate cutting of characters.
[0097] Exemplarily, due to various reasons such as the position and angle of shooting of the license plate image, the sizes of the cut characters may be different, which affects the accuracy of subsequent character recognition. Therefore, before character recognition, the characters are normalized.
[0098] For example, let the original image function be f(x, y), the normalized new image function be g(x, y), the point (x0, y0) be a point in the function g(x, y), and the corresponding point in f(x, y) be (x1, y1). The gray value of g(x0, y0) is obtained by weighting the points in the 4-neighborhood of (x1, y1) in the original image, that is, formula (8):
[0099] g(x,y)=(1-α)(1-β)f(i,j)+α(1-β)f(i+1,j)+(1-α)βf(i,j+1)+αβf(i+1,j+1)(8)
[0100] Where i and j are the integer values of (x1, y1), α = x1-i, and β = y1-j.
[0101] S105 , performing character recognition on the plurality of license plate characters respectively, and completing license plate recognition according to the character recognition results.
[0102] The last step is to perform character recognition on the obtained multiple characters, obtain the character recognition results of each character, and complete the license plate recognition based on the character recognition results of each character.
[0103] In some embodiments, the performing character recognition on the plurality of license plate characters respectively includes:
[0104] Performing character recognition on the plurality of license plate characters respectively using a template matching method to obtain a character recognition result; or
[0105] Each license plate character is input into the trained neural network model for character recognition, and the character recognition result is output.
[0106] Exemplarily, character templates corresponding to various characters are pre-configured, and template matching is used to calculate the similarity between the obtained images of each character and the binary images corresponding to the character templates. The character template with the highest similarity is the matched and recognized character.
[0107] In other embodiments, a trained neural network model is obtained by training the neural network model. For example, the neural network model includes but is not limited to a BP (Back-Propagation Neural Network) network. Figure 6 As shown in the figure, the BP network is a back propagation algorithm that feeds back the error value. It consists of three parts: the input layer, the hidden layer, and the output layer. Its neuron transfer function is the Sigmoid activation function.
[0108] Since it is necessary to complete the recognition of Chinese characters, numbers, and English characters and the function of distinguishing the three, illustratively, four BP networks are used to complete the recognition, and all BP networks are three-layered.
[0109] The number of neuron nodes in the input layer depends on the feature dimension obtained after the image is segmented and normalized. For example, the number of neuron nodes in the input layer is 30*60. It should be noted that the number of neuron nodes in the input layer is not specifically limited in this application.
[0110] The more hidden layer neurons there are, the more accurate the network will be, but the cost is that training time will be longer. However, if there are too many hidden layer neurons, overfitting will occur, which will greatly reduce recognition accuracy. Therefore, the rule for determining the number of hidden layer neurons is to use as few neurons as possible while meeting the accuracy requirements of the design standards.
[0111] The number of neuron nodes in the output layer depends on the type of output and the desired output method, that is, the encoding of the expected output type. For example, the network used to distinguish whether the characters are Chinese characters, numbers or English characters has 3 expected output results, so only three codes are needed to complete it, such as (0,0), (0,1), (1,0), so the number of neuron nodes required is 2. The output of the network used to recognize numbers requires 10 results corresponding to the numbers 0-9 respectively. Gray code is used for encoding in this experimental design, and the number of neuron nodes required is 4. The output of the network used to recognize English letters requires 26 results corresponding to the numbers AZ respectively, and 5-bit binary encoding is required, so the number of neuron nodes required is 5. There are 54 output results for recognizing Chinese characters, so the same six-bit binary encoding method as above is used, that is, the number of neuron nodes required is 6.
[0112] After constructing the BP network, it is then trained. For example, Figure 7 As shown in the figure, the training sample image is input into the BP network for training. After multiple rounds of iterative training, the mean square error generated by comparing the output of the BP network with the sample image is minimized. The threshold and weight are continuously adjusted to obtain a trained BP network.
[0113] Afterwards, the characters to be recognized obtained by character segmentation, that is, the data to be recognized, are input into the trained BP network for character recognition, and the character recognition results are output.
[0114] In the above embodiment, the original license plate image of the license plate to be identified is obtained, image preprocessing is performed on the original license plate image to obtain a processed license plate image, and then the license plate area is located on the processed license plate image to obtain a target image corresponding to the license plate area, and the target image is subjected to character segmentation to obtain multiple license plate characters. Thereafter, character recognition is performed on the multiple license plate characters respectively, and license plate recognition is completed based on the character recognition results, thereby improving the accuracy and efficiency of license plate recognition.
[0115] See also Figure 8 , Figure 8 A schematic block diagram of a license plate recognition device provided in an embodiment of the present application.
[0116] like Figure 8As shown, the license plate recognition device 200 may include a processor 211 and a memory 212 , and the processor 211 and the memory 212 are connected via a bus, such as an I2C (Inter-integrated Circuit) bus.
[0117] Specifically, the processor 211 may be a micro-controller unit (MCU), a central processing unit (CPU), or a digital signal processor (DSP).
[0118] Specifically, the memory 212 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk, etc. The memory 212 stores various computer programs for execution by the processor 211 .
[0119] The processor 211 is configured to run a computer program stored in the memory processor 211 and implement the following steps when executing the computer program:
[0120] Obtain the original license plate image of the license plate to be recognized;
[0121] Performing image preprocessing on the original license plate image to obtain a processed license plate image;
[0122] performing license plate area positioning on the processed license plate image to obtain a target image corresponding to the license plate area;
[0123] Performing character segmentation on the target image to obtain a plurality of license plate characters;
[0124] Character recognition is performed on the plurality of license plate characters respectively, and license plate recognition is completed according to the character recognition results.
[0125] In some embodiments, when performing license plate area positioning on the processed license plate image to obtain a target image corresponding to the license plate area, the processor 211 is configured to implement:
[0126] Performing edge detection on the license plate area of the processed license plate image to preliminarily locate the license plate area;
[0127] The license plate area is positioned horizontally and vertically based on the preliminary positioning result to accurately position the license plate area.
[0128] In some embodiments, when performing edge detection on the processed license plate image to preliminarily locate the license plate area, the processor 211 is configured to implement:
[0129] The processed license plate image is subjected to edge detection of the license plate region by using wavelet transform to obtain high-frequency components of the processed license plate image in different scales and directions, and the license plate region is preliminarily located based on the high-frequency components.
[0130] In some embodiments, when performing the horizontal and vertical positioning of the license plate area based on the preliminary positioning result to accurately position the license plate area, the processor 211 is configured to implement:
[0131] The license plate area is positioned horizontally and vertically using a projection method, and the license plate area is accurately positioned by combining the horizontal positioning results and the vertical positioning results.
[0132] In some embodiments, when performing character segmentation on the target image to obtain a plurality of license plate characters, the processor 211 is configured to implement:
[0133] Performing character segmentation on the target image using a projection segmentation method to obtain a plurality of license plate characters; or
[0134] The target image is cut into characters according to a corresponding ratio to obtain a plurality of license plate characters.
[0135] In some embodiments, when implementing the use of the projection segmentation method to perform character segmentation on the target image to obtain the plurality of license plate characters, the processor 211 is configured to implement:
[0136] The target image is vertically projected using a projection segmentation method. If the interval between adjacent connected domains in the projection is greater than a preset interval threshold, the corresponding areas of the adjacent connected domains are segmented to obtain a plurality of license plate characters.
[0137] In some embodiments, when implementing the character recognition of the plurality of license plate characters respectively, the processor 211 is configured to implement:
[0138] Performing character recognition on the plurality of license plate characters respectively using a template matching method to obtain a character recognition result; or
[0139] Each license plate character is input into the trained neural network model for character recognition, and the character recognition result is output.
[0140] A device is also provided in an embodiment of the present application. The types of the device include but are not limited to mobile phones, cameras, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, personal computers (PCs), netbooks, personal digital assistants (PDAs), etc., and no restrictions are imposed in the embodiments of the present application.
[0141] The device includes a license plate recognition device. For example, the license plate recognition device can be the license plate recognition device 200 described in the above embodiment. The device can execute any of the license plate recognition methods provided in the embodiments of the present application, and thus can achieve the beneficial effects achieved by any of the license plate recognition methods provided in the embodiments of the present application. For details, please refer to the previous embodiments and will not be repeated here.
[0142] The present application also provides a storage medium that stores a computer program. The computer program includes program instructions, and the processor executes the program instructions to implement the steps of the license plate recognition method provided in the above embodiment. For example, the computer program is loaded by the processor and can execute the following steps:
[0143] Obtain the original license plate image of the license plate to be recognized;
[0144] Performing image preprocessing on the original license plate image to obtain a processed license plate image;
[0145] performing license plate area positioning on the processed license plate image to obtain a target image corresponding to the license plate area;
[0146] Performing character segmentation on the target image to obtain a plurality of license plate characters;
[0147] Character recognition is performed on the plurality of license plate characters respectively, and license plate recognition is completed according to the character recognition results.
[0148] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0149] The storage medium may be an internal storage unit of the license plate recognition device or apparatus of the aforementioned embodiment, such as a hard disk or memory of the license plate recognition device or apparatus. The storage medium may also be an external storage device of the license plate recognition device or apparatus, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., provided on the license plate recognition device or apparatus.
[0150] Since the computer program stored in the storage medium can execute any license plate recognition method provided in the embodiments of the present application, the beneficial effects that can be achieved by any license plate recognition method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0151] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A license plate recognition method, characterized in that: The license plate recognition method comprises: Obtain the original license plate image of the license plate to be recognized; Performing image preprocessing on the original license plate image to obtain a processed license plate image; performing license plate area positioning on the processed license plate image to obtain a target image corresponding to the license plate area; Performing character segmentation on the target image to obtain a plurality of license plate characters; Performing character recognition on the plurality of license plate characters respectively, and completing license plate recognition according to the character recognition results; The performing license plate area positioning on the processed license plate image includes: Performing edge detection on the processed license plate image to preliminarily locate the license plate area, including: performing edge detection on the processed license plate image using wavelet transform to obtain high-frequency components of the processed license plate image at different scales and directions, preliminarily locating the license plate area based on the high-frequency components, and performing a license plate area positioning algorithm based on morphological processing to obtain the license plate area in a connected area; The step of performing character segmentation on the target image to obtain a plurality of license plate characters includes: Different characters are distinguished according to a plurality of features corresponding to the characters, and then cut according to the character boundary features to obtain a plurality of license plate characters, wherein the features include character size, shape, color, grayscale, and structure; The target image is vertically projected using a projection segmentation method. If the interval between adjacent connected domains in the projection is greater than a preset interval threshold, the corresponding areas of the adjacent connected domains are segmented to obtain a plurality of license plate characters.
2. The method according to claim 1, characterized in that After performing edge detection on the processed license plate image to preliminarily locate the license plate area, the method further includes: The license plate area is positioned horizontally and vertically based on the preliminary positioning result to accurately position the license plate area.
3. The method according to claim 2, characterized in that The performing horizontal positioning and vertical positioning of the license plate area based on the preliminary positioning result to accurately position the license plate area includes: The license plate area is positioned horizontally and vertically using a projection method, and the license plate area is accurately positioned by combining the horizontal positioning results and the vertical positioning results.
4. The method according to any one of claims 1 to 3, characterized in that The performing character recognition on the plurality of license plate characters respectively includes: Performing character recognition on the plurality of license plate characters respectively using a template matching method to obtain a character recognition result; or Each license plate character is input into the trained neural network model for character recognition, and the character recognition result is output.
5. A license plate recognition device, characterized in that: The license plate recognition device includes a processor and a memory, wherein the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, the license plate recognition method according to any one of claims 1 to 4 is implemented.
6. A device, characterized in that The device comprises the license plate recognition apparatus as claimed in claim 5.
7. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the license plate recognition method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Low-illumination complicated background license plate positioning method based on wavelet transform and SVM
CN106407959A
Template matching and neural network algorithm-combined license plate recognition method
CN108615034A