License plate recognition method and device, storage medium and electronic equipment
By automatically determining the license plate of the vehicle by using correction weight and target vector matching technology when identifying errors in the image recognition equipment in the parking lot, the problem of inability to automate the entry and exit management of vehicles in the prior art is solved, and efficient and automatic exit management is achieved.
Patent Information
- Application Number
- CN202111326762.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-11-10
AI Technical Summary
The image recognition equipment in existing parking lots has low accuracy when identifying license plates, which leads to the inability to automate vehicle entry and exit management, and requires manual exit procedures, which is time-consuming and labor-intensive.
When the vehicle exits, if the identified license plate does not match the existing license plate, the correction weight of each character in the license plate is determined, the target vector is constructed, and the most similar existing license plate is matched to achieve automated exit management.
It realizes that when the equipment recognizes errors, the vehicle's license plate is automatically determined in each on-site license plate, avoiding manual intervention, saving time and human resources, improving appearance efficiency, and reducing traffic congestion.
Smart Images

Figure CN114049623B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle management, and in particular to a license plate recognition method and device, a storage medium and an electronic device. Background Art
[0002] With the development of image recognition technology, in the process of vehicle entry and exit management in parking lots, image recognition equipment is usually used to recognize the vehicle's license plate, and automatic management is achieved based on the recognized license plate.
[0003] In the current automated management process, the vehicle's license plate is usually recognized by an entry recognition device at the entrance of the parking lot, and the vehicle's entry information is recorded based on the license plate recognized by the entry recognition device. At the exit of the parking lot, the vehicle's license plate is recognized again by an exit recognition device, and the vehicle's entry information is matched based on the license plate recognized by the exit recognition device to complete billing and release tasks.
[0004] In actual application, the accuracy of license plate recognition by parking lot identification equipment is very limited, and the vehicle's license plate is often misidentified. Based on the management method of using the license plate recognized by the equipment as the vehicle's license plate, if the parking lot's entry identification equipment or exit identification equipment misidentifies a vehicle's license plate, resulting in the vehicle's license plate being different twice, when the vehicle leaves the parking lot, it cannot be automatically charged and released, and the owner needs to manually go through the exit procedures, which takes a lot of time and human resources. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a license plate recognition method to solve the problem that when the recognition device recognizes the vehicle's license plate incorrectly, manual exit procedures are required, which consumes a lot of time and human resources.
[0006] The embodiment of the present invention also provides a license plate recognition device to ensure the practical implementation and application of the above method.
[0007] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0008] A license plate recognition method, comprising:
[0009] When the vehicle leaves the parking lot, if the current vehicle license plate identified by the image recognition device does not match any of the pre-recorded license plates present, then the correction weight corresponding to each vehicle license plate character in the current vehicle license plate is determined;
[0010] Constructing a first target vector according to the correction weight corresponding to each vehicle license plate character in the current vehicle license plate;
[0011] Determine a target license plate character corresponding to each of the license plate characters in each of the license plates present, wherein the target license plate character is a vehicle license plate character in the current vehicle license plate;
[0012] Determine the correction weight corresponding to each of the license plate characters in each of the license plates present according to the target license plate characters corresponding to each of the license plate characters in each of the license plates present;
[0013] Constructing a second target vector corresponding to each of the license plates present according to the correction weight corresponding to each of the license plate characters present in each of the license plates present;
[0014] determining a similarity between each of the second target vectors and the first target vector;
[0015] The license plate corresponding to the second target vector having the highest similarity with the first target vector among the second target vectors is used as the license plate corresponding to the vehicle.
[0016] In the above method, optionally, determining the correction weight corresponding to each vehicle license plate character in the current vehicle license plate includes:
[0017] Obtaining a plurality of preset correction weights and uncorrected characters and corrected characters corresponding to each of the preset correction weights;
[0018] According to the uncorrected characters and the corrected characters corresponding to the respective preset correction weights, the correction weight corresponding to each vehicle license plate character in the current vehicle license plate is determined from the plurality of preset correction weights.
[0019] Optionally, the method further comprises determining the correction weight corresponding to each vehicle license plate character in the current vehicle license plate from among the plurality of preset correction weights based on the uncorrected characters and the corrected characters corresponding to the preset correction weights, including:
[0020] For each of the vehicle license plate characters in the current vehicle license plate, the vehicle license plate character is compared with the uncorrected characters and corrected characters corresponding to each of the preset correction weights, and the preset correction weights in which the corresponding uncorrected characters and corrected characters match the vehicle license plate character are determined as the correction weight corresponding to the vehicle license plate character.
[0021] The above method may optionally include determining the correction weight corresponding to each license plate character in each license plate according to the target license plate character corresponding to each license plate character in each license plate, including:
[0022] Compare the target license plate character corresponding to each of the license plate characters in each of the license plates in the field with the uncorrected character corresponding to each of the preset correction weights;
[0023] Comparing each of the characters of the license plate present in each of the license plates present with the corrected characters corresponding to each of the preset correction weights;
[0024] For each of the present license plate characters, the target preset correction weight corresponding to the present license plate character is determined among the multiple preset correction weights, and the target preset correction weight is used as the correction weight corresponding to the present license plate character, the uncorrected character corresponding to the target preset correction weight matches the target license plate character corresponding to the present license plate character, and its corresponding corrected character matches the present license plate character.
[0025] Optionally, the method described above constructs the first target vector according to the correction weight corresponding to each vehicle license plate character in the current vehicle license plate, including:
[0026] The correction weight corresponding to each vehicle license plate character in the current vehicle license plate is used as a matrix element to construct a weight matrix corresponding to the current vehicle license plate, and the vector represented by the weight matrix is used as the first target vector.
[0027] In the above method, optionally, the determining the similarity between each of the second target vectors and the first target vector comprises:
[0028] For each of the second target vectors, the cosine value of the angle between the second target vector and the first target vector is calculated, and the cosine value of the angle is used as the similarity between the second target vector and the first target vector.
[0029] The above method may optionally include taking the on-site license plate corresponding to the second target vector having the highest similarity with the first target vector among the second target vectors as the license plate corresponding to the vehicle, including:
[0030] Determine a first value corresponding to each second target vector, where the first value corresponding to each second target vector is the absolute value of the difference between the cosine value of the angle between the second target vector and the first target vector and the value one;
[0031] Determine a second value, where the second value is the first value with the smallest value among the first values;
[0032] The license plate on site corresponding to the second target vector corresponding to the second value is used as the license plate corresponding to the vehicle.
[0033] A license plate recognition device, comprising:
[0034] A first determination unit is used to determine the correction weight corresponding to each vehicle license plate character in the current vehicle license plate if the current vehicle license plate recognized by the image recognition device does not match any of the pre-recorded license plates on the scene when the vehicle leaves the parking lot;
[0035] A first construction unit, configured to construct a first target vector according to a correction weight corresponding to each vehicle license plate character in the current vehicle license plate;
[0036] A second determination unit is used to determine a target license plate character corresponding to each of the present license plate characters, wherein the target license plate character is a vehicle license plate character in the current vehicle license plate;
[0037] A third determining unit is used to determine the correction weight corresponding to each of the license plate characters in each of the license plates present according to the target license plate characters corresponding to each of the license plate characters in each of the license plates present;
[0038] A second construction unit is used to construct a second target vector corresponding to each of the license plates present according to the correction weight corresponding to each of the license plate characters present in each of the license plates present;
[0039] a fourth determining unit, configured to determine a similarity between each of the second target vectors and the first target vector;
[0040] The correction unit is used to use the on-site license plate corresponding to the second target vector having the highest similarity with the first target vector among the second target vectors as the license plate corresponding to the vehicle.
[0041] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned license plate recognition method.
[0042] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the above-mentioned license plate recognition method.
[0043] A license plate recognition method provided based on the above-mentioned embodiment of the present invention includes: when the vehicle leaves the parking lot, if the current vehicle license plate recognized by the image recognition device does not match any of the pre-recorded license plates, determine the correction weight corresponding to each vehicle license plate character in the current vehicle license plate. Construct a first target vector based on the correction weight corresponding to each vehicle license plate character. Determine the target license plate character corresponding to each license plate character in each license plate present, wherein the target license plate character is the vehicle license plate character in the current vehicle license plate. Determine the correction weight corresponding to each license plate character in each license plate present based on the target license plate character corresponding to each license plate character in each license plate present. For each license plate present, construct its corresponding second target vector based on the correction weight corresponding to each license plate character present. Determine the similarity between each second target vector and the first target vector, and use the license plate present corresponding to the second target vector with the highest similarity to the first target vector as the license plate corresponding to the vehicle. By using the method provided by the embodiment of the present invention, when the current vehicle license plate identified by the device does not match the on-site license plate, the vehicle license plate can be corrected, and the corresponding license plate of the vehicle can be determined among the on-site license plates based on the current vehicle license plate. The corrected license plate can be used to achieve automatic exit management of the vehicle, without the need for manual exit procedures, which can save a lot of time and human resources. In addition, it is conducive to improving the exit efficiency of vehicles, avoiding traffic jams, and further improving the service experience of car owners. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention 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 invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0045] Figure 1 An application scenario diagram of a license plate recognition method provided by an embodiment of the present invention;
[0046] Figure 2 A method flow chart of a license plate recognition method provided by an embodiment of the present invention;
[0047] Figure 3 A flowchart of another method of a license plate recognition method provided by an embodiment of the present invention;
[0048] Figure 4 Another method flow chart of a license plate recognition method provided by an embodiment of the present invention;
[0049] Figure 5 A schematic diagram of the structure of a license plate recognition device provided by an embodiment of the present invention;
[0050] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising 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 sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0053] As can be seen from the background technology, in the vehicle access management of parking lots, image recognition equipment is usually used to identify the vehicle license plate to achieve automated access management, such as billing and release. However, the recognition accuracy of the image recognition equipment used in parking lots is low. When recognition errors occur, it will lead to the inability to achieve automated vehicle access management, requiring car owners to spend a certain amount of time to manually go through the exit procedures, and also consume a certain amount of human resources. In addition, it will lead to low vehicle traffic efficiency and easily cause traffic jams.
[0054] Therefore, an embodiment of the present invention provides a license plate recognition method. When the vehicle license plate recognized by the device does not match the license plate on site, the vehicle license plate can be determined among the license plates on site to achieve automated management of vehicle exit, save human resources, and improve vehicle exit efficiency.
[0055] The application scenario of the method provided by the embodiment of the present invention can be as follows Figure 1 As shown, a pass bar is provided at the exit of the parking lot to prevent vehicles from leaving the parking lot. When a vehicle drives toward the exit, the image recognition device will take a picture of the vehicle, perform image recognition on the license plate image contained in the photographed picture, and use the recognition result as the vehicle license plate at the current exit. In the parking lot's on-site license plate library, the on-site license plate corresponding to the current vehicle license plate is matched, and the entry and exit management process such as billing is performed based on the entry time corresponding to the corresponding on-site license plate and the exit time of the current vehicle license plate. When the management process is completed, the pass bar is triggered to be lifted so that the vehicle can leave the parking lot.
[0056] The on-site license plate database of a parking lot refers to a database that stores all on-site license plates. On-site license plates refer to the license plates of vehicles parked in the parking lot. They are obtained by photographing vehicles entering the parking lot through image recognition equipment and then performing image recognition. After the license plate is recognized, the vehicle's entry information such as entry time and entry picture can be recorded in correspondence with the license plate. Each on-site license plate in the on-site license plate database changes in real time. When the license plate of a vehicle recognized at the exit matches a certain on-site license plate, the on-site license plate is removed from the on-site license plate database, that is, after the corresponding vehicle is recognized to leave the parking lot, its corresponding license plate is removed from the on-site license plate database.
[0057] It should be noted that Figure 1 The scenario shown is only a brief schematic diagram provided to better illustrate the method provided by an embodiment of the present invention. The physical device shown in the figure is only a schematic illustration and does not limit the device form in the actual application scenario.
[0058] The embodiment of the present invention provides a license plate recognition method, which can be applied to a vehicle management system of a parking lot, and the execution subject can be a server of the system, such as a cloud server. The method flow chart of the method is as follows: Figure 2 As shown, including:
[0059] S101: When a vehicle leaves a parking lot, if the current vehicle license plate identified by the image recognition device does not match any of the pre-recorded license plates present, then determining a correction weight corresponding to each vehicle license plate character in the current vehicle license plate;
[0060] In the method provided by the embodiment of the present invention, when a vehicle leaves a parking lot, if the image recognition device identifies the vehicle license plate obtained by the current vehicle, and matches it with each pre-recorded license plate on the spot, the result of the match is that the current vehicle license plate does not match each license plate on the spot. At this time, the correction weight corresponding to each vehicle license plate character in the current vehicle license plate can be determined, and the correction weight corresponding to each vehicle license plate character is a probability parameter that characterizes that the vehicle license plate character is recognized as the vehicle license plate character by the image recognition device. Specifically, information statistics can be performed according to the actual recognition situation, and the correction weight corresponding to each vehicle license plate character can be determined based on the statistical information. Samples can also be designed according to the actual recognition situation, and a neural network model can be trained to determine the corresponding correction weight through the trained neural network model. It should be noted that the method for determining the correction weight can be selected according to actual needs, which does not affect the function of the method provided by the embodiment of the present invention.
[0061] S102: constructing a first target vector according to the correction weight corresponding to each vehicle license plate character in the current vehicle license plate;
[0062] In the method provided by the embodiment of the present invention, a vector corresponding to the current vehicle license plate, ie, a first target vector, can be constructed according to the correction weight corresponding to each vehicle license plate character.
[0063] S103: Determine a target license plate character corresponding to each of the license plate characters in the present license plates, wherein the target license plate character is a vehicle license plate character in the current vehicle license plate;
[0064] In the method provided by the embodiment of the present invention, for each present license plate, the target license plate character corresponding to each present license plate character in the present license plate can be determined. The target license plate character corresponding to the present license plate character refers to the vehicle license plate character located at the target license plate position in the current vehicle license plate, and the target license plate position is the sequence position of the present license plate character in the corresponding present license plate. For example, if the current vehicle license plate is "ED2039" and the present license plate is "E01039", the target license plate character corresponding to the first character "E" in the present license plate is the first character "E" in the current vehicle license plate, and the target license plate character corresponding to the second character "0" in the present license plate is the second character "D" in the current vehicle license plate, and so on.
[0065] S104: determining a correction weight corresponding to each of the license plate characters in each of the license plates present according to the target license plate characters corresponding to each of the license plate characters in each of the license plates present;
[0066] In the method provided by the embodiment of the present invention, for each present license plate character in each present license plate, the correction weight corresponding to the present license plate character can be determined based on the present license plate character and its corresponding target license plate character. The correction weight corresponding to the present license plate character is a probability parameter that characterizes that the present license plate character is recognized by the image recognition device as the target license plate character corresponding to the present license plate character. The specific determination method is the same as the determination method of the correction weight corresponding to the vehicle license plate character, which can be referred to the above description and will not be repeated here.
[0067] S105: constructing a second target vector corresponding to each of the license plates present according to the correction weight corresponding to each of the license plate characters present in each of the license plates present;
[0068] In the method provided by the embodiment of the present invention, for each license plate present, a vector corresponding to the license plate present, ie, a second target vector corresponding to the license plate present, can be constructed according to the correction weight corresponding to each character of the license plate present.
[0069] S106: Determine the similarity between each of the second target vectors and the first target vector;
[0070] In the method provided in the embodiment of the present invention, the similarity between each second target vector and the first target vector can be calculated by a preset similarity algorithm. Specifically, the calculation can be performed using an existing vector similarity algorithm, such as a distance algorithm such as Euclidean distance or a cosine similarity algorithm.
[0071] It should be noted that, in the specific implementation process, the similarity measurement algorithm can be selected according to actual needs, which does not affect the function of the method provided in the embodiment of the present invention.
[0072] S107: Using the license plate corresponding to the second target vector having the highest similarity with the first target vector among the second target vectors as the license plate corresponding to the vehicle.
[0073] In the method provided by the embodiment of the present invention, the similarity between each second target vector and the first target vector can be compared to obtain the second target vector with the highest degree of similarity represented by its corresponding similarity, and the on-site license plate corresponding to the second target vector is used as the license plate corresponding to the vehicle, and the subsequent vehicle access management processing is carried out with the on-site license plate.
[0074] Based on the method provided by the embodiment of the present invention, when the vehicle leaves the parking lot, if the vehicle license plate identified by the image recognition device does not match any of the license plates on the scene, the correction weight corresponding to each vehicle license plate character in the current vehicle license plate is determined, and based on this, the first target vector is constructed. Among the various vehicle license plate characters, the target license plate character corresponding to each of the license plate characters on the scene is determined to determine the correction weight corresponding to each of the license plate characters on the scene in each license plate on the scene, and based on this, the second target vector corresponding to each license plate on the scene is constructed. The similarity between each second target vector and the first target vector is determined, and the license plate on the scene corresponding to the second target vector with the highest similarity to the first target vector is used as the license plate corresponding to the current vehicle. Applying the method provided by the embodiment of the present invention, when the device has a recognition error, the license plate corresponding to the current vehicle can be determined among the various license plates on the scene, and the automatic entry and exit management of the vehicle can be realized with the license plate, without the need to manually go through the exit procedures, which can save the owner's time and human resources. Secondly, the traffic efficiency of the vehicle can be improved, traffic jams can be avoided, and the service experience of the owner can be further improved.
[0075] In order to better illustrate the method provided by the embodiment of the present invention, Figure 2 Based on the method shown, an embodiment of the present invention provides another license plate recognition method, wherein the process of determining the correction weight corresponding to each vehicle license plate character in the current vehicle license plate mentioned in step S101 includes:
[0076] Obtaining a plurality of preset correction weights and uncorrected characters and corrected characters corresponding to each of the preset correction weights;
[0077] In the method provided by the embodiment of the present invention, statistical aggregation is performed based on historical recognition data, and each preset correction weight and the uncorrected characters and corrected characters corresponding to each preset correction weight are set based on statistical information. Each preset correction weight is a probability parameter that characterizes the corresponding corrected character being recognized by the device as its corresponding uncorrected character.
[0078] In the method provided by the embodiment of the present invention, each preset correction weight and its corresponding uncorrected characters and corrected characters can be determined by actual manual correction data. In the prior art, when a vehicle leaves a parking lot, if the recognized license plate does not match the license plate on site, manual procedures are required. The staff at the end booth of the parking lot can manually correct these misidentified license plates, that is, record the actual license plates on the vehicle. The various historical data of manual corrections can be obtained, and the misidentified license plates and corrected license plates can be summarized, for example: (Min D2129D, Min D21291), (Min D2128D, Min D21291), etc. It should be noted that in the method provided by the embodiment of the present invention, during the recognition and processing of the license plate characters, the first Chinese character (the character representing the provincial administrative region) is not processed.
[0079] Each wrong license plate and its corresponding corrected license plate can be compared and counted. Specifically, each character of each wrong license plate can be extracted through the program, P = {p1, p2, p3, ..., pi}, and each character of each corrected license plate can be extracted, C = {c1, c2, c3, ..., ci}, P represents the wrong license plate number, C represents the corrected license plate number, i represents the i-th character of the license plate, and for each wrong license plate and its corresponding corrected license plate, the characters in the same order in the license plate are taken, such as p1c1, p2c2, ..., pici. The characters pi in the wrong license plate and the characters ci in the corrected license plate are collected, the number of occurrences is accumulated, and the weight is represented by the number of occurrences. The more the accumulated number of occurrences, the greater the weight. The summary statistical information can be stored in the form of a table, such as shown in Table 1 below.
[0080] Table 1
[0081] Correct the previous character Corrected characters Occurrence 0 0 frequency 0 1 … 0 2 … … … … Z 0 … Z 1 … Z 2 … … … …
[0082] The preset correction weight in the method provided in the embodiment of the present invention is the number of occurrences in Table 1, the corresponding uncorrected characters are the characters before correction in Table 1, and the corrected characters are the characters after correction in Table 1.
[0083] According to the uncorrected characters and the corrected characters corresponding to the respective preset correction weights, the correction weight corresponding to each vehicle license plate character in the current vehicle license plate is determined from the plurality of preset correction weights.
[0084] In the method provided by an embodiment of the present invention, the uncorrected characters and corrected characters corresponding to each preset correction weight can be used to match the preset correction weight corresponding to each vehicle license plate character in each preset correction weight as the correction weight corresponding to each vehicle license plate character.
[0085] It should be noted that, in the method provided in the embodiment of the present invention, the number of occurrences counted as the weight value is only to better illustrate a specific embodiment provided by the method provided in the present invention. In the specific implementation process, other parameters characterizing the probability can be used as the weight value. For example, the proportion of the number of occurrences in the total number of times can be further counted as a preset correction weight, etc., which does not affect the function of the method provided in the embodiment of the present invention.
[0086] Based on the method provided in the embodiment of the present invention, various preset correction weights can be pre-configured, and the correction weight corresponding to each vehicle license plate character can be determined in the pre-configured information. The processing process is relatively convenient and fast, which can further improve the processing efficiency.
[0087] Further, combined with Figure 3 As shown in the flow chart, based on the above embodiment, the embodiment of the present invention provides another license plate recognition method, wherein the process of determining the correction weight corresponding to each vehicle license plate character includes:
[0088] S201: Acquire a plurality of preset correction weights and uncorrected characters and corrected characters corresponding to each of the preset correction weights;
[0089] The process of determining the correction weight corresponding to each vehicle license plate character in the current vehicle license plate from among the plurality of preset correction weights according to the uncorrected characters and the corrected characters corresponding to the preset correction weights mentioned in the above embodiment includes:
[0090] S202: for each of the vehicle license plate characters in the current vehicle license plate, the vehicle license plate character is compared with the uncorrected character and the corrected character corresponding to each of the preset correction weights;
[0091] In the method provided by the embodiment of the present invention, each vehicle license plate character in the current vehicle license plate can be compared with the uncorrected characters and corrected characters corresponding to each preset correction weight, so as to find the preset correction weight corresponding to each vehicle license plate character in each preset correction weight. For example, if the current vehicle license plate is "ED2039" (omit the identification characters of the provincial administrative region), according to the pre-configured information in Table 1, the characters "E", "D", "2", "0", "3" and "9" are matched with the characters before correction, respectively, and the weight data corresponding to the uncorrected characters matching the vehicle license plate characters are obtained, as shown in Table 2 below, the characters in the first column are the uncorrected characters matching each vehicle license plate character, the characters in the first row are the corrected characters corresponding to the uncorrected characters corresponding to the column and the same preset correction weight, the data in Table 2 except the first row and the first column are the preset correction weights, the uncorrected characters corresponding to each preset correction weight are the uncorrected characters at the beginning of the row, and the corrected characters corresponding to each preset correction weight are the corrected characters at the beginning of the column.
[0092] Table 2
[0093] 0 1 2 3 … W X Y Z E 15 398 22 15 … 0 29 13 10 D 5918 252 18 26 … 56 9 6 13 2 79 239 0 89 … 12 11 11 352 0 0 631 48 84 … 19 3 3 4 3 245 242 228 0 … 7 7 5 4 9 97 196 176 84 … 22 9 10 11
[0094] It should be noted that the specific recording method of the weight information provided in the method provided in the embodiment of the present invention, the specific license plate and the specific preset correction weight value are only for better illustrating a specific embodiment provided by the method provided in the embodiment of the present invention. In the specific implementation process, the specific license plate and the specific weight value are determined by the actual recognition and statistical conditions, and do not affect the function of the method provided in the embodiment of the present invention.
[0095] S203: For each of the vehicle license plate characters, a preset correction weight in which both the corresponding uncorrected character and the corrected character match the vehicle license plate character is determined as the correction weight corresponding to the vehicle license plate character.
[0096] In the method provided by the embodiment of the present invention, by comparing the uncorrected characters with the corrected characters, a preset correction weight can be found among the various preset correction weights, and the corresponding uncorrected characters and corrected characters both match the vehicle license plate characters currently being compared, and this preset correction weight can be used as the correction weight corresponding to the vehicle license plate characters currently being compared.
[0097] For example, in step S202, in the data shown in Table 2, the vehicle license plate characters "E", "D", "2", "0", "3" and "9" are further compared with the corresponding corrected characters in Table 2 to obtain corresponding weights. For example, for the character "E", the preset correction weight of the first character of the row and the first character of the column is "E" is obtained, and for the character "D", the preset correction weight of the first character of the row and the first character of the column is "D" is obtained. The preset correction weight corresponding to each vehicle license plate character in the license plate "ED2039" can be obtained, for example, as shown in Table 3 below.
[0098] Table 3
[0099] E D 2 0 3 9 ED2039 585452 65512 545254 54512 56515 54515
[0100] In order to better illustrate the method provided by the embodiment of the present invention, based on the method provided by the above embodiment, Figure 4 As shown in the flowchart, the embodiment of the present invention provides another license plate recognition method, wherein the process of determining the correction weight corresponding to each license plate character in each license plate according to the target license plate character corresponding to each license plate character in each license plate mentioned in step S104 includes:
[0101] S301: comparing the target license plate character corresponding to each of the license plate characters in each of the license plates present with the uncorrected character corresponding to each of the preset correction weights;
[0102] In the method provided by the embodiment of the present invention, for each present license plate character in each present license plate, the target license plate character corresponding to the present license plate character is compared with the uncorrected character corresponding to each preset correction weight. For example, the current vehicle license plate is "ED2039", and there are present license plates "E01039" and "E0102Y". For the character "E" in the license plate "E01039", the corresponding target license plate character is "E", then the character "E" is matched with the uncorrected character in the data shown in Table 1 to obtain the weight data corresponding to the uncorrected character "E" in Table 1. For the character "0" in the license plate "E01039", the corresponding target license plate character is "D", then the character "D" is matched to obtain the weight data corresponding to the uncorrected character "D" in Table 1, and so on.
[0103] S302: Compare each of the characters of the license plate on the scene with the corrected characters corresponding to each of the preset correction weights;
[0104] In the method provided by the embodiment of the present invention, for each license plate character in each license plate, the corrected characters corresponding to each preset correction weight can be compared with the characters in the license plate. For example, in the example of step S301, for the character "E" in "E01039", the character "E" can be compared with the corrected characters corresponding to each preset correction weight in the weight data corresponding to the uncorrected character "E" to obtain the preset correction weight of the corrected character "E". For the character "0", the character "0" can be compared with the corrected characters corresponding to each preset correction weight in the weight data corresponding to the uncorrected character "D", and so on.
[0105] S303: For each of the present license plate characters, determine the target preset correction weight corresponding to the present license plate character from the multiple preset correction weights, and use the target preset correction weight as the correction weight corresponding to the present license plate character, the uncorrected character corresponding to the target preset correction weight matches the target license plate character corresponding to the present license plate character, and its corresponding corrected character matches the present license plate character.
[0106] In the method provided by the embodiment of the present invention, for each present license plate character in each present license plate, a preset correction weight can be found in each preset correction weight, and the uncorrected character corresponding to the preset correction weight matches the target license plate character corresponding to the present license plate character, and the corrected character corresponding to the preset correction weight matches the present license plate character. For example, as shown in Table 4 below, for the present license plates "E01039" and "E0102Y", the preset correction weight corresponding to each of the present license plate characters can be obtained respectively, as shown in Table 4 below, in the present license plate "E01039", the correction weight corresponding to the character "E" is 585452, the correction weight corresponding to the character "0" is 5918, the correction weight corresponding to the character "1" is 545254, and so on. The uncorrected character corresponding to each preset correction weight in Table 4 is the character at the head of its column.
[0107] Table 4
[0108] E D 2 0 3 9 E01039 585452 5918 545254 54512 56515 54515 E0102Y 585452 5918 239 54512 228 10
[0109] Furthermore, the embodiment of the present invention provides another license plate recognition method, in which Figure 2 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of constructing the first target vector according to the correction weight corresponding to each vehicle license plate character in the current vehicle license plate mentioned in step S102 includes:
[0110] The correction weight corresponding to each vehicle license plate character in the current vehicle license plate is used as a matrix element to construct a weight matrix corresponding to the current vehicle license plate, and the vector represented by the weight matrix is used as the first target vector.
[0111] In the method provided by the embodiment of the present invention, the correction weight corresponding to each vehicle license plate character is used as an element of the matrix to construct the corresponding weight matrix, and the vector represented by the weight matrix is used as the first target vector. For example, in the example in the above embodiment, the current vehicle license plate is "ED2039", where the preset correction weights corresponding to the vehicle license plate characters are 585452, 65512, 545254, 54512, 56515 and 54515, respectively, and the matrix is constructed: {585452, 65512, 545254, 54512, 56515, 54515}, and the corresponding first target vector is: {585452, 65512, 545254, 54512, 56515, 54515}.
[0112] Furthermore, in the method provided in the embodiment of the present invention, the principle of constructing the second target vector corresponding to each license plate on the scene mentioned in step S105 is the same as the principle of constructing the first target vector, which can be seen from the above description and will not be repeated here.
[0113] In the method provided by the embodiment of the present invention, according to the example of the above embodiment, regarding the license plates "E01039" and "E0102Y" on the scene, the second target vector corresponding to the license plate "E01039" can be constructed as: {585452, 5918, 545254, 54512, 56515, 54515}. The second target vector corresponding to the license plate "E0102Y" is: {585452, 5918, 239, 54512, 228, 10}.
[0114] In order to better illustrate the method provided by the embodiment of the present invention, Figure 2 Based on the method shown, an embodiment of the present invention provides another license plate recognition method. In the method provided by the embodiment of the present invention, the process of determining the similarity between each second target vector and the first target vector mentioned in step S106 includes:
[0115] For each of the second target vectors, the cosine value of the angle between the second target vector and the first target vector is calculated, and the cosine value of the angle is used as the similarity between the second target vector and the first target vector.
[0116] In the method provided by the embodiment of the present invention, the similarity between each second target vector and the first target vector is determined by calculating the cosine value of the angle between each second target vector and the first target vector.
[0117] The calculation formula of the cosine value of the angle is as follows:
[0118]
[0119] cos(θ) represents the cosine of the angle between vector a(x1, y1) and vector b(x2, y2).
[0120] For example, citing the specific embodiment provided in the above embodiment, the first target vector corresponding to the current vehicle license plate "ED2039" is {585452,65512,545254,54512,56515,54515}, the second target vector corresponding to the license plate "E01039" is {585452,5918,545254,54512,56515,54515}, and the second target vector corresponding to the license plate "E0102Y" is {585452,5918,239,54512,228,10}.
[0121] For the license plate "E01039" on the scene, according to the above calculation principle formula, the cosine value of the angle between the corresponding second target vector and the first target vector can be calculated:
[0122]
[0123] For the license plate "E0102Y" on the scene, according to the above calculation principle formula, the cosine value of the angle between the corresponding second target vector and the first target vector can be calculated:
[0124]
[0125] Based on the method provided by the embodiment of the present invention, the similarity between two vectors is determined by cosine similarity, and the calculation process is relatively convenient and fast, which can further improve the processing efficiency.
[0126] Further, based on the method provided in the above embodiment, in the method provided in the embodiment of the present invention, the process mentioned in step S107 of using the on-site license plate corresponding to the second target vector having the highest similarity with the first target vector among the second target vectors as the license plate corresponding to the vehicle includes:
[0127] Determine a first value corresponding to each second target vector, where the first value corresponding to each second target vector is the absolute value of the difference between the cosine value of the angle between the second target vector and the first target vector and the value one;
[0128] In the method provided by the embodiment of the present invention, based on the determination of cosine similarity, if the cosine value of the angle between two vectors is closer to 1, the similarity between the two vectors is higher. For each second target vector, the cosine value of the angle between it and the first target vector can be subtracted from the value 1, and the absolute value of the calculation result can be taken, and the final value can be used as the first value corresponding to the second target vector.
[0129] For example, the cosine value of the angle between the second target vector and the first target vector corresponding to the license plate "E01039" is 0.997279, and its corresponding first numerical value is |0.997279-1|=0.002721, while the cosine value of the angle between the second target vector and the first target vector corresponding to the license plate "E0102Y" is 0.728439, and its corresponding first numerical value is |0.728439-1|=0.271461.
[0130] Determine a second value, where the second value is the first value with the smallest value among the first values;
[0131] In the method provided by the embodiment of the present invention, each first value is compared, and the first value with the smallest value is used as the second value, that is, the angle cosine value closest to 1 among the angle cosine values is determined. For example, in the example in the above steps, the second value is the angle cosine value between the second target vector corresponding to the license plate "E01039" on the scene and the first target vector: 0.997279.
[0132] The license plate on site corresponding to the second target vector corresponding to the second value is used as the license plate corresponding to the vehicle.
[0133] In the method provided by the embodiment of the present invention, among the license plates present, the license plate present corresponding to the second target vector corresponding to the second value is determined, and the license plate present is used as the license plate corresponding to the current license plate. For example, in the above steps, the license plate "E01039" present is used as the license plate of the current vehicle.
[0134] Based on the method provided in the embodiment of the present invention, by comparing the difference between the cosine value of the angle and the value one, the similarity between the vectors can be determined. The calculation process is relatively simple, which can further improve the processing efficiency.
[0135] and Figure 2 Corresponding to the license plate recognition method shown in FIG. 1 , the embodiment of the present invention further provides a license plate recognition device for Figure 2 The specific implementation of the method shown in is shown in the structural diagram Figure 5 As shown, including:
[0136] The first determination unit 401 is used to determine the correction weight corresponding to each vehicle license plate character in the current vehicle license plate if the current vehicle license plate recognized by the image recognition device does not match any of the pre-recorded license plates on the scene when the vehicle leaves the parking lot;
[0137] A first constructing unit 402 is used to construct a first target vector according to the correction weight corresponding to each vehicle license plate character in the current vehicle license plate;
[0138] The second determining unit 403 is used to determine the target license plate character corresponding to each of the license plate characters in each of the license plates present, wherein the target license plate character is the vehicle license plate character in the current vehicle license plate;
[0139] The third determining unit 404 is used to determine the correction weight corresponding to each of the present license plate characters in each of the present license plates according to the target license plate characters corresponding to each of the present license plate characters in each of the present license plates;
[0140] The second construction unit 405 is used to construct a second target vector corresponding to each of the license plates according to the correction weight corresponding to each of the characters in the license plates;
[0141] a fourth determining unit 406, configured to determine a similarity between each of the second target vectors and the first target vector;
[0142] The correction unit 407 is configured to use the on-site license plate corresponding to the second target vector having the highest similarity with the first target vector among the second target vectors as the license plate corresponding to the vehicle.
[0143] Based on the device provided by the embodiment of the present invention, when the vehicle leaves the parking lot, if the vehicle license plate identified by the image recognition device does not match any of the license plates on the scene, the correction weight corresponding to each vehicle license plate character in the current vehicle license plate is determined, and based on this, the first target vector is constructed. Among the various vehicle license plate characters, the target license plate character corresponding to each of the license plate characters on the scene is determined to determine the correction weight corresponding to each of the license plate characters on the scene in each license plate on the scene, and based on this, the second target vector corresponding to each license plate on the scene is constructed. The similarity between each second target vector and the first target vector is determined, and the license plate on the scene corresponding to the second target vector with the highest similarity to the first target vector is used as the license plate corresponding to the current vehicle. Using the device provided by the embodiment of the present invention, when the device has a recognition error, the license plate corresponding to the current vehicle can be determined among the various license plates on the scene, and the automatic entry and exit management of the vehicle can be realized with the license plate, without the need to manually go through the exit procedures, which can save the owner's time and human resources. Secondly, the traffic efficiency of the vehicle can be improved, traffic jams can be avoided, and the service experience of the owner can be further improved.
[0144] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the first determining unit 401 includes:
[0145] An acquisition subunit, used for acquiring a plurality of preset correction weights and uncorrected characters and corrected characters corresponding to each of the preset correction weights;
[0146] The first determination subunit is used to determine the correction weight corresponding to each vehicle license plate character in the current vehicle license plate from the multiple preset correction weights based on the uncorrected characters and the corrected characters corresponding to the respective preset correction weights.
[0147] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the first determining subunit includes:
[0148] The first comparison subunit is used to compare each of the vehicle license plate characters in the current vehicle license plate with the uncorrected characters and corrected characters corresponding to each of the preset correction weights, and determine the preset correction weights in which the corresponding uncorrected characters and corrected characters match the vehicle license plate characters as the correction weights corresponding to the vehicle license plate characters.
[0149] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the third determining unit 404 includes:
[0150] A second comparison subunit is used to compare the target license plate character corresponding to each of the license plate characters in each of the license plates with the uncorrected character corresponding to each of the preset correction weights;
[0151] A third comparison subunit is used to compare each of the characters of the license plate on the scene with each corrected character corresponding to the preset correction weight;
[0152] The second determination subunit is used to determine, for each of the present license plate characters, a target preset correction weight corresponding to the present license plate character from the multiple preset correction weights, and use the target preset correction weight as the correction weight corresponding to the present license plate character, the uncorrected character corresponding to the target preset correction weight matches the target license plate character corresponding to the present license plate character, and its corresponding corrected character matches the present license plate character.
[0153] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the first construction unit 402 includes:
[0154] A construction subunit is used to use the correction weight corresponding to each vehicle license plate character in the current vehicle license plate as a matrix element, construct a weight matrix corresponding to the current vehicle license plate, and use the vector represented by the weight matrix as the first target vector.
[0155] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the fourth determining unit 406 includes:
[0156] The calculation subunit is used to calculate the cosine value of the angle between the second target vector and the first target vector for each of the second target vectors, and use the cosine value of the angle as the similarity between the second target vector and the first target vector.
[0157] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the correction unit 407 includes:
[0158] A third determining subunit is used to determine a first value corresponding to each second target vector, where the first value corresponding to each second target vector is an absolute value of a difference between a cosine value of an angle between the second target vector and the first target vector and value one;
[0159] a fourth determining subunit, configured to determine a second value, where the second value is a first value with the smallest value among the first values;
[0160] The fifth determining subunit is used to use the on-site license plate corresponding to the second target vector corresponding to the second numerical value as the license plate corresponding to the vehicle.
[0161] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned license plate recognition method.
[0162] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 6 As shown, it specifically includes a memory 501 and one or more instructions 502, wherein the one or more instructions 502 are stored in the memory 501 and are configured to be executed by one or more processors 503 to perform the following operations:
[0163] When the vehicle leaves the parking lot, if the current vehicle license plate identified by the image recognition device does not match any of the pre-recorded license plates present, then the correction weight corresponding to each vehicle license plate character in the current vehicle license plate is determined;
[0164] Constructing a first target vector according to the correction weight corresponding to each vehicle license plate character in the current vehicle license plate;
[0165] Determine a target license plate character corresponding to each of the license plate characters in each of the license plates present, wherein the target license plate character is a vehicle license plate character in the current vehicle license plate;
[0166] Determine the correction weight corresponding to each of the license plate characters in each of the license plates present according to the target license plate characters corresponding to each of the license plate characters in each of the license plates present;
[0167] Constructing a second target vector corresponding to each of the license plates present according to the correction weight corresponding to each of the license plate characters present in each of the license plates present;
[0168] determining a similarity between each of the second target vectors and the first target vector;
[0169] The license plate corresponding to the second target vector having the highest similarity with the first target vector among the second target vectors is used as the license plate corresponding to the vehicle.
[0170] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0171] 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 the present invention.
[0172] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one 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 invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A license plate recognition method, characterized in that: include: When the vehicle leaves the parking lot, if the current vehicle license plate identified by the image recognition device does not match any of the pre-recorded license plates present, then the correction weight corresponding to each vehicle license plate character in the current vehicle license plate is determined; Constructing a first target vector according to the correction weight corresponding to each vehicle license plate character in the current vehicle license plate; Determine a target license plate character corresponding to each of the license plate characters in each of the license plates present, wherein the target license plate character is a vehicle license plate character in the current vehicle license plate; Determine the correction weight corresponding to each of the license plate characters in each of the license plates present according to the target license plate characters corresponding to each of the license plate characters in each of the license plates present; Constructing a second target vector corresponding to each of the license plates present according to the correction weight corresponding to each of the license plate characters present in each of the license plates present; determining a similarity between each of the second target vectors and the first target vector; The license plate corresponding to the second target vector having the highest similarity with the first target vector among the second target vectors is used as the license plate corresponding to the vehicle; Wherein, determining the correction weight corresponding to each vehicle license plate character in the current vehicle license plate includes: Acquire multiple preset correction weights and uncorrected characters and corrected characters corresponding to each preset correction weight; for each vehicle license plate character in the current vehicle license plate, compare the vehicle license plate character with the uncorrected characters and corrected characters corresponding to each preset correction weight, and determine the preset correction weight at which both the corresponding uncorrected characters and the corrected characters match the vehicle license plate character as the correction weight corresponding to the vehicle license plate character; The step of determining the correction weight corresponding to each of the characters in the license plate present in accordance with the target license plate character corresponding to each of the characters in the license plate present includes: The target license plate character corresponding to each of the license plate characters in each of the license plates present is respectively compared with the uncorrected character corresponding to each of the preset correction weights; each of the license plate characters in each of the license plates present is respectively compared with the corrected character corresponding to each of the preset correction weights; for each of the license plate characters present, the target preset correction weight corresponding to the license plate character present is determined from the multiple preset correction weights, and the target preset correction weight is used as the correction weight corresponding to the license plate character present, the uncorrected character corresponding to the target preset correction weight matches the target license plate character corresponding to the license plate character present, and the corrected character corresponding to the target preset correction weight matches the license plate character present.
2. The method according to claim 1, characterized in that The step of constructing a first target vector according to the correction weight corresponding to each vehicle license plate character in the current vehicle license plate includes: The correction weight corresponding to each vehicle license plate character in the current vehicle license plate is used as a matrix element to construct a weight matrix corresponding to the current vehicle license plate, and the vector represented by the weight matrix is used as the first target vector.
3. The method according to claim 1, characterized in that The determining the similarity between each of the second target vectors and the first target vector comprises: For each of the second target vectors, the cosine value of the angle between the second target vector and the first target vector is calculated, and the cosine value of the angle is used as the similarity between the second target vector and the first target vector.
4. The method according to claim 3, characterized in that The method of using the on-site license plate corresponding to the second target vector having the highest similarity with the first target vector among the second target vectors as the license plate corresponding to the vehicle includes: Determine a first value corresponding to each second target vector, where the first value corresponding to each second target vector is the absolute value of the difference between the cosine value of the angle between the second target vector and the first target vector and the value one; Determine a second value, where the second value is the first value with the smallest value among the first values; The license plate on site corresponding to the second target vector corresponding to the second value is used as the license plate corresponding to the vehicle.
5. A license plate recognition device, characterized in that: include: A first determination unit is used to determine the correction weight corresponding to each vehicle license plate character in the current vehicle license plate if the current vehicle license plate recognized by the image recognition device does not match any of the pre-recorded license plates on the scene when the vehicle leaves the parking lot; A first construction unit, configured to construct a first target vector according to a correction weight corresponding to each vehicle license plate character in the current vehicle license plate; A second determination unit is used to determine a target license plate character corresponding to each of the present license plate characters, wherein the target license plate character is a vehicle license plate character in the current vehicle license plate; A third determining unit is used to determine the correction weight corresponding to each of the license plate characters in each of the license plates present according to the target license plate characters corresponding to each of the license plate characters in each of the license plates present; A second construction unit is used to construct a second target vector corresponding to each of the license plates present according to the correction weight corresponding to each of the license plate characters present in each of the license plates present; a fourth determining unit, configured to determine a similarity between each of the second target vectors and the first target vector; a correction unit, configured to use the on-site license plate corresponding to the second target vector having the highest similarity with the first target vector among the second target vectors as the license plate corresponding to the vehicle; Wherein, the first determining unit includes: An acquisition subunit, used for acquiring a plurality of preset correction weights and uncorrected characters and corrected characters corresponding to each of the preset correction weights; A first comparison subunit is used to compare each of the vehicle license plate characters in the current vehicle license plate with the uncorrected characters and the corrected characters corresponding to each of the preset correction weights, and determine the preset correction weights at which both the corresponding uncorrected characters and the corrected characters match the vehicle license plate characters as the correction weights corresponding to the vehicle license plate characters; The third determining unit includes: A second comparison subunit is used to compare the target license plate character corresponding to each of the license plate characters in each of the license plates with the uncorrected character corresponding to each of the preset correction weights; A third comparison subunit is used to compare each of the characters of the license plate on the scene with each corrected character corresponding to the preset correction weight; The second determination subunit is used to determine, for each of the present license plate characters, a target preset correction weight corresponding to the present license plate character from the multiple preset correction weights, and use the target preset correction weight as the correction weight corresponding to the present license plate character, the uncorrected character corresponding to the target preset correction weight matches the target license plate character corresponding to the present license plate character, and its corresponding corrected character matches the present license plate character.
6. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the license plate recognition method according to any one of claims 1 to 4.
7. An electronic device, characterized in that: It comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the license plate recognition method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Fake plate detection method based on license plate identification and vehicle feature matching
CN107545239A
Training modeling method, vehicle charging method, management system and storage medium
CN110598758A