License plate matching method and device, electronic equipment and computer program product

By obtaining the license plate string and confidence array, using the weight assignment strategy and license plate prefix tree for fuzzy matching, and calculating the minimum editing cost, the problem of license plate recognition errors is solved, and high-accuracy and high-speed license plate matching is achieved in complex environments.

CN120673390APending Publication Date: 2025-09-19TP-LINK
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510773797.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

License plate recognition in complex environments is affected by factors such as lighting and occlusion, which may lead to errors or omissions in recognition results and affect the robustness of license plate matching.

Method used

By obtaining the license plate string and its confidence array, using the weight assignment strategy and license plate prefix tree for fuzzy matching, the minimum editing cost is calculated, the matching result is determined, and the impact of recognition errors is reduced.

Benefits of technology

Maintain high matching accuracy and speed in complex environments, improve the robustness of license plate matching, and reduce the impact of environmental and lighting factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673390A_ABST
    Figure CN120673390A_ABST
Patent Text Reader

Abstract

The invention discloses a license plate matching method, a license plate matching device, electronic equipment and a computer program product. The method comprises the steps that a to-be-processed license plate is recognized, a character string of the to-be-processed license plate and a confidence coefficient array corresponding to the character string are obtained, and the dimension of the confidence coefficient array is the same as the length of the character string; according to the character string, the confidence coefficient array and a preset weight assignment strategy, a weight array corresponding to the character string is determined, and the dimension of the weight array is the same as that of the confidence coefficient array; based on a preset license plate prefix tree and the weight array, the character string is searched to obtain a candidate license plate set, the candidate license plate set comprises at least one candidate license plate, and the license plate prefix tree is constructed based on a license plate library; calculating the minimum editing cost of the character string and each candidate license plate in the candidate license plate set; and determining a matching result of the to-be-processed license plate based on each minimum editing cost. According to the scheme, the license plate matching robustness can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular relates to a license plate matching method, a license plate matching device, an electronic device, and a computer program product. Background Art

[0002] When a vehicle passes through a checkpoint, a license plate record is generated. On wide roads, multiple cameras are often required to capture vehicles from different directions. The same vehicle passing through multiple cameras will upload records, necessitating the merging of these records. Furthermore, in similar applications such as parking lot entry and exit, when a vehicle passes through a checkpoint, it must be matched against a license plate database to determine its access rights and charge a fee based on parking time before the gate is released. All of this relies on license plate recognition and matching.

[0003] However, since the checkpoint environment may be relatively complex, when recognizing the vehicle's license plate, the recognition results may be affected by environmental factors such as lighting and / or occlusion, resulting in partial errors or omissions in the recognition results, which will seriously affect the robustness of subsequent license plate matching. Summary of the Invention

[0004] The present application provides a license plate matching method, a license plate matching device, an electronic device, and a computer program product, which can improve the robustness of license plate matching.

[0005] In a first aspect, the present application provides a license plate matching method, comprising:

[0006] Identify the license plate to be processed and obtain the string of the license plate to be processed and the confidence array corresponding to the string, where the dimension of the confidence array is the same as the length of the string;

[0007] Determine the weight array corresponding to the string based on the string, the confidence array, and the preset weight assignment strategy, where the dimension of the weight array is the same as the dimension of the confidence array;

[0008] Based on a preset license plate prefix tree and weight array, the character string is searched to obtain a candidate license plate set, the candidate license plate set including at least one candidate license plate, wherein the license plate prefix tree is constructed based on the license plate library;

[0009] Calculate the minimum editing cost between the string and each candidate license plate in the candidate license plate set;

[0010] Based on each minimum editing cost, the matching result of the license plate to be processed is determined.

[0011] In a second aspect, the present application provides a license plate matching device, comprising:

[0012] The recognition module is used to recognize the license plate to be processed and obtain the character string of the license plate to be processed and the confidence array corresponding to the character string, wherein the dimension of the confidence array is the same as the length of the character string;

[0013] A first determination module is configured to determine a weight array corresponding to the character string based on the character string, the confidence array, and a preset weight assignment strategy, wherein the dimension of the weight array is the same as the dimension of the confidence array;

[0014] A search module is used to search for a character string based on a preset license plate prefix tree and a weight array to obtain a candidate license plate set, wherein the candidate license plate set includes at least one candidate license plate, wherein the license plate prefix tree is constructed based on the license plate library;

[0015] A calculation module, used for calculating the minimum editing cost between the character string and each candidate license plate in the candidate license plate set;

[0016] The second determination module is used to determine the matching result of the license plate to be processed based on each minimum editing cost.

[0017] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of the first aspect when executing the computer program.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which implements the steps of the method of the first aspect when executed by a processor.

[0019] In a fifth aspect, the present application provides a computer program product, which includes a computer program, and when the computer program is executed by one or more processors, it implements the steps of the method of the first aspect.

[0020] Compared to the prior art, the present application offers the following advantages: to reduce the impact of misidentification or missed recognition on license plate matching, the electronic device, in addition to identifying the license plate's character string, also obtains a confidence array corresponding to the character string when identifying the license plate. It is understood that this confidence array effectively represents the recognition confidence level of each character in the character string. Thus, the electronic device can determine the weight array corresponding to the character string based on the character string, the confidence array, and a preset weight assignment strategy. Then, based on the preset license plate prefix tree and the weight array, it searches the character string to obtain a set of candidate license plates. It is understood that by introducing the weight array, the impact of different characters in the character string on the search operation can be adjusted, thereby ensuring that the search result takes into account possible misidentification and missed recognition. Finally, the electronic device can calculate the minimum edit cost between the character string and each candidate license plate in the candidate license plate set, and determine a match result for the license plate based on each minimum edit cost. The above license plate matching process does not rely on pixel-by-pixel segmentation operations, so the matching results are less affected by factors such as the environment, lighting, and shooting angle. It also takes into account relevant factors such as the confidence of the recognition results, thereby maintaining a high matching accuracy and matching speed in complex environments, thereby improving the robustness of license plate matching.

[0021] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0023] Figure 1 This is a schematic diagram of the implementation process of the license plate matching method provided in the embodiment of the present application;

[0024] Figure 2 This is an example diagram of a license plate prefix tree provided in an embodiment of the present application;

[0025] Figure 3 Schematic diagram of the structure of the license plate matching device provided in an embodiment of the present application;

[0026] Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.

[0029] In the description of the embodiments of the present application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features.

[0030] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0031] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.

[0032] In the description of the embodiments of the present application, the term "plurality" refers to two or more (including two), unless otherwise clearly and specifically defined.

[0033] The embodiment of the present application proposes a license plate matching method. The license plate matching method can be applied to electronic devices with data processing capabilities. Figure 1 , Figure 1 The implementation process of the license plate matching method applied to the electronic device is given, and the details are as follows:

[0034] Step 101: Identify the license plate to be processed and obtain the character string of the license plate to be processed and the confidence array corresponding to the character string.

[0035] The electronic device can use a trained license plate recognition model to recognize the license plate to be processed, and obtain a recognition result output by the license plate recognition model for the license plate to be processed. In some examples, the license plate recognition model can be a deep neural network model with end-to-end recognition capabilities, and the specific results of the deep neural network model are not limited here.

[0036] Among them, the recognition result can include two parts of data, namely: the string of the license plate to be processed, and the confidence array corresponding to the string. It can be understood that the dimension of the confidence array is the same as the length of the string, which can be used to express the credibility of the recognized string; the i-th data in the confidence array is the confidence of the i-th character of the string, which expresses whether the i-th character is credible, which is usually a floating point number or a percentage integer between 0 and 1. In some examples, the string obtained for the license plate to be processed may be "XB12344" (where X can be the abbreviation corresponding to a province. For privacy reasons, X is used as an example here), and the corresponding confidence array may be [0.98, 0.97, 0.90, 0.60, 0.45, 0.70, 0].

[0037] Step 102: Determine the weight array corresponding to the character string according to the character string, the confidence array and the preset weight assignment strategy.

[0038] In order to improve the accuracy of subsequent string search and correction, the embodiment of the present application can pre-set a weight assignment strategy to determine the weight array corresponding to the string based on the string, the confidence array and the weight assignment strategy. The weight array can be used to identify the importance and reliability of each character in the string.

[0039] In some examples, based on the license plate format, it can be seen that certain positions have a greater impact on the overall recognition results (such as the first province abbreviation on the license plate), so the weight assignment strategy can assign a relatively high weight to the character at that position; in other examples, the higher the confidence level of the character, the lower the probability of recognition error, so the weight assignment strategy can assign a relatively higher weight to the character; the setting principle of the weight assignment strategy is not limited here.

[0040] It can be understood that the weight array corresponding to the string should have the same dimension as the confidence array; that is, the number of elements in these two arrays is equal to the number of characters in the string, so that each element in the array uniquely corresponds to a character in the string.

[0041] Step 103: Search the character string based on the preset license plate prefix tree and weight array to obtain a set of candidate license plates.

[0042] To improve search efficiency and accuracy, electronic devices can first construct a license plate prefix tree based on the license plate library and then perform fuzzy matching on the identified string based on this license plate prefix tree. During fuzzy matching, a weighted matching cost can be calculated in conjunction with a weight array. Because the license plate prefix tree stores a complete set of legal license plates, sorted by frequency, and supports fast prefix-based searches, it can quickly find a set of candidate license plates. This set of candidate license plates includes at least one candidate license plate that is character-similar to the string.

[0043] Step 104 : Calculate the minimum editing cost between the character string and each candidate license plate in the candidate license plate set.

[0044] For each candidate license plate in the candidate license plate set, the electronic device can calculate the minimum edit cost between the candidate license plate and the recognized character string. In some examples, the minimum edit cost can be calculated based on a weighted edit distance algorithm; of course, other algorithms can also be used for calculation, which is not limited here.

[0045] Step 105: Determine the matching result of the license plate to be processed based on each minimum editing cost.

[0046] It will be appreciated that each candidate license plate in the candidate license plate set will be assigned a corresponding minimum edit cost. After summing these minimum edit costs, the electronic device can then find the minimum value among these minimum edit costs. It will be appreciated that the candidate license plate corresponding to this minimum value is the license plate that is most similar to the recognized character string, and thus the matching result for the license plate to be processed can be determined based on this minimum value.

[0047] Specifically, if the minimum value is less than a preset cost threshold, the license plate in the license plate library that is most similar to the license plate to be processed is considered to be substantially similar to the license plate to be processed, and the electronic device can determine that the matching result is a successful match between the license plate to be processed and the candidate license plate corresponding to the minimum value. Conversely, if the minimum value is greater than or equal to the cost threshold, the license plate in the license plate library that is most similar to the license plate to be processed is considered to be significantly different from the license plate to be processed, and the matching result can be determined to be a failed match. The electronic device can then add the license plate to be processed as a new license plate to the license plate library. In some examples, the cost threshold can be set to 2; of course, the cost threshold can also be set to other values, which are not limited here.

[0048] In some embodiments, the weight assignment strategy may set the weight of the corresponding character based on the confidence level and the character position; then step 102 may include:

[0049] Step A1: Divide characters in a character string into first target characters, second target characters, and third target characters according to a confidence array.

[0050] The first target character refers to a character in the confidence array whose corresponding confidence is 0. The first target character can be understood as a placeholder character.

[0051] The second target character is adjacent to the first target character in a specified direction, specifically the forward direction. Considering that license plates are typically arranged left and right, the specified direction can also be understood as the left direction. That is, the second target character is the character immediately preceding (one position to the left of) the first target character.

[0052] The third target character is a character other than the first target character and the second target character.

[0053] In one application scenario, if the difference between the standard license plate length corresponding to the pending license plate and the length of the recognition result for the pending license plate is greater than a preset difference threshold, the recognition result is considered to be highly likely unreliable, and the vehicle corresponding to the pending license plate can be directly recorded as an unlicensed vehicle, meaning no further subsequent operations are required. Otherwise, subsequent operations can continue. The difference threshold can be set to 2, and the standard license plate length corresponding to the pending license plate can be determined based on the color of the pending license plate and the recognition result. This is illustrated below with a specific example: if the recognition result for a vehicle's pending license plate includes letters, numbers, and Chinese characters (the Chinese character is the province abbreviation and is in the first position), and the license plate color is blue, then the pending license plate is preliminarily determined to be a mainland gasoline-powered small car license plate, with a standard license plate length of 7. At this time, if the length of the recognition result for the pending license plate is only 4 digits, the difference between the two is 3, which is greater than the preset difference threshold of 2, and the vehicle will be recorded and reported as an unlicensed vehicle. Similarly, all possible scenarios are not elaborated here.

[0054] In another application scenario, there may not be any first target characters in the recognized character string; accordingly, when there is no first target character, the second target character also does not exist; that is, in this application scenario, all characters in the character string are third target characters.

[0055] Step A2: Determine the weights corresponding to the first target character, the second target character, and the third target character respectively according to the weight assignment strategy.

[0056] For the first target character and the second target character:

[0057] Because the first target character is a placeholder, its weight can be set to a lower value in the weight assignment strategy. Similarly, because the second target character is close to the first target character (i.e., the placeholder), its weight can also be set to a lower value in the weight assignment strategy. Based on this, in some examples, the weights corresponding to the first target character and the second target character can be determined as a first preset value, which is set by the weight assignment strategy, for example, 0.4.

[0058] For the third target character:

[0059] Since the third target character isn't obtained by placeholder filling, its weight can be determined based on two factors: confidence and importance. The importance determination corresponds to the second preset value, while the confidence determination corresponds to the third preset value. The weight of the third target character can be specifically the product of the second and third preset values.

[0060] Among them, whether it is important refers to whether the position of the third target character is in an important position; for license plates within a certain region, the first character in the license plate (that is, the character expressing the province abbreviation) can be regarded as an important character. In the weight assignment strategy proposed in the embodiment of the present application, the second preset value corresponding to the case where the judgment result of whether it is important is yes (that is, the third target character is an important character) is set to 1.5; the second preset value corresponding to the case where the judgment result of whether it is important is no (that is, the third target character is an unimportant character) is set to 1.

[0061] Among them, whether it is confident or not can be judged based on a preset confidence threshold, specifically: when the confidence of the third target character is less than the confidence threshold, the third target character is an unconfident character; when the confidence of the third target character is greater than or equal to the confidence threshold, the third target character is a confident character. In the weight assignment strategy proposed in the embodiment of the present application, the third preset value corresponding to the case where the result of the confidence judgment is yes (that is, the third target character is a confident character) can be set to 1; the third preset value corresponding to the case where the result of the confidence judgment is no (that is, the third target character is an unconfident character) is set to 0.8. In addition, the confidence threshold can also be set by the weight assignment strategy. For example, the weight assignment strategy can set the confidence threshold to 0.92.

[0062] In step A3, a weight array is determined according to the weights corresponding to the first target character, the second target character, and the third target character.

[0063] It can be understood that the first target character, the second target character and the third target character have completely expressed the character string. Therefore, the weight corresponding to the first target character, the weight corresponding to the second target character and the weight corresponding to the third target character can be sorted according to the arrangement order of each character in the character string to obtain the corresponding weight array.

[0064] To facilitate understanding of the above weight assignment process, the following is an explanation using a specific example:

[0065] Assume that the string obtained from the license plate recognition is "XB12344" (where X can be the abbreviation of a province. For privacy reasons, X is used as an example here), and the corresponding confidence array is [0.98, 0.97, 0.90, 0.60, 0.45, 0.70, 0]. Then:

[0066] Since the confidence of the last character "4" is 0, the last character "4" is determined to be the first target character; since the second-to-last character "4" is the previous character of the last character "4", the second-to-last character "4" is determined to be the second target character; the remaining characters, namely the characters "X", "B", "1", "2" and "3" are all the third target characters.

[0067] For the last character "4", since it is the first target character, the corresponding weight can be determined to be 0.4; for the second to last character "4", since it is the second target character, the corresponding weight can be determined to be 0.4; for the character "X", since it is the first character of the license plate and the confidence is greater than the confidence threshold of 0.92, it is an important and confident character, and the corresponding weight can be determined to be 1.5*1, that is, 1.5; for the character "B", since it is not the first character of the license plate and the confidence is greater than the confidence threshold of 0.92, it is an important and confident character, and the corresponding weight can be determined to be 1.5*1, that is, 1.5; The confidence level is greater than the confidence threshold of 0.92, so it is an unimportant and confident character, and the corresponding weight can be determined to be 1*1, that is, 1; for the characters "1", "2" and "3", since none of them are the first characters of the license plate and their confidence levels are less than the confidence threshold of 0.92, they are all unimportant and unconfident characters, and the corresponding weights can be determined to be 1*0.8, that is, 0.8; the corresponding weight array is [1.5, 1, 0.8, 0.8, 0.8, 0.4, 0.4].

[0068] In some embodiments, the specific structure and construction process of the license plate prefix tree are explained:

[0069] The license plate prefix tree is specifically a Trie tree built based on an N-dimensional sliding window. It's understandable that a large value for N may make it difficult to find matching candidate license plates during subsequent fuzzy matching. Conversely, a small value for N may result in a wide license plate prefix tree, reducing search efficiency. Therefore, N should be set based on both time consumption and performance.

[0070] Each node in the license plate prefix tree is specifically a character of an existing license plate in the license plate database. It is understood that in addition to expressing the characters of the existing license plate, the nodes at each level of the license plate prefix tree can also record the frequency of occurrence of the character. The frequency of occurrence is actually the frequency of occurrence of the subtree corresponding to the character (which can be determined based on the N-dimensional sliding window result) in the license plate database (equivalent to the number of existing license plates in the license plate database). In the embodiment of the present application, the frequency of occurrence can be recorded by a frequency counter, so that the search path priority can be dynamically adjusted based on the frequency of occurrence during fuzzy matching. On this basis, the child nodes under each node can be stored in descending order according to the frequency of occurrence recorded by the child node, so that when searching or traversing later, relatively high-frequency child nodes can be preferentially accessed based on the order of the child nodes. It is understood that each time a new license plate is identified, the license plate prefix tree can be updated based on the license plate, the frequency of occurrence of the node corresponding to each character in the license plate along the path is updated, and the order of the child nodes under the node is synchronously updated.

[0071] In addition, the leaf nodes in the license plate prefix tree can also maintain an inverted index, where the inverted index is specifically: the index of the license plate corresponding to the subtree where the leaf node is located (equivalent to the N-dimensional sliding window result) in the license plate database.

[0072] To facilitate understanding, the license plate prefix tree is explained below through a specific example:

[0073] Assume N is 3, and the existing license plates in the license plate database are: AB123 (index 1), AB124 (index 2), and ABABA (index 3). Then the N-dimensional sliding window result for AB123 is: AB1, B12, 123; the sliding window result for AB124 is: AB1, B12, 124; and the N-dimensional sliding window result for ABABA is: ABA, BAB, ABA. This can be illustrated in Table 1 below:

[0074] index Already have a license plate N-dimensional sliding window results (N=3) 1 AB123 AB1,B12,123 2 AB124 AB1,B12,124 3 ABABA ABA,BAB,ABA

[0075] Table 1

[0076] It can be seen that the N-dimensional sliding window result AB1 appears twice (corresponding to two existing license plates, namely AB123 and AB124); the N-dimensional sliding window result B12 appears twice (corresponding to two existing license plates, namely AB123 and AB124); the N-dimensional sliding window result 123 appears once (corresponding to an existing license plate, namely AB123); the N-dimensional sliding window result 124 appears once (corresponding to an existing license plate, namely AB124); the N-dimensional sliding window result ABA appears once (corresponding to an existing license plate, namely ABABA); the N-dimensional sliding window result BAB appears once (corresponding to an existing license plate, namely ABABA). Therefore, we can construct the following Figure 2 The license plate prefix tree shown.

[0077] In some embodiments, based on the structure of the license plate prefix tree proposed above, the electronic device can specifically find the license plate candidate set in the following manner:

[0078] Step B1: perform subsequence segmentation on the character string to obtain multiple character string subsequences.

[0079] Since the path in the license plate prefix tree is obtained based on the N-dimensional sliding window result, in order to facilitate matching, the electronic device can also perform subsequence segmentation on the recognized string; it can be understood that the operation of the subsequence segmentation is similar to the operation of the N-dimensional sliding window, and the length of the obtained string subsequence is the same as the sliding window length of the license plate prefix tree.

[0080] In some examples, assuming that the recognized character string is A81233, after performing subsequence segmentation on the character string, the obtained character string subsequences are specifically four items: A81, 812, 123 and 233.

[0081] Step B2: Based on the multiple string subsequences, search for an inverted index that meets the preset conditions in the license plate prefix tree to obtain an inverted index set.

[0082] The electronic device can search based on each string subsequence in the license plate prefix tree, thereby determining the subtree that matches each string subsequence, and then obtaining the inverted index corresponding to the subtree through the record of the leaf node on the subtree. In order to reduce the amount of subsequent computational processing, in an embodiment of the present application, for any string subsequence, only the subtree that matches the string subsequence and whose corresponding occurrence frequency is greater than or equal to a preset occurrence frequency threshold is considered. That is, when a subtree matches the string subsequence, the occurrence frequency of the subtree should also be greater than or equal to the occurrence frequency threshold, and the inverted index of the subtree is an inverted index that meets the preset conditions and can be recorded in the inverted index set as an element in the inverted index set.

[0083] In some examples, the occurrence frequency threshold can be set according to actual conditions, for example, it can be set to 2; of course, the occurrence frequency threshold can also be set to other values, which are not limited here.

[0084] Step B3: For each license plate corresponding to the inverted index in the inverted index set, the matching cost between the character string and the license plate is calculated based on the weight array.

[0085] It can be understood that each inverted index corresponds to a license plate in the license plate database. Since the operations in steps B1 and B2 are only preliminary matches based on the N-dimensional sliding window results (string subsequences), it is necessary to determine the license plate corresponding to the inverted index and then check whether the license plate matches the license plate to be identified. Based on this, for each license plate corresponding to the inverted index in the inverted index set, the electronic device can calculate the matching cost between the identified string (representing the license plate to be identified) and the license plate based on the determined weight array.

[0086] In some embodiments, for a license plate corresponding to any inverted index in the inverted index set, the matching cost between the license plate and the recognized string can be calculated as follows:

[0087] Step B31: perform subsequence segmentation on the license plate to obtain multiple license plate subsequences.

[0088] As described above, the subsequence segmentation operation is similar to the N-dimensional sliding window operation. The length of the obtained license plate subsequence is the same as the sliding window length of the license plate prefix tree; that is, the length of the license plate subsequence and the length of the string subsequence are both the same as the sliding window length of the license plate prefix tree.

[0089] Step B32 , based on the weight corresponding to each string subsequence in the weight array and the preset similar character mapping table, calculate the matching cost between each string subsequence and each license plate subsequence to determine the target license plate subsequence corresponding to each string subsequence.

[0090] The similar character mapping table stores the mapping relationship between two similar different characters. For example, 0 and D are similar characters, and 0 and Q are also similar characters. No further details are given here. The similar character mapping table can be specifically set in advance by the staff, and similar characters can be added or deleted in the similar character mapping table according to actual conditions. No further details are given here. Taking into account the existence of recognition errors, the matching cost weight between two similar characters can generally be set to a smaller value (for example, 0.5), and the matching cost weight between two dissimilar characters can be set to a larger value (for example, 1). In this way, the matching cost of each string subsequence and each license plate subsequence can be calculated. Of course, the matching cost weight in different situations can also be set to other values ​​according to needs, which is not limited here.

[0091] In some examples, assuming the recognized string is A81233, the weight array of the string is [1.0, 0.8, 0.8, 1.0, 0.4, 0.4]; decomposing both the string and the weight array yields:

[0092] The specific string subsequence is: A81,812,123,233;

[0093] The decomposition results of the weight array are: [1.0.0.8,0.8], [0.8,0.8,1.0], [0.8,1.0,0.4], [1.0,0.4,0.4].

[0094] For the string subsequence "A81", assuming that the license plate subsequence to be matched in the license plate "AB123" is "AB1", the matching cost between the two is: 1*0+0.5*0.8+0.8*0=0.4.

[0095] Among them, the "1" in "1*0" is specifically the weight corresponding to the character "A" in the string subsequence "A81" in the weight array, and the "0" in "1*0" is specifically the matching cost weight of the character "A" in the string subsequence "A81" and the character "A" in the license plate subsequence "AB1" (because the two are the same characters); similarly, the "0.8" in "0.5*0.8" is specifically the weight corresponding to the character "8" in the string subsequence "A81" in the weight array, and the "0.5" in "0.5*0.8" is specifically the matching cost weight of the character "8" in the string subsequence "A81" and the character "B" in the license plate subsequence "AB1" (because the two are similar characters); and the rest are similar and not limited here.

[0096] Thus, for any string subsequence, the matching cost with each license plate subsequence of any license plate can be determined through the above process. The electronic device can then filter based on this matching cost to find the license plate subsequence with the lowest matching cost with the string subsequence. This license plate subsequence becomes the target license plate subsequence for the string subsequence. In other words, the target license plate subsequence is the license plate subsequence with the lowest matching cost with the corresponding string subsequence.

[0097] In some examples, let's take the recognized string A81233, the weight array of the string is [1.0, 0.8, 0.8, 1.0, 0.4, 0.4], and the license plate to be matched is "AB123". We can get:

[0098] The target license plate subsequence of the string subsequence "A81" is "AB1", and its matching cost is 1*0+0.5*0.8+0.8*0=0.4;

[0099] The target license plate subsequence of the string subsequence "812" is "B12", and its matching cost is 0.8*0.5+0.8*0+1*0=0.4;

[0100] The target license plate subsequence of the string subsequence "123" is "123", and its matching cost is 0.8*0+1*0+1*0=0;

[0101] The target license plate subsequence of the string subsequence "233" is "123", and its matching cost is 1*1+0.4*1+0.4*0=1.4.

[0102] B33, calculate the average of the matching costs between each string subsequence and the corresponding target license plate subsequence to obtain the matching cost between the string and the license plate.

[0103] For any license plate corresponding to an inverted index, each subsequence of the identified string has been found in the license plate, along with a corresponding target license plate subsequence and matching cost. Therefore, if the identified string has M subsequences, then M target license plate subsequences can be found, resulting in M ​​matching costs. By averaging these M matching costs, we can obtain the matching cost between the string and the license plate.

[0104] Based on the example proposed in step B32, it can be seen that the matching cost between the recognized character string "A81233" and the license plate "AB123" is: [0.4+0.4+0+1.4) / 4=0.55.

[0105] Step B4: construct a candidate license plate set based on at least one license plate with the minimum matching cost.

[0106] It can be understood that when there are L inverted indices in the inverted index set, since each inverted index corresponds to a license plate, a total of L license plates can be determined. The electronic device can calculate the matching cost of these L license plates with the recognized character string, thereby obtaining L matching costs, and find the license plate corresponding to the minimum matching cost among these L matching costs. Considering that there may be multiple minimum matching costs, the number of license plates with the minimum matching cost is not limited here, that is, there must be at least one license plate with the minimum matching cost with the recognized character string. These license plates can all be determined as candidate license plates, thereby constructing a candidate license plate set.

[0107] In some embodiments, to enhance the explainability of the matching, the electronic device may determine the minimum edit distance cost between the candidate license plate and the character string in the following manner:

[0108] Step C1 : for each candidate license plate, determine the editing operation to be performed based on the difference between the candidate license plate and the character string.

[0109] It is understandable that two characters that are exactly the same do not require editing operations; only two characters that are different require editing operations. Furthermore, the present application implements the subdivision of editing operations into: the replacement operation of similar characters, and the replacement operation of dissimilar characters. These two editing operations may correspond to different editing costs. In some examples, the editing cost corresponding to the replacement operation of similar characters may be 0.2, and the editing cost corresponding to the replacement operation of dissimilar characters may be 1; of course, the editing costs corresponding to different editing operations may also be set according to actual conditions, which is not limited here.

[0110] Step C2: Determine the minimum editing cost of the candidate license plate and character string based on the editing cost corresponding to the editing operation, the character sequence corresponding to the editing operation, and the weight array.

[0111] The electronic device can determine the corresponding weight in the weight array corresponding to the string based on the character sequence corresponding to the edit operation. It can be understood that the edit cost corresponding to each edit operation is multiplied by the weight indicated by the corresponding character sequence and then summed to obtain the minimum edit cost of the candidate license plate and string.

[0112] In some examples, assume that the string identified for the license plate to be processed is XBD72911, and the candidate license plate is XBD12919, where the first character X is the abbreviation of a province. The confidence array, weight array, and related editing operations for this string can be shown in Table 2 below:

[0113]

[0114] Table 2

[0115] Then, the minimum editing cost of the string "XBD72911" and the candidate license plate "XBD12919" is:

[0116] 1*0.8*0.2+0.4*1=0.56

[0117] Among them, the "1*0.8" in "1*0.8*0.2" is determined based on the weight indicated in the weight array of the character sequence corresponding to the replacement operation of similar characters; the "0.2" in "1*0.8*0.2" is determined based on the editing cost of the replacement operation of similar characters; the "0.4" in "0.4*1" is determined based on the weight indicated in the weight array of the character sequence corresponding to the replacement operation of dissimilar characters, and the "1" in "0.4*1" is determined based on the editing cost of the replacement operation of dissimilar characters.

[0118] As can be seen from the above, in the embodiments of the present application, to reduce the impact of misidentification or missed recognition on license plate matching, the electronic device, in addition to identifying the character string of the license plate to be processed, also obtains a confidence array corresponding to the character string. It will be understood that this confidence array effectively represents the recognition confidence level of each character in the character string. Thus, the electronic device can determine the weight array corresponding to the character string based on the character string, the confidence array, and a preset weight assignment strategy. Then, based on the preset license plate prefix tree and the weight array, it searches the character string to obtain a set of candidate license plates. It will be understood that by introducing the weight array, the impact of different characters in the character string on the search operation can be adjusted, thereby ensuring that the search results take into account possible misidentification and missed recognition. Finally, the electronic device can calculate the minimum edit cost between the character string and each candidate license plate in the candidate license plate set, and determine a match result for the license plate to be processed based on each minimum edit cost. The above license plate matching process does not rely on pixel-by-pixel segmentation operations, so the matching results are less affected by factors such as the environment, lighting, and shooting angle. It also takes into account relevant factors such as the confidence of the recognition results, thereby maintaining a high matching accuracy and matching speed in complex environments, thereby improving the robustness of license plate matching.

[0119] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0120] Corresponding to the license plate matching method provided above, the present embodiment also provides a license plate matching device. Figure 3 The license plate matching device 3 in the embodiment of the present application includes:

[0121] The recognition module 301 is used to recognize the license plate to be processed and obtain the character string of the license plate to be processed and the confidence array corresponding to the character string, wherein the dimension of the confidence array is the same as the length of the character string;

[0122] A first determining module 302 is configured to determine a weight array corresponding to the character string based on the character string, the confidence array, and a preset weight assignment strategy, wherein the dimension of the weight array is the same as the dimension of the confidence array;

[0123] A search module 303 is configured to search for a character string based on a preset license plate prefix tree and a weight array to obtain a candidate license plate set, wherein the candidate license plate set includes at least one candidate license plate, wherein the license plate prefix tree is constructed based on the license plate library;

[0124] A calculation module 304 is used to calculate the minimum editing cost between the character string and each candidate license plate in the candidate license plate set;

[0125] The second determining module 305 is configured to determine a matching result of the license plate to be processed based on each minimum editing cost.

[0126] In some embodiments, the first determining module 302 includes:

[0127] a dividing unit, configured to divide characters in the character string into a first target character, a second target character, and a third target character according to the confidence array, wherein the confidence corresponding to the first target character in the confidence array is 0, the second target character is adjacent to the first target character in a specified direction, and the third target character is a character other than the first target character and the second target character;

[0128] A first determining unit is configured to determine weights corresponding to the first target character, the second target character, and the third target character, respectively, according to a weight assignment strategy;

[0129] The second determining unit is configured to determine a weight array according to the weights corresponding to the first target character, the second target character, and the third target character.

[0130] In some embodiments, the first determining unit includes:

[0131] A first determining subunit, configured to determine the weights corresponding to the first target character and the second target character as first preset values;

[0132] A second determining subunit is configured to determine the weight corresponding to the third target character as a product of the second preset value and the third preset value;

[0133] The first preset value, the second preset value and the third preset value are all set by a weight assignment strategy.

[0134] In some embodiments, the search module 303 includes:

[0135] The word segmentation unit is used to perform subsequence segmentation on the string to obtain multiple string subsequences, where the length of the string subsequence is the same as the sliding window length of the license plate prefix tree;

[0136] A search unit is used to search for an inverted index that meets a preset condition in the license plate prefix tree based on multiple string subsequences to obtain an inverted index set;

[0137] A calculation unit, configured to calculate, for each license plate corresponding to an inverted index in the inverted index set, a matching cost between the character string and the license plate based on the weight array;

[0138] The construction unit is used to construct a candidate license plate set based on at least one license plate with the minimum matching cost.

[0139] In some embodiments, the computing unit includes:

[0140] The word segmentation subunit is used to perform subsequence segmentation on the license plate to obtain multiple license plate subsequences, where the length of the license plate subsequence is the same as the sliding window length of the license plate prefix tree;

[0141] A first calculation subunit is configured to calculate the matching cost between each string subsequence and each license plate subsequence based on the weight corresponding to each string subsequence in the weight array and a preset similar character mapping table, so as to determine a target license plate subsequence corresponding to each string subsequence, wherein the target license plate subsequence is the license plate subsequence having the minimum matching cost with the corresponding string subsequence;

[0142] The second calculation subunit is used to calculate the average of the matching costs between each character string subsequence and the corresponding target license plate subsequence to obtain the matching cost between the character string and the license plate.

[0143] In some embodiments, the calculation module 304 includes:

[0144] a third determining unit, configured to determine, for each candidate license plate, an editing operation to be performed based on a difference between the candidate license plate and the character string;

[0145] The fourth determining unit is used to determine the minimum edit distance cost between the candidate license plate and the character string according to the edit cost corresponding to the edit operation, the character sequence corresponding to the edit operation, and the weight array.

[0146] In some embodiments, the second determining module 305 includes:

[0147] a fifth determining unit, configured to determine a minimum value among the minimum edit costs;

[0148] a sixth determining unit, configured to determine, when the minimum value is less than a preset cost threshold, that the matching result is: the license plate to be processed successfully matches the candidate license plate corresponding to the minimum value;

[0149] The seventh determining unit is used to determine the matching result as: matching failure when the minimum value is greater than or equal to the cost threshold, and add the license plate to be processed as a new license plate to the license plate database.

[0150] As can be seen from the above, in the embodiments of the present application, to reduce the impact of misidentification or missed recognition on license plate matching, the electronic device, in addition to identifying the character string of the license plate to be processed, also obtains a confidence array corresponding to the character string. It will be understood that this confidence array effectively represents the recognition confidence level of each character in the character string. Thus, the electronic device can determine the weight array corresponding to the character string based on the character string, the confidence array, and a preset weight assignment strategy. Then, based on the preset license plate prefix tree and the weight array, it searches the character string to obtain a set of candidate license plates. It will be understood that by introducing the weight array, the impact of different characters in the character string on the search operation can be adjusted, thereby ensuring that the search results take into account possible misidentification and missed recognition. Finally, the electronic device can calculate the minimum edit cost between the character string and each candidate license plate in the candidate license plate set, and determine a match result for the license plate to be processed based on each minimum edit cost. The above license plate matching process does not rely on pixel-by-pixel segmentation operations, so the matching results are less affected by factors such as the environment, lighting, and shooting angle. It also takes into account relevant factors such as the confidence of the recognition results, thereby maintaining a high matching accuracy and matching speed in complex environments, thereby improving the robustness of license plate matching.

[0151] Corresponding to the license plate matching method provided above, the embodiment of the present application also provides an electronic device. Figure 4 The electronic device 4 in the embodiment of the present application includes: a memory 401, one or more processors 402 ( Figure 4 Only one is shown in the figure) and a computer program stored in the memory 401 and executable on the processor. Specifically, the processor 402 implements the following steps when executing the computer program stored in the memory 401:

[0152] Identify the license plate to be processed and obtain the string of the license plate to be processed and the confidence array corresponding to the string, where the dimension of the confidence array is the same as the length of the string;

[0153] Determine the weight array corresponding to the string based on the string, the confidence array, and the preset weight assignment strategy, where the dimension of the weight array is the same as the dimension of the confidence array;

[0154] Based on a preset license plate prefix tree and weight array, the character string is searched to obtain a candidate license plate set, the candidate license plate set including at least one candidate license plate, wherein the license plate prefix tree is constructed based on the license plate library;

[0155] Calculate the minimum editing cost between the string and each candidate license plate in the candidate license plate set;

[0156] Based on each minimum editing cost, the matching result of the license plate to be processed is determined.

[0157] Assuming that the above is the first possible implementation, in a second possible implementation provided based on the first possible implementation, the weight array corresponding to the string is determined according to the string, the confidence array, and the preset weight assignment strategy, including:

[0158] According to the confidence array, the characters in the string are divided into a first target character, a second target character, and a third target character, wherein the confidence corresponding to the first target character in the confidence array is 0, the second target character is adjacent to the first target character in a specified direction, and the third target character is a character other than the first target character and the second target character;

[0159] Determine the weights corresponding to the first target character, the second target character, and the third target character respectively according to the weight assignment strategy;

[0160] A weight array is determined according to the weights corresponding to the first target character, the second target character, and the third target character.

[0161] In a third possible implementation provided on the basis of the second possible implementation, the weights corresponding to the first target character, the second target character, and the third target character are determined respectively according to a weight assignment strategy, including:

[0162] Determining the weights corresponding to the first target character and the second target character as first preset values;

[0163] Determining the weight corresponding to the third target character as the product of the second preset value and the third preset value;

[0164] The first preset value, the second preset value and the third preset value are all set by a weight assignment strategy.

[0165] In a fourth possible implementation provided as a basis for the first possible implementation, based on a preset license plate prefix tree and weight array, a character string is searched to obtain a set of candidate license plates, including:

[0166] Perform subsequence segmentation on the string to obtain multiple string subsequences, where the length of the string subsequence is the same as the sliding window length of the license plate prefix tree;

[0167] Based on multiple string subsequences, search for inverted indexes that meet preset conditions in the license plate prefix tree to obtain an inverted index set;

[0168] For each license plate corresponding to the inverted index in the inverted index set, the matching cost between the string and the license plate is calculated based on the weight array;

[0169] Based on at least one license plate with the minimum matching cost, a candidate license plate set is constructed.

[0170] In a fifth possible implementation provided as a basis for the fourth possible implementation, the matching cost between the character string and the license plate is calculated based on the weight array, including:

[0171] Perform subsequence segmentation on the license plate to obtain multiple license plate subsequences, where the length of the license plate subsequence is the same as the sliding window length of the license plate prefix tree;

[0172] Based on the weights corresponding to each string subsequence in the weight array and a preset similar character mapping table, the matching cost between each string subsequence and each license plate subsequence is calculated to determine the target license plate subsequence corresponding to each string subsequence. The target license plate subsequence is the license plate subsequence that has the minimum matching cost with the corresponding string subsequence.

[0173] The matching cost between each string subsequence and the corresponding target license plate subsequence is averaged to obtain the matching cost between the string and the license plate.

[0174] In a sixth possible implementation provided on the basis of the first possible implementation, calculating the minimum edit cost between the character string and each candidate license plate in the candidate license plate set includes:

[0175] For each candidate license plate, determining an editing operation to be performed based on the difference between the candidate license plate and the character string;

[0176] The minimum edit distance cost between the candidate license plate and the character string is determined according to the edit cost corresponding to the edit operation, the character sequence corresponding to the edit operation, and the weight array.

[0177] In a seventh possible implementation provided as a basis for the first possible implementation, determining a matching result of a license plate to be processed based on each minimum edit cost includes:

[0178] Determine the minimum value among the minimum editing costs;

[0179] When the minimum value is less than the preset cost threshold, the matching result is determined as: the license plate to be processed successfully matches the candidate license plate corresponding to the minimum value;

[0180] When the minimum value is greater than or equal to the cost threshold, the matching result is determined to be: matching failure, and the license plate to be processed is added to the license plate database as a new license plate.

[0181] It should be understood that in the embodiment of the present application, the processor 402 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0182] The memory 401 may include a read-only memory and a random access memory, and provides instructions and data to the processor 402. A portion or all of the memory 401 may also include a non-volatile random access memory. For example, the memory 401 may also store device type information.

[0183] As can be seen from the above, in the embodiments of the present application, to reduce the impact of misidentification or missed recognition on license plate matching, the electronic device, in addition to identifying the character string of the license plate to be processed, also obtains a confidence array corresponding to the character string. It will be understood that this confidence array effectively represents the recognition confidence level of each character in the character string. Thus, the electronic device can determine the weight array corresponding to the character string based on the character string, the confidence array, and a preset weight assignment strategy. Then, based on the preset license plate prefix tree and the weight array, it searches the character string to obtain a set of candidate license plates. It will be understood that by introducing the weight array, the impact of different characters in the character string on the search operation can be adjusted, thereby ensuring that the search results take into account possible misidentification and missed recognition. Finally, the electronic device can calculate the minimum edit cost between the character string and each candidate license plate in the candidate license plate set, and determine a match result for the license plate to be processed based on each minimum edit cost. The above license plate matching process does not rely on pixel-by-pixel segmentation operations, so the matching results are less affected by factors such as the environment, lighting, and shooting angle. It also takes into account relevant factors such as the confidence of the recognition results, thereby maintaining a high matching accuracy and matching speed in complex environments, thereby improving the robustness of license plate matching.

[0184] An embodiment of the present application further provides a computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps in the above-mentioned various method embodiments.

[0185] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0186] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0187] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of external device software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0188] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the system embodiments described above are merely schematic. For example, the division of the above modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0189] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

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

[0191] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A license plate matching method, characterized in that: include: Identify the license plate to be processed, and obtain a character string of the license plate to be processed and a confidence array corresponding to the character string, wherein the dimension of the confidence array is the same as the length of the character string; Determining a weight array corresponding to the character string according to the character string, the confidence array, and a preset weight assignment strategy, wherein the dimension of the weight array is the same as the dimension of the confidence array; Based on a preset license plate prefix tree and the weight array, searching the character string to obtain a candidate license plate set, the candidate license plate set including at least one candidate license plate, wherein the license plate prefix tree is constructed based on a license plate library; Calculating the minimum editing cost between the character string and each candidate license plate in the candidate license plate set; Based on each of the minimum editing costs, a matching result of the license plate to be processed is determined.

2. The license plate matching method according to claim 1, wherein: The step of determining a weight array corresponding to the character string according to the character string, the confidence array, and a preset weight assignment strategy includes: According to the confidence array, the characters in the character string are divided into a first target character, a second target character, and a third target character, wherein the confidence corresponding to the first target character in the confidence array is 0, the second target character is adjacent to the first target character in a specified direction, and the third target character is a character other than the first target character and the second target character; determining weights corresponding to the first target character, the second target character, and the third target character respectively according to the weight assignment strategy; The weight array is determined according to the weights corresponding to the first target character, the second target character, and the third target character.

3. The license plate matching method according to claim 2, wherein: The step of determining the weights corresponding to the first target character, the second target character, and the third target character respectively according to the weight assignment strategy includes: determining the weights corresponding to the first target character and the second target character as first preset values; Determining the weight corresponding to the third target character as the product of the second preset value and the third preset value; The first preset value, the second preset value and the third preset value are all set by the weight assignment strategy.

4. The license plate matching method according to claim 1, wherein: The method searches the character string based on the preset license plate prefix tree and the weight array to obtain a set of candidate license plates, including: Performing subsequence segmentation on the character string to obtain multiple character string subsequences, wherein the length of the character string subsequences is the same as the sliding window length of the license plate prefix tree; Based on the multiple string subsequences, searching for an inverted index that meets a preset condition in the license plate prefix tree to obtain an inverted index set; For the license plate corresponding to each inverted index in the inverted index set, calculating the matching cost between the string and the license plate based on the weight array; The candidate license plate set is constructed based on at least one license plate with the minimum matching cost.

5. The license plate matching method according to claim 4, wherein: The calculating the matching cost between the character string and the license plate based on the weight array includes: Performing subsequence segmentation on the license plate to obtain multiple license plate subsequences, wherein the length of the license plate subsequence is the same as the sliding window length of the license plate prefix tree; Calculating the matching cost between each string subsequence and each license plate subsequence based on the weight corresponding to each string subsequence in the weight array and a preset similar character mapping table to determine a target license plate subsequence corresponding to each string subsequence, wherein the target license plate subsequence is the license plate subsequence having the minimum matching cost with the corresponding string subsequence; The matching costs between each of the character string subsequences and the corresponding target license plate subsequences are averaged to obtain the matching costs between the character string and the license plate.

6. The license plate matching method according to claim 1, wherein: The calculating of the minimum editing cost between the character string and each candidate license plate in the candidate license plate set includes: For each candidate license plate, determining an editing operation to be performed based on a difference between the candidate license plate and the character string; The minimum edit distance cost between the candidate license plate and the character string is determined according to the edit cost corresponding to the edit operation, the character sequence corresponding to the edit operation, and the weight array.

7. The license plate matching method according to claim 1, wherein: The determining of the matching result of the license plate to be processed based on each of the minimum editing costs includes: Determining a minimum value among the minimum edit costs; In the case where the minimum value is less than a preset cost threshold, determining the matching result as: the license plate to be processed successfully matches the candidate license plate corresponding to the minimum value; When the minimum value is greater than or equal to the cost threshold, the matching result is determined to be a matching failure, and the license plate to be processed is added to the license plate database as a new license plate.

8. A license plate matching device, characterized in that: include: an identification module, configured to identify a license plate to be processed and obtain a character string of the license plate to be processed and a confidence array corresponding to the character string, wherein the dimension of the confidence array is the same as the length of the character string; a first determining module, configured to determine a weight array corresponding to the character string according to the character string, the confidence array, and a preset weight assignment strategy, wherein the dimension of the weight array is the same as the dimension of the confidence array; A search module, configured to search the character string based on a preset license plate prefix tree and the weight array to obtain a candidate license plate set, the candidate license plate set including at least one candidate license plate, wherein the license plate prefix tree is constructed based on a license plate library; a calculation module, configured to calculate the minimum editing cost between the character string and each candidate license plate in the candidate license plate set; The second determining module is used to determine the matching result of the license plate to be processed based on each of the minimum editing costs.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by one or more processors, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Closed-loop license plate recognition method and system based on adaptive data set

    CN121236743A