A license plate recognition method, device and equipment

By expanding the vehicle marking area and combining CNN/RNN for feature extraction, the problem of high license plate omission rate in existing license plate recognition solutions is solved, and a more accurate license plate recognition effect is achieved.

CN113610770BActive Publication Date: 2024-10-15ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110799265.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-15
Publication Date
2024-10-15
Estimated Expiration
2041-07-15

AI Technical Summary

Technical Problem

Existing license plate recognition solutions have the problem of high license plate omission rates, mainly due to poor license plate area positioning and the inability to accurately identify license plates.

Method used

By acquiring multiple original image frames, we perform vehicle and license plate detection, expand the vehicle mark area to crop out more accurate license plate image frames, and combine convolutional neural networks (CNN) and recurrent neural networks (RNN) for feature extraction and character recognition. Use connection temporal classification (CTC) and cumulative cross entropy (CCE) losses to adjust model parameters, enhance the dependence between feature vectors, and improve license plate content recognition accuracy.

Benefits of technology

It effectively reduces the false negative rate of license plates, improves the accuracy and efficiency of license plate recognition, and ensures the accurate extraction and identification of license plate content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113610770B_ABST
    Figure CN113610770B_ABST
Patent Text Reader

Abstract

The present invention provides a license plate recognition method, device and equipment, the method comprising: acquiring multiple original image frames collected after a vehicle reaches a preset collection area; performing vehicle detection and license plate detection on the multiple original image frames respectively to obtain multiple first image frames, wherein the first image frames contain a vehicle marking area for the vehicle and a first license plate marking area for the license plate; expanding the vehicle marking area contained in the multiple first image frames, and cropping the corresponding first image frames according to the expanded vehicle marking area to obtain multiple second image frames; performing license plate detection on the multiple second image frames respectively to obtain multiple third image frames, wherein the third image frames contain a second license plate marking area for the license plate; and determining the license plate content of the license plate based on the first license plate marking area and the second license plate marking area. The method provided by the present invention can reduce the problem of license plate underreporting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a vehicle license plate recognition method, device and equipment. Background Art

[0002] License plate recognition is a technology that detects vehicles on monitored roads to automatically extract vehicle license plate information and perform relevant processing on the above vehicle license plate information. License plate recognition is widely used in many scenarios, such as highway toll management, automatic photography of speeding violations, parking lot management, community in and out vehicle management, traffic data collection, etc., and with the development of artificial intelligence technologies such as deep learning, the field of intelligent transportation has developed rapidly and is playing an increasingly important role in people's lives. Therefore, higher requirements are also placed on the effect of license plate recognition.

[0003] The license plate recognition solution in the prior art locates the license plate area of ​​the collected original image, and obtains the license plate content by performing character recognition on the above license plate area. However, the above license plate recognition solution has problems such as a high license plate underreporting rate. The vehicle itself has a license plate, but due to the defects of the solution itself, such as poor license plate area positioning, the license plate cannot be recognized. Summary of the invention

[0004] The present invention provides a license plate recognition method, device and equipment, which solve the problem of high license plate underreporting rate in the license plate recognition scheme in the prior art.

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

[0006] Acquire multiple original image frames collected after the vehicle reaches a preset collection area;

[0007] Performing vehicle detection and license plate detection on the plurality of original image frames respectively to obtain a plurality of first image frames, wherein the first image frames include a vehicle marking area for the vehicle and a first license plate marking area for the license plate;

[0008] Expanding the vehicle marking areas included in the plurality of first image frames, and cropping the corresponding first image frames according to the expanded vehicle marking areas to obtain a plurality of second image frames;

[0009] Performing license plate detection on the plurality of second image frames respectively to obtain a plurality of third image frames, wherein the third image frames contain a second license plate marking area for the license plate;

[0010] Based on the first license plate marking area and the second license plate marking area, a license plate content of the license plate is determined.

[0011] Optionally, after obtaining a plurality of third image frames, the method further includes:

[0012] For each of the plurality of third image frames, determining whether there is a corresponding second license plate mark area;

[0013] When it is determined that there is a corresponding second license plate mark area, a fourth image frame whose license plate quality meets preset requirements is obtained from the plurality of third image frames;

[0014] When it is determined that there is no corresponding second license plate marking area, for each first image frame in the multiple first image frames, determine whether there is a corresponding first license plate marking area; when it is determined that there is a corresponding first license plate marking area, filter out a fourth image frame from the multiple first image frames whose license plate quality meets preset requirements.

[0015] Optionally, determining the license plate content of the license plate based on the first license plate mark area and the second license plate mark area includes:

[0016] Inputting the fourth image frame into a pre-trained license plate recognition model;

[0017] Performing feature extraction on the input fourth image frame based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H1;

[0018] Based on the correlation matrix calculation layer in the license plate recognition model, the dependency between the feature vectors in the feature matrix H1 is enhanced to obtain a dependency matrix O;

[0019] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0020] Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the license plate content and output it, and obtain n license plate contents of the output license plate.

[0021] Optionally, after obtaining the outputted n license plate contents of the license plate, the method further comprises:

[0022] When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates meet the preset license plate encoding rules, the license plate content of the license plate is determined according to the contents of the n license plates.

[0023] Optionally, pre-train a license plate recognition model, including:

[0024] Inputting image frames from pre-collected sample data into a license plate recognition model;

[0025] Adjusting the parameters of the license plate recognition model according to the connection temporal classification CTC loss and the cumulative cross entropy CCE loss so that the license plate recognition model outputs the license plate content corresponding to the image frame;

[0026] Among them, the sample data includes an image frame containing a license plate area and a license plate content corresponding to the image frame; the CTC loss is calculated based on the arrangement order of characters in the output license plate content and the arrangement order of characters in the license plate content corresponding to the image frame; the CCE loss is calculated based on the number of occurrences of the same character in the output license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame.

[0027] Optionally, adjusting the parameters of the license plate recognition model according to the connection temporal classification CTC loss includes:

[0028] Perform feature extraction on the image frames in the sample data based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H1;

[0029] Based on the correlation matrix calculation layer in the license plate recognition model, the dependency between the feature vectors in the feature matrix H1 is enhanced to obtain a dependency matrix O;

[0030] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0031] Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the first license plate content and output it;

[0032] Calculating a connection temporal classification CTC loss according to an arrangement order of characters in the first license plate content and an arrangement order of characters in the license plate content corresponding to the image frame in the sample data;

[0033] The parameters of the license plate recognition model are adjusted according to the CTC loss.

[0034] Optionally, the license plate recognition model further includes a second CNN feature extraction layer and a second classifier, and adjusting the parameters of the license plate recognition model according to the cumulative cross entropy CCE loss includes:

[0035] Perform feature extraction on the feature matrix H1 based on the second CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H3;

[0036] Based on the second classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step, sort the characters with the highest probability according to timestep to obtain the second license plate content and output it;

[0037] Calculating a cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data;

[0038] The parameters of the license plate recognition model are adjusted according to the CCE loss.

[0039] Optionally, the dependency between the eigenvectors in the feature matrix H1 is enhanced to obtain a dependency matrix O, including:

[0040] Calculate a distance matrix representing the distances between different eigenvectors in the feature matrix H1;

[0041] Calculate a correlation matrix representing the correlation relationship between different eigenvectors in the feature matrix H1;

[0042] Calculating the product of the distance matrix and the association matrix to obtain a correlation matrix;

[0043] The product of the correlation matrix, the feature matrix H1 and the preset weight matrix is ​​calculated to obtain the dependency matrix O.

[0044] Optionally, calculating the cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data includes:

[0045] Calculate the cumulative probability of each character c appearing in all positions in the feature matrix H3 in, is the probability of each character c appearing at each position i in the feature matrix H3, i=1,2,…,T, T is the total number of positions in the feature matrix H3, C is the license plate character set, is a space;

[0046] For the cumulative probability o c Normalize and obtain the normalized cumulative probability

[0047] Calculate the number of occurrences L of the character c in the license plate content corresponding to the image frame in the sample data c , and for the L c Normalize it,

[0048] Calculate the cumulative cross entropy CCE loss Where I is the input license plate image, and S is the second license plate content.

[0049] Optionally, after obtaining the outputted n license plate contents of the license plate, the method further comprises:

[0050] When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and is not equal to 0, and the contents of the n license plates meet the preset license plate coding rules, a license plate status label indicating that the license plate status is normal is determined;

[0051] When it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates do not comply with the preset license plate encoding rules, or when it is determined that n is equal to 0, the multiple second image frames are respectively input into a pre-trained license plate state classification model to obtain an output license plate state label identifying the license plate state as normal / abnormal, and the license plate state label is determined to be the license plate state label output by the license plate state classification model.

[0052] Optionally, selecting and obtaining a fourth image frame whose license plate quality meets preset requirements from the plurality of third image frames / first image frames includes:

[0053] When it is determined that the second license plate mark area / the first license plate mark area is a license plate image, the clarity of the license plate image is calculated, and whether the license plate is abnormal is determined according to the license plate image, and the inclination angle of the license plate is calculated;

[0054] A fourth image frame whose license plate quality meets preset requirements is obtained by screening from the multiple third image frames / first image frames, wherein the preset requirements are that the clarity is not less than a first preset threshold, the inclination angle is not greater than a second preset threshold, and the license plate is not abnormal.

[0055] Optionally, determining that the second license plate marking area is a license plate image includes:

[0056] When it is determined that the aspect ratio of the second license plate mark area is within a preset threshold range and the width of the second license plate mark area is greater than a third preset threshold, enlarging the second license plate mark area;

[0057] Input the enlarged second license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0058] When the output is a determination result that the license plate image is obtained, determining that the second license plate mark area / the first license plate mark area is a license plate image;

[0059] Determining that the first license plate marking area is a license plate image includes:

[0060] When it is determined that the aspect ratio of the first license plate mark area is within a preset threshold range and the width of the first license plate mark area is greater than a third preset threshold, expanding the first license plate mark area;

[0061] Input the enlarged first license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0062] When the output is a determination result that the license plate image is a license plate image, it is determined that the first license plate mark area is a license plate image.

[0063] Optionally, the tilt angle of the license plate is calculated, including:

[0064] Grayscale and threshold segmentation are performed on the enlarged second license plate mark area / first license plate mark area to obtain a binary image;

[0065] Performing connected domain segmentation and connected domain marking on the binary image, determining each character in the binary image, and determining the highest point and the lowest point of each character;

[0066] Perform straight line fitting on the highest point and the lowest point respectively, determine a first straight line where the highest point is located and a second straight line where the lowest point is located, and calculate an average slope k of the slope of the first straight line and the slope of the second straight line;

[0067] The inclination angle θ of the license plate area is calculated according to the average slope, and the inclination angle θ=atan(k).

[0068] Optionally, after determining whether the license plate is abnormal according to the license plate image, the method further includes:

[0069] Calculate the total number of characters in the binary image corresponding to the determined non-abnormal license plate;

[0070] The fourth image frames corresponding to the license plates whose total number is less than a fourth preset threshold are screened out.

[0071] Optionally, cropping the corresponding first image frame according to the enlarged vehicle marking area includes:

[0072] According to the width of the enlarged vehicle marking area and the preset aspect ratio, the upper half of the corresponding first image frame is cropped.

[0073] In a second aspect, the present invention provides a license plate recognition device, including a memory and a processor, wherein:

[0074] The memory is used to store computer programs;

[0075] The processor is used to read the program in the memory and execute the following steps:

[0076] Acquire multiple original image frames collected after the vehicle reaches a preset collection area;

[0077] Performing vehicle detection and license plate detection on the plurality of original image frames respectively to obtain a plurality of first image frames, wherein the first image frames include a vehicle marking area for the vehicle and a first license plate marking area for the license plate;

[0078] Expanding the vehicle marking areas included in the plurality of first image frames, and cropping the corresponding first image frames according to the expanded vehicle marking areas to obtain a plurality of second image frames;

[0079] Performing license plate detection on the plurality of second image frames respectively to obtain a plurality of third image frames, wherein the third image frames contain a second license plate marking area for the license plate;

[0080] Based on the first license plate marking area and the second license plate marking area, a license plate content of the license plate is determined.

[0081] Optionally, after obtaining a plurality of third image frames, the processor is further configured to:

[0082] For each of the plurality of third image frames, determining whether there is a corresponding second license plate mark area;

[0083] When it is determined that there is a corresponding second license plate mark area, a fourth image frame whose license plate quality meets preset requirements is obtained from the plurality of third image frames;

[0084] When it is determined that there is no corresponding second license plate marking area, for each first image frame in the multiple first image frames, determine whether there is a corresponding first license plate marking area; when it is determined that there is a corresponding first license plate marking area, filter out a fourth image frame from the multiple first image frames whose license plate quality meets preset requirements.

[0085] Optionally, the processor determines the license plate content of the license plate based on the first license plate mark area and the second license plate mark area, including:

[0086] Inputting the fourth image frame into a pre-trained license plate recognition model;

[0087] Performing feature extraction on the input fourth image frame based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H1;

[0088] Based on the correlation matrix calculation layer in the license plate recognition model, the dependency between the feature vectors in the feature matrix H1 is enhanced to obtain a dependency matrix O;

[0089] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0090] Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the license plate content and output it, and obtain n license plate contents of the output license plate.

[0091] Optionally, after obtaining the outputted n license plate contents of the license plate, the processor is further used to:

[0092] When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates meet the preset license plate encoding rules, the license plate content of the license plate is determined according to the contents of the n license plates.

[0093] Optionally, the processor pre-trains a license plate recognition model, including:

[0094] Inputting image frames from pre-collected sample data into a license plate recognition model;

[0095] Adjusting the parameters of the license plate recognition model according to the connection temporal classification CTC loss and the cumulative cross entropy CCE loss so that the license plate recognition model outputs the license plate content corresponding to the image frame;

[0096] Among them, the sample data includes an image frame containing a license plate area and a license plate content corresponding to the image frame; the CTC loss is calculated based on the arrangement order of characters in the output license plate content and the arrangement order of characters in the license plate content corresponding to the image frame; the CCE loss is calculated based on the number of occurrences of the same character in the output license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame.

[0097] Optionally, the processor adjusts the parameters of the license plate recognition model according to the connection temporal classification CTC loss, including:

[0098] Perform feature extraction on the image frames in the sample data based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H1;

[0099] Based on the correlation matrix calculation layer in the license plate recognition model, the dependency between the feature vectors in the feature matrix H1 is enhanced to obtain a dependency matrix O;

[0100] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0101] Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the first license plate content and output it;

[0102] Calculating a connection temporal classification CTC loss according to an arrangement order of characters in the first license plate content and an arrangement order of characters in the license plate content corresponding to the image frame in the sample data;

[0103] The parameters of the license plate recognition model are adjusted according to the CTC loss.

[0104] Optionally, the license plate recognition model further includes a second CNN feature extraction layer and a second classifier, and the processor adjusts the parameters of the license plate recognition model according to the cumulative cross entropy CCE loss, including:

[0105] Perform feature extraction on the feature matrix H1 based on the second CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H3;

[0106] Based on the second classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step, sort the characters with the highest probability according to timestep to obtain the second license plate content and output it;

[0107] Calculating a cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data;

[0108] The parameters of the license plate recognition model are adjusted according to the CCE loss.

[0109] Optionally, the processor enhances the dependency between the eigenvectors in the feature matrix H1 to obtain a dependency matrix O, including:

[0110] Calculate a distance matrix representing the distances between different eigenvectors in the feature matrix H1;

[0111] Calculate a correlation matrix representing the correlation relationship between different eigenvectors in the feature matrix H1;

[0112] Calculating the product of the distance matrix and the association matrix to obtain a correlation matrix;

[0113] The product of the correlation matrix, the feature matrix H1 and the preset weight matrix is ​​calculated to obtain the dependency matrix O.

[0114] Optionally, the processor calculates the cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data, including:

[0115] Calculate the cumulative probability of each character c appearing in all positions in the feature matrix H3 in, is the probability of each character c appearing at each position i in the feature matrix H3, i=1,2,…,T, T is the total number of positions in the feature matrix H3, C is the license plate character set, is a space;

[0116] For the cumulative probability o c Normalize and obtain the normalized cumulative probability

[0117] Calculate the number of occurrences L of the character c in the license plate content corresponding to the image frame in the sample data c , and for the L c Normalize it,

[0118] Calculate the cumulative cross entropy CCE loss Where I is the input license plate image, and S is the second license plate content.

[0119] Optionally, after obtaining the outputted n license plate contents of the license plate, the processor is further used to:

[0120] When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and is not equal to 0, and the contents of the n license plates meet the preset license plate coding rules, a license plate status label indicating that the license plate status is normal is determined;

[0121] When it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates do not comply with the preset license plate encoding rules, or when it is determined that n is equal to 0, the multiple second image frames are respectively input into a pre-trained license plate state classification model to obtain an output license plate state label identifying the license plate state as normal / abnormal, and the license plate state label is determined to be the license plate state label output by the license plate state classification model.

[0122] Optionally, the processor selects and obtains a fourth image frame whose license plate quality meets preset requirements from the plurality of third image frames / first image frames, including:

[0123] When it is determined that the second license plate mark area / the first license plate mark area is a license plate image, the clarity of the license plate image is calculated, and whether the license plate is abnormal is determined according to the license plate image, and the inclination angle of the license plate is calculated;

[0124] A fourth image frame whose license plate quality meets preset requirements is obtained by screening from the multiple third image frames / first image frames, wherein the preset requirements are that the clarity is not less than a first preset threshold, the inclination angle is not greater than a second preset threshold, and the license plate is not abnormal.

[0125] Optionally, the processor determines that the second license plate marking area is a license plate image, comprising:

[0126] When it is determined that the aspect ratio of the second license plate mark area is within a preset threshold range and the width of the second license plate mark area is greater than a third preset threshold, enlarging the second license plate mark area;

[0127] Input the enlarged second license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0128] When the output is a determination result that the license plate image is obtained, determining that the second license plate mark area / the first license plate mark area is a license plate image;

[0129] The processor determines that the first license plate mark area is a license plate image, including:

[0130] When it is determined that the aspect ratio of the first license plate mark area is within a preset threshold range and the width of the first license plate mark area is greater than a third preset threshold, expanding the first license plate mark area;

[0131] Input the enlarged first license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0132] When the output is a determination result that the license plate image is a license plate image, it is determined that the first license plate mark area is a license plate image.

[0133] Optionally, the processor calculates the tilt angle of the license plate, including:

[0134] Grayscale and threshold segmentation are performed on the enlarged second license plate mark area / first license plate mark area to obtain a binary image;

[0135] Performing connected domain segmentation and connected domain marking on the binary image, determining each character in the binary image, and determining the highest point and the lowest point of each character;

[0136] Perform straight line fitting on the highest point and the lowest point respectively, determine a first straight line where the highest point is located and a second straight line where the lowest point is located, and calculate an average slope k of the slope of the first straight line and the slope of the second straight line;

[0137] The inclination angle θ of the license plate area is calculated according to the average slope, and the inclination angle θ=atan(k).

[0138] Optionally, after determining whether the license plate is abnormal according to the license plate image, the processor is further configured to:

[0139] Calculate the total number of characters in the binary image corresponding to the determined non-abnormal license plate;

[0140] The fourth image frames corresponding to the license plates whose total number is less than a fourth preset threshold are screened out.

[0141] Optionally, the processor crops the corresponding first image frame according to the enlarged vehicle marking area, including:

[0142] According to the width of the enlarged vehicle marking area and the preset aspect ratio, the upper half of the corresponding first image frame is cropped.

[0143] In a third aspect, the present invention provides a license plate recognition device, comprising:

[0144] An image frame acquisition unit, used to acquire a plurality of original image frames acquired after the vehicle reaches a preset acquisition area;

[0145] A first detection unit, configured to perform vehicle detection and license plate detection on the plurality of original image frames respectively, to obtain a plurality of first image frames, wherein the first image frames include a vehicle marking area for the vehicle and a first license plate marking area for the license plate;

[0146] A cropping unit, configured to enlarge the vehicle marking area included in the plurality of first image frames, and crop the corresponding first image frames according to the enlarged vehicle marking area to obtain a plurality of second image frames;

[0147] A second detection unit, configured to perform license plate detection on the plurality of second image frames respectively to obtain a plurality of third image frames, wherein the third image frames include a second license plate marking area for the license plate;

[0148] A content determination unit is used to determine the license plate content of the license plate based on the first license plate mark area and the second license plate mark area.

[0149] Optionally, after obtaining the plurality of third image frames, the content determination unit is further configured to:

[0150] For each of the plurality of third image frames, determining whether there is a corresponding second license plate mark area;

[0151] When it is determined that there is a corresponding second license plate mark area, a fourth image frame whose license plate quality meets preset requirements is obtained from the plurality of third image frames;

[0152] When it is determined that there is no corresponding second license plate marking area, for each first image frame in the multiple first image frames, determine whether there is a corresponding first license plate marking area; when it is determined that there is a corresponding first license plate marking area, filter out a fourth image frame from the multiple first image frames whose license plate quality meets preset requirements.

[0153] Optionally, the content determination unit determines the license plate content of the license plate based on the first license plate mark area and the second license plate mark area, including:

[0154] Inputting the fourth image frame into a pre-trained license plate recognition model;

[0155] Performing feature extraction on the input fourth image frame based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H1;

[0156] Based on the correlation matrix calculation layer in the license plate recognition model, the dependency between the feature vectors in the feature matrix H1 is enhanced to obtain a dependency matrix O;

[0157] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0158] Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the license plate content and output it, and obtain n license plate contents of the output license plate.

[0159] Optionally, after obtaining the outputted n license plate contents of the license plate, the content determination unit is further used to:

[0160] When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates meet the preset license plate encoding rules, the license plate content of the license plate is determined according to the contents of the n license plates.

[0161] Optionally, the content determination unit pre-trains a license plate recognition model, including:

[0162] Inputting image frames from pre-collected sample data into a license plate recognition model;

[0163] Adjusting the parameters of the license plate recognition model according to the connection temporal classification CTC loss and the cumulative cross entropy CCE loss so that the license plate recognition model outputs the license plate content corresponding to the image frame;

[0164] Among them, the sample data includes an image frame containing a license plate area and a license plate content corresponding to the image frame; the CTC loss is calculated based on the arrangement order of characters in the output license plate content and the arrangement order of characters in the license plate content corresponding to the image frame; the CCE loss is calculated based on the number of occurrences of the same character in the output license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame.

[0165] Optionally, the content determination unit adjusts the parameters of the license plate recognition model according to the connection temporal classification CTC loss, including:

[0166] Perform feature extraction on the image frames in the sample data based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H1;

[0167] Based on the correlation matrix calculation layer in the license plate recognition model, the dependency between the feature vectors in the feature matrix H1 is enhanced to obtain a dependency matrix O;

[0168] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0169] Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the first license plate content and output it;

[0170] Calculating a connection temporal classification CTC loss according to an arrangement order of characters in the first license plate content and an arrangement order of characters in the license plate content corresponding to the image frame in the sample data;

[0171] The parameters of the license plate recognition model are adjusted according to the CTC loss.

[0172] Optionally, the license plate recognition model further includes a second CNN feature extraction layer and a second classifier, and the content determination unit adjusts the parameters of the license plate recognition model according to the cumulative cross entropy CCE loss, including:

[0173] Perform feature extraction on the feature matrix H1 based on the second CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H3;

[0174] Based on the second classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step, sort the characters with the highest probability according to timestep to obtain the second license plate content and output it;

[0175] Calculating a cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data;

[0176] The parameters of the license plate recognition model are adjusted according to the CCE loss.

[0177] Optionally, the content determination unit enhances the dependency between the feature vectors in the feature matrix H1 to obtain a dependency matrix O, including:

[0178] Calculate a distance matrix representing the distances between different eigenvectors in the feature matrix H1;

[0179] Calculate a correlation matrix representing the correlation relationship between different eigenvectors in the feature matrix H1;

[0180] Calculating the product of the distance matrix and the association matrix to obtain a correlation matrix;

[0181] The product of the correlation matrix, the feature matrix H1 and the preset weight matrix is ​​calculated to obtain the dependency matrix O.

[0182] Optionally, the content determination unit calculates the cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data, including:

[0183] Calculate the cumulative probability of each character c appearing in all positions in the feature matrix H3 in, is the probability of each character c appearing at each position i in the feature matrix H3, i=1,2,…,T, T is the total number of positions in the feature matrix H3, C is the license plate character set, is a space;

[0184] For the cumulative probability o c Normalize and obtain the normalized cumulative probability

[0185] Calculate the number of occurrences L of the character c in the license plate content corresponding to the image frame in the sample data c , and for the Lc Normalize it,

[0186] Calculate the cumulative cross entropy CCE loss Where I is the input license plate image, and S is the second license plate content.

[0187] Optionally, after obtaining the outputted n license plate contents of the license plate, the content determination unit is further used to:

[0188] When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and is not equal to 0, and the contents of the n license plates meet the preset license plate coding rules, a license plate status label indicating that the license plate status is normal is determined;

[0189] When it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates do not comply with the preset license plate encoding rules, or when it is determined that n is equal to 0, the multiple second image frames are respectively input into a pre-trained license plate state classification model to obtain an output license plate state label identifying the license plate state as normal / abnormal, and the license plate state label is determined to be the license plate state label output by the license plate state classification model.

[0190] Optionally, the content determination unit selects and obtains a fourth image frame whose license plate quality meets preset requirements from the plurality of third image frames / first image frames, including:

[0191] When it is determined that the second license plate mark area / the first license plate mark area is a license plate image, the clarity of the license plate image is calculated, and whether the license plate is abnormal is determined according to the license plate image, and the inclination angle of the license plate is calculated;

[0192] A fourth image frame whose license plate quality meets preset requirements is obtained by screening from the multiple third image frames / first image frames, wherein the preset requirements are that the clarity is not less than a first preset threshold, the inclination angle is not greater than a second preset threshold, and the license plate is not abnormal.

[0193] Optionally, the content determination unit determines that the second license plate mark area is a license plate image, including:

[0194] When it is determined that the aspect ratio of the second license plate mark area is within a preset threshold range and the width of the second license plate mark area is greater than a third preset threshold, enlarging the second license plate mark area;

[0195] Input the enlarged second license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0196] When the output is a determination result that the license plate image is obtained, determining that the second license plate mark area / the first license plate mark area is a license plate image;

[0197] The content determination unit determines that the first license plate mark area is a license plate image, including:

[0198] When it is determined that the aspect ratio of the first license plate mark area is within a preset threshold range and the width of the first license plate mark area is greater than a third preset threshold, expanding the first license plate mark area;

[0199] Input the enlarged first license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0200] When the output is a determination result that the license plate image is a license plate image, it is determined that the first license plate mark area is a license plate image.

[0201] Optionally, the content determination unit calculates the tilt angle of the license plate, including:

[0202] Grayscale and threshold segmentation are performed on the enlarged second license plate mark area / first license plate mark area to obtain a binary image;

[0203] Performing connected domain segmentation and connected domain marking on the binary image, determining each character in the binary image, and determining the highest point and the lowest point of each character;

[0204] Perform straight line fitting on the highest point and the lowest point respectively, determine a first straight line where the highest point is located and a second straight line where the lowest point is located, and calculate an average slope k of the slope of the first straight line and the slope of the second straight line;

[0205] The inclination angle θ of the license plate area is calculated according to the average slope, and the inclination angle θ=atan(k).

[0206] Optionally, after determining whether the license plate is abnormal according to the license plate image, the content determination unit is further used to:

[0207] Calculate the total number of characters in the binary image corresponding to the determined non-abnormal license plate;

[0208] The fourth image frames corresponding to the license plates whose total number is less than a fourth preset threshold are screened out.

[0209] Optionally, the cropping unit crops the corresponding first image frame according to the enlarged vehicle marking area, including:

[0210] According to the width of the enlarged vehicle marking area and the preset aspect ratio, the upper half of the corresponding first image frame is cropped.

[0211] In a fourth aspect, the present invention provides a computer program medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the license plate recognition method provided in the first aspect above.

[0212] In a fifth aspect, the present invention provides a chip, which is coupled to a memory in a device so that the chip calls program instructions stored in the memory during operation to implement the above-mentioned various aspects of the embodiments of the present application and any possible method involved in each aspect.

[0213] In a sixth aspect, the present invention provides a computer program product. When the computer program product runs on an electronic device, the electronic device executes and implements the above-mentioned various aspects of the embodiments of the present application and any possible method involved in each aspect.

[0214] The present invention provides a license plate recognition method, device and equipment, which have the following beneficial effects:

[0215] It can reduce the problem of license plate omissions caused by inaccurate vehicle detection and clipping of license plates. BRIEF DESCRIPTION OF THE DRAWINGS

[0216] Figure 1 A schematic diagram of an application scenario of a license plate recognition method provided by an embodiment of the present invention;

[0217] Figure 2 A flowchart of a license plate recognition method provided by an embodiment of the present invention;

[0218] Figure 3 A schematic diagram of a license plate quality assessment model provided by an embodiment of the present invention;

[0219] Figure 4 A schematic diagram of a license plate recognition model provided by an embodiment of the present invention;

[0220] Figure 5 A schematic diagram of a license plate image frame including similar characters provided by an embodiment of the present invention;

[0221] Figure 6 A schematic diagram of a training license plate recognition model provided by an embodiment of the present invention;

[0222] Figure 7 A schematic diagram of an image frame of a passively shielded license plate provided by an embodiment of the present invention;

[0223] Figure 8 A flowchart of a specific implementation of a license plate recognition method provided by an embodiment of the present invention;

[0224] Fig. 9 A schematic diagram of a license plate recognition device provided by an embodiment of the present invention;

[0225] Fig.10 A schematic diagram of a license plate recognition device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0226] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0227] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein.

[0228] The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0229] In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" refers to two or more than two, and other quantifiers are similar. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application, and the embodiments of the present application and the features in the embodiments may be combined with each other without conflict.

[0230] Hereinafter, some terms used in the embodiments of the present invention are explained to facilitate understanding by those skilled in the art.

[0231] (1) The term “Convolutional Neural Networks (CNN)” in the embodiments of the present invention refers to a type of feedforward neural network that includes convolution calculations and has a deep structure, and is one of the representative algorithms of deep learning.

[0232] (2) The term “Recurrent Neural Network (RNN)” in the embodiments of the present invention refers to a type of recurrent neural network that takes sequence data as input, performs recursion in the direction of sequence evolution, and all nodes are connected in a chain-like manner.

[0233] (3) The term "single-stage detection method" in the embodiments of the present invention refers to an object detection algorithm that does not explicitly provide a process for extracting candidate regions, but instead combines extraction and detection into one to directly obtain the final detection result, and its detection speed is often faster.

[0234] (4) The term “You Only Look Once (YOLO) algorithm” in the embodiments of the present invention transforms the target detection problem into a regression problem, and uses a convolutional neural network structure to directly predict the object position and category probability from the input image.

[0235] (5) The term “two-stage detection method” in the embodiments of the present invention refers to an object detection algorithm that first generates object candidate boxes and then classifies the candidate boxes.

[0236] (6) The term “AlexNet classification model” in the embodiments of the present invention refers to a classification model that deepens the network structure based on the LeNet classification model and learns richer and higher-dimensional image features.

[0237] (7) The term “Visual Geometry Group Net (VGGNet) classification model” in the embodiments of the present invention refers to a deep convolutional neural network developed by the Computer Vision Group of the University of Oxford. It explores the relationship between the depth of a convolutional neural network and its performance, and successfully constructs a 16- to 19-layer deep convolutional neural network by repeatedly stacking 3*3 small convolution kernels and 2*2 maximum pooling layers.

[0238] (8) The term “deep residual network (ResNet) classification model” in the embodiments of the present invention solves the problem that deep convolutional neural network models are difficult to train and greatly improves the network depth.

[0239] (9) The term “Convolutional Recurrent Neural Network (CRNN)” in the embodiments of the present invention is mainly used to recognize text sequences of indefinite length in an end-to-end manner. Instead of cutting individual characters first, text recognition is converted into a time-dependent sequence learning problem, which can realize image-based sequence recognition.

[0240] In view of the above-mentioned problems existing in the prior art license plate recognition solutions, the present application proposes a license plate recognition method, device and equipment.

[0241] The following is a detailed description of a license plate recognition method, device and equipment in an embodiment of the present application in conjunction with the accompanying drawings.

[0242] Example 1

[0243] like Figure 1 As shown, an embodiment of the present invention provides a schematic diagram of an application scenario of a license plate recognition method, including:

[0244] The image acquisition device 101 is used to acquire multiple original image frames after the vehicle reaches a preset acquisition area;

[0245] The license plate recognition device 102 is used to obtain multiple original image frames collected by the above-mentioned image acquisition device after the vehicle arrives at a preset acquisition area; perform vehicle detection and license plate detection on the above-mentioned multiple original image frames respectively to obtain multiple first image frames, and the above-mentioned first image frames contain a vehicle marking area for the vehicle and a first license plate marking area for the license plate; expand the vehicle marking area contained in the multiple first image frames, and crop the corresponding first image frames according to the expanded vehicle marking area to obtain multiple second image frames; perform license plate detection on the above-mentioned multiple second image frames respectively to obtain multiple third image frames, and the above-mentioned third image frames contain a second license plate marking area for the license plate; determine the license plate content of the above-mentioned license plate based on the above-mentioned first license plate marking area and the above-mentioned second license plate marking area.

[0246] The image acquisition device is installed near the preset acquisition area.

[0247] The image acquisition device and the license plate recognition device are communicatively connected via a network, which may be a local area network, a wide area network, or the like.

[0248] After the image acquisition device acquires a plurality of original image frames, the plurality of original image frames are stored or sent to the license plate recognition device.

[0249] The embodiment of the present invention does not specify any specific type of the above-mentioned image acquisition device, and any device that can implement the above-mentioned original image frame acquisition function can be applied to the embodiment of the present invention.

[0250] The embodiment of the present invention does not specify any specific type of the above-mentioned license plate recognition device. Any device that can implement the relevant functions of the above-mentioned license plate recognition device can be applied to the embodiment of the present invention.

[0251] It should be noted that the above application scenario is only an example of an application scenario of a license plate recognition method provided by an embodiment of the present invention, and does not constitute a specific limitation on the embodiment of the present invention. On the basis of the above application scenario, some entities can be added or deleted. For example, the above image acquisition device 101 can be one or more, and all the functions of the above image acquisition device and the license plate recognition device can be integrated into one device.

[0252] The embodiment of the present invention provides a flow chart of a license plate recognition method, such as Figure 2 As shown, including:

[0253] Step S201, acquiring a plurality of original image frames captured after the vehicle arrives at a preset capture area;

[0254] The original image frame may be obtained in real time or in a pre-stored manner.

[0255] The number of the acquired original image frames can be specifically set according to the specific implementation situation. As an optional implementation manner, the number of the original image frames is greater than 3.

[0256] Step S202, performing vehicle detection and license plate detection on the plurality of original image frames respectively to obtain a plurality of first image frames, wherein the first image frames include a vehicle marking area for the vehicle and a first license plate marking area for the license plate;

[0257] The above multiple original image frames are respectively input into the pre-trained target detection model, and vehicle and license plate detection are performed simultaneously, and the vehicle detection results and license plate detection results are output.

[0258] Among them, the above-mentioned vehicle detection is used to detect the vehicle coordinates, and the above-mentioned vehicle detection result is the above-mentioned vehicle marking area for the vehicle; the above-mentioned license plate detection is used to detect the license plate coordinates, and the above-mentioned license plate detection result is the above-mentioned first license plate marking area for the license plate.

[0259] As an optional implementation, the vehicle marking area is marked by a vehicle marking frame; and the first license plate marking area is marked by a first license plate marking frame.

[0260] The above target detection model can be implemented using a single-stage detection method, such as the SingleShot MultiBox Detector (SSD) algorithm and the YOLO algorithm; or a two-stage detection method, such as the Faster Region with Convolutional Neural Networks features (Faster RCNN) algorithm.

[0261] Step S203, enlarging the vehicle mark area included in the plurality of first image frames, and cropping the corresponding first image frames according to the enlarged vehicle mark area to obtain a plurality of second image frames;

[0262] The direction of enlarging the vehicle mark area may be any one or more of the directions of up, down, left, and right.

[0263] Because most motor vehicle license plates are hung below the vehicle, when cropping the vehicle marking area, inaccurate vehicle detection may cause the lower part of the license plate to be cropped outside the above-mentioned vehicle marking area. In order to overcome the above-mentioned problem, as an optional implementation method, the above-mentioned vehicle marking area is expanded downward.

[0264] Expanding the vehicle marking area downward can reduce the situation where the license plate is cropped due to inaccurate vehicle detection.

[0265] It should be noted that the degree of expansion of the above-mentioned vehicle marking area can be specifically limited according to the specific implementation situation. It can be expanded by a preset proportion. For example, when the above-mentioned vehicle marking area is expanded downward, the expansion proportion can be set to 10% of the height of the above-mentioned vehicle marking area; it can also be expanded by a preset size. For example, when the above-mentioned vehicle marking area is expanded downward, the expansion size can be set to 1 cm.

[0266] Because most motor vehicle license plates are hung below the vehicle, when cropping the corresponding first image frame, it is necessary to consider the position of the license plate relative to the vehicle, and crop the corresponding first image frame according to the enlarged vehicle marking area, including:

[0267] According to the width of the enlarged vehicle marking area and the preset aspect ratio, the corresponding upper half of the first image frame is cropped.

[0268] Cropping off the upper half of the first image frame can make the license plate occupy a larger proportion in the cropped second image frame, making it easier to detect the license plate later and reducing the possibility of missed license plate detection.

[0269] The aspect ratio of the cropping may be specifically set according to specific implementation conditions. For example, the aspect ratio may be set to 1:1. This embodiment of the present invention does not impose any limitation on this.

[0270] Step S204, performing license plate detection on the plurality of second image frames respectively to obtain a plurality of third image frames, wherein the third image frames contain a second license plate marking area for the license plate;

[0271] The above-mentioned multiple second image frames are respectively input into a pre-trained license plate detection model to perform license plate detection and output the license plate detection result.

[0272] The license plate detection is used to detect the coordinates of the license plate, and the license plate detection result is a second license plate marking area for the license plate.

[0273] The above license plate detection model can be implemented using a single-stage detection method, such as the SingleShot MultiBox Detector (SSD) algorithm and the YOLO algorithm; or a two-stage detection method, such as FasterRCNN.

[0274] As an optional implementation, the above license plate detection model can also output the license plate type, confidence information of whether it is a license plate, etc.

[0275] The above license plate type can be used to determine what type of license plate the license plate belongs to, for example, a blue plate, a yellow plate, a police plate, a new energy plate, etc. The above confidence information can be used to assist in determining whether the license plate is detected.

[0276] Step S205: determining the license plate content of the license plate based on the first license plate mark area and the second license plate mark area.

[0277] When the second license plate marking area exists, the license plate content is determined according to the second license plate marking area; when the second license plate marking area does not exist, the license plate content is determined according to the first license plate marking area.

[0278] In order to improve the precision and accuracy of license plate recognition, it is necessary to determine an image frame whose quality meets the preset requirements in the first image frame or the third image frame to perform license plate content recognition. After obtaining multiple third image frames, the method further includes:

[0279] For each of the plurality of third image frames, determining whether there is a corresponding second license plate marking area;

[0280] When it is determined that there is a corresponding second license plate mark area, a fourth image frame whose license plate quality meets preset requirements is obtained from the plurality of third image frames;

[0281] When it is determined that there is no corresponding second license plate marking area, for each first image frame in the above-mentioned multiple first image frames, determine whether there is a corresponding first license plate marking area; when it is determined that there is a corresponding first license plate marking area, filter out a fourth image frame whose license plate quality meets the preset requirements from the above-mentioned multiple first image frames.

[0282] Determine whether the license plate detection model used in the above step S204 detects the second license plate marking area. If so, perform license plate quality screening in the third image frame in which the second license plate marking area is detected; otherwise, determine whether the target detection model used in the above step S202 detects the first license plate marking area. If so, perform license plate quality screening in the first image frame in which the first license plate marking area is detected; otherwise, determine that the license plate is not detected.

[0283] The following implementation method is adopted to evaluate the license plate quality of the second license plate mark area / the first license plate mark area, and to select and obtain a fourth image frame whose license plate quality meets the preset requirements from the plurality of third image frames / the first image frames:

[0284] When it is determined that the second license plate mark area / the first license plate mark area is a license plate image, the clarity of the license plate image is calculated, and whether the license plate is abnormal is determined based on the license plate image, and the inclination angle of the license plate is calculated;

[0285] A fourth image frame whose license plate quality meets preset requirements is obtained by screening from the above-mentioned multiple third image frames / first image frames. The above-mentioned preset requirements are that the above-mentioned clarity is not less than a first preset threshold, and the above-mentioned inclination angle is not greater than a second preset threshold, and the above-mentioned license plate is not abnormal.

[0286] The second license plate marking area / first license plate marking area is input into a pre-trained license plate quality assessment model to perform quality assessment on the license plate, and a fourth image frame whose license plate quality meets preset requirements is output.

[0287] The license plate quality assessment model has the following four functions: (1) determining whether the second license plate mark area / first license plate mark area is a license plate image; (2) calculating the clarity of the license plate image; (3) determining whether the license plate is abnormal based on the license plate image; (4) calculating the tilt angle of the license plate. The above four functions can be implemented by an independent license plate quality assessment model, or multiple models can be combined to form a license plate quality assessment model, and the above four functions can be implemented by each sub-model.

[0288] like Figure 3 As shown, an embodiment of the present invention provides a schematic diagram of a license plate quality assessment model 300, including:

[0289] The license plate existence classification model 301 is used to determine whether the second license plate mark area / first license plate mark area is a license plate image according to the input second license plate mark area / first license plate mark area;

[0290] A clarity screening model 302 is used to calculate the clarity of the license plate image and screen the image frames whose clarity is not less than a first preset threshold;

[0291] The abnormal license plate screening model 303 is used to determine whether the license plate is abnormal based on the license plate image, and screen image frames with non-abnormal license plates;

[0292] The tilt angle screening model 304 is used to calculate the tilt angle of the license plate and screen the image frames whose tilt angle is not greater than a second preset threshold.

[0293] According to the screening results of the clarity screening model, the abnormal license plate screening model and the tilt angle screening model, a fourth image frame whose license plate quality meets the preset requirements is determined.

[0294] It should be noted that the above-mentioned license plate existence classification model, clarity screening model, abnormal license plate screening model and tilt angle screening model are obtained through independent training.

[0295] The embodiment of the present invention proposes the use of a license plate quality assessment model for the passing vehicles in the original image frames, and screens the image frames from the aspects of whether it is a license plate image, clarity, angle, and whether the license plate is abnormal. This not only improves the accuracy of license plate content recognition and reduces false alarms, but also reduces the time for license plate recognition on unnecessary image frames.

[0296] The license plate quality assessment model or the license plate existence classification model adopts the following implementation to determine that the second license plate mark area is a license plate image:

[0297] When it is determined that the aspect ratio of the second license plate mark area is within a preset threshold range and the width of the second license plate mark area is greater than a third preset threshold, enlarging the second license plate mark area;

[0298] Input the enlarged second license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0299] When the output is a determination result that the license plate image is obtained, it is determined that the second license plate mark area / the first license plate mark area is a license plate image.

[0300] The license plate quality assessment model or the license plate existence classification model adopts the following implementation to determine that the first license plate marking area is a license plate image:

[0301] When it is determined that the aspect ratio of the first license plate mark area is within a preset threshold range and the width of the first license plate mark area is greater than a third preset threshold, enlarging the first license plate mark area;

[0302] Input the enlarged first license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0303] When the output is a determination result that the license plate image is a license plate image, it is determined that the first license plate mark area is a license plate image.

[0304] First, the aspect ratio of the license plate mark area is determined, where the aspect ratio r=the width w of the license plate mark area / the height h of the license plate mark area.

[0305] Among them, the above-mentioned license plate marking area includes the above-mentioned first license plate marking area and the above-mentioned second license plate marking area, which will not be repeated hereafter.

[0306] The preset threshold range of the aspect ratio may be specifically set according to specific implementation conditions. For example, the preset threshold range of the aspect ratio may be set to [0.7, 7.5]. This embodiment of the present invention does not impose any limitation on this.

[0307] If the aspect ratio of the license plate marking area does not meet the preset threshold range, it is directly determined that the aspect ratio of the license plate marking area is abnormal, and no further judgment is performed; if the aspect ratio of the license plate marking area meets the preset threshold range, the width of the license plate marking area is judged.

[0308] The third preset threshold of the width can be specifically set according to the specific implementation situation. For example, according to actual experience, the third preset threshold of the width of a single-layer license plate is set to 50, and the third preset threshold of the width of a double-layer license plate is set to 40. The embodiment of the present invention does not impose any limitation on this.

[0309] If the width of the license plate marking area is less than the third preset threshold, it is directly determined that the width of the license plate marking area is too small and no further judgment is performed; if the width of the license plate marking area is not less than the third preset threshold, the license plate marking area is expanded.

[0310] It should be noted that the direction and degree of expansion of the license plate mark area can be specifically set according to the specific implementation method: the expansion direction can be any one or more of the directions of upward, downward, left and right; the expansion degree can be a preset ratio or a preset size. For example, the license plate mark area is expanded upward and downward by 1 / 10 of the height of the license plate mark area, and expanded leftward and rightward by 1 / 10 of the width of the license plate mark area, so as to reduce the incomplete license plate caused by inaccurate license plate detection.

[0311] The enlarged license plate mark area is input into the pre-trained classification model to determine whether it is a license plate image. The above classification model can use the AlexNet classification model, or the VGGNet classification model, or the ResNet classification model, etc. If the judgment result output by the above classification model is not a license plate image, the clarity screening model, the abnormal license plate screening model, and the tilt angle screening model are no longer used for the next judgment; if the judgment result output by the above classification model is a license plate image, the clarity screening model, the abnormal license plate screening model, and the tilt angle screening model are continued to be used for the next judgment.

[0312] The clarity screening model can adopt an AlexNet classification model, a VGGNet classification model, a ResNet classification model, etc. to classify the second license plate mark area / first license plate mark area of ​​the input license plate image, and output the clarity probability of each license plate mark area as the classification result, and record the clarity probability as the clarity Q.

[0313] It should be noted that the first preset threshold of the clarity Q can be specifically set according to specific implementation conditions, for example, the first preset threshold is set to 50, and the embodiment of the present invention does not impose any limitation on this.

[0314] The enlarged license plate marking area is input into the above-mentioned inclination angle screening model. The above-mentioned inclination angle screening model is implemented by an image processing method. Any calculation method that can calculate the inclination angle of the license plate can be applied to the above-mentioned inclination angle screening model. The embodiment of the present invention does not impose any limitation on this. As an optional implementation method, the above-mentioned inclination angle screening model calculates the inclination angle of the license plate using the following implementation method:

[0315] Grayscale and threshold segmentation are performed on the enlarged second license plate mark area / first license plate mark area to obtain a binary image;

[0316] Performing connected domain segmentation and connected domain labeling on the binary image, determining each character in the binary image, and determining the highest point and the lowest point of each character;

[0317] Perform straight line fitting on the highest point and the lowest point respectively, determine a first straight line where the highest point is located and a second straight line where the lowest point is located, and calculate an average slope k of the slope of the first straight line and the slope of the second straight line;

[0318] The inclination angle θ of the license plate area is calculated based on the average slope, and the inclination angle θ=atan(k).

[0319] The above threshold segmentation may be implemented by global threshold segmentation or local threshold segmentation, which is not limited in any way in the embodiment of the present invention.

[0320] Each character in the binary image may be determined by marking the characters with character boxes, and the embodiment of the present invention does not impose any limitation on this.

[0321] The highest point of each character is placed in set U, and the lowest point of each character is placed in set D. Then, based on all the points in set U and set D, the first straight line l where the highest points of all characters are located is determined by using the straight line fitting method. U , and the second straight line l where the lowest points of all characters are located D , and calculate the slopes of the two straight lines as k U and k D , using the above k U and k D , calculate the average slope k = (k U +k D ) / 2.

[0322] It should be noted that the second preset threshold of the above-mentioned inclination angle θ can be specifically set according to the specific implementation situation. For example, considering that in actual applications, when the inclination angle of the license plate exceeds 25 degrees, it is basically difficult for the human eye to recognize it, the above-mentioned second preset threshold is set to 25 degrees. The embodiment of the present invention does not impose any limitation on this.

[0323] The above abnormal license plate screening model can use an AlexNet classification model, a VGGNet classification model, a ResNet classification model, etc. to classify the license plate image in the input enlarged license plate marking area, and output whether each license plate is abnormal as a classification result.

[0324] The above-mentioned license plate abnormalities refer to whether it is contaminated, damaged, blocked by obstacles, etc.

[0325] When the clarity of the license plate image is low, it is easy to produce an erroneous recognition result of the license plate abnormality. Considering that the number of characters in the license plate is abnormal when the license plate is abnormal, the number of characters used in the above-mentioned tilt angle screening model is combined to assist in judging whether the license plate is abnormal. After judging whether the license plate is abnormal according to the above-mentioned license plate image, it also includes:

[0326] Calculate the total number of characters in the binary image corresponding to the determined non-abnormal license plate;

[0327] The fourth image frames corresponding to the license plates whose total number is less than the fourth preset threshold are screened out.

[0328] The total number of the above characters can be obtained by obtaining the number of character boxes in the above tilt angle screening model, or the total number of the above characters can be calculated by a detection method. The embodiment of the present invention does not impose any limitation on the calculation method of the number of the above characters.

[0329] It should be noted that the fourth preset threshold may be specifically set according to specific implementation conditions. For example, the fourth preset threshold is set to 7, and the embodiment of the present invention does not impose any limitation on this.

[0330] When the total number of characters is less than 7, the license plate is determined to be an abnormal license plate; when the total number of characters is not less than 7 and the above abnormal license plate screening model outputs that the license plate is not abnormal, it is considered normal.

[0331] When the license plate clarity angle Q≥50, the tilt angle θ≤25, and the license plate is not abnormal, the image frame is considered to be the fourth image frame whose license plate quality meets the preset requirements.

[0332] The embodiment of the present invention evaluates the quality of the license plate, limits the aspect ratio and width of the license plate, classifies whether it is a license plate, and judges the clarity of the license plate, the tilt angle of the license plate and whether it is damaged or blocked. License plates that do not meet the rules and have poor quality are screened out, and only license plate content recognition is performed on license plates that pass the screening. This not only improves the accuracy of license plate recognition and reduces false alarms, but also reduces the time for performing license plate content recognition on unnecessary image frames, thereby improving the efficiency of license plate content recognition.

[0333] After the fourth image frame whose license plate quality meets the preset requirements is obtained through screening, the license plate content of the license plate is determined based on the first license plate mark area and the second license plate mark area in the following manner:

[0334] Inputting the fourth image frame into a pre-trained license plate recognition model;

[0335] Based on the first CNN feature extraction layer in the above license plate recognition model, feature extraction is performed on the input fourth image frame to obtain a feature matrix H1;

[0336] Based on the correlation matrix calculation layer in the above license plate recognition model, the dependency between the eigenvectors in the above feature matrix H1 is enhanced to obtain the dependency matrix O;

[0337] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0338] Based on the first classifier in the above license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the largest probability according to timestep to obtain the license plate content and output it, and obtain the output n license plate contents of the above license plate.

[0339] like Figure 4 As shown, an embodiment of the present invention provides a schematic diagram of a license plate recognition model.

[0340] The above license plate recognition model includes a first CNN feature extraction layer, an association matrix calculation layer, an RNN feature extraction layer and a first classifier.

[0341] When the license plate recognition model performs CTC decoding, a character in the license plate may occupy more than one time step. If the local correlation of the feature vector is not taken into account, decoding errors will occur. For example, the first Chinese character of the license plate, "Qiong", may be decoded as "Qiong Jing". In order to alleviate the above problem, an embodiment of the present invention proposes to add an association matrix calculation layer between the first CNN feature extraction layer and the RNN feature extraction layer. The association matrix calculation layer not only considers the distance information between the feature vectors but also the correlation information between the feature vectors. Therefore, it can be used to enhance the related information between the same character extracted by the first CNN feature extraction layer at different time steps.

[0342] The above-mentioned correlation matrix calculation layer adopts the following implementation method to enhance the dependency between the eigenvectors in the above-mentioned feature matrix H1 and obtain the dependency matrix O:

[0343] Calculate the distance matrix representing the distances between different eigenvectors in the above eigenmatrix H1;

[0344] Calculate the correlation matrix representing the correlation relationship between different eigenvectors in the above-mentioned eigenmatrix H1;

[0345] Calculate the product of the above distance matrix and the above association matrix to obtain the correlation matrix;

[0346] The product of the above correlation matrix, the above feature matrix H1 and the preset weight matrix is ​​calculated to obtain the dependency matrix O.

[0347] The above distance matrix is ​​S D (i,j)=exp(-d ij +δ) / exp(-d ij +δ)+1, where d ij =|ij|, represents the geometric distance between different feature positions in the above feature matrix H1, and δ is a preset scale factor;

[0348] The above correlation matrix S A (i,j)=a i ·a j / ‖a i ‖‖a j ‖, where a i is the eigenvector h in the above eigenmatrix H1 i A linear transformation of , where i = 1, .., T, T is the total number of positions in the above feature matrix H1.

[0349] The above-mentioned correlation matrix S=(S A *S D ).

[0350] The above-mentioned dependency matrix O = SH1W c , where W c is a preset weight matrix.

[0351] In the embodiment of the present invention, an association matrix calculation layer is added between the first CNN feature extraction layer and the RNN feature extraction layer. The above-mentioned association matrix calculation layer not only considers the distance information between features but also considers the feature adjacency information, and can be used to enhance the dependence and correlation between the feature vectors in the feature matrix H1 extracted by the first CNN feature extraction layer, improve the recognition accuracy of the first Chinese character of the license plate in the left-right structure, and achieve a higher license plate recognition rate.

[0352] In the related art, when using CTC loss as the loss function of the license plate recognition model, there are many paths that can be correctly decoded, and each path will affect the CNN feature extraction. Therefore, when the CNN extracts features, it is difficult to extract effective features because it does not know the specific positions of each character.

[0353] Secondly, when the quality of the image frame is poor, it is easy to misrecognize similar and adjacent characters in the license plate. As Figure 5 shown, the embodiment of the present invention provides a schematic diagram of a license plate image frame including similar characters. It can be clearly felt that the numbers 0 and the letter D, the numbers 2 and the letter Z, the numbers 1 and the letter I, etc. are similar characters. The following Table 1 provides examples of adjacent characters in the license plate.

[0354] Table 1 Adjacent Character Set Table

[0355] Similar character set number character 1 2、Z 2 0, D, U, Q 3 8、B 4 1. T, Y 5 7. T, Z 6 4、A 7 N, H 8 E. F 9 5、S 10 6、G

[0356] Finally, when the license plate recognition model performs CTC character decoding, it will filter out adjacent identical characters. For example, if the result output by the classifier is "Zhe_A_1__22_3_45", the result after CTC decoding is "ZheA12345". Therefore, when there are consecutive identical characters in the license plate, it will cause license plate characters to be lost.

[0357] To overcome the above problems, the embodiment of the present invention adopts the following implementation manner to pre-train the license plate recognition model:

[0358] Input the image frames in the pre-collected sample data into the license plate recognition model;

[0359] Adjusting the parameters of the license plate recognition model according to the Connectionist Temporal Classification (CTC) loss and the Cumulative Cross Entropy (CCE) loss so that the license plate recognition model outputs the license plate content corresponding to the image frame;

[0360] Among them, the above-mentioned sample data includes an image frame containing a license plate area and a license plate content corresponding to the above-mentioned image frame; the above-mentioned CTC loss is calculated based on the arrangement order of characters in the output license plate content and the arrangement order of characters in the license plate content corresponding to the above-mentioned image frame; the above-mentioned CCE loss is calculated based on the number of occurrences of the same characters in the output license plate content and the number of occurrences of the same characters in the license plate content corresponding to the above-mentioned image frame.

[0361] like Figure 6 As shown, an embodiment of the present invention provides a schematic diagram of training a license plate recognition model.

[0362] The CTC loss is used to optimize the weights of the RNN branch including the above-mentioned association matrix calculation layer, the above-mentioned RNN feature extraction layer, and the above-mentioned first classifier, and the CCE loss is used to optimize the weights of the CNN branch including the above-mentioned first CNN feature extraction layer, the above-mentioned second CNN feature extraction layer, and the above-mentioned second classifier.

[0363] It should be noted that when using the above license plate recognition model, the above second CNN feature extraction layer and the above second classifier are discarded to reduce the time consumption of license plate recognition and improve the efficiency of license plate recognition.

[0364] The embodiment of the present invention adopts CCE loss to assist the training of the CRNN+CTC loss branch, but removes CCE loss during the use stage, which not only does not increase the time consumption, but also helps to improve the recognition accuracy of similar characters and adjacent identical characters, thereby improving the recognition accuracy of license plate characters.

[0365] The parameters of the above license plate recognition model are adjusted according to the connection time classification CTC loss, including:

[0366] Based on the first CNN feature extraction layer in the license plate recognition model, feature extraction is performed on the image frames in the sample data to obtain a feature matrix H1;

[0367] Based on the correlation matrix calculation layer in the above license plate recognition model, the dependency between the eigenvectors in the above feature matrix H1 is enhanced to obtain the dependency matrix O;

[0368] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0369] Based on the first classifier in the above license plate recognition model, predict the characters and probabilities corresponding to each time step, sort the characters with the highest probability according to timestep to obtain the first license plate content and output it;

[0370] Calculate the connection temporal classification CTC loss according to the arrangement order of the characters in the first license plate content and the arrangement order of the characters in the license plate content corresponding to the image frame in the sample data;

[0371] Adjust the parameters of the above license plate recognition model according to the above CTC loss.

[0372] CTC focuses on the order of characters.

[0373] The license plate recognition model further includes a second CNN feature extraction layer and a second classifier. The parameters of the license plate recognition model are adjusted according to the cumulative cross entropy CCE loss, including:

[0374] Based on the second CNN feature extraction layer in the license plate recognition model, feature extraction is performed on the feature matrix H1 to obtain a feature matrix H3;

[0375] Based on the second classifier in the above license plate recognition model, predict the characters and probabilities corresponding to each time step, sort the characters with the highest probability according to timestep to obtain the second license plate content and output it;

[0376] Calculate the cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data;

[0377] The parameters of the above license plate recognition model are adjusted according to the above CCE loss.

[0378] CCE focuses on the number of times each character appears, so there is no need to consider the order of license plate characters. It only needs to accurately predict the number of times each license plate character appears. The number of times each character appears can be converted into the cumulative probability of each class appearing. Therefore, CCE only needs digital supervision information in the character and its sequence annotation, and does not require order information.

[0379] The embodiment of the present invention adopts the following implementation method to calculate the cumulative cross entropy CCE loss, including:

[0380] Calculate the cumulative probability of each character c appearing in all positions in the above feature matrix H3 in, is the probability of each character c appearing in each position i in the above feature matrix H3, i = 1, 2, ..., T, T is the total number of positions in the above feature matrix H3, C is the license plate character set, is a space;

[0381] For the above cumulative probability o c Normalize and obtain the normalized cumulative probability

[0382] Calculate the number of occurrences L of the character c in the license plate content corresponding to the above image frame in the above sample data c , and for the above L c Normalize it,

[0383] Calculate the cumulative cross entropy CCE loss Where I is the input license plate image, and S is the second license plate content mentioned above.

[0384] It should be noted that the softmax classifier obtains each type of license plate character at each position i (i = 1, 2, ..., T) in the last layer feature map Probability of occurrence

[0385] After obtaining the n license plate contents of the license plate output by the license plate recognition model, it also includes:

[0386] When it is determined that the above n is not less than a preset value, or when it is determined that the above n is less than a preset value and is not equal to 0, and the above n license plate contents conform to the preset license plate encoding rule, the license plate content of the above license plate is determined according to the above n license plate contents.

[0387] It should be noted that the value of the above preset value can be specifically set according to the specific implementation scenario. For example, the above preset value is set to 3, and the embodiment of the present invention does not impose any limitation on this.

[0388] The specific implementation method of determining the license plate content of the license plate may be to vote on the n license plate contents to determine the most likely characters and the order of arrangement of the characters in the final license plate content.

[0389] In the related art, for vehicle images in which no license plate is detected, the license plate status is not output, and the license plate status of vehicle images in which the license plate is detected is obtained by reclassifying normal license plates and partially damaged license plates based on the character segmentation results. The above segmentation threshold is set artificially, and the generalization performance is poor. In addition, it directly judges whether the license plate is damaged or obscured based on the different segmentation thresholds of the segmented characters. It cannot identify intentional occlusion and passive occlusion, and has a high false alarm rate.

[0390] like Figure 7 As shown, an embodiment of the present invention provides a schematic diagram of an image frame for passively shielding a license plate.

[0391] The license plates in the above two image frames are blocked by pedestrians and road signs respectively.

[0392] The solutions in the related art cannot identify the above-mentioned situation of passively obstructed license plates.

[0393] In order to overcome the above problem, after obtaining the n license plate contents of the above license plate, the embodiment of the present invention further includes:

[0394] When it is determined that the above n is not less than a preset value, or when it is determined that the above n is less than a preset value and is not equal to 0, and the above n license plate contents meet the preset license plate coding rules, a license plate status label indicating that the license plate status is normal is determined;

[0395] When it is determined that the above n is less than a preset value and is not equal to 0, and the contents of the above n license plates do not comply with the preset license plate encoding rules, or when it is determined that the above n is equal to 0, the above multiple second image frames are respectively input into a pre-trained license plate state classification model to obtain an output license plate state label identifying the license plate state as normal / abnormal, and the license plate state label is determined to be the license plate state label output by the above license plate state classification model.

[0396] The above preset value is the same preset value as the preset value used when determining the license plate content of the above license plate.

[0397] The above-mentioned preset license plate coding rules can be specifically set according to the specific implementation situation, for example, according to relevant agreed specifications, etc., and can be specifically: the first digit of the license plate is set to be the Chinese character representing the provincial administrative region where the vehicle is registered, the second digit of the license plate is set to be the English letter representing the prefecture-level administrative region where the vehicle is registered, and the remaining digits of the license plate are the serial number code of the license plate. The embodiment of the present invention does not impose any limitation on this.

[0398] When the above n is less than a preset value, it is determined whether the above n is 0.

[0399] When the above n is equal to 0, the above multiple second image frames are respectively input into the pre-trained license plate state classification model to obtain the output license plate state label identifying the license plate state as normal / abnormal, and the license plate state label is determined to be the license plate state label output by the above license plate state classification model.

[0400] When the above n is not equal to 0, it is necessary to determine whether the contents of the above n license plates comply with the preset license plate coding rules; if so, determine the license plate status label that identifies the license plate status as normal; if not, respectively input the above multiple second image frames into a pre-trained license plate status classification model to obtain the output license plate status label that identifies the license plate status as normal / abnormal, and determine that the license plate status label is the license plate status label output by the above license plate status classification model.

[0401] The above-mentioned license plate status classification model can adopt an AlexNet classification model, a VGGNet classification model, a ResNet classification model, etc., and the embodiment of the present invention does not impose any limitation on this.

[0402] The above abnormal license plate status is caused by deliberate damage and occlusion, and does not include passive occlusion, such as the above Figure 7 In the two cases shown, the image acquisition device is blocked by leaves, resulting in the license plate being blocked.

[0403] It should be noted that the license plate status label indicating whether the license plate status is normal / abnormal is a label determined based on the multiple second image frames.

[0404] By making decisions to determine the above license plate status labels, the classification accuracy of damaged license plates can be improved and false positives of license plates that are not artificially damaged or obscured can be reduced.

[0405] like Figure 8 As shown, an embodiment of the present invention provides a flowchart of a specific implementation of a license plate recognition method, including:

[0406] Step S801, obtaining N original image frames collected after the vehicle arrives at a preset collection area, where N>3;

[0407] Step S802, setting the serial number i of the current original image frame to 0, and the current number n of the fourth image frame whose license plate quality meets the preset requirement to 0.

[0408] Step S803, determine whether i is less than N, if so, execute step S804, otherwise, execute step S815;

[0409] Step S804, performing vehicle detection and license plate detection on the plurality of original image frames respectively to obtain a plurality of first image frames, wherein the first image frames include a vehicle marking area for the vehicle and a first license plate marking area for the license plate;

[0410] Step S805, downwardly expanding the vehicle mark areas included in the plurality of first image frames, and cropping the corresponding first image frames according to the expanded vehicle mark areas to obtain a plurality of second image frames;

[0411] Step S806, performing license plate detection on the plurality of second image frames respectively to obtain a plurality of third image frames, wherein the third image frames contain a second license plate marking area for the license plate;

[0412] Step S807, determining whether the second license plate mark area exists, if yes, executing step S808, otherwise, executing step S809;

[0413] Step S808, input the second license plate mark area into the license plate quality assessment model, and execute step S811;

[0414] Step S809, determining whether the first license plate mark area exists, if yes, executing step S810, otherwise, executing step S814;

[0415] Step S810, inputting the first license plate mark area into the license plate quality assessment model, and executing step S811;

[0416] Step S811, determine whether the quality of the license plate meets the preset requirements, if yes, execute step S812, otherwise, execute step S814;

[0417] Step S812, increasing the current n by one;

[0418] Step S813, inputting the fourth image frame that meets the preset requirements into a pre-trained license plate recognition model, and recording the output license plate content;

[0419] Step S814, add 1 to the current i and execute step S803;

[0420] Step S815, determine whether n is not less than 3, if so, execute step S818, otherwise, execute step S816;

[0421] Step S816, determine whether n is equal to 0, if so, execute step S819, otherwise, execute step S817;

[0422] Step S817, determine whether the contents of the above n license plates conform to the preset license plate coding rules, if so, execute step S818, otherwise, execute step S819.

[0423] Step S818, determining the license plate content of the license plate according to the n license plate contents, and determining a license plate status label indicating that the license plate status is normal;

[0424] Step S819, input the second image frame into a pre-trained license plate state classification model, obtain an output license plate state label that identifies the license plate state as normal / abnormal, and determine that the license plate state label is the license plate state label output by the above license plate state classification model.

[0425] Example 2

[0426] The embodiment of the present invention provides a schematic diagram of a license plate recognition device 900, including a memory 901 and a processor 902. Fig. 9 As shown, where:

[0427] The memory is used to store computer programs;

[0428] The processor is used to read the program in the memory and execute the following steps:

[0429] Acquire multiple original image frames collected after the vehicle reaches a preset collection area;

[0430] Performing vehicle detection and license plate detection on the plurality of original image frames respectively to obtain a plurality of first image frames, wherein the first image frames include a vehicle marking area for the vehicle and a first license plate marking area for the license plate;

[0431] Expanding the vehicle marking areas included in the plurality of first image frames, and cropping the corresponding first image frames according to the expanded vehicle marking areas to obtain a plurality of second image frames;

[0432] Performing license plate detection on the plurality of second image frames respectively to obtain a plurality of third image frames, wherein the third image frames contain a second license plate marking area for the license plate;

[0433] Based on the first license plate marking area and the second license plate marking area, a license plate content of the license plate is determined.

[0434] Optionally, after obtaining a plurality of third image frames, the processor is further configured to:

[0435] For each of the plurality of third image frames, determining whether there is a corresponding second license plate mark area;

[0436] When it is determined that there is a corresponding second license plate mark area, a fourth image frame whose license plate quality meets preset requirements is obtained from the plurality of third image frames;

[0437] When it is determined that there is no corresponding second license plate marking area, for each first image frame in the multiple first image frames, determine whether there is a corresponding first license plate marking area; when it is determined that there is a corresponding first license plate marking area, filter out a fourth image frame from the multiple first image frames whose license plate quality meets preset requirements.

[0438] Optionally, the processor determines the license plate content of the license plate based on the first license plate mark area and the second license plate mark area, including:

[0439] Inputting the fourth image frame into a pre-trained license plate recognition model;

[0440] Performing feature extraction on the input fourth image frame based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H1;

[0441] Based on the correlation matrix calculation layer in the license plate recognition model, the dependency between the feature vectors in the feature matrix H1 is enhanced to obtain a dependency matrix O;

[0442] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0443] Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the license plate content and output it, and obtain n license plate contents of the output license plate.

[0444] Optionally, after obtaining the outputted n license plate contents of the license plate, the processor is further used to:

[0445] When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates meet the preset license plate encoding rules, the license plate content of the license plate is determined according to the contents of the n license plates.

[0446] Optionally, the processor pre-trains a license plate recognition model, including:

[0447] Inputting image frames from pre-collected sample data into a license plate recognition model;

[0448] Adjusting the parameters of the license plate recognition model according to the connection temporal classification CTC loss and the cumulative cross entropy CCE loss so that the license plate recognition model outputs the license plate content corresponding to the image frame;

[0449] Among them, the sample data includes an image frame containing a license plate area and a license plate content corresponding to the image frame; the CTC loss is calculated based on the arrangement order of characters in the output license plate content and the arrangement order of characters in the license plate content corresponding to the image frame; the CCE loss is calculated based on the number of occurrences of the same character in the output license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame.

[0450] Optionally, the processor adjusts the parameters of the license plate recognition model according to the connection temporal classification CTC loss, including:

[0451] Perform feature extraction on the image frames in the sample data based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H1;

[0452] Based on the correlation matrix calculation layer in the license plate recognition model, the dependency between the feature vectors in the feature matrix H1 is enhanced to obtain a dependency matrix O;

[0453] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0454] Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the first license plate content and output it;

[0455] Calculating a connection temporal classification CTC loss according to an arrangement order of characters in the first license plate content and an arrangement order of characters in the license plate content corresponding to the image frame in the sample data;

[0456] The parameters of the license plate recognition model are adjusted according to the CTC loss.

[0457] Optionally, the license plate recognition model further includes a second CNN feature extraction layer and a second classifier, and the processor adjusts the parameters of the license plate recognition model according to the cumulative cross entropy CCE loss, including:

[0458] Perform feature extraction on the feature matrix H1 based on the second CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H3;

[0459] Based on the second classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step, sort the characters with the highest probability according to timestep to obtain the second license plate content and output it;

[0460] Calculating a cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data;

[0461] The parameters of the license plate recognition model are adjusted according to the CCE loss.

[0462] Optionally, the processor enhances the dependency between the eigenvectors in the feature matrix H1 to obtain a dependency matrix O, including:

[0463] Calculate a distance matrix representing the distances between different eigenvectors in the feature matrix H1;

[0464] Calculate a correlation matrix representing the correlation relationship between different eigenvectors in the feature matrix H1;

[0465] Calculating the product of the distance matrix and the association matrix to obtain a correlation matrix;

[0466] The product of the correlation matrix, the feature matrix H1 and the preset weight matrix is ​​calculated to obtain the dependency matrix O.

[0467] Optionally, the processor calculates the cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data, including:

[0468] Calculate the cumulative probability of each character c appearing in all positions in the feature matrix H3 in, is the probability of each character c appearing at each position i in the feature matrix H3, i=1,2,…,T, T is the total number of positions in the feature matrix H3, C is the license plate character set, is a space;

[0469] For the cumulative probability o c Normalize and obtain the normalized cumulative probability

[0470] Calculate the number of occurrences L of the character c in the license plate content corresponding to the image frame in the sample data c , and for the L c Normalize it,

[0471] Calculate the cumulative cross entropy CCE loss Where I is the input license plate image, and S is the second license plate content.

[0472] Optionally, after obtaining the outputted n license plate contents of the license plate, the processor is further used to:

[0473] When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and is not equal to 0, and the contents of the n license plates meet the preset license plate coding rules, a license plate status label indicating that the license plate status is normal is determined;

[0474] When it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates do not comply with the preset license plate encoding rules, or when it is determined that n is equal to 0, the multiple second image frames are respectively input into a pre-trained license plate state classification model to obtain an output license plate state label identifying the license plate state as normal / abnormal, and the license plate state label is determined to be the license plate state label output by the license plate state classification model.

[0475] Optionally, the processor selects and obtains a fourth image frame whose license plate quality meets preset requirements from the plurality of third image frames / first image frames, including:

[0476] When it is determined that the second license plate mark area / the first license plate mark area is a license plate image, the clarity of the license plate image is calculated, and whether the license plate is abnormal is determined according to the license plate image, and the inclination angle of the license plate is calculated;

[0477] A fourth image frame whose license plate quality meets preset requirements is obtained by screening from the multiple third image frames / first image frames, wherein the preset requirements are that the clarity is not less than a first preset threshold, the inclination angle is not greater than a second preset threshold, and the license plate is not abnormal.

[0478] Optionally, the processor determines that the second license plate marking area is a license plate image, comprising:

[0479] When it is determined that the aspect ratio of the second license plate mark area is within a preset threshold range and the width of the second license plate mark area is greater than a third preset threshold, enlarging the second license plate mark area;

[0480] Input the enlarged second license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0481] When the output is a determination result that the license plate image is obtained, determining that the second license plate mark area / the first license plate mark area is a license plate image;

[0482] The processor determines that the first license plate mark area is a license plate image, including:

[0483] When it is determined that the aspect ratio of the first license plate mark area is within a preset threshold range and the width of the first license plate mark area is greater than a third preset threshold, expanding the first license plate mark area;

[0484] Input the enlarged first license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0485] When the output is a determination result that the license plate image is a license plate image, it is determined that the first license plate mark area is a license plate image.

[0486] Optionally, the processor calculates the tilt angle of the license plate, including:

[0487] Grayscale and threshold segmentation are performed on the enlarged second license plate mark area / first license plate mark area to obtain a binary image;

[0488] Performing connected domain segmentation and connected domain marking on the binary image, determining each character in the binary image, and determining the highest point and the lowest point of each character;

[0489] Perform straight line fitting on the highest point and the lowest point respectively, determine a first straight line where the highest point is located and a second straight line where the lowest point is located, and calculate an average slope k of the slope of the first straight line and the slope of the second straight line;

[0490] The inclination angle θ of the license plate area is calculated according to the average slope, and the inclination angle θ=atan(k).

[0491] Optionally, after determining whether the license plate is abnormal according to the license plate image, the processor is further configured to:

[0492] Calculate the total number of characters in the binary image corresponding to the determined non-abnormal license plate;

[0493] The fourth image frames corresponding to the license plates whose total number is less than a fourth preset threshold are screened out.

[0494] Optionally, the processor crops the corresponding first image frame according to the enlarged vehicle marking area, including:

[0495] According to the width of the enlarged vehicle marking area and the preset aspect ratio, the upper half of the corresponding first image frame is cropped.

[0496] An embodiment of the present invention provides a schematic diagram of a license plate recognition device, such as Fig.10 As shown, including:

[0497] The image frame acquisition unit 1001 is used to acquire a plurality of original image frames acquired after the vehicle reaches a preset acquisition area;

[0498] A first detection unit 1002 is used to perform vehicle detection and license plate detection on the multiple original image frames respectively to obtain multiple first image frames, wherein the first image frames include a vehicle marking area for the vehicle and a first license plate marking area for the license plate;

[0499] The cropping unit 1003 is used to expand the vehicle mark area included in the plurality of first image frames, and crop the corresponding first image frames according to the expanded vehicle mark area to obtain a plurality of second image frames;

[0500] A second detection unit 1004 is used to perform license plate detection on the plurality of second image frames respectively to obtain a plurality of third image frames, wherein the third image frames contain a second license plate marking area for the license plate;

[0501] The content determination unit 1005 is used to determine the license plate content of the license plate based on the first license plate mark area and the second license plate mark area.

[0502] Optionally, after obtaining the plurality of third image frames, the content determination unit is further configured to:

[0503] For each of the plurality of third image frames, determining whether there is a corresponding second license plate mark area;

[0504] When it is determined that there is a corresponding second license plate mark area, a fourth image frame whose license plate quality meets preset requirements is obtained from the plurality of third image frames;

[0505] When it is determined that there is no corresponding second license plate marking area, for each first image frame in the multiple first image frames, determine whether there is a corresponding first license plate marking area; when it is determined that there is a corresponding first license plate marking area, filter out a fourth image frame from the multiple first image frames whose license plate quality meets preset requirements.

[0506] Optionally, the content determination unit determines the license plate content of the license plate based on the first license plate mark area and the second license plate mark area, including:

[0507] Inputting the fourth image frame into a pre-trained license plate recognition model;

[0508] Performing feature extraction on the input fourth image frame based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H1;

[0509] Based on the correlation matrix calculation layer in the license plate recognition model, the dependency between the feature vectors in the feature matrix H1 is enhanced to obtain a dependency matrix O;

[0510] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0511] Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the license plate content and output it, and obtain n license plate contents of the output license plate.

[0512] Optionally, after obtaining the outputted n license plate contents of the license plate, the content determination unit is further used to:

[0513] When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates meet the preset license plate encoding rules, the license plate content of the license plate is determined according to the contents of the n license plates.

[0514] Optionally, the content determination unit pre-trains a license plate recognition model, including:

[0515] Inputting image frames from pre-collected sample data into a license plate recognition model;

[0516] Adjusting the parameters of the license plate recognition model according to the connection temporal classification CTC loss and the cumulative cross entropy CCE loss so that the license plate recognition model outputs the license plate content corresponding to the image frame;

[0517] Among them, the sample data includes an image frame containing a license plate area and a license plate content corresponding to the image frame; the CTC loss is calculated based on the arrangement order of characters in the output license plate content and the arrangement order of characters in the license plate content corresponding to the image frame; the CCE loss is calculated based on the number of occurrences of the same character in the output license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame.

[0518] Optionally, the content determination unit adjusts the parameters of the license plate recognition model according to the connection temporal classification CTC loss, including:

[0519] Perform feature extraction on the image frames in the sample data based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H1;

[0520] Based on the correlation matrix calculation layer in the license plate recognition model, the dependency between the feature vectors in the feature matrix H1 is enhanced to obtain a dependency matrix O;

[0521] Based on the RNN feature extraction layer in the license plate recognition model, feature extraction is performed on the dependency matrix O to obtain a feature matrix H2;

[0522] Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the first license plate content and output it;

[0523] Calculating a connection temporal classification CTC loss according to an arrangement order of characters in the first license plate content and an arrangement order of characters in the license plate content corresponding to the image frame in the sample data;

[0524] The parameters of the license plate recognition model are adjusted according to the CTC loss.

[0525] Optionally, the license plate recognition model further includes a second CNN feature extraction layer and a second classifier, and the content determination unit adjusts the parameters of the license plate recognition model according to the cumulative cross entropy CCE loss, including:

[0526] Perform feature extraction on the feature matrix H1 based on the second CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H3;

[0527] Based on the second classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step, sort the characters with the highest probability according to timestep to obtain the second license plate content and output it;

[0528] Calculating a cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data;

[0529] The parameters of the license plate recognition model are adjusted according to the CCE loss.

[0530] Optionally, the content determination unit enhances the dependency between the feature vectors in the feature matrix H1 to obtain a dependency matrix O, including:

[0531] Calculate a distance matrix representing the distances between different eigenvectors in the feature matrix H1;

[0532] Calculate a correlation matrix representing the correlation relationship between different eigenvectors in the feature matrix H1;

[0533] Calculating the product of the distance matrix and the association matrix to obtain a correlation matrix;

[0534] The product of the correlation matrix, the feature matrix H1 and the preset weight matrix is ​​calculated to obtain the dependency matrix O.

[0535] Optionally, the content determination unit calculates the cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data, including:

[0536] Calculate the cumulative probability of each character c appearing in all positions in the feature matrix H3 in, is the probability of each character c appearing at each position i in the feature matrix H3, i=1,2,…,T, T is the total number of positions in the feature matrix H3, C is the license plate character set, is a space;

[0537] For the cumulative probability o c Normalize and obtain the normalized cumulative probability

[0538] Calculate the number of occurrences L of the character c in the license plate content corresponding to the image frame in the sample data c , and for the L c Normalize it,

[0539] Calculate the cumulative cross entropy CCE loss Where I is the input license plate image, and S is the second license plate content.

[0540] Optionally, after obtaining the outputted n license plate contents of the license plate, the content determination unit is further used to:

[0541] When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and is not equal to 0, and the contents of the n license plates meet the preset license plate coding rules, a license plate status label indicating that the license plate status is normal is determined;

[0542] When it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates do not comply with the preset license plate encoding rules, or when it is determined that n is equal to 0, the multiple second image frames are respectively input into a pre-trained license plate state classification model to obtain an output license plate state label identifying the license plate state as normal / abnormal, and the license plate state label is determined to be the license plate state label output by the license plate state classification model.

[0543] Optionally, the content determination unit selects and obtains a fourth image frame whose license plate quality meets preset requirements from the plurality of third image frames / first image frames, including:

[0544] When it is determined that the second license plate mark area / the first license plate mark area is a license plate image, the clarity of the license plate image is calculated, and whether the license plate is abnormal is determined according to the license plate image, and the inclination angle of the license plate is calculated;

[0545] A fourth image frame whose license plate quality meets preset requirements is obtained by screening from the multiple third image frames / first image frames, wherein the preset requirements are that the clarity is not less than a first preset threshold, the inclination angle is not greater than a second preset threshold, and the license plate is not abnormal.

[0546] Optionally, the content determination unit determines that the second license plate mark area is a license plate image, including:

[0547] When it is determined that the aspect ratio of the second license plate mark area is within a preset threshold range and the width of the second license plate mark area is greater than a third preset threshold, enlarging the second license plate mark area;

[0548] Input the enlarged second license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0549] When the output is a determination result that the license plate image is obtained, determining that the second license plate mark area / the first license plate mark area is a license plate image;

[0550] The content determination unit determines that the first license plate mark area is a license plate image, including:

[0551] When it is determined that the aspect ratio of the first license plate mark area is within a preset threshold range and the width of the first license plate mark area is greater than a third preset threshold, expanding the first license plate mark area;

[0552] Input the enlarged first license plate mark area into a pre-trained classification model to determine whether it is a license plate image;

[0553] When the output is a determination result that the license plate image is a license plate image, it is determined that the first license plate mark area is a license plate image.

[0554] Optionally, the content determination unit calculates the tilt angle of the license plate, including:

[0555] Grayscale and threshold segmentation are performed on the enlarged second license plate mark area / first license plate mark area to obtain a binary image;

[0556] Performing connected domain segmentation and connected domain marking on the binary image, determining each character in the binary image, and determining the highest point and the lowest point of each character;

[0557] Perform straight line fitting on the highest point and the lowest point respectively, determine a first straight line where the highest point is located and a second straight line where the lowest point is located, and calculate an average slope k of the slope of the first straight line and the slope of the second straight line;

[0558] The inclination angle θ of the license plate area is calculated according to the average slope, and the inclination angle θ=atan(k).

[0559] Optionally, after determining whether the license plate is abnormal according to the license plate image, the content determination unit is further used to:

[0560] Calculate the total number of characters in the binary image corresponding to the determined non-abnormal license plate;

[0561] The fourth image frames corresponding to the license plates whose total number is less than a fourth preset threshold are screened out.

[0562] Optionally, the cropping unit crops the corresponding first image frame according to the enlarged vehicle marking area, including:

[0563] According to the width of the enlarged vehicle marking area and the preset aspect ratio, the upper half of the corresponding first image frame is cropped.

[0564] The present invention also provides a computer program medium on which a computer program is stored. When the program is executed by a processor, the steps of the license plate recognition method provided in the above embodiment 1 are implemented.

[0565] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules 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 modules, which can be electrical, mechanical or other forms.

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

[0567] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0568] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0569] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.

[0570] The technical solution provided by the present application is introduced in detail above. The principles and implementation methods of the present application are explained by using specific examples in the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0571] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0572] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0573] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0574] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0575] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A license plate recognition method, It is characterized in that include: Acquire multiple original image frames collected after the vehicle reaches a preset collection area; Performing vehicle detection and license plate detection on the plurality of original image frames respectively to obtain a plurality of first image frames, wherein the first image frames include a vehicle marking area for the vehicle and a first license plate marking area for the license plate; Expanding the vehicle marking areas included in the plurality of first image frames, and cropping the corresponding first image frames according to the expanded vehicle marking areas to obtain a plurality of second image frames; Performing license plate detection on the plurality of second image frames respectively to obtain a plurality of third image frames, wherein the third image frames contain a second license plate marking area for the license plate; Filtering from the plurality of third image frames / first image frames to obtain a fourth image frame whose license plate quality meets preset requirements; Inputting the fourth image frame into a pre-trained license plate recognition model; Based on the first CNN feature extraction layer in the license plate recognition model, feature extraction is performed on the input fourth image frame to obtain a feature matrix H 1 ; Based on the correlation matrix calculation layer in the license plate recognition model, the feature matrix H is enhanced 1 The dependency between the eigenvectors in is obtained to obtain the dependency matrix O; Based on the RNN feature extraction layer in the license plate recognition model, the dependency matrix O is extracted to obtain the feature matrix H 2 ; Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the license plate content and output it, and obtain n license plate contents of the output license plate.

2. The method according to claim 1, It is characterized in that The step of selecting and obtaining a fourth image frame whose license plate quality meets preset requirements from the plurality of third image frames / first image frames includes: For each of the plurality of third image frames, determining whether there is a corresponding second license plate mark area; When it is determined that there is a corresponding second license plate mark area, a fourth image frame whose license plate quality meets the preset requirement is obtained from the plurality of third image frames; When it is determined that there is no corresponding second license plate marking area, for each first image frame in the multiple first image frames, determine whether there is a corresponding first license plate marking area; when it is determined that there is a corresponding first license plate marking area, filter out a fourth image frame from the multiple first image frames whose license plate quality meets preset requirements.

3. The method according to claim 1, It is characterized in that After obtaining the outputted n license plate contents of the license plate, it also includes: When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates meet the preset license plate encoding rules, the license plate content of the license plate is determined according to the contents of the n license plates.

4. The method according to claim 1, It is characterized in that Pre-trained license plate recognition model, including: Inputting image frames from pre-collected sample data into a license plate recognition model; Adjusting the parameters of the license plate recognition model according to the connection temporal classification CTC loss and the cumulative cross entropy CCE loss so that the license plate recognition model outputs the license plate content corresponding to the image frame; Among them, the sample data includes an image frame containing a license plate area and a license plate content corresponding to the image frame; the CTC loss is calculated based on the arrangement order of characters in the output license plate content and the arrangement order of characters in the license plate content corresponding to the image frame; the CCE loss is calculated based on the number of occurrences of the same character in the output license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame.

5. The method according to claim 4, It is characterized in that The parameters of the license plate recognition model are adjusted according to the connection time classification CTC loss, including: Based on the first CNN feature extraction layer in the license plate recognition model, feature extraction is performed on the image frame in the sample data to obtain a feature matrix H 1 ; Based on the correlation matrix calculation layer in the license plate recognition model, the feature matrix H is enhanced 1 The dependency between the eigenvectors in is obtained to obtain the dependency matrix O; Based on the RNN feature extraction layer in the license plate recognition model, the dependency matrix O is extracted to obtain the feature matrix H 2 ; Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the first license plate content and output it; Calculating a connection temporal classification CTC loss according to an arrangement order of characters in the first license plate content and an arrangement order of characters in the license plate content corresponding to the image frame in the sample data; The parameters of the license plate recognition model are adjusted according to the CTC loss.

6. The method according to claim 5, It is characterized in that The license plate recognition model also includes a second CNN feature extraction layer and a second classifier, and adjusting the parameters of the license plate recognition model according to the cumulative cross entropy CCE loss includes: Based on the second CNN feature extraction layer in the license plate recognition model, the feature matrix H 1 Perform feature extraction and obtain the feature matrix H 3 ; Based on the second classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step, sort the characters with the highest probability according to timestep to obtain the second license plate content and output it; Calculating a cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data; The parameters of the license plate recognition model are adjusted according to the CCE loss.

7. The method according to claim 5, It is characterized in that Enhance the feature matrix H 1 The dependency between the eigenvectors in is obtained, and the dependency matrix O is obtained, including: Calculate the characteristic matrix H 1 The distance matrix of the distances between different eigenvectors in ; Calculate the characteristic matrix H 1 The correlation matrix of the correlation relationship between different eigenvectors in ; Calculating the product of the distance matrix and the association matrix to obtain a correlation matrix; Calculate the correlation matrix and the feature matrix H 1 And the product of the preset weight matrix to obtain the dependency matrix O.

8. The method according to claim 6, It is characterized in that Calculating the cumulative cross entropy CCE loss according to the number of occurrences of the same character in the second license plate content and the number of occurrences of the same character in the license plate content corresponding to the image frame in the sample data, including: Calculate each character c in the feature matrix H 3 The cumulative probability of all positions appearing in in, For each character c in the feature matrix H 3 The probability of each position i appearing in , i = 1, 2, ..., T, T is the feature matrix H 3 The total number of positions in C is the license plate character set, is a space; For the cumulative probability o c Normalize and obtain the normalized cumulative probability Calculate the number of occurrences L of the character c in the license plate content corresponding to the image frame in the sample data c , and for the L c Normalize it, Calculate the cumulative cross entropy CCE loss Where I is the input license plate image, and S is the second license plate content.

9. The method according to claim 1, It is characterized in that After obtaining the outputted n license plate contents of the license plate, it also includes: When it is determined that n is not less than a preset value, or when it is determined that n is less than a preset value and is not equal to 0, and the contents of the n license plates meet the preset license plate coding rules, a license plate status label indicating that the license plate status is normal is determined; When it is determined that n is less than a preset value and not equal to 0, and the contents of the n license plates do not comply with the preset license plate encoding rules, or when it is determined that n is equal to 0, the multiple second image frames are respectively input into a pre-trained license plate state classification model to obtain an output license plate state label identifying the license plate state as normal / abnormal, and the license plate state label is determined to be the license plate state label output by the license plate state classification model.

10. The method according to claim 2, It is characterized in that The method of selecting and obtaining a fourth image frame whose license plate quality meets preset requirements from the plurality of third image frames / first image frames comprises: When it is determined that the second license plate mark area / the first license plate mark area is a license plate image, the clarity of the license plate image is calculated, and whether the license plate is abnormal is determined according to the license plate image, and the inclination angle of the license plate is calculated; A fourth image frame whose license plate quality meets preset requirements is obtained by screening from the multiple third image frames / first image frames, wherein the preset requirements are that the clarity is not less than a first preset threshold, the inclination angle is not greater than a second preset threshold, and the license plate is not abnormal.

11. The method according to claim 10, It is characterized in that Determining that the second license plate marking area is a license plate image includes: When it is determined that the aspect ratio of the second license plate mark area is within a preset threshold range and the width of the second license plate mark area is greater than a third preset threshold, enlarging the second license plate mark area; Input the enlarged second license plate mark area into a pre-trained classification model to determine whether it is a license plate image; When the output is a determination result that the license plate image is obtained, determining that the second license plate mark area / the first license plate mark area is a license plate image; Determining that the first license plate marking area is a license plate image includes: When it is determined that the aspect ratio of the first license plate mark area is within a preset threshold range and the width of the first license plate mark area is greater than a third preset threshold, expanding the first license plate mark area; Input the enlarged first license plate mark area into a pre-trained classification model to determine whether it is a license plate image; When the output is a determination result that the license plate image is a license plate image, it is determined that the first license plate mark area is a license plate image.

12. The method according to claim 11, It is characterized in that Calculate the tilt angle of the license plate, including: Grayscale and threshold segmentation are performed on the enlarged second license plate mark area / first license plate mark area to obtain a binary image; Performing connected domain segmentation and connected domain marking on the binary image, determining each character in the binary image, and determining the highest point and the lowest point of each character; Perform straight line fitting on the highest point and the lowest point respectively, determine a first straight line where the highest point is located and a second straight line where the lowest point is located, and calculate an average slope k of the slope of the first straight line and the slope of the second straight line; The inclination angle θ of the license plate area is calculated according to the average slope, and the inclination angle θ=atan(k).

13. The method according to claim 12, It is characterized in that After determining whether the license plate is abnormal according to the license plate image, the method further includes: Calculate the total number of characters in the binary image corresponding to the determined non-abnormal license plate; The fourth image frames corresponding to the license plates whose total number is less than a fourth preset threshold are screened out.

14. The method according to claim 1, It is characterized in that Cropping the corresponding first image frame according to the enlarged vehicle marking area includes: According to the width of the enlarged vehicle marking area and the preset aspect ratio, the upper half of the corresponding first image frame is cropped.

15. A license plate recognition device, It is characterized in that comprising a memory and a processor, wherein: The memory is used to store computer programs; The processor is used to read the program in the memory and execute the license plate recognition method according to any one of claims 1 to 14.

16. A license plate recognition device, It is characterized in that include: An image frame acquisition unit, used to acquire a plurality of original image frames acquired after the vehicle reaches a preset acquisition area; A first detection unit, configured to perform vehicle detection and license plate detection on the plurality of original image frames respectively, to obtain a plurality of first image frames, wherein the first image frames include a vehicle marking area for the vehicle and a first license plate marking area for the license plate; A cropping unit, configured to enlarge the vehicle marking area included in the plurality of first image frames, and crop the corresponding first image frames according to the enlarged vehicle marking area to obtain a plurality of second image frames; A second detection unit, configured to perform license plate detection on the plurality of second image frames respectively to obtain a plurality of third image frames, wherein the third image frames include a second license plate marking area for the license plate; a content determination unit, configured to select and obtain a fourth image frame whose license plate quality meets preset requirements from the plurality of third image frames / first image frames; input the fourth image frame into a pre-trained license plate recognition model; perform feature extraction on the input fourth image frame based on the first CNN feature extraction layer in the license plate recognition model to obtain a feature matrix H 1 Based on the correlation matrix calculation layer in the license plate recognition model, the feature matrix H is enhanced 1 The dependency matrix O is obtained by extracting features from the dependency matrix O based on the RNN feature extraction layer in the license plate recognition model to obtain the feature matrix H 2 ; Based on the first classifier in the license plate recognition model, predict the characters and probabilities corresponding to each time step timestep, sort the characters with the highest probability according to timestep to obtain the license plate content and output it, and obtain n license plate contents of the output license plate.

17. A computer program medium, It is characterized in that A computer program is stored thereon, and when the program is executed by a processor, the steps of the license plate recognition method as claimed in any one of claims 1 to 14 are implemented.