License plate recognition method and system, electronic equipment and storage medium
By using the technology of character replacement and confidence matching in the license plate recognition system, the recognition accuracy problem of existing systems under limited low-quality images and equipment configurations is solved, and higher license plate recognition accuracy and normality of vehicle entry and exit are achieved.
Patent Information
- Application Number
- CN202411465957.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-25
AI Technical Summary
The existing license plate recognition system cannot effectively ensure the accuracy of license plate recognition when low-quality images and limited equipment configurations, which affects the normal entry and exit of the vehicle.
By obtaining multiple identified license plates for the current vehicle and matching them with the target license plates in the vehicle target library. If the exact match fails, replace the easily mixed characters in the license plate to update the match. If the match is still not successful, match the characters with confidence in the identification license plate with a higher confidence than the threshold value to determine the matching degree of the license plate to ensure the accuracy of the identification result.
When the quality of the equipment and image cannot be guaranteed, the accuracy of license plate recognition is effectively improved through character replacement and confidence matching, and the normal entry and exit of the vehicle is ensured.
Smart Images

Figure CN119516528A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a license plate recognition method and system, electronic equipment, and storage medium. Background Art
[0002] In order to prevent foreign vehicles from entering at will, parks, factories or communities usually have an automatic license plate recognition system at the vehicle entrance to recognize the license plates of vehicles preparing to enter. Entry will only be allowed when the vehicle's license plate is recognized as a registered license plate.
[0003] The current automatic vehicle recognition system mainly collects an image of the vehicle. Then, it uses computer vision, image processing, and pattern recognition technologies to extract the vehicle's license plate from the vehicle image. Then, it determines whether the vehicle's license plate is a registered license plate. If the vehicle's license plate is a registered license plate, it is determined that the license plate recognition is successful and the vehicle is allowed to enter.
[0004] However, the accuracy of license plates recognized by existing methods depends on the quality of images and complex algorithms for processing images. For some old warehouses or private factories, or affected by other factors, it is impossible to collect high-quality images, and it is impossible to configure equipment that supports complex algorithms for processing images. Therefore, accurate license plate recognition cannot be guaranteed, which can easily affect the normal entry and exit of vehicles. Summary of the invention
[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a license plate recognition method and system, electronic equipment, and storage medium to solve the problem that the prior art cannot effectively guarantee the license plate of the device.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] The first aspect of the present application provides a license plate recognition method, comprising:
[0008] Get each identification license plate of the current vehicle;
[0009] Matching each of the identified license plates with each of the target license plates in the vehicle target library;
[0010] If any of the identified license plates completely matches any of the target license plates, the identified license plate that completely matches the target license plate is determined as the license plate of the current vehicle, and the license plate recognition is determined to be successful;
[0011] If each of the identified license plates does not completely match each of the target license plates, then the easily confused characters in each of the identified license plates are replaced with corresponding characters to obtain updated license plates corresponding to each of the identified license plates, and each of the updated license plates is matched with each of the target license plates;
[0012] If any of the updated license plates completely matches any of the target license plates, the updated license plate that completely matches the target license plate is determined as the license plate of the current vehicle, and the license plate recognition is determined to be successful;
[0013] If each of the updated license plates does not completely match each of the target license plates, then for each of the identified license plates, the characters in the identified license plate with a confidence level higher than a confidence level threshold are compared with the characters in each of the target license plates to determine the matching level of each character of the identified license plate, and the matching level of the identified license plate is determined based on the matching level of each character of the identified license plate;
[0014] According to the matching degree of each of the recognized license plates, the license plate of the current vehicle is determined, and a license plate recognition result is determined.
[0015] Optionally, in the above-mentioned license plate recognition method, the obtaining of each recognized license plate of the current vehicle includes:
[0016] Collecting a video stream of the current vehicle;
[0017] Locating the license plate area in each frame image of the video stream respectively;
[0018] License plate recognition is performed on the license plate area in each frame image of the video stream to obtain each recognized license plate of the current vehicle.
[0019] Optionally, in the above license plate recognition method, replacing the easily confused characters in each of the recognized license plates with corresponding characters to obtain updated license plates corresponding to each of the recognized license plates, and matching each of the updated license plates with each of the target license plates includes:
[0020] Sorting the identified license plates in descending order according to the highest matching degree with the target license plates;
[0021] According to the arrangement order of each of the identified license plates, each of the identified license plates is traversed in turn, and the easily confused characters in the currently traversed identified license plate are replaced with corresponding characters to obtain an updated license plate corresponding to the currently traversed identified license plate, and each of the currently obtained updated license plates is matched with each of the target license plates until any one of the updated license plates is completely matched with any one of the target license plates, or all of the identified license plates are traversed.
[0022] Optionally, in the above-mentioned license plate recognition method, for each of the identified license plates, the characters in the identified license plate with a confidence level higher than a confidence level threshold are compared with the characters of each of the target license plates to determine the matching level of each character of the identified license plate, and the matching level of the identified license plate is determined according to the matching level of each character of the identified license plate, including:
[0023] For each of the identified license plates, determining the confidence level of each character in the identified license plate;
[0024] Matching each character of the recognized license plate whose confidence is greater than the confidence threshold with the characters at the same position of each target license plate to obtain the matching degree of each character of the recognized license plate;
[0025] The matching degrees of the respective characters of the recognized license plate are summarized to obtain the matching degree of the recognized license plate.
[0026] Optionally, in the above-mentioned license plate recognition method, matching each character of the recognized license plate whose confidence is greater than the confidence threshold with each character at the same position of each target license plate to obtain the matching degree of each character of the recognized license plate includes:
[0027] Sort the characters of the recognized license plate whose confidence is greater than the confidence threshold in descending order of confidence;
[0028] According to the sorting order of each character of the recognized license plate, traverse each character of the recognized license plate in turn, match the currently traversed character of the recognized license plate with the character at the same position in each target license plate, determine the number of target license plates whose characters at the same position match the characters of the recognized license plate, and obtain the matching degree of the currently traversed characters of the recognized license plate, until the matching degree of the currently traversed characters of the recognized license plate reaches the preset matching degree, or all characters of the recognized license plate are traversed.
[0029] Optionally, in the above-mentioned license plate recognition method, determining the license plate of the current vehicle according to the matching degree of each of the recognized license plates and determining the license plate recognition result includes:
[0030] If the maximum value among the matching degrees of the recognized license plates is greater than the matching degree threshold, the recognized license plate with the maximum matching degree is determined as the license plate of the current vehicle;
[0031] Determining that the license plate recognition is successful, and issuing an alarm for the recognition record of the license plate of the current vehicle;
[0032] If the maximum value of the matching degrees of the recognized license plates is not greater than the matching degree threshold, it is determined that the license plate recognition has failed.
[0033] Optionally, in the above-mentioned license plate recognition method, determining the license plate of the current vehicle according to the matching degree of each of the recognized license plates and determining the license plate recognition result includes:
[0034] Feedback the two recognized license plates with the greatest matching degree to the user;
[0035] If the user's selection operation instruction is received, the recognized license plate selected by the user is determined as the license plate of the current vehicle, and the license plate recognition is determined to be successful;
[0036] If a modification operation instruction from the user is received, the recognized license plate modified by the user is determined as the license plate of the current vehicle, and it is determined that the license plate recognition is successful.
[0037] The second aspect of the present application provides a license plate recognition system, comprising:
[0038] A license plate acquisition unit, used to acquire each identification license plate of the current vehicle;
[0039] A first matching unit, used for matching each of the identified license plates with each target license plate in a vehicle target library;
[0040] A first determination unit is used to determine the recognized license plate that completely matches the target license plate as the license plate of the current vehicle when any one of the recognized license plates completely matches any one of the target license plates, and determine that the license plate recognition is successful;
[0041] A second matching unit is used to replace the easily confused characters in each of the identified license plates with corresponding characters when each of the identified license plates does not completely match each of the target license plates, obtain an updated license plate corresponding to each of the identified license plates, and match each of the updated license plates with each of the target license plates;
[0042] A second determination unit is used to determine the updated license plate that completely matches the target license plate as the license plate of the current vehicle when any one of the updated license plates completely matches any one of the target license plates, and determine that the license plate recognition is successful;
[0043] A third matching unit is used for, when each of the updated license plates does not completely match each of the target license plates, for each of the identified license plates, comparing the characters in the identified license plates with a confidence level higher than a confidence level threshold with the characters in each of the target license plates, to determine the matching level of each character of the identified license plate, and determining the matching level of the identified license plate according to the matching level of each character of the identified license plate;
[0044] The third determination unit is used to determine the license plate of the current vehicle and determine the license plate recognition result according to the matching degree of each of the recognized license plates.
[0045] Optionally, in the above license plate recognition system, the license plate acquisition unit includes:
[0046] A collection unit, used for collecting the video stream of the current vehicle;
[0047] A positioning unit, used to respectively locate the license plate area in each frame image of the video stream;
[0048] The recognition unit is used to perform license plate recognition on the license plate area in each frame image of the video stream to obtain each recognized license plate of the current vehicle.
[0049] Optionally, in the above license plate recognition system, the second matching unit includes:
[0050] A first sorting unit, used to sort the identified license plates in descending order according to the highest matching degree with the target license plates;
[0051] The second matching subunit is used to traverse each of the identified license plates in sequence according to the arrangement order of each of the identified license plates, replace the easily confused characters in the currently traversed identified license plate with corresponding characters, obtain an updated license plate corresponding to the currently traversed identified license plate, and match each of the currently obtained updated license plates with each of the target license plates until any one of the updated license plates is completely matched with any one of the target license plates, or all of the identified license plates are traversed.
[0052] Optionally, in the above license plate recognition system, the third matching unit includes:
[0053] A confidence determination unit, used to determine the confidence of each character in the identified license plate respectively for each identified license plate;
[0054] A character matching unit, used for matching each character of the recognized license plate whose confidence is greater than a confidence threshold with each character at the same position of each target license plate, to obtain a matching degree of each character of the recognized license plate;
[0055] The summarizing unit is used to summarize the matching degrees of each character of the recognized license plate to obtain the matching degree of the recognized license plate.
[0056] Optionally, in the above license plate recognition system, the character matching unit includes:
[0057] A second sorting unit, used to sort the characters of the recognized license plate whose confidence is greater than the confidence threshold, in descending order of confidence;
[0058] The character matching subunit is used to traverse the characters of the recognized license plate in sequence according to the sorting order of the characters of the recognized license plate, match the currently traversed characters of the recognized license plate with the characters at the same position in each of the target license plates, determine the number of target license plates whose characters at the same position match the characters of the recognized license plate, and obtain the matching degree of the currently traversed characters of the recognized license plate, until the matching degree of the currently traversed characters of the recognized license plate reaches a preset matching degree, or all the characters of the recognized license plate are traversed.
[0059] Optionally, in the above license plate recognition system, the third determination unit includes:
[0060] A first license plate determination unit is used to determine the recognized license plate with the greatest matching degree as the license plate of the current vehicle when the maximum value among the matching degrees of the recognized license plates is greater than a matching degree threshold, determine that the license plate recognition is successful, and issue an alarm for the recognition record of the license plate of the current vehicle;
[0061] The failure determination unit is used to determine that the license plate recognition has failed when the maximum value among the matching degrees of the recognized license plates is not greater than the matching degree threshold.
[0062] Optionally, in the above license plate recognition system, the third determination unit includes:
[0063] A feedback unit, used for feeding back the two recognized license plates with the greatest matching degree to the user;
[0064] A second license plate determination unit is used to determine the recognized license plate selected by the user as the license plate of the current vehicle when receiving the user's selection operation instruction, and determine that the license plate recognition is successful;
[0065] The third license plate determination unit is used to determine the recognized license plate modified by the user as the license plate of the current vehicle when receiving the modification operation instruction from the user, and determine that the license plate recognition is successful.
[0066] A third aspect of the present application provides an electronic device, including:
[0067] Memory and processor;
[0068] Wherein, the memory is used to store programs;
[0069] The processor is used to execute the program, and when the program is executed, it is specifically used to implement any one of the license plate recognition methods described above.
[0070] In a fourth aspect, the present application provides a computer storage medium for storing a computer program, which, when executed by a processor, is used to implement a license plate recognition method as described in any one of the above.
[0071] The present application provides a license plate recognition method to obtain each recognized license plate of the current vehicle. First, each recognized license plate is matched with each target license plate in the vehicle target library. If any recognized license plate completely matches any target license plate, the recognized license plate that completely matches the target license plate is determined to be the license plate of the current vehicle, and the license plate recognition is determined to be successful. If each recognized license plate does not completely match each target license plate, the easily confused characters in each recognized license plate are replaced with corresponding characters to obtain the updated license plates corresponding to each recognized license plate, and each updated license plate is matched with each target license plate. Thus, characters that are easy to recognize incorrectly can be taken into account, thereby effectively ensuring. If any updated license plate completely matches any target license plate, the updated license plate that completely matches the target license plate is determined to be the license plate of the current vehicle, and the license plate recognition is determined to be successful. If each updated license plate does not completely match each target license plate, then for each identified license plate, the characters in the identified license plate with a confidence level higher than the confidence threshold are compared with the characters of each target license plate to determine the matching level of each character of the identified license plate, and the matching level of the identified license plate is determined based on the matching level of each character of the identified license plate. Based on the matching level of each identified license plate, the license plate of the current vehicle is determined, and the license plate recognition result is determined. When the recognition error is large, the recognition is performed by matching characters with higher confidence levels, thereby effectively ensuring the accuracy of recognition. Therefore, this solution combines character replacement and matching characters with higher confidence levels, so that even when the equipment and image quality cannot meet the requirements, it can ensure accurate recognition of license plates. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0073] Figure 1 A flowchart of a license plate recognition method provided in an embodiment of the present application;
[0074] Figure 2 A flowchart for obtaining each identified license plate of the current vehicle provided in an embodiment of the present application;
[0075] Figure 3A flowchart of a method for matching characters of a recognized license plate provided in an embodiment of the present application;
[0076] Figure 4 A schematic diagram of the architecture of a license plate recognition system provided in an embodiment of the present application;
[0077] Figure 5 A schematic diagram of the architecture of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0078] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0079] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0080] The present application embodiment provides a license plate recognition method, such as Figure 1 As shown, the specific steps include:
[0081] S101, obtaining each identification license plate of the current vehicle.
[0082] The recognized license plate of the current vehicle is the license plate recognized based on the image of the vehicle that needs to be recognized. Considering that the accuracy of the license plate directly recognized based on the image of the vehicle cannot be guaranteed, in the embodiment of the present application, the license plate recognition of the current vehicle is performed multiple times to obtain multiple recognized license plates, and then the license plate of the vehicle is recognized from each of the recognized license plates, thereby effectively improving the accuracy of the final recognition.
[0083] Optionally, in another embodiment of the present application, a specific implementation of step S101 is as follows: Figure 2 As shown, the following steps are included:
[0084] S201, collecting the video stream of the current vehicle.
[0085] Optionally, when the current vehicle travels to the identification area, the video stream of the current vehicle may be collected in real time through the access control camera.
[0086] S202: Locate the license plate area in each frame image of the video stream respectively.
[0087] S203: Perform license plate recognition on the license plate area in each frame image of the video stream to obtain each recognized license plate of the current vehicle.
[0088] Specifically, the license plate area in each frame image of the video stream can be recognized by character segmentation, character recognition, etc., so as to recognize multiple license plates. Then, all license plates can be determined as the recognized license plates of the current vehicle, or the N license plates with the greatest probability can be determined as the recognized license plates of the current license plate.
[0089] Due to issues such as the quality of the video captured by the camera and the recognition algorithm, the currently recognized license plate may be misidentified. Therefore, at this time, each recognized license plate can be pushed to the system through a protocol for judgment, that is, to execute subsequent steps.
[0090] S102, matching each recognized license plate with each target license plate in the vehicle target library.
[0091] Among them, each target license plate in the vehicle target library is a pre-registered license plate allowed to enter. Therefore, in order to ensure the accuracy of the recognition result, the recognized license plate will be matched with each target license plate in the vehicle target library.
[0092] S103, determining whether any recognized license plate completely matches any target license plate.
[0093] Specifically, if any recognized license plate completely matches one of the target license plates, that is, any recognized license plate is included in the vehicle target library, it means that the recognized vehicle is the correct license plate, so step S104 is executed at this time. If each recognized license plate does not completely match each target license plate, that is, there is no recognized license plate that completely matches the target license plate, it means that there may be errors in each of the obtained recognized license plates, so step S105 is executed at this time.
[0094] S104: Determine the recognized license plate that completely matches the target license plate as the license plate of the current vehicle, and determine that the license plate recognition is successful.
[0095] In order to facilitate recording and authorizing the current vehicle to enter, it is necessary to determine the recognized license plate that completely matches the target license plate as the license plate of the current vehicle and determine that the license plate recognition is successful.
[0096] S105, replacing easily confused characters in each recognized license plate with corresponding characters, obtaining updated license plates corresponding to each recognized license plate, and matching each updated license plate with each target license plate.
[0097] At this time, each license plate may be misidentified, and misidentification is usually caused by the presence of easily confused characters in the license plate, which leads to recognition errors, such as "B" and "8".
[0098] Therefore, in the embodiment of the present application, for each identified license plate, if the identified license plate contains easily confused characters, the characters are replaced with corresponding characters, that is, characters that are easily confused, so as to obtain the corresponding updated license plate. The updated license plate is then used to match each target license plate.
[0099] It should be noted that, considering that easily confused characters may be recognized correctly or incorrectly, when there are multiple easily confused characters in the recognized license plate, all situations should be considered when replacing the easily confused characters, that is, not only each easily confused character should be replaced individually, but also multiple easily confused characters in each situation should be replaced at the same time.
[0100] Optionally, in another embodiment of the present application, a specific implementation of step S105 includes the following steps:
[0101] Sort each recognized license plate in descending order according to the highest degree of match with each target license plate, then traverse each recognized license plate in turn according to their arrangement order, replace the easily confused characters in the currently traversed recognized license plate with the corresponding characters, obtain the updated license plate corresponding to the currently traversed recognized license plate, and match each currently obtained updated license plate with each target license plate until any updated license plate completely matches any target license plate, or all recognized license plates are traversed.
[0102] It should be noted that, since the process matching has been performed in step S102, the matching degree of each recognized license plate and each target license plate can be obtained, and the highest matching degree among the matching degrees of each target license plate can be obtained. The recognized license plate with a higher matching degree usually contains fewer easily confused characters, and the possibility that it belongs to the license plate of the current vehicle is greater, so in order to reduce the workload and improve the efficiency of license plate recognition. In the embodiment of the present application, each recognized license plate is sorted from high to low according to the highest matching degree with each target license plate, so that the recognized license plate with a high matching degree can be replaced with characters according to the sorting result, and compared with the target license plate, so that when the updated license plate that completely matches the target license plate is matched, there is no need to process the subsequent recognized license plate.
[0103] S106, determining whether any updated license plate completely matches any target license plate.
[0104] If any updated license plate completely matches any target license plate, step S107 is executed. If each updated license plate does not completely match each target license plate, that is, after all possible character replacements are performed on all identified license plates, none of the updated license plates completely matches the target license plate, step S108 is executed.
[0105] S107: Determine the updated license plate that completely matches the target license plate as the license plate of the current vehicle, and determine that the license plate recognition is successful.
[0106] S108. For each recognized license plate, the characters in the recognized license plate whose confidence level is higher than the confidence threshold are compared with the characters of each target license plate to determine the matching degree of each character of the recognized license plate, and the matching degree of the recognized license plate is determined according to the matching degree of each character of the recognized license plate.
[0107] Since there is still no completely matching license plate after replacing the easily confused characters, it means that the error of identifying the license plate is relatively large. Therefore, in the embodiment of the present application, the confidence of each character of the identified license plate is determined, and the characters with higher confidence are matched with the characters of each target license plate to determine the size of the number of characters that can be matched in each target license plate, thereby determining the matching degree of each character with higher confidence of the identified license plate. The matching degree of each character reflects the matching degree of the identified license plate, so the matching degree of the identified license plate can be determined based on the matching degree of each character of the identified license plate. Based on the matching degree of the identified license plate, it can be further considered whether it is determined to belong to the target license plate, that is, whether the license plate is successfully identified.
[0108] Optionally, considering that the character matching efficiency is relatively slow, if there are many target license plates, the license plate recognition efficiency will be slow. When the license plate entry is not carried out in time, the staff will often intervene. Therefore, step S108 may be performed only when the number of target license plates is less than a certain number.
[0109] Optionally, in another embodiment of the present application, a specific implementation of step S108 is as follows: Figure 3 As shown, the following steps are included:
[0110] S301 . Determine the confidence level of each character in the recognized license plate for each recognized license plate.
[0111] Optionally, a large number of license plate images can be collected, the characters therein can be marked, and the images can be used as training samples to train the model, so that the model can identify the degree of match between each character of the license plate of each device and the features in the model, and then determine the confidence of each character.
[0112] S302, matching each character of the recognized license plate whose confidence is greater than the confidence threshold with the characters at the same position of each target license plate, to obtain the matching degree of each character of the recognized license plate.
[0113] Specifically, for a character in the identified license plate, it is matched with the character in the same position in each target license plate. For example, if a character in the identified license plate is the third character, it is matched with the third character in the target license plate, so that the matching degree of the character can be determined.
[0114] Optionally, in another embodiment of the present application, a specific implementation of step S302 includes the following steps:
[0115] Sort the characters of the recognized license plate whose confidence is greater than the confidence threshold in descending order of confidence, traverse the characters of the recognized license plate in sequence according to the sorting order of the characters of the recognized license plate, match the currently traversed characters of the recognized license plate with the characters at the same position in each target license plate, determine the number of target license plates in which the characters at the same position match the characters of the recognized license plate, and obtain the matching degree of the currently traversed characters of the recognized license plate, until the matching degree of the currently traversed characters of the recognized license plate reaches the preset matching degree, or all the characters of the recognized license plate are traversed.
[0116] It should be noted that the greater the confidence of the character, the greater its matching degree is usually, and when the current matching degree is small, it has no reference value. Therefore, in the embodiment of the present application, the characters are sorted in order from large to small according to the confidence, so that the characters with larger confidence can be matched first. After the matching degree of the currently matched character reaches the preset matching degree, it is no longer necessary to match the subsequent characters, so the matching degree of the subsequent characters will be less than the preset matching degree and has no reference value, so the processing amount can be reduced and the efficiency of license plate recognition can be accelerated.
[0117] S303: Summarize the matching degrees of the characters of the recognized license plate to obtain the matching degree of the recognized license plate.
[0118] S109: Determine the license plate of the current vehicle according to the matching degree of each recognized license plate, and determine the license plate recognition result.
[0119] According to the matching degree of each recognized license plate, it can be determined whether it contains a recognized license plate that can guarantee the accurate determination of the license plate of the current vehicle, thereby determining the license plate recognition result, and then determining whether the current license plate is authorized to enter.
[0120] Optionally, in another embodiment of the present application, a specific implementation of step S109 includes:
[0121] If the maximum value of the matching degree of each recognized license plate is greater than the matching degree threshold, the recognized license plate with the greatest matching degree is determined as the license plate of the current vehicle, and then the license plate recognition is determined to be successful, and an alarm is issued for the recognition record of the current vehicle's license plate. If the maximum value of the matching degree of each recognized license plate is not greater than the matching degree threshold, it is determined that the license plate recognition has failed.
[0122] It should be noted that in the embodiment of the present application, if the matching degree of the recognized license plate with the greatest matching degree is greater than the matching degree threshold, it means that the probability of the license plate being the target license plate is relatively high, and the license plate recognition can be determined to be successful, so that the current target vehicle can enter. However, since the matching target license plate cannot be determined at this time, it can only be directly determined as the license plate of the current vehicle, and an alarm needs to be issued to facilitate confirmation and manual adjustment by the staff.
[0123] If the maximum value of the matching degree of each recognized license plate is not greater than the matching degree threshold, it means that the probability that each recognized license plate belongs to the target license plate is small, so it is determined that the license plate recognition has failed and the current vehicle is prohibited from entering.
[0124] Optionally, in another embodiment of the present application, another specific implementation of step S109 includes:
[0125] The two recognized license plates with the greatest matching degree are fed back to the user.
[0126] If a selection operation instruction from the user is received, the recognized license plate selected by the user is determined as the license plate of the current vehicle, and the license plate recognition is determined to be successful.
[0127] If a modification operation instruction from the user is received, the recognized license plate modified by the user is determined as the license plate of the current vehicle, and the license plate recognition is determined to be successful.
[0128] Of course, if the user believes that both recognized license plates are incorrect, then neither of them can be selected, thereby determining that the license plate recognition has failed and prohibiting the current vehicle from entering.
[0129] The embodiment of the present application provides a license plate recognition method to obtain each recognition license plate of the current vehicle. First, each recognition license plate is matched with each target license plate in the vehicle target library. If any recognition license plate completely matches any target license plate, the recognition license plate that completely matches the target license plate is determined to be the license plate of the current vehicle, and the license plate recognition is determined to be successful. If each recognition license plate does not completely match each target license plate, the easily confused characters in each recognition license plate are replaced with corresponding characters to obtain the updated license plates corresponding to each recognition license plate, and each updated license plate is matched with each target license plate. Thus, characters that are easy to recognize errors can be taken into account, which can be effectively guaranteed. If any updated license plate completely matches any target license plate, the updated license plate that completely matches the target license plate is determined to be the license plate of the current vehicle, and the license plate recognition is determined to be successful. If each updated license plate does not completely match each target license plate, then for each identified license plate, the characters in the identified license plate with a confidence level higher than the confidence threshold are compared with the characters of each target license plate to determine the matching level of each character of the identified license plate, and the matching level of the identified license plate is determined based on the matching level of each character of the identified license plate. Based on the matching level of each identified license plate, the license plate of the current vehicle is determined, and the license plate recognition result is determined. When the recognition error is large, the recognition is performed by matching characters with higher confidence levels, thereby effectively ensuring the accuracy of recognition. Therefore, this solution combines character replacement and matching characters with higher confidence levels, so that even when the equipment and image quality cannot meet the requirements, it can ensure accurate recognition of license plates.
[0130] Another embodiment of the present application provides a license plate recognition system, such as Figure 4 As shown, including:
[0131] The license plate acquisition unit 401 is used to acquire each recognized license plate of the current vehicle.
[0132] The first matching unit 402 is used to match each recognized license plate with each target license plate in the vehicle target library.
[0133] The first determination unit 403 is used to determine the recognized license plate that completely matches the target license plate as the license plate of the current vehicle when any recognized license plate completely matches any target license plate, and determine that the license plate recognition is successful.
[0134] The second matching unit 404 is used to replace the easily confused characters in each recognized license plate with corresponding characters when each recognized license plate does not completely match each target license plate, obtain an updated license plate corresponding to each recognized license plate, and match each updated license plate with each target license plate.
[0135] The second determining unit 405 is used to determine the updated license plate that completely matches the target license plate as the license plate of the current vehicle when any updated license plate completely matches any target license plate, and determine that the license plate recognition is successful.
[0136] The third matching unit 406 is used to compare the characters in the identified license plate with a confidence level higher than a confidence threshold with the characters of each target license plate for each identified license plate when each updated license plate does not completely match each target license plate, to determine the matching level of each character of the identified license plate, and determine the matching level of the identified license plate based on the matching level of each character of the identified license plate.
[0137] The third determination unit 407 is used to determine the license plate of the current vehicle according to the matching degree of each recognized license plate, and determine the license plate recognition result.
[0138] Optionally, in a license plate recognition system provided in another embodiment of the present application, the license plate acquisition unit includes:
[0139] The acquisition unit is used to acquire the video stream of the current vehicle.
[0140] The positioning unit is used to respectively locate the license plate area in each frame image of the video stream.
[0141] The recognition unit is used to perform license plate recognition on the license plate area in each frame image of the video stream to obtain each recognized license plate of the current vehicle.
[0142] Optionally, in a license plate recognition system provided in another embodiment of the present application, the second matching unit includes:
[0143] The first sorting unit is used to sort each recognized license plate in descending order according to the highest matching degree with each target license plate.
[0144] The second matching subunit is used to traverse each recognized license plate in sequence according to the arrangement order of each recognized license plate, replace the easily confused characters in the currently traversed recognized license plate with the corresponding characters, obtain the updated license plate corresponding to the currently traversed recognized license plate, and match each currently obtained updated license plate with each target license plate until any updated license plate is completely matched with any target license plate, or all recognized license plates are traversed.
[0145] Optionally, in a license plate recognition system provided in another embodiment of the present application, the third matching unit includes:
[0146] The confidence determination unit is used to determine the confidence of each character in the recognized license plate respectively for each recognized license plate.
[0147] The character matching unit is used to match each character of the recognized license plate whose confidence is greater than the confidence threshold with the characters at the same position of each target license plate to obtain the matching degree of each character of the recognized license plate.
[0148] The summarizing unit is used to summarize the matching degrees of each character of the recognized license plate to obtain the matching degree of the recognized license plate.
[0149] Optionally, in a license plate recognition system provided in another embodiment of the present application, the character matching unit includes:
[0150] The second sorting unit is used to sort the characters of the recognized license plate whose confidence is greater than the confidence threshold in descending order of confidence.
[0151] The character matching subunit is used to traverse the characters of the recognized license plate in sequence according to the sorting order of the characters of the recognized license plate, match the currently traversed characters of the recognized license plate with the characters at the same position in each target license plate, determine the number of target license plates whose characters at the same position match the characters of the recognized license plate, and obtain the matching degree of the currently traversed characters of the recognized license plate, until the matching degree of the currently traversed characters of the recognized license plate reaches the preset matching degree, or all the characters of the recognized license plate are traversed.
[0152] Optionally, in a license plate recognition system provided in another embodiment of the present application, the third determination unit includes:
[0153] The first license plate determination unit is used to determine the recognized license plate with the greatest matching degree as the license plate of the current vehicle when the maximum value of the matching degrees of each recognized license plate is greater than the matching degree threshold, determine that the license plate recognition is successful, and issue an alarm for the recognition record of the license plate of the current vehicle.
[0154] The failure determination unit is used to determine that the license plate recognition has failed when the maximum value among the matching degrees of each recognized license plate is not greater than the matching degree threshold.
[0155] Optionally, in a license plate recognition system provided in another embodiment of the present application, the third determination unit includes:
[0156] The feedback unit is used to feed back the two recognized license plates with the greatest matching degree to the user.
[0157] The second license plate determination unit is used to determine the recognized license plate selected by the user as the license plate of the current vehicle when receiving the user's selection operation instruction, and determine that the license plate recognition is successful.
[0158] The third license plate determination unit is used to determine the recognized license plate modified by the user as the license plate of the current vehicle when receiving the modification operation instruction from the user, and determine that the license plate recognition is successful.
[0159] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the implementation process of the corresponding steps provided in the above method embodiments, and will not be repeated here.
[0160] Another embodiment of the present application provides an electronic device, such as Figure 5 As shown, including:
[0161] Memory 501 and processor 502 .
[0162] The memory 501 is used to store programs.
[0163] The processor 502 is used to execute the program stored in the memory 501. When the program is executed, it is specifically used to implement the license plate recognition method provided by any one of the above embodiments.
[0164] Another embodiment of the present application provides a computer storage medium for storing a computer program. When the computer program is executed by a processor, it is used to implement the license plate recognition method provided in any of the above embodiments.
[0165] Computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0166] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0167] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A license plate recognition method, characterized in that: include: Get each identification license plate of the current vehicle; Matching each of the identified license plates with each target license plate in a vehicle target library; If any of the identified license plates completely matches any of the target license plates, the identified license plate that completely matches the target license plate is determined as the license plate of the current vehicle, and the license plate recognition is determined to be successful; If each of the identified license plates does not completely match each of the target license plates, then the easily confused characters in each of the identified license plates are replaced with corresponding characters to obtain updated license plates corresponding to each of the identified license plates, and each of the updated license plates is matched with each of the target license plates; If any of the updated license plates completely matches any of the target license plates, the updated license plate that completely matches the target license plate is determined as the license plate of the current vehicle, and the license plate recognition is determined to be successful; If each of the updated license plates does not completely match each of the target license plates, then for each of the identified license plates, the characters in the identified license plate with a confidence level higher than a confidence level threshold are compared with the characters in each of the target license plates to determine the matching level of each character of the identified license plate, and the matching level of the identified license plate is determined based on the matching level of each character of the identified license plate; According to the matching degree of each of the recognized license plates, the license plate of the current vehicle is determined, and a license plate recognition result is determined.
2. The method according to claim 1, characterized in that The obtaining of each identification license plate of the current vehicle includes: Collecting a video stream of the current vehicle; Locating the license plate area in each frame image of the video stream respectively; License plate recognition is performed on the license plate area in each frame image of the video stream to obtain each recognized license plate of the current vehicle.
3. The method according to claim 1, characterized in that: The step of replacing the easily confusable characters in each of the identified license plates with corresponding characters to obtain an updated license plate corresponding to each of the identified license plates, and matching each of the updated license plates with each of the target license plates includes: Sorting the identified license plates in descending order according to the highest matching degree with the target license plates; According to the arrangement order of each of the identified license plates, each of the identified license plates is traversed in turn, and the easily confused characters in the currently traversed identified license plate are replaced with corresponding characters to obtain an updated license plate corresponding to the currently traversed identified license plate, and each of the currently obtained updated license plates is matched with each of the target license plates until any one of the updated license plates is completely matched with any one of the target license plates, or all of the identified license plates are traversed.
4. The method according to claim 1, characterized in that The step of comparing the characters in the recognized license plate whose confidence is higher than the confidence threshold with the characters in each target license plate respectively for each recognized license plate to determine the matching degree of each character in the recognized license plate, and determining the matching degree of the recognized license plate according to the matching degree of each character in the recognized license plate, comprises: For each of the identified license plates, determining the confidence level of each character in the identified license plate; Matching each character of the recognized license plate whose confidence is greater than the confidence threshold with the characters at the same position of each target license plate to obtain the matching degree of each character of the recognized license plate; The matching degrees of the respective characters of the recognized license plate are summarized to obtain the matching degree of the recognized license plate.
5. The method according to claim 4, characterized in that The step of matching each character of the recognized license plate whose confidence is greater than a confidence threshold with each character at the same position of each target license plate to obtain a matching degree of each character of the recognized license plate includes: Sort the characters of the recognized license plate whose confidence is greater than the confidence threshold in descending order of confidence; According to the sorting order of each character of the recognized license plate, traverse each character of the recognized license plate in turn, match the currently traversed character of the recognized license plate with the character at the same position in each target license plate, determine the number of target license plates whose characters at the same position match the characters of the recognized license plate, and obtain the matching degree of the currently traversed characters of the recognized license plate, until the matching degree of the currently traversed characters of the recognized license plate reaches the preset matching degree, or all characters of the recognized license plate are traversed.
6. The method according to claim 1, characterized in that Determining the license plate of the current vehicle according to the matching degree of each of the identified license plates and determining the license plate recognition result includes: If the maximum value among the matching degrees of the recognized license plates is greater than the matching degree threshold, the recognized license plate with the maximum matching degree is determined as the license plate of the current vehicle; Determining that the license plate recognition is successful, and issuing an alarm for the recognition record of the license plate of the current vehicle; If the maximum value of the matching degrees of the recognized license plates is not greater than the matching degree threshold, it is determined that the license plate recognition has failed.
7. The method according to claim 1, characterized in that Determining the license plate of the current vehicle according to the matching degree of each of the identified license plates and determining the license plate recognition result includes: Feedback the two recognized license plates with the greatest matching degree to the user; If the user's selection operation instruction is received, the recognized license plate selected by the user is determined as the license plate of the current vehicle, and the license plate recognition is determined to be successful; If a modification operation instruction from the user is received, the recognized license plate modified by the user is determined as the license plate of the current vehicle, and it is determined that the license plate recognition is successful.
8. A license plate recognition system, characterized in that: include: A license plate acquisition unit, used to acquire each identification license plate of the current vehicle; A first matching unit, used for matching each of the identified license plates with each target license plate in a vehicle target library; A first determination unit is used to determine the recognized license plate that completely matches the target license plate as the license plate of the current vehicle when any one of the recognized license plates completely matches any one of the target license plates, and determine that the license plate recognition is successful; A second matching unit is used to replace the easily confused characters in each of the identified license plates with corresponding characters when each of the identified license plates does not completely match each of the target license plates, obtain an updated license plate corresponding to each of the identified license plates, and match each of the updated license plates with each of the target license plates; A second determination unit is used to determine the updated license plate that completely matches the target license plate as the license plate of the current vehicle when any one of the updated license plates completely matches any one of the target license plates, and determine that the license plate recognition is successful; A third matching unit is used for, when each of the updated license plates does not completely match each of the target license plates, for each of the identified license plates, comparing the characters in the identified license plates with a confidence level higher than a confidence level threshold with the characters in each of the target license plates, to determine the matching level of each character of the identified license plate, and determining the matching level of the identified license plate according to the matching level of each character of the identified license plate; The third determination unit is used to determine the license plate of the current vehicle and determine the license plate recognition result according to the matching degree of each of the recognized license plates.
9. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the license plate recognition method as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, is used to implement the license plate recognition method as described in any one of claims 1 to 7.