License plate recognition method and device
By recognizing the probability information of characters in license plate images and setting thresholds, combined with the average probability optimization of multiple frames of images, the problem of low accuracy in license plate recognition caused by occlusion or reflection is solved, and higher recognition accuracy is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-24
- Publication Date
- 2026-03-20
AI Technical Summary
In existing technologies, license plate recognition suffers from low accuracy due to characters being obscured or reflecting light.
By acquiring license plate images, the probability information of each character position is identified, and a first probability threshold is set to ensure that the character position probability is greater than the threshold before being stitched into license plate information. At the same time, the average probability of multiple frames of images and the adjustment parameters are used to optimize the recognition results and eliminate the influence of occlusion or reflection.
It improves the accuracy of license plate information recognition, ensuring that the recognized characters generate license plate information when they are not obscured or reflective, thus enhancing the reliability of the recognition.
Smart Images

Figure CN115393836B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a license plate recognition method and device. BACKGROUND
[0002] With the rapid development of image processing technology, license plate information of a vehicle can also be recognized from an image. The image can be captured by a camera arranged at a road, an entrance of a parking lot, or the like. The license plate information recognized from an image captured by a camera located on a road can be used for accurate traffic management of the vehicle. The license plate information recognized from an image captured by a camera located at an entrance of a parking lot can be used to open the entrance of the parking lot and record the time of entry of the vehicle. The license plate information recognized from an image captured by a camera located at an exit of a parking lot can be used to find the time of entry corresponding to the license plate information, so as to perform fee settlement and open the exit of the parking lot.
[0003] In the above scenarios, how to ensure the recognition accuracy of the license plate is a problem to be solved. SUMMARY
[0004] The present application provides a license plate recognition method and device to improve the recognition accuracy of the license plate.
[0005] In a first aspect, the present application provides a license plate recognition method, comprising:
[0006] obtaining a first image, wherein the first image includes a license plate;
[0007] recognizing the first image to obtain character probability information of the license plate, wherein the character probability information includes: a first character corresponding to each character position, and a first probability that each character position is the first character, wherein the probability that the character position is the first character is greater than the probability that the character position is any other character;
[0008] if the first probability of each character position in the license plate is greater than a first probability threshold of the first character corresponding to each character position, then the first character corresponding to each character position is spliced into license plate information, wherein the first probability threshold of a character is determined according to the probability that the character is recognized from a second image, and the clarity of the character in the second image is greater than a preset clarity.
[0009] Optionally, a plurality of character positions in the license plate are divided into a first character position and a second character position, wherein the first probability corresponding to the first character position is greater than a first probability threshold of the first character corresponding to the first character position, the first probability corresponding to the second character position is less than or equal to a first probability threshold of the first character corresponding to the second character position, and greater than a second probability threshold of the first character corresponding to the second character position.
[0010] The method further comprises:
[0011] For each of the at least two second characters, determining a probability that the second character position is the average probability of the second character in at least two images, the at least two images comprising the first image and a third image, the third image being taken at a different time from the first image for the same vehicle, the second probability threshold of a character being determined according to a probability of identifying the character from the second image, the second probability threshold of a character being less than the first probability threshold of the character;
[0012] If the maximum average probability corresponding to the second character position is greater than the first probability threshold of the second character corresponding to the maximum average probability, the first character of the first character position and the second character corresponding to the maximum average probability are spliced as license plate information;
[0013] If the maximum average probability corresponding to the second character position is less than or equal to the first probability threshold of the second character corresponding to the maximum average probability, it is determined that the license plate is blocked.
[0014] Optionally, the method further comprises:
[0015] If the first probability of at least one of the character positions is less than or equal to the second probability threshold of the first character corresponding to the character position, it is determined that the license plate is blocked, the second probability threshold of a character being determined according to a probability of identifying the character from the second image, the second probability threshold of a character being less than the first probability threshold of the character.
[0016] Optionally, the first probability threshold of a character is determined by a first function, an input of the first function being a probability of identifying the character from the second image and a first preset threshold, the first function being a monotonically increasing function.
[0017] Optionally, the second probability threshold of a character is determined by a second function, an input of the second function being a probability of identifying the character from the second image and a second preset threshold, the second function being a monotonically increasing function, the second preset threshold being less than the first preset threshold.
[0018] Optionally, if the first probability of each of the character positions is greater than the first probability threshold of the first character corresponding to the character position, before splicing the first character corresponding to each of the character positions as license plate information, the method further comprises:
[0019] determine a first adjustment parameter according to a difference between the first probability of the third character position and a probability of identifying the first character corresponding to the third character position from the second image, the third character position being at least two character positions with a larger first probability of the first character;
[0020] adjust the first probability by the first adjustment parameter.
[0021] Optionally, the determining, for each of the at least two second characters, the average probability of the second character position being the second character in the at least two images comprises:
[0022] determining, for each of the at least two second characters, a second probability of the second character position being the second character in the at least two images respectively;
[0023] determining, for each of the images, a second adjustment parameter of the image according to a difference between the second probability of each of the second character positions being the second character in the image and a probability of identifying each of the second characters from the second image;
[0024] adjusting, for each of the images, the second probability corresponding to the image by the second adjustment parameter of the image;
[0025] determining the average probability of the second character position being the second character in the at least two images according to the adjusted second probability.
[0026] In a second aspect, the present application provides an electronic device comprising:
[0027] a first image acquisition module configured to acquire a first image, the first image comprising a license plate;
[0028] a character probability information identification module configured to identify the first image to obtain character probability information of the license plate, the character probability information comprising: a first character corresponding to each character position, and a first probability of each character position being the first character, the probability of the character position being the first character being larger than the probability of the character position being other characters;
[0029] a license plate information determination module configured to, if the first probability of each character position in the license plate is greater than a first probability threshold of the first character corresponding to the character position, concatenate the first character corresponding to each of the character positions as license plate information, the first probability threshold of a character being determined according to a probability of identifying the character from a second image, the character in the second image having a clarity greater than a preset clarity.
[0030] Optionally, the plurality of character positions in the license plate are divided into first character positions and second character positions, the first probability corresponding to the first character positions is greater than a first probability threshold of the first character corresponding to the first character positions, the first probability corresponding to the second character positions is less than or equal to a first probability threshold of the first character corresponding to the second character positions and greater than a second probability threshold of the first character corresponding to the second character positions.
[0031] The electronic device further includes:
[0032] The first average probability determination module is configured to determine, for each of the at least two second characters, an average probability of the second character position being the second character in at least two images, the at least two images including the first image and a third image, the third image being taken at different times for the same vehicle as the first image, the second probability threshold of a character being determined according to a probability of identifying the character from the second image, the second probability threshold of the character being less than the first probability threshold of the character.
[0033] The third license plate information determination module is configured to, if the maximum average probability corresponding to the second character position is greater than the first probability threshold of the second character corresponding to the maximum average probability, concatenate the first character of the first character position and the second character corresponding to the maximum average probability as license plate information.
[0034] The first license plate occlusion determination module is configured to, if the maximum average probability corresponding to the second character position is less than or equal to the first probability threshold of the second character corresponding to the maximum average probability, determine that the license plate is occluded.
[0035] Optionally, the electronic device further includes:
[0036] The second license plate occlusion determination module is configured to, if the first probability of at least one of the character positions is less than or equal to the second probability threshold of the first character corresponding to the character position, determine that the license plate is occluded, the second probability threshold of a character being determined according to a probability of identifying the character from the second image, the second probability threshold of the character being less than the first probability threshold of the character.
[0037] Optionally, the first probability threshold of a character is determined by a first function, an input of the first function being a probability of identifying the character from the second image and a first preset threshold, the first function being a monotonically increasing function.
[0038] Optionally, the second probability threshold of a character is determined by a second function, an input of the second function is a probability of recognizing the character from the second image and a second preset threshold, the second function is a monotonically increasing function, and the second preset threshold is less than the first preset threshold.
[0039] Optionally, the electronic device further comprises:
[0040] The first adjustment parameter determination module is configured to determine a first adjustment parameter according to a difference between the first probability of the third character position and a probability of recognizing the first character corresponding to the third character position from the second image before the first character corresponding to each of the character positions is spliced into the license plate information, the third character position being at least two character positions with a larger first probability.
[0041] The first adjustment module is configured to adjust the first probability by the first adjustment parameter.
[0042] Optionally, the second average probability determination module is further configured to:
[0043] For each of the at least two second characters, determine a second probability of the second character position being the second character in each of the at least two images;
[0044] For each of the images, determine a second adjustment parameter of the image according to a difference between the second probability of each of the second character positions being the second character in the image and a probability of recognizing each of the second characters from the second image;
[0045] For each of the images, adjust the second probability corresponding to the image by the second adjustment parameter of the image;
[0046] Determine an average probability of the second character position being the second character in the at least two images according to the adjusted second probability.
[0047] In a third aspect, the present application provides an electronic device, comprising: a memory, a processor;
[0048] a memory; a memory for storing computer execution instructions;
[0049] When the processor executes the computer execution instructions, the electronic device realizes the method of the first aspect.
[0050] In a fourth aspect, the present application provides a computer program for realizing the method of the first aspect.
[0051] In a fifth aspect, the present application provides a computer readable storage medium, wherein computer executable instructions are stored in the computer readable storage medium, and when the computer executable instructions in the computer readable storage medium are executed by a processor of an electronic device, the electronic device implements the method in the first aspect.
[0052] The present application provides a license plate recognition method and device, the method comprising: obtaining a first image, the first image comprising a license plate; identifying the first image to obtain character probability information of the license plate, the character probability information comprising: a first character corresponding to each character position, and a first probability of each character position being the first character, the probability of the character position being the first character being greater than the probability of the character position being other characters; if the first probability of each character position in the license plate is greater than a first probability threshold of the first character corresponding to each character position, then splicing the first character corresponding to each character position as license plate information, the first probability threshold of a character being determined according to the probability of identifying the character from a second image, the clarity of the character in the second image being greater than a preset clarity. The present application can determine whether each character in the license plate information is reliable through the first probability threshold, and in the case of reliability, each character is taken as license plate information, thereby improving the recognition accuracy of the license plate information. BRIEF DESCRIPTION OF DRAWINGS
[0053] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
[0054] Figure 1 An exemplary license plate recognition scene is shown to which the embodiments of the present application are applicable;
[0055] Figure 2 An exemplary license plate information recognition process is shown according to the prior art;
[0056] Figure 3 An exemplary diagram showing the recognizability of each character position in a license plate at different times is shown;
[0057] Figure 4 An exemplary step flowchart of a license plate recognition method according to the embodiments of the present application is shown;
[0058] Figure 5 An exemplary structural block diagram of an electronic device according to the embodiments of the present application is shown;
[0059] Figure 6 An exemplary structural block diagram of another electronic device according to the embodiments of the present application is shown.
[0060] The specific embodiments of the present application have been shown and described in the above drawings and specification, it is to be understood that the application is not limited to the embodiments disclosed, but rather can be practiced with modification and alteration within the scope of the appended claims. Accordingly, the specification and drawings are to be regarded as illustrative in nature and not as restrictive. DETAILED DESCRIPTION
[0061] The illustrative examples set forth herein will vary from one another in different ways. Some of the examples are described below and further described in the detailed description of the application that follows. The following description is not to be taken in a limiting sense, but is made merely for the purpose of illustrating the general principles of the application.
[0062] Figure 1 An example shows a schematic diagram of a license plate recognition scenario to which the embodiments of the present application are applicable. Referring to Figure 1 As shown, the license plate recognition technology needs an image acquisition device and a computing device. The image acquisition device is used to take pictures of vehicles to obtain images of the vehicles. The image acquisition device is in communication connection with the computing device to send the taken images to the computing device. The computing device is used to recognize license plate information from the images.
[0063] The license plate information includes, but is not limited to, Chinese characters, English letters, Arabic numerals, and license plate colors. The license plate recognition technology is based on digital image processing, pattern recognition, computer vision, etc., and can be widely applied to traffic management, unattended parking lots, vehicle positioning, car theft prevention, highway tolls, etc.
[0064] Figure 2 An example shows a schematic diagram of a license plate information recognition process provided by the prior art. Referring to Figure 2 As shown, first, a pixel region where the license plate is located is extracted from the image to obtain a license plate image; then, the license plate image is corrected to obtain a rectangular license plate image, which can include, but is not limited to, rotating the license plate image, pixel padding, etc.; finally, license plate information is recognized from the rectangular license plate image.
[0065] However, in the process of recognizing the license plate information in actual application, the positions of some characters in the license plate have low recognizability due to some reasons. For example, the positions of some characters in the license plate are blocked by the front vehicle during the movement of the vehicle, resulting in low recognizability of the positions of the characters. For another example, the positions of some characters in the license plate in the image have glare, resulting in low recognizability of the positions of the characters. In this case, the accuracy of the obtained license plate information is low.
[0066] In practical application, the positions of the characters that are blocked or reflected light may be different at different times due to the continuous movement of the vehicle. Figure 3 An example shows a schematic diagram of the recognizability of the positions of the characters in a license plate at different times. Referring to Figure 3 As shown, the area formed by the dashed line is a blocked area or a reflected light area. At time t1, the third character position and the fourth character position in the license plate are blocked or reflected light, so the probabilities that the third character position and the fourth character position correspond to one character are small, i.e., the recognizability is low. At time t2, the third to sixth character positions in the license plate are blocked or reflected light, so the probabilities that the third to sixth character positions correspond to one character are small, i.e., the recognizability is low. At time t3, the sixth character position in the license plate is blocked or reflected light, so the probability that the sixth character position corresponds to one character is small, i.e., the recognizability is low.
[0067] To solve the above problem, the embodiment of the present application can identify the license plate from an image with high clarity to obtain the probability of each character in the license plate, and determine a first probability threshold of the character according to the probability. The first probability threshold can be used to represent the confidence of the character, and the identification result greater than the first probability threshold can be considered as reliable. Thus, after identifying the license plate information from any image, for one character position in the license plate, if the probability that the character position corresponds to one character is greater than the first probability threshold of the character, it means that the character position is reliable, which can also be understood as that the character position is identified as the character without being blocked or reflected light; if the probability that the character position corresponds to one character is less than or equal to the first probability threshold of the character, it means that the character position is unreliable, which means that the character position is identified as the character in the case of being blocked or reflected light. In this way, the first probability threshold can be used to determine whether each character in the identified license plate information is reliable, and the characters are used as the license plate information in the case of being reliable, so as to improve the recognition accuracy of the license plate information.
[0068] The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0069] Figure 4 An example shows a step flowchart of a license plate recognition method provided by the embodiment of the present application. Referring to Figure 4 As shown, the license plate recognition method includes S101 to S103.
[0070] S101: Obtain a first image, and the first image includes a license plate.
[0071] The first image includes an image region in which the license plate is located, and the first image is a corrected image.
[0072] S102: Identify the first image to obtain character probability information of the license plate, the character probability information including: a first character corresponding to each character position, and a first probability of each character position being the first character, the probability of the character position being the first character being greater than the probability of the character position being other characters.
[0073] In actual application, the character probability information can be identified from the first image by any algorithm. A typical algorithm is CTC (connectionist temporal classification). The continuous temporal classification usually outputs an M*N matrix, and the value of the mth row and the nth column in the matrix represents the probability of the mth pixel position being the nth character.
[0074] M can be the number of pixel positions, and M can be flexibly set according to the width of the first image. The larger the width of the first image, the larger the number of pixel positions can be set. L consecutive pixel positions can correspond to a character position of the license plate. Since the number K of character positions in the license plate is usually fixed, L can be determined according to K and M, i.e. L=M / K. The number of character positions of the above license plate is usually 7, i.e. each license plate includes 7 characters.
[0075] N can be the number of available characters for each pixel position. N can be set according to the actual application scenario. For example, if each character position in the license plate can be any one of the following characters: 0-9, A-Z, 26 regions, then N can be 10+26+26=62.
[0076] After obtaining the above matrix, for each row of data, the character corresponding to the column in which the maximum value in the row is located can be taken as the character corresponding to the row. Usually, the consecutive L rows correspond to the same character, representing that the consecutive L pixel positions correspond to the same character position in the license plate.
[0077] In the embodiment of the application, the character corresponding to each character position in the license plate information identified from the first image is referred to as a first character, and the probability of the character position being the first character is referred to as a first probability.
[0078] S103: If the first probability of each character position in the license plate is greater than the first probability threshold of the first character corresponding to each character position, the first character corresponding to each character position is spliced into the license plate information. The first probability threshold of a character is determined according to the probability of identifying the character from the second image, and the clarity of the character in the second image is greater than a preset clarity.
[0079] The license plate information is obtained by splicing the first character corresponding to each character position according to the order of the character positions.
[0080] The license plate information is generated under the condition that the character at each character position is reliable, so that each character in the license plate information is obtained without being blocked or reflected, and the accuracy of the license plate information is improved.
[0081] It should be noted that the first probability threshold can be obtained by the following steps: first, for a large number of second images, the character corresponding to each character position in the license plate information is identified from each second image according to the method of S102, and the probability that the character position is the character can be referred to as the reference character and the reference probability, respectively; then, for each character, the reference probabilities of the character identified from different second images are averaged to obtain the average reference probability of the character; finally, the first probability threshold of the character is determined according to the average reference probability of the character, and the first probability threshold can be the average reference probability of the character, or a function of the average reference probability of the character.
[0082] Optionally, the first probability threshold of a character is determined by a first function, the input of the first function is the probability of identifying the character from the second image and the first preset threshold, and the first function is a monotonically increasing function.
[0083] It can be understood that for a monotonically increasing function, the output increases as the input increases. For the first function, as the probability of a character increases and / or the first preset threshold increases, the first probability threshold of the character also increases, and conversely, as the probability of a character decreases and / or the first preset threshold decreases, the first probability threshold of the character also decreases.
[0084] There are many monotonically increasing functions, for example, the output can be obtained by directly adding all inputs, or the output can be obtained by directly multiplying all inputs. In the embodiment of the application, in order to facilitate calculation, the first function can be the product of the probability of identifying the character from the second image and the first preset threshold.
[0085] The first preset threshold can be flexibly set according to the actual application scene, and its value is between 0 and 1, for example, 0.25.
[0086] Based on the above first preset probability, a second preset probability can also be set, and the second preset probability can also be determined according to the probability of identifying the character from the second image. For the same character, the first preset probability of the character is greater than the second preset probability of the character. Corresponding to the method of determining the first probability threshold by the first function, the second probability threshold can also be determined by a second function.
[0087] Specifically, the second probability threshold of a character is determined by a second function, an input of the second function is the probability of recognizing the character from the second image and a second preset threshold, the second function is a monotonically increasing function, and the second preset threshold is smaller than the first preset threshold.
[0088] It can be understood that for a monotonically increasing function, the output increases with the increase of the input. For the second function, the second probability threshold of a character increases with the increase of the probability of the character and / or the increase of the second preset threshold, and vice versa.
[0089] There are many monotonically increasing functions, for example, the output can be obtained by directly adding all inputs, or the output can be obtained by directly multiplying all inputs. In the embodiment of the present application, in order to facilitate calculation, the second function can be the product of the probability of recognizing the character from the second image and the second preset threshold.
[0090] The second preset threshold can be flexibly set according to the actual application scene, and its value is between 0 and 1, for example, 0.5.
[0091] According to the above first probability threshold and the above second probability threshold, three value intervals can be obtained, the first value interval is a value interval less than or equal to the second probability threshold, the second value interval is a value interval greater than the second probability threshold and less than or equal to the first probability threshold, and the third value interval is a value interval greater than the first probability threshold.
[0092] In the embodiment of the present application, since the license plate usually includes multiple character positions, each character position corresponds to a character, so the first probability corresponding to each character position in the license plate can be in any of the above three value intervals. The above character positions can be divided into two types: first character positions and second character positions, the first probability corresponding to the first character positions and the second character positions is in different value intervals. In addition to the scenario of S103, the processing process in two scenarios is given below.
[0093] In the first scenario, the first character position is in the first value interval, and the second character position is in the third value interval, or the first character position is in the third value interval, and the second character position is in the first value interval. That is, the first probability of at least one of the character positions is less than or equal to the second probability threshold of the first character corresponding to the character position. At this time, it is determined that the region where the character position in the license plate is located is reflected or blocked, the credibility of the character of the predicted character position is low, and it is determined that the license plate is blocked and cannot give accurate license plate information. Avoid giving license plate information with low accuracy.
[0094] In the second scenario, the first probability of the first character position is in the third value interval, and the first probability of the second character position is in the second value interval. That is, the first probability of the first character position is greater than the first probability threshold of the first character corresponding to the first character position, and the first probability of the second character position is less than or equal to the first probability threshold of the first character corresponding to the second character position, and the first probability of the second character position is greater than the second probability threshold of the first character corresponding to the second character position. At this time, for each of the at least two second characters, the average probability of the second character position being the second character in the at least two images is determined, and the at least two images include the first image and the third image, and the third image is an image taken at a different time from the first image for the same vehicle.
[0095] When the first image is a current image, the third image can be at least one image before and / or after the first image. The second characters are candidate characters, and the N characters in the M*N matrix in S102 are N second characters. If the second character position corresponds to the m1th to m2th rows in the image, the following three methods can be used for processing.
[0096] The first method is to average the m1th to m2th rows of the matrices corresponding to the at least two images respectively to obtain a vector, and each element in the vector corresponds to a second character and is used to represent the average probability of the second character position being the second character in the at least two images.
[0097] The second method is to average the matrices corresponding to the at least two images respectively to obtain an average matrix. Then, the character and probability of each character position can be determined from the average matrix as new character probability information, and the specific method is the same as the process of determining the character probability information in S102. When the new character probability information meets the condition of S103, the license plate information can be generated according to S103. When the new character probability information does not meet the condition of S103, it is determined that the license plate is blocked.
[0098] The third method is to average the matrices corresponding to the at least two images respectively to obtain an average matrix. Then, a vector can be obtained by taking the row corresponding to the second character position from the average matrix, and each element in the vector corresponds to a second character and is used to represent the average probability of the second character position being the second character in the at least two images.
[0099] For different second characters in the first mode and the third mode, the average probability of the second character position being a second character is different in at least two frames of images, and an embodiment of the present application will make a decision by the maximum average probability and the second character corresponding to the maximum average probability. If the maximum average probability corresponding to the second character position is greater than the first probability threshold of the second character corresponding to the maximum average probability, the first character at the first character position and the second character corresponding to the maximum average probability are spliced as the license plate information. If the maximum average probability corresponding to the second character position is less than or equal to the first probability threshold of the second character corresponding to the maximum average probability, it is determined that the license plate is blocked.
[0100] wherein the maximum average probability represents the maximum probability of the second character position being a second character. In an embodiment of the present application, by averaging the probabilities corresponding to the front and rear frames, the second character to which the second character position is most likely to correspond can be determined from the statistical principle, and the accuracy of the license plate information is improved. If the maximum average probability is greater than the corresponding first probability threshold, it can be determined that the character corresponding to the second character position is the second character corresponding to the maximum average probability. If the maximum average probability is still less than the corresponding first probability threshold, it is determined that the second character position is blocked in multiple frames of images all the time, and the character corresponding to the second character position cannot be determined, and thus the license plate information cannot be determined.
[0101] Before obtaining the license plate information as described above, in order to avoid the first probabilities included in the character probability information of the first image being all large or all small, which leads to poor accuracy of the license plate information, the first probabilities can be adjusted so as to be comparable to the first probability threshold. Specifically, a first adjustment parameter is determined according to the difference between the first probability of the third character position and the probability of identifying the first character corresponding to the third character position from the second image, the third character position being at least two character positions with large first probabilities of the first character; and the first probability is adjusted by the first adjustment parameter.
[0102] wherein the first adjustment parameter can be a function of the difference.
[0103] The difference can be a ratio, which can be calculated by the following formula:
[0104]
[0105] wherein DIFF1 is the difference, I is the number of the third character positions, P1 i is the probability of identifying the first character corresponding to the i-th third character position from the second image, P2 i is the first probability of the i-th third character position.
[0106] In actual application, the difference degree can be used as the first adjustment parameter, or the first adjustment parameter can be obtained by linear transformation of the difference degree, and the linear relationship between the difference degree and the first adjustment parameter is monotonously increasing.
[0107] Correspondingly, the first adjustment parameter can be multiplied by each first probability to obtain an adjusted first probability.
[0108] Similarly, when determining the average probability of the second character position being the second character in the at least two frames of images for each of the at least two second characters, the second probability of each second character can also be adjusted according to the above scheme. Specifically, for each of the at least two second characters, the second probability of the second character position being the second character in the at least two frames of images is determined respectively; for each frame of image, a second adjustment parameter of the image is determined according to the difference degree between the second probability of each second character position being the second character in the image and the probability of recognizing each second character from the second image; for each frame of image, the second probability corresponding to the image is adjusted by the second adjustment parameter of the image; and the average probability of the second character position being the second character in the at least two frames of images is determined according to the adjusted second probability.
[0109] Specifically, if each second character position corresponds to the m1th to m2th row in the image, for each frame of image, the image corresponds to a difference degree, which can be calculated according to the following formula:
[0110]
[0111] wherein DIFF2 is the difference degree, m1 is the starting row corresponding to the third character position in the matrix, m2 is the ending row corresponding to the third character position in the matrix, P1 n is the probability of recognizing the nth second character from the second image, P2 m.n is the second probability of the mth row for the nth second character.
[0112] Correspondingly, for the license plate recognition method shown in Figure 4 The embodiment of the present application further provides an electronic device. Figure 5 An exemplary structure block diagram of an electronic device provided by the embodiment of the present application is shown. Referring to Figure 5 As shown in
[0113] The first image acquisition module 201 is configured to acquire a first image, wherein the first image comprises a license plate.
[0114] The character probability information identification module 202 is configured to identify the first image to obtain character probability information of the license plate, the character probability information comprising: a first character corresponding to each character position, and a first probability of each character position being the first character, the probability of the character position being the first character being greater than the probability of the character position being other characters.
[0115] The license plate information determination module 203 is configured to, if the first probability of each character position in the license plate is greater than a first probability threshold of the first character corresponding to each character position, splice the first character corresponding to each character position as license plate information, the first probability threshold of a character being determined according to a probability of identifying the character from a second image, the character in the second image having a clarity greater than a preset clarity.
[0116] Optionally, a plurality of character positions in the license plate are divided into first character positions and second character positions, the first probability corresponding to the first character positions being greater than a first probability threshold of the first character corresponding to the first character positions, the first probability corresponding to the second character positions being less than or equal to a first probability threshold of the first character corresponding to the second character positions and greater than a second probability threshold of the first character corresponding to the second character positions.
[0117] The electronic device further comprises:
[0118] The first average probability determination module is configured to, for each of the at least two second characters, determine an average probability of the second character position being the second character in at least two images, the at least two images comprising the first image and a third image, the third image being captured at different times for the same vehicle as the first image, the second probability threshold of a character being determined according to a probability of identifying the character from the second image, the second probability threshold of a character being less than the first probability threshold of the character.
[0119] The third license plate information determination module is configured to, if the maximum average probability corresponding to the second character position is greater than a first probability threshold of the second character corresponding to the maximum average probability, splice the first character of the first character position and the second character corresponding to the maximum average probability as license plate information.
[0120] The first license plate shielding determination module is configured to, if the maximum average probability corresponding to the second character position is less than or equal to a first probability threshold of the second character corresponding to the maximum average probability, determine that the license plate is shielded.
[0121] Optionally, the electronic device further comprises:
[0122] The second license plate shielding determination module is configured to determine that the license plate is shielded if the first probability of at least one of the character positions is less than or equal to a second probability threshold of the first character corresponding to the character position, the second probability threshold of one character being determined according to a probability of recognizing the character from the second image, and the second probability threshold of one character being less than the first probability threshold of the character.
[0123] Optionally, the first probability threshold of one character is determined by a first function, an input of the first function being a probability of recognizing the character from the second image and a first preset threshold, and the first function being a monotonically increasing function.
[0124] Optionally, the second probability threshold of one character is determined by a second function, an input of the second function being a probability of recognizing the character from the second image and a second preset threshold, the second function being a monotonically increasing function, and the second preset threshold being less than the first preset threshold.
[0125] Optionally, the electronic device further comprises:
[0126] The first adjustment parameter determination module is configured to determine a first adjustment parameter according to a difference between the first probability of a third character position and a probability of recognizing the first character corresponding to the third character position from the second image before the first characters corresponding to the character positions are spliced into license plate information, the third character position being at least two character positions with a larger first probability of the first character.
[0127] The first adjustment module is configured to adjust the first probability by the first adjustment parameter.
[0128] Optionally, the second average probability determination module is further configured to:
[0129] For each of the at least two second characters, determine a second probability of the second character position being the second character in at least two images, respectively;
[0130] For each of the images, determine a second adjustment parameter of the image according to a difference between the second probability of each of the second character positions being the second character in the image and a probability of recognizing each of the second characters from the second image;
[0131] For each of the images, adjust the second probability corresponding to the image by the second adjustment parameter of the image;
[0132] Determine an average probability of the second character position being the second character in at least two images according to the adjusted second probability.
[0133] The embodiment of the electronic device is a device embodiment corresponding to the method embodiment, has the same technical effects as the method embodiment, and the detailed description can be referred to the detailed description of the method embodiment. The present application embodiment will not be repeated here.
[0134] Figure 6 An exemplary structure block diagram of another electronic device provided by the embodiment of the present application is shown. The electronic device 300 comprises a processor 301 and a memory 302 for storing computer-executable instructions for the processor 301, when the processor 301 executes the computer-executable instructions, causes the electronic device 300 to implement the aforementioned license plate recognition method.
[0135] In addition, the electronic device further comprises a receiver 303 and a transmitter 304, the receiver 303 is used to receive information from the rest of the device or equipment, and forward to the processor 301, the transmitter 304 is used to send information to the rest of the device or equipment.
[0136] The embodiment of the present application further provides a computer program, and the computer program is used for implementing the aforementioned license plate recognition method.
[0137] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores computer-executable instructions, when the computer-executable instructions in the storage medium are executed by the processor of the electronic device, causes the electronic device to implement the aforementioned license plate recognition method.
[0138] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The present application is intended to cover any variations, uses or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice in the art to which the application pertains. The specification and examples are to be regarded as exemplary only, and the true scope and spirit of the application are indicated by the following claims.
[0139] It should be understood that the present application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the application is limited only by the claims that follow.
Claims
1. A license plate recognition method, characterized in that, include: Acquire a first image, which includes a license plate; The first image is identified to obtain the character probability information of the license plate. The character probability information includes: the first character corresponding to each character position, the first probability that each character position is the first character, and the probability that the character position is the first character is greater than the probability that the character position is any other character. If the first probability of each character position in the license plate is greater than the first probability threshold of the first character corresponding to each character position, then the first characters corresponding to each character position are concatenated to form the license plate information. The first probability threshold of a character is determined based on the probability of recognizing the character from the second image. The clarity of the character in the second image is greater than the preset clarity. If the first probability of each character position in the license plate is greater than the first probability threshold of the first character corresponding to each character position, then before concatenating the first characters corresponding to each character position into the license plate information, the process further includes: The first adjustment parameter is determined based on the degree of difference between the first probability of the third character position and the probability of recognizing the first character corresponding to the third character position from the second image, wherein the third character position is at least one of the two character positions with a higher first probability of the first character. The first probability is adjusted using the first adjustment parameter.
2. The method according to claim 1, characterized in that, The license plate is divided into a first character position and a second character position. The first probability corresponding to the first character position is greater than the first probability threshold of the first character corresponding to the first character position. The first probability corresponding to the second character position is less than or equal to the first probability threshold of the first character corresponding to the second character position, and greater than the second probability threshold of the first character corresponding to the second character position. The method further includes: For each of at least two second characters, determine the average probability that the position of the second character is the second character in at least two frames of images, the at least two frames of images including the first image and the third image, the third image and the first image being taken at different times for the same vehicle, a second probability threshold for a character is determined based on the probability of recognizing the character from the second image, the second probability threshold for a character is less than the first probability threshold for the character; If the maximum average probability corresponding to the second character position is greater than the first probability threshold of the second character corresponding to the maximum average probability, then the first character at the first character position and the second character corresponding to the maximum average probability are concatenated to form the license plate information. If the maximum average probability corresponding to the second character position is less than or equal to the first probability threshold of the second character corresponding to the maximum average probability, then it is determined that the license plate is obscured.
3. The method according to claim 2, characterized in that, The method further includes: If the first probability of at least one of the character positions is less than or equal to the second probability threshold of the first character corresponding to the character position, then it is determined that the license plate is obscured. The second probability threshold of a character is determined based on the probability of recognizing the character from the second image, and the second probability threshold of a character is less than the first probability threshold of the character.
4. The method according to any one of claims 1 to 3, characterized in that, The first probability threshold of a character is determined by a first function, the input of which is the probability of recognizing the character from the second image and a first preset threshold, and the first function is a monotonically increasing function.
5. The method according to any one of claims 2 or 3, characterized in that, The second probability threshold of a character is determined by a second function, the input of which is the probability of recognizing the character from the second image and a second preset threshold. The second function is a monotonically increasing function, and the second preset threshold is less than the first preset threshold.
6. The method according to claim 2 or 3, characterized in that, Determining the average probability that the position of the second character is the second character in at least two frames of images for each of at least two second characters includes: For each of at least two second characters, determine a second probability that the position of the second character is the second character in at least two frames of images; For each frame of the image, a second adjustment parameter for the image is determined based on the degree of difference between the second probability that each second character position is the second character in the image and the probability of recognizing each second character from the second image; For each frame of the image, the second probability corresponding to the image is adjusted using the second adjustment parameter of the image; The average probability that the position of the second character is the second character in at least two frames of images is determined based on the adjusted second probability.
7. An electronic device, characterized in that, include: The first image acquisition module is used to acquire a first image, wherein the first image includes a license plate; A character probability information recognition module is used to recognize the first image and obtain the character probability information of the license plate. The character probability information includes: a first character corresponding to each character position, a first probability that each character position is the first character, and the probability that the character position is the first character is greater than the probability that the character position is any other character. The license plate information determination module is used to concatenate the first characters corresponding to each character position into license plate information if the first probability of each character position in the license plate is greater than the first probability threshold of the first character corresponding to each character position. The first probability threshold of a character is determined based on the probability of recognizing the character from the second image. The clarity of the character in the second image is greater than a preset clarity. The first adjustment parameter determination module is used to determine the first adjustment parameter based on the difference between the first probability of the third character position and the probability of recognizing the first character corresponding to the third character position from the second image before splicing the first characters corresponding to each of the character positions into license plate information. The third character position is at least two character positions with a higher first probability of the first character. The first adjustment module adjusts the first probability using the first adjustment parameter.
8. An electronic device, characterized in that, include: Memory, processor; Memory; Memory used to store instructions executed by the computer; When the processor executes the computer execution instructions, it causes the electronic device to implement the method of any one of claims 1 to 6.
9. A computer program, characterized in that, The computer program is used to implement the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by a processor of an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method of detecting absence and coverage of license plate in real time
CN104951784A
Covered license plate identification method and apparatus
CN107301385A