License plate character cutting method, license plate recognition method, device, equipment and storage medium
By combining the template scaling and sliding retrieval algorithms, the error problem caused by interference in the traditional method is solved, and higher license plate character cutting and recognition accuracy is achieved.
Patent Information
- Application Number
- CN202111272859.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-10-29
AI Technical Summary
Among the existing license plate recognition methods, the license plate character cutting method based on the traditional character recognition algorithm is easily disturbed by reflection, stains and slight deformation, resulting in large errors in the cutting results and recognition results.
Using the license plate character cutting method combining template scaling algorithm and sliding search algorithm, by obtaining standard license plate images and preset standard cutting templates, sliding search for multiple template reduction coefficients, and finding the minimum projection grayscale accumulated value to determine the best Cut lines to resist interference and improve cutting accuracy.
It improves the accuracy and accuracy of license plate character cutting, ensures the accuracy and accuracy of the final license plate recognition results, and enhances the anti-interference ability to reflect light, stains and slight deformation.
Smart Images

Figure CN114005120B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence and computer vision processing, and particularly relates to a license plate character cutting method, a license plate recognition method, a device, equipment and a storage medium. Background Art
[0002] License plate recognition, as a core technology of traffic monitoring, is applied in multiple subsystems, such as a red light running monitoring system, a speeding monitoring system, a reverse driving monitoring system, a no-entry monitoring system, a bus lane monitoring system, a non-motor vehicle lane driving monitoring system, a double yellow line crossing monitoring system, an emergency parking strip driving monitoring system, a mobile vehicle inspection system, an intelligent multimedia network license plate recognition system, etc. Among them, the intelligent multimedia network license plate recognition system is widely applied in aspects such as automatic registration and verification of passing vehicles, highway toll collection, vehicle safety verification, community vehicle management, and parking lot management.
[0003] Currently, license plate recognition methods include solutions based on traditional character recognition algorithms and whole license plate deep recognition algorithms. Among them, the latter has problems such as computational redundancy, high requirements for terminal computing power, and the need to retrain the model for new license plate categories, resulting in poor flexibility; while the former belongs to an identification scheme that detects license plate characters one by one. Although it is relatively flexible and has a small amount of computation, since the recognition accuracy mainly depends on the character recognition accuracy, and the traditional license plate character cutting method cuts each license plate character based on the valley value of gray projection, there is a problem that the method of finding the single-character cutting line is easily interfered, resulting in large errors in the character cutting result and the license plate recognition result.
[0004] Specifically, the license plate recognition method process based on the traditional character recognition algorithm is as Figure 1 shown. The character segmentation link therein performs projection mapping based on a grayscale image or a binary image, and detects and segments according to the gray valley value: as Figure 2 shown, the image below the license plate image is the projection accumulation value of the license plate pixel gray value in the horizontal direction. Since there will be a projection valley value at the character interval, character cutting can be performed based on this feature. However, when there are situations such as reflection, stains, and slight deformation in the license plate image, it will cause projection interference, resulting in cutting errors. For example Figure 3 in, the projection accumulation valley values of the two marks in front of the character "Su" will cause errors in finding the character cutting line or confusion between true and false. And in the license plate key point detection link, some errors will also be introduced, resulting in left and right deviations and scaling deviations in the corresponding positions between the true license plate area and the license plate detection area after rotation and / or stretching alignment, interfering with the search for the single-character cutting line. Summary of the Invention
[0005] In order to solve the problem that the search method for single-character cutting lines in license plate recognition solutions based on traditional character recognition algorithms is easily disturbed, resulting in large errors in character cutting results and license plate recognition results, the purpose of the present invention is to provide a new license plate character cutting method, license plate recognition method, device, equipment and storage medium, which can enable the search method for each single-character cutting line to resist the interference caused by reflection, stains, slight deformation and errors introduced in the license plate key point detection link, thereby improving the precision and accuracy of the license plate character cutting results and ensuring the precision and accuracy of the final license plate recognition results.
[0006] In a first aspect, the present invention provides a license plate character cutting method, comprising:
[0007] Acquire a license plate image to be cut that is aligned with a standard license plate image and a standard cutting template preset according to the standard license plate image, wherein the standard cutting template includes coordinates of a plurality of character cutting lines in the standard license plate image, and the plurality of character cutting lines refer to the required cutting lines for cutting out all license plate characters in the standard license plate image;
[0008] For each template reduction coefficient among a plurality of template reduction coefficients, a corresponding sliding position set is determined, wherein the template reduction coefficient is a real number and has a value range of (0,1], each sliding position in the sliding position set is an integer, and the sliding position refers to the dynamic coordinates of the first character cutting line among the plurality of character cutting lines and along the license plate character arrangement direction in the standard license plate image during the process of the standard cutting template sliding along the license plate character arrangement direction;
[0009] For each template reduction coefficient, according to the standard cutting template and the corresponding sliding position set, the license plate image to be cut is subjected to sliding retrieval along the license plate character arrangement direction, and the total cumulative grayscale value of the projections of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions is calculated during the sliding retrieval process;
[0010] Find the minimum value among all the calculated cumulative total values of projection grayscale;
[0011] Calculating the coordinates of each of the plurality of character cutting lines in the license plate image to be cut according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value;
[0012] According to the coordinates of each character cutting line in the license plate image to be cut, the license plate image to be cut is cut with license plate characters to obtain a plurality of individual license plate character images.
[0013] Based on the above invention content, a new license plate character cutting scheme combining a template scaling algorithm and a sliding retrieval algorithm is provided, that is, after obtaining a license plate image to be cut aligned with a standard license plate image and a standard cutting template preset according to the standard license plate image, the license plate image to be cut can be subjected to a sliding retrieval along the license plate character arrangement direction for each template reduction coefficient among a plurality of template reduction coefficients according to the standard cutting template and the corresponding sliding position set, and during the sliding retrieval process, the total cumulative grayscale value of the projections of all character cutting lines when the first character cutting line is located at each corresponding sliding position is calculated, and then the template reduction coefficient and sliding position that minimize the total cumulative grayscale value of the projections of all character cutting lines are found according to the calculation results, and finally the best license plate character cutting scheme is obtained according to the search results, so that the search method of each single character cutting line can resist the interference caused by reflection, stains, slight deformation and errors introduced in the license plate key point detection link, thereby improving the precision and accuracy of the license plate character cutting results, ensuring the precision and accuracy of the final license plate recognition results, and facilitating practical application and promotion.
[0014] In a possible design, the standard cutting template uses the coordinate set {x1, x2, ..., x k ,…,x K} represents, where K represents the total number of the plurality of character cutting lines, k is an integer and its value range is [1, K], x k is an integer and represents the coordinates of the kth character cutting line arranged in sequence along the license plate character arrangement direction in the standard license plate image;
[0015] The coordinates of each of the plurality of character cutting lines in the license plate image to be cut are calculated according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value, including:
[0016] According to the standard cutting template and the template reduction coefficient and sliding position corresponding to the minimum value, the coordinates of each of the multiple character cutting lines in the license plate image to be cut are calculated according to the following formula:
[0017]
[0018] In the formula, represents the coordinates of the kth character cutting line in the license plate image to be cut, IF() represents the rounding function, ε min represents the template reduction coefficient corresponding to the minimum value, x′ min Indicates the slide position corresponding to the minimum value.
[0019] In a possible design, the standard cutting template uses the coordinate set {x1, x2, ..., x k ,…,x K} represents, where K represents the total number of the plurality of character cutting lines, k is an integer and its value range is [1, K], x k is an integer and represents the coordinates of the kth character cutting line arranged in sequence along the license plate character arrangement direction in the standard license plate image;
[0020] When the arrangement direction of the license plate characters is consistent with the direction of the pixel coordinate axis, for each template reduction coefficient among the multiple template reduction coefficients, a corresponding sliding position set is determined, including:
[0021] For each template reduction coefficient among the multiple template reduction coefficients, a corresponding sliding position set is determined according to the last pixel coordinate in the license plate image to be cut and in the arrangement direction of the license plate characters, wherein the sliding position set is represented by {x′ m1 ,x′ m2 ,…,x′ mn ,…,x′ mN} means that m and n are positive integers, x′ mn Indicates that the condition IF(ε m (x′ mn +x K -x1))≤X and the nth sliding position corresponding to the mth template reduction coefficient among the multiple template reduction coefficients, N represents the nth sliding position that satisfies the condition IF(ε m (x′ mn +x K -x1))≤X, IF() represents the rounding function, ε m represents the mth template reduction coefficient, and X represents the last pixel coordinate.
[0022] In a possible design, the standard cutting template uses the coordinate set {x1, x2, ..., x k ,…,x K} represents, where K represents the total number of the plurality of character cutting lines, k is an integer and its value range is [1, K], x k is an integer and represents the coordinates of the kth character cutting line arranged in sequence along the license plate character arrangement direction in the standard license plate image;
[0023] In the sliding search process, the cumulative total grayscale values of the projections of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions are calculated, including:
[0024] During the sliding search process, the cumulative total grayscale value of the projections of the plurality of character cutting lines when the first character cutting line is located at each sliding position is calculated according to the following formula:
[0025]
[0026] In the formula, S mn represents the total cumulative projection grayscale value when the first character cutting line is located at the corresponding nth sliding window position for the mth template reduction coefficient among the multiple template reduction coefficients, i is a positive integer, x mi represents the coordinates of the i-th character cutting line corresponding to the m-th template reduction coefficient, Gray(x mi ) indicates that the coordinate x is located in the license plate image to be cut. mi The accumulated result of the pixel grayscale value at the position, IF() represents the rounding function, ε m represents the mth template reduction coefficient, x′ mn represents the nth sliding position corresponding to the mth template reduction coefficient, x i is an integer and represents the coordinates of the i-th character cutting line arranged in sequence along the license plate character arrangement direction in the standard license plate image.
[0027] In a second aspect, the present invention provides a license plate character cutting device, comprising an acquisition module, a set determination module, a sliding retrieval module, a minimum value search module, a coordinate calculation module and a cutting execution module;
[0028] The acquisition module is used to acquire the license plate image to be cut that is aligned with the standard license plate image and a standard cutting template preset according to the standard license plate image, wherein the standard cutting template includes the coordinates of multiple character cutting lines in the standard license plate image, and the multiple character cutting lines refer to the required cutting lines for cutting out all license plate characters in the standard license plate image;
[0029] The set determination module is used to determine a corresponding sliding position set for each template reduction coefficient among a plurality of template reduction coefficients, wherein the template reduction coefficient is a real number and has a value range of (0,1], each sliding position in the sliding position set is an integer, and the sliding position refers to the dynamic coordinates of the first character cutting line among the plurality of character cutting lines and along the license plate character arrangement direction in the standard license plate image during the process of the standard cutting template sliding along the license plate character arrangement direction;
[0030] The sliding retrieval module is respectively connected to the acquisition module and the set determination module for performing a sliding retrieval on the license plate image to be cut along the arrangement direction of the license plate characters according to the standard cutting template and the corresponding sliding position set for each template reduction coefficient, and calculates the total cumulative grayscale value of the projections of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions during the sliding retrieval process;
[0031] The minimum value search module is communicatively connected to the sliding search module and is used to find the minimum value among all the calculated cumulative total values of the projection grayscales;
[0032] The coordinate calculation module is respectively connected to the acquisition module and the minimum value search module for calculating the coordinates of each of the multiple character cutting lines in the license plate image to be cut according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value;
[0033] The cutting execution module is used to perform license plate character cutting on the license plate image to be cut according to the coordinates of each character cutting line in the license plate image to be cut, so as to obtain a plurality of license plate character individual images.
[0034] In a third aspect, the present invention provides a license plate recognition method, comprising:
[0035] Perform license plate frame recognition processing on the original image based on the target detection algorithm to obtain a license plate frame image;
[0036] According to the color pixel ratio in the license plate frame image, determining whether the license plate frame image is a new energy vehicle license plate image or a fuel vehicle license plate image;
[0037] Based on the license plate key point detection algorithm and the license plate size corresponding to the determination result, the license plate frame image is aligned to obtain a license plate image to be cut that is aligned with the standard license plate image, wherein the standard license plate image has a corresponding relationship with the determination result;
[0038] Using the license plate character cutting method as described in the first aspect or any possible design of the first aspect to perform license plate character cutting processing on the license plate image to be cut, to obtain a plurality of individual license plate character images;
[0039] For each individual license plate character image among the plurality of individual license plate character images, a corresponding character recognition result is obtained based on a character recognition algorithm.
[0040] Based on the above invention content, on the basis of the technical effect of the first aspect or any possible design, after detecting the license plate frame image, the fuel license plate image or the new energy license plate image (with a larger proportion of green) can be distinguished according to the color ratio of the license plate area, so that in the alignment and stretching stage, stretching and alignment can be performed according to the ratio of 44:14 for the fuel license plate size or 48:14 for the new energy license plate size, and the license plate character cutting processing can be performed using a suitable standard cutting template, so as to further ensure the precision and accuracy of the license plate character cutting results and improve the precision and accuracy of the final license plate recognition results.
[0041] In a possible design, determining whether the license plate frame image is a new energy vehicle license plate image or a fuel vehicle license plate image according to the color pixel ratio in the license plate frame image includes:
[0042] Counting the proportion of green pixels in the license plate frame image;
[0043] Determine whether the proportion of the green pixels exceeds a preset threshold;
[0044] If so, it is determined that the license plate frame image is a new energy license plate image, otherwise it is determined that the license plate frame image is a fuel license plate image.
[0045] In a fourth aspect, the present invention provides a license plate recognition device, comprising a license plate frame detection module, a license plate type determination module, a license plate image alignment module, a license plate character cutting module and a character recognition module which are sequentially communicatively connected;
[0046] The license plate frame detection module is used to perform license plate frame recognition processing on the original image based on the target detection algorithm to obtain a license plate frame image;
[0047] The license plate type determination module is used to determine whether the license plate frame image is a new energy vehicle license plate image or a fuel vehicle license plate image according to the color pixel ratio in the license plate frame image;
[0048] The license plate image alignment module is used to align the license plate frame image based on the license plate key point detection algorithm and the license plate size corresponding to the determination result to obtain the license plate image to be cut that is aligned with the standard license plate image, wherein the standard license plate image has a corresponding relationship with the determination result;
[0049] The license plate character cutting module is used to perform license plate character cutting processing on the license plate image to be cut to obtain multiple license plate character individual images, wherein the license plate character cutting module includes an acquisition unit, a set determination unit, a sliding retrieval unit, a minimum value search unit, a coordinate calculation unit and a cutting execution unit;
[0050] The acquisition unit is used to acquire the license plate image to be cut that is aligned with the standard license plate image and a standard cutting template preset according to the standard license plate image, wherein the standard cutting template includes coordinates of multiple character cutting lines in the standard license plate image, and the multiple character cutting lines refer to the required cutting lines for cutting out all license plate characters in the standard license plate image;
[0051] The set determination unit is used to determine a corresponding sliding position set for each template reduction coefficient in a plurality of template reduction coefficients, wherein the template reduction coefficient is a real number and has a value range of (0,1], each sliding position in the sliding position set is an integer, and the sliding position refers to the dynamic coordinates of the first character cutting line in the plurality of character cutting lines and along the license plate character arrangement direction in the standard license plate image during the sliding of the standard cutting template along the license plate character arrangement direction;
[0052] The sliding retrieval unit is respectively connected to the acquisition unit and the set determination unit for performing a sliding retrieval on the license plate image to be cut along the arrangement direction of the license plate characters according to the standard cutting template and the corresponding sliding position set for each template reduction coefficient, and calculates the total cumulative grayscale value of the projections of the plurality of character cutting lines when the first character cutting line is located at each corresponding sliding position during the sliding retrieval process;
[0053] The minimum value search unit is communicatively connected to the sliding search unit and is used to find the minimum value among all the calculated cumulative total values of the projection grayscales;
[0054] The coordinate calculation unit is respectively connected to the acquisition unit and the minimum value search unit for calculating the coordinates of each of the plurality of character cutting lines in the license plate image to be cut according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value;
[0055] The cutting execution unit is used to perform license plate character cutting on the license plate image to be cut according to the coordinates of each character cutting line in the license plate image to be cut, so as to obtain a plurality of license plate character individual images;
[0056] The character recognition module is used to obtain a corresponding character recognition result based on a character recognition algorithm for each individual license plate character image among the multiple individual license plate character images.
[0057] In a fifth aspect, the present invention provides a computer device comprising a memory and a processor that are communicatively connected, wherein the memory is used to store a computer program, and the processor is used to read the computer program to execute the license plate character cutting method as described in the first aspect or any possible design of the first aspect, or to execute the license plate recognition method as described in the third aspect or any possible design of the third aspect.
[0058] In a sixth aspect, the present invention provides a computer-readable storage medium having instructions stored thereon. When the instructions are run on a computer, the license plate character cutting method as described in the first aspect or any possible design of the first aspect is executed, or the license plate recognition method as described in the third aspect or any possible design of the third aspect is executed.
[0059] In the seventh aspect, the present invention provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the license plate character cutting method as described in the first aspect or any possible design of the first aspect, or to execute the license plate recognition method as described in the third aspect or any possible design of the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0061] Figure 1 It is a flowchart of the license plate recognition method based on the traditional character recognition algorithm.
[0062] Figure 2 This is an example of character segmentation based on grayscale images according to grayscale valley values.
[0063] Figure 3 This is an example of the interference that exists in the process of character segmentation based on grayscale images according to grayscale valley values.
[0064] Figure 4 These are four example diagrams of the positional relationship between the real license plate area and the license plate detection area.
[0065] Figure 5 The figure is a flow chart of the license plate character cutting method provided by the present invention.
[0066] Figure 6 This is an example diagram of the positional relationship between the standard license plate image and multiple character cutting lines provided by the present invention.
[0067] Figure 7 It is a structural schematic diagram of the license plate character cutting device provided by the present invention.
[0068] Figure 8 It is a flow chart of the license plate recognition method provided by the present invention.
[0069] Fig. 9 It is a structural schematic diagram of the license plate recognition device provided by the present invention.
[0070] Fig.10 It is a structural schematic diagram of the computer device provided by the present invention.
[0071] In the above figure: 100-real license plate area; 200-license plate detection area. DETAILED DESCRIPTION
[0072] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. It should be noted that although the description of these embodiments is used to help understand the present invention, it does not constitute a limitation of the present invention. The specific structures and functional details disclosed herein are only used to describe the embodiments of the present invention. However, the present invention can be embodied in many alternative forms, and it should not be understood that the present invention is limited to the embodiments set forth herein.
[0073] It should be understood that although the terms first and second, etc. may be used herein to describe various objects, these objects should not be limited by these terms. These terms are only used to distinguish one object from another object. For example, a first object can be referred to as a second object, and similarly, a second object can be referred to as a first object without departing from the scope of the exemplary embodiments of the present invention.
[0074] It should be understood that the term "and / or" that may appear in this article is merely a description of the association relationship between associated objects, indicating that there may be three relationships. For example, A and / or B can represent three situations: A exists alone, B exists alone, or A and B exist at the same time; the term " / and" that may appear in this article describes another type of association object relationship, indicating that there may be two relationships. For example, A / and B can represent two situations: A exists alone or A and B exist at the same time; in addition, the character " / " that may appear in this article generally indicates that the previous and next associated objects are in an "or" relationship.
[0075] like Figures 5-6As shown, the license plate character cutting method provided in the first aspect of this embodiment can be executed by, but is not limited to, a computer device with certain computing resources, such as a personal computer (PC, referring to a multi-purpose computer with a size, price and performance suitable for personal use; desktops, laptops, small laptops, tablets and ultrabooks are all personal computers), smart phones, personal digital assistants (PAD) or wearable devices and other electronic devices, so that after obtaining the license plate image to be cut aligned with the standard license plate image and the standard cutting template preset according to the standard license plate image, the template reduction coefficient and sliding position that minimizes the total cumulative value of the projection grayscale of all character cutting lines can be found by a sliding search method for each template reduction coefficient among multiple template reduction coefficients, and the best license plate character cutting scheme is obtained according to the search results, so that the search method for each single character cutting line can resist the interference caused by reflection, stains, slight deformation and errors introduced in the key point detection link of the license plate, so as to improve the precision and accuracy of the license plate character cutting result and ensure the precision and accuracy of the final license plate recognition result. Figure 5 As shown, the license plate character cutting method may include but is not limited to the following steps S1 to S6.
[0076] S1. Obtain a license plate image to be cut that is aligned with a standard license plate image and a standard cutting template preset according to the standard license plate image, wherein the standard cutting template includes coordinates of multiple character cutting lines in the standard license plate image, and the multiple character cutting lines refer to the required cutting lines for cutting out all license plate characters in the standard license plate image.
[0077] In step S1, the standard license plate image is a standard image of a license plate, such as a license plate design image. Aligning the license plate image to be cut with the standard license plate image means that the license plate image to be cut and the standard license plate image have the same width (e.g., the same number of vertical pixels) and length (e.g., the same number of horizontal pixels) in the same pixel coordinate system through conventional processing methods such as rotation and / or stretching. Figure 6 In the standard license plate image of the fuel license plate shown, the lower left corner vertex of the standard license plate image is the origin of the pixel coordinate system, and the lower left corner vertex of the license plate image to be cut is also the origin of the pixel coordinate system. In addition, the license plate image to be cut and the standard cutting template can be, but are not limited to, read from a storage unit or transmitted by a transmission unit.
[0078] In the step S1, specifically, the standard cutting template can be a set of coordinates {x1, x2, ..., xk ,…,x K} represents, where K represents the total number of the plurality of character cutting lines, k is an integer and its value range is [1, K], x k is an integer and represents the coordinates of the kth character cutting line arranged in sequence along the license plate character arrangement direction in the standard license plate image. The standard cutting template can be, but is not limited to, obtained by manual marking according to the actual position of each license plate character in the standard license plate image, that is, manually marking the coordinates of the multiple character cutting lines in the standard license plate image; for example, Figure 6 As shown, for the standard license plate image of the fuel license plate, there are seven license plate characters and one dot character, and the required cutting lines are nine longitudinal cutting lines. Assuming that the length and width pixels of the standard license plate image of the fuel license plate are 440*a×140*a, a represents the proportional coefficient, then when the license plate characters are arranged in the right direction, the horizontal coordinates of the nine character dividing lines are: x1=9.5*a, x2=66.5*a, x3=123.5*a, x4=145.5*a, x5=202.5*a, x6=259.5*a, x7=316.5*a, x8=373.5*a and x9=430.5*a.
[0079] S2. For each template reduction coefficient among the multiple template reduction coefficients, determine the corresponding sliding position set, wherein the template reduction coefficient is a real number and its value range is (0,1], each sliding position in the sliding position set is an integer, and the sliding position refers to the dynamic coordinates of the first character cutting line among the multiple character cutting lines and along the license plate character arrangement direction in the standard license plate image during the process of the standard cutting template sliding along the license plate character arrangement direction.
[0080] In step S2, the multiple template reduction coefficients refer to the reduction coefficients of multiple selected cutting templates obtained based on the standard cutting template relative to the standard cutting template, such as 1 (i.e., the corresponding selected cutting template is the standard cutting template), 0.9, 0.85, 0.8, 0.77, 0.74, 0.71 and 0.68, etc. Considering that in the actual license plate recognition process, the pixels of the license plate image are often controlled within 100p to 200p, therefore, for each pair of adjacent two template reduction coefficients in the multiple template reduction coefficients, a control method can be adopted to reduce the corresponding cutting results (i.e., all license plate character individual images) in the license plate character arrangement direction by making the average pixel difference of 1, that is, through the configuration of the template reduction coefficient, the average number of pixels of all license plate character individual images corresponding to the previous template reduction coefficient in the license plate character arrangement direction is one pixel more than that of all license plate character individual images corresponding to the next template reduction coefficient, wherein the previous template reduction coefficient and the next template reduction coefficient are a pair of adjacent two template reduction coefficients in the multiple template reduction coefficients. According to this step-by-step reduction method, usually configuring ten template reduction coefficients can cover the introduced errors in the license plate key point detection link.
[0081] In the step S2, specifically, when the arrangement direction of the license plate characters is consistent with the direction of the pixel coordinate axis, for each template reduction coefficient among the multiple template reduction coefficients, a corresponding sliding position set is determined, including: for each template reduction coefficient among the multiple template reduction coefficients, according to the last pixel coordinate in the license plate image to be cut and in the arrangement direction of the license plate characters, a corresponding sliding position set is determined, wherein the sliding position set is represented by {x′ m1 ,x′ m2 ,…,x′ mn ,…,x′ mN} means that m and n are positive integers, x′ mn Indicates that the condition IF(ε m (x′ mn +x K -x1))≤X and the nth sliding position corresponding to the mth template reduction coefficient among the multiple template reduction coefficients, N represents the nth sliding position that satisfies the condition IF(ε m (x′ mn +x K -x1))≤X, IF() represents the rounding function, ε m represents the mth template reduction coefficient, and X represents the last pixel coordinate. Figure 6 As shown, the license plate character arrangement direction and the pixel coordinate axis direction are both rightward, and the last pixel coordinate is the coordinate of the rightmost pixel point. mn Satisfy the condition IF(εm (x′ mn +x K -x1))≤X, during the sliding of the standard cutting template along the license plate character arrangement direction, it can be ensured that the last character cutting line among the multiple character cutting lines and along the license plate character arrangement direction is still in the standard license plate image, otherwise the last license plate character along the license plate character arrangement direction cannot be accurately cut. Since N represents the condition IF(ε m (x′ mn +x K -x1))≤X, although the number of sliding positions of each template reduction coefficient may be different, for each template reduction coefficient, the corresponding sliding process can be performed pixel by pixel along the arrangement direction of the license plate characters, ensuring that the sliding position that minimizes the total cumulative grayscale of all character cutting lines can be found without omission. In addition, the rounding function can be but is not limited to a rounding function, and the sliding position set {x′ m1 ,x′ m2 ,…,x′ mn ,…,x′ mN} can be exemplified by {0,1,2,…,x′ mN}.
[0082] S3. For each template reduction coefficient, according to the standard cutting template and the corresponding sliding position set, the license plate image to be cut is subjected to a sliding search along the arrangement direction of the license plate characters, and during the sliding search process, the total grayscale cumulative value of the projections of the multiple character cutting lines when the first character cutting line is located at the corresponding sliding positions is calculated.
[0083] In the step S3, specifically, calculating the total cumulative grayscale projection values of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions during the sliding retrieval process includes: calculating the total cumulative grayscale projection values of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions during the sliding retrieval process according to the following formula:
[0084]
[0085] In the formula, S mn represents the total cumulative projection grayscale value when the first character cutting line is located at the corresponding nth sliding window position for the mth template reduction coefficient among the multiple template reduction coefficients, i is a positive integer, x mi represents the coordinates of the i-th character cutting line corresponding to the m-th template reduction coefficient, Gray(x mi) indicates that the coordinate x is located in the license plate image to be cut. mi The accumulated result of the pixel grayscale value at the position, IF() represents the rounding function, ε m represents the mth template reduction coefficient, x′ mn represents the nth sliding position corresponding to the mth template reduction coefficient, x i is an integer and represents the coordinates of the i-th character cutting line arranged in sequence along the license plate character arrangement direction in the standard license plate image. Figure 6 As shown, when the lower left corner vertex of the standard license plate image is the origin of the pixel coordinate system, Wherein, j is an integer, Y represents the maximum vertical coordinate of the pixel in the standard license plate image, gray(x mi , j) represents the coordinate (x mi , j) (the grayscale value of each pixel ranges from 0 to 255, where 0 represents all black and 255 represents all white).
[0086] S4. Find the minimum value among all the calculated cumulative total values of the projection grayscale.
[0087] In step S4, considering that there will be projection valley values at the character intervals, it can be ensured that the multiple character cutting lines obtained subsequently based on the search results and in the license plate image to be cut can be located at the optimal character intervals in the license plate image to be cut, thereby obtaining the optimal license plate character cutting solution.
[0088] S5. According to the standard cutting template and the template reduction coefficient and sliding position corresponding to the minimum value, the coordinates of each of the multiple character cutting lines in the license plate image to be cut are calculated.
[0089] In the step S5, specifically, according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value, the coordinates of each of the multiple character cutting lines in the license plate image to be cut are calculated, including: according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value, the coordinates of each of the multiple character cutting lines in the license plate image to be cut are calculated according to the following formula:
[0090]
[0091] In the formula, represents the coordinates of the kth character cutting line in the license plate image to be cut, IF() represents the rounding function, ε min represents the template reduction coefficient corresponding to the minimum value, x′ minIndicates the slide position corresponding to the minimum value.
[0092] S6. Perform license plate character cutting on the license plate image to be cut according to the coordinates of each character cutting line in the license plate image to be cut, to obtain a plurality of license plate character individual images.
[0093] In step S6, since the multiple character cutting lines obtained according to the search results and in the license plate image to be cut can be located at the optimal character interval in the license plate image to be cut, the license plate image to be cut is cut based on this optimal license plate character cutting scheme. The cutting result can resist the interference caused by reflection, stains, slight deformation and errors introduced in the license plate key point detection link, improve the cutting precision and accuracy, and ensure the precision and accuracy of the final license plate recognition result.
[0094] Therefore, based on the license plate character cutting method described in the aforementioned steps S1 to S6, a new license plate character cutting scheme combining a template scaling algorithm and a sliding retrieval algorithm is provided, that is, after obtaining a license plate image to be cut aligned with a standard license plate image and a standard cutting template preset according to the standard license plate image, the license plate image to be cut can be subjected to a sliding retrieval along the license plate character arrangement direction for each template reduction coefficient among a plurality of template reduction coefficients according to the standard cutting template and the corresponding sliding position set, and during the sliding retrieval process, the total cumulative grayscale value of the projections of all character cutting lines when the first character cutting line is located at each corresponding sliding position is calculated, and then the template reduction coefficient and sliding position that minimize the total cumulative grayscale value of the projections of all character cutting lines are found according to the calculation results, and finally the best license plate character cutting scheme is obtained according to the search results, so that the search method of each single character cutting line can resist the interference caused by reflection, stains, slight deformation and errors introduced in the key point detection link of the license plate, thereby improving the precision and accuracy of the license plate character cutting results, ensuring the precision and accuracy of the final license plate recognition results, and facilitating practical application and promotion.
[0095] like Figure 7 As shown, the second aspect of this embodiment provides a virtual device for implementing the license plate character cutting method described in the first aspect, including an acquisition module, a set determination module, a sliding retrieval module, a minimum value search module, a coordinate calculation module and a cutting execution module;
[0096] The acquisition module is used to acquire the license plate image to be cut that is aligned with the standard license plate image and a standard cutting template preset according to the standard license plate image, wherein the standard cutting template includes the coordinates of multiple character cutting lines in the standard license plate image, and the multiple character cutting lines refer to the required cutting lines for cutting out all license plate characters in the standard license plate image;
[0097] The set determination module is used to determine a corresponding sliding position set for each template reduction coefficient among a plurality of template reduction coefficients, wherein the template reduction coefficient is a real number and has a value range of (0,1], each sliding position in the sliding position set is an integer, and the sliding position refers to the dynamic coordinates of the first character cutting line among the plurality of character cutting lines and along the license plate character arrangement direction in the standard license plate image during the process of the standard cutting template sliding along the license plate character arrangement direction;
[0098] The sliding retrieval module is respectively connected to the acquisition module and the set determination module for performing a sliding retrieval on the license plate image to be cut along the arrangement direction of the license plate characters according to the standard cutting template and the corresponding sliding position set for each template reduction coefficient, and calculates the total cumulative grayscale value of the projections of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions during the sliding retrieval process;
[0099] The minimum value search module is communicatively connected to the sliding search module and is used to find the minimum value among all the calculated cumulative total values of the projection grayscales;
[0100] The coordinate calculation module is respectively connected to the acquisition module and the minimum value search module for calculating the coordinates of each of the multiple character cutting lines in the license plate image to be cut according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value;
[0101] The cutting execution module is used to perform license plate character cutting on the license plate image to be cut according to the coordinates of each character cutting line in the license plate image to be cut, so as to obtain a plurality of license plate character individual images.
[0102] The working process, working details and technical effects of the aforementioned device provided in the second aspect of this embodiment can be referred to the license plate character cutting method described in the first aspect, and will not be repeated here.
[0103] like Figure 8 As shown, the third aspect of this embodiment further provides a new license plate recognition method based on the technical solution of the first aspect, including the following steps S10 to S50.
[0104] S10. Perform license plate frame recognition processing on the original image based on the target detection algorithm to obtain a license plate frame image.
[0105] In the step S10, the target detection algorithm is an existing artificial intelligence recognition algorithm for identifying objects in a picture and marking the position of the objects. Specifically, it can be but not limited to Faster R-CNN (Faster Regions with Convolutional Neural Networks features, a target detection algorithm proposed by He Kaiming et al. in 2015, which won multiple first places in the 2015 ILSVRV and COCO competitions) target detection algorithm, SSD (Single Shot MultiBox Detector, a target detection algorithm proposed by Wei Liu at ECCV 2016, which is one of the currently popular main detection frameworks) target detection algorithm or YOLO (You only look once, currently the latest version has been developed to V4, and is also widely used in the industry. Its basic principle is: first, the input image is divided into 7x7 grids, 2 borders are predicted for each grid, and then the target windows with relatively low probability are removed according to the threshold, and finally the redundant windows are removed by border merging to obtain the detection result) target detection algorithm, etc. Therefore, through conventional sample training and recognition processing, the license plate frame can be identified from the original image, and the license plate frame image can be obtained by cutting according to the recognition result. In addition, the original image can be, but is not limited to, a vehicle monitoring video image.
[0106] S20. Determine whether the license plate frame image is a new energy vehicle license plate image or a fuel vehicle license plate image according to the color pixel ratio in the license plate frame image.
[0107] In the step S20, considering that the specifications of license plates in my country are relatively limited, the new energy license plate is green with 8 characters, and the fuel license plate is 7 characters, wherein the size of the front license plate of the new energy vehicle is 480*140mm, and the size of the front license plate of the fuel vehicle is 440*140mm. In order to ensure that the appropriate license plate size can be used for alignment processing for different types of license plate frame images in the future, and the appropriate standard cutting template can be used for license plate character cutting processing, it is necessary to first determine the type of the license plate frame image (i.e., new energy license plate image or fuel license plate image) according to the color pixel ratio in the license plate frame image. Specifically, according to the color pixel ratio in the license plate frame image, determining that the license plate frame image is a new energy license plate image or a fuel license plate image includes but is not limited to the following steps S201 to S203: S201. Count the proportion of green pixels in the license plate frame image; S202. Determine whether the proportion of green pixels exceeds a preset threshold; S203. If so, determine that the license plate frame image is a new energy license plate image, otherwise determine that the license plate frame image is a fuel license plate image. In addition, the preset threshold may be 38% for example.
[0108] S30. Based on the license plate key point detection algorithm and the license plate size corresponding to the determination result, the license plate frame image is aligned to obtain a license plate image to be cut that is aligned with the standard license plate image, wherein the standard license plate image has a corresponding relationship with the determination result.
[0109] In step S30, the license plate key point detection algorithm can adopt a conventional detection algorithm based on a multi-task convolutional neural network (MTCNN) model, and realize stretching alignment based on traditional coordinate rotation transformation. For example, when the license plate frame image is a new energy license plate image, the license plate frame image is stretched and aligned to a standard size image of 480*140 mm, and when the license plate frame image is a fuel license plate image, the license plate frame image is stretched and aligned to a standard size image of 440*140 mm.
[0110] S40. Use the license plate character cutting method as described in the first aspect to perform license plate character cutting processing on the license plate image to be cut, and obtain multiple license plate character individual images.
[0111] S50. For each individual license plate character image among the plurality of individual license plate character images, obtain a corresponding character recognition result based on a character recognition algorithm.
[0112] In step S50, the character recognition algorithm may adopt a conventional recognition algorithm based on a deep model, for example, a deep model such as a residual network ResNet.
[0113] Therefore, based on the license plate recognition method described in the aforementioned steps S10 to S50, on the basis of the technical effect of the first aspect, after detecting the license plate frame image, the fuel license plate image or the new energy license plate image (with a larger proportion of green) can be distinguished according to the color ratio of the license plate area, so that in the alignment and stretching stage, stretching and alignment can be performed according to the ratio of 44:14 for the fuel license plate size or 48:14 for the new energy license plate size, and the license plate character cutting processing can be performed using a suitable standard cutting template, so as to further ensure the precision and accuracy of the license plate character cutting results and improve the precision and accuracy of the final license plate recognition results.
[0114] like Fig. 9 As shown, the fourth aspect of this embodiment provides a virtual device for implementing the license plate recognition method described in the third aspect, comprising a license plate frame detection module, a license plate type determination module, a license plate image alignment module, a license plate character cutting module and a character recognition module which are sequentially communicatively connected;
[0115] The license plate frame detection module is used to perform license plate frame recognition processing on the original image based on the target detection algorithm to obtain a license plate frame image;
[0116] The license plate type determination module is used to determine whether the license plate frame image is a new energy vehicle license plate image or a fuel vehicle license plate image according to the color pixel ratio in the license plate frame image;
[0117] The license plate image alignment module is used to align the license plate frame image based on the license plate key point detection algorithm and the license plate size corresponding to the determination result to obtain the license plate image to be cut that is aligned with the standard license plate image, wherein the standard license plate image has a corresponding relationship with the determination result;
[0118] The license plate character cutting module is used to perform license plate character cutting processing on the license plate image to be cut to obtain multiple license plate character individual images, wherein the license plate character cutting module includes an acquisition unit, a set determination unit, a sliding retrieval unit, a minimum value search unit, a coordinate calculation unit and a cutting execution unit;
[0119] The acquisition unit is used to acquire the license plate image to be cut that is aligned with the standard license plate image and a standard cutting template preset according to the standard license plate image, wherein the standard cutting template includes coordinates of multiple character cutting lines in the standard license plate image, and the multiple character cutting lines refer to the required cutting lines for cutting out all license plate characters in the standard license plate image;
[0120] The set determination unit is used to determine a corresponding sliding position set for each template reduction coefficient in a plurality of template reduction coefficients, wherein the template reduction coefficient is a real number and has a value range of (0,1], each sliding position in the sliding position set is an integer, and the sliding position refers to the dynamic coordinates of the first character cutting line in the plurality of character cutting lines and along the license plate character arrangement direction in the standard license plate image during the sliding of the standard cutting template along the license plate character arrangement direction;
[0121] The sliding retrieval unit is respectively connected to the acquisition unit and the set determination unit for performing a sliding retrieval on the license plate image to be cut along the arrangement direction of the license plate characters according to the standard cutting template and the corresponding sliding position set for each template reduction coefficient, and calculates the total cumulative grayscale value of the projections of the plurality of character cutting lines when the first character cutting line is located at each corresponding sliding position during the sliding retrieval process;
[0122] The minimum value search unit is communicatively connected to the sliding search unit and is used to find the minimum value among all the calculated cumulative total values of the projection grayscales;
[0123] The coordinate calculation unit is respectively connected to the acquisition unit and the minimum value search unit for calculating the coordinates of each of the plurality of character cutting lines in the license plate image to be cut according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value;
[0124] The cutting execution unit is used to perform license plate character cutting on the license plate image to be cut according to the coordinates of each character cutting line in the license plate image to be cut, so as to obtain a plurality of license plate character individual images;
[0125] The character recognition module is used to obtain a corresponding character recognition result based on a character recognition algorithm for each individual license plate character image among the multiple individual license plate character images.
[0126] The working process, working details and technical effects of the aforementioned device provided in the fourth aspect of this embodiment can be referred to the license plate recognition method described in the third aspect, and will not be repeated here.
[0127] like Fig.10 As shown, the fifth aspect of this embodiment provides a computer device for executing the license plate character cutting method as described in the first aspect or the license plate recognition method as described in the third aspect, including a memory and a processor connected in communication, wherein the memory is used to store a computer program, and the processor is used to read the computer program to execute the license plate character cutting method as described in the first aspect or the license plate recognition method as described in the third aspect. Specifically, the memory may include, but is not limited to, a random access memory (Random-Access Memory, RAM), a read-only memory (Read-Only Memory, ROM), a flash memory (Flash Memory), a first-in-first-out memory (First Input First Output, FIFO) and / or a first-in-last-out memory (First Input Last Output, FILO), etc.; the processor may include, but is not limited to, a microprocessor of the STM32F105 series. In addition, the computer device may also include, but is not limited to, a power module, a display screen, and other necessary components.
[0128] The working process, working details and technical effects of the aforementioned computer device provided in the fifth aspect of this embodiment can be referred to the license plate character cutting method described in the first aspect or the license plate recognition method described in the third aspect, and will not be repeated here.
[0129] The sixth aspect of this embodiment provides a computer-readable storage medium storing instructions including the license plate character cutting method as described in the first aspect or the license plate recognition method as described in the third aspect, that is, the computer-readable storage medium stores instructions, and when the instructions are run on a computer, the license plate character cutting method as described in the first aspect or the license plate recognition method as described in the third aspect is executed. The computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to computer-readable storage media such as floppy disks, optical disks, hard disks, flash memory, USB flash drives and / or memory sticks, and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0130] The working process, working details and technical effects of the aforementioned computer-readable storage medium provided in the sixth aspect of this embodiment can be referred to the license plate character cutting method described in the first aspect or the license plate recognition method described in the third aspect, and will not be repeated here.
[0131] In a seventh aspect, the present embodiment provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the license plate character cutting method as described in the first aspect or the license plate recognition method as described in the third aspect. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0132] Finally, it should be noted that the present invention is not limited to the above optional implementations, and anyone can derive other various forms of products under the enlightenment of the present invention. The above specific implementations should not be understood as limiting the scope of protection of the present invention. The scope of protection of the present invention should be based on the definition in the claims, and the description can be used to interpret the claims.
Claims
1. A license plate character cutting method, It is characterized in that include: Acquire a license plate image to be cut that is aligned with a standard license plate image and a standard cutting template preset according to the standard license plate image, wherein the standard cutting template includes coordinates of a plurality of character cutting lines in the standard license plate image, and the plurality of character cutting lines refer to the required cutting lines for cutting out all license plate characters in the standard license plate image; For each template reduction coefficient among a plurality of template reduction coefficients, a corresponding sliding position set is determined, wherein the template reduction coefficient is a real number and has a value range of (0,1], each sliding position in the sliding position set is an integer, and the sliding position refers to the dynamic coordinates of the first character cutting line among the plurality of character cutting lines and along the license plate character arrangement direction in the standard license plate image during the process of the standard cutting template sliding along the license plate character arrangement direction; For each template reduction coefficient, according to the standard cutting template and the corresponding sliding position set, the license plate image to be cut is subjected to sliding retrieval along the license plate character arrangement direction, and the total cumulative grayscale value of the projections of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions is calculated during the sliding retrieval process; Find the minimum value among all the calculated cumulative total values of projection grayscale; Calculating the coordinates of each of the plurality of character cutting lines in the license plate image to be cut according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value; According to the coordinates of each character cutting line in the license plate image to be cut, the license plate image to be cut is cut with license plate characters to obtain a plurality of individual license plate character images.
2. The license plate character cutting method as claimed in claim 1, It is characterized in that The standard cutting template uses the coordinate set {x 1 ,x 2 ,…,x k ,…,x K } represents, where K represents the total number of the plurality of character cutting lines, k is an integer and its value range is [1, K], x k is an integer and represents the coordinates of the kth character cutting line arranged in sequence along the license plate character arrangement direction in the standard license plate image; The coordinates of each of the plurality of character cutting lines in the license plate image to be cut are calculated according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value, including: According to the standard cutting template and the template reduction coefficient and sliding position corresponding to the minimum value, the coordinates of each of the multiple character cutting lines in the license plate image to be cut are calculated according to the following formula: In the formula, represents the coordinates of the kth character cutting line in the license plate image to be cut, IF() represents the rounding function, ε min represents the template reduction coefficient corresponding to the minimum value, x′ min Indicates the slide position corresponding to the minimum value.
3. The license plate character cutting method as claimed in claim 1, It is characterized in that The standard cutting template uses the coordinate set {x 1 ,x 2 ,…,x k ,…,x K } represents, where K represents the total number of the plurality of character cutting lines, k is an integer and its value range is [1, K], x k is an integer and represents the coordinates of the kth character cutting line arranged in sequence along the license plate character arrangement direction in the standard license plate image; When the arrangement direction of the license plate characters is consistent with the direction of the pixel coordinate axis, for each template reduction coefficient among the multiple template reduction coefficients, a corresponding sliding position set is determined, including: For each template reduction coefficient among the multiple template reduction coefficients, a corresponding sliding position set is determined according to the last pixel coordinate in the license plate image to be cut and in the arrangement direction of the license plate characters, wherein the sliding position set is represented by {x′ m1 ,x′ m2 ,…,x′ mn ,…,x′ mN } means that m and n are positive integers, x′ mn Indicates that the condition IF(ε m (x′ mn +x K -x 1 ))≤X and corresponding to the nth sliding position of the mth template reduction coefficient among the plurality of template reduction coefficients, N represents the nth sliding position that satisfies the condition IF(ε m (x′ mn +x K -x 1 ))≤X, IF() represents the rounding function, ε m represents the mth template reduction coefficient, and X represents the last pixel coordinate.
4. The license plate character cutting method as claimed in claim 1, It is characterized in that The standard cutting template uses the coordinate set {x 1 ,x 2 ,…,x k ,…,x K } represents, where K represents the total number of the plurality of character cutting lines, k is an integer and its value range is [1, K], x k is an integer and represents the coordinates of the kth character cutting line arranged in sequence along the license plate character arrangement direction in the standard license plate image; In the sliding search process, the cumulative total grayscale values of the projections of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions are calculated, including: During the sliding search process, the cumulative total grayscale value of the projections of the plurality of character cutting lines when the first character cutting line is located at each sliding position is calculated according to the following formula: In the formula, S mn represents the total cumulative grayscale value of the projection when the first character cutting line is located at the corresponding nth sliding window position for the mth template reduction coefficient among the multiple template reduction coefficients, i is a positive integer, x mi represents the coordinates of the i-th character cutting line corresponding to the m-th template reduction coefficient, Gray(x mi ) indicates that the coordinate x is located in the license plate image to be cut. mi The accumulated result of the pixel grayscale value at the position, IF() represents the rounding function, ε m represents the mth template reduction coefficient, x′ mn represents the nth sliding position corresponding to the mth template reduction coefficient, x i is an integer and represents the coordinates of the i-th character cutting line arranged in sequence along the license plate character arrangement direction in the standard license plate image.
5. A license plate character cutting device, It is characterized in that It includes an acquisition module, a set determination module, a sliding retrieval module, a minimum value search module, a coordinate calculation module and a cutting execution module; The acquisition module is used to acquire the license plate image to be cut that is aligned with the standard license plate image and a standard cutting template preset according to the standard license plate image, wherein the standard cutting template includes the coordinates of multiple character cutting lines in the standard license plate image, and the multiple character cutting lines refer to the required cutting lines for cutting out all license plate characters in the standard license plate image; The set determination module is used to determine a corresponding sliding position set for each template reduction coefficient among a plurality of template reduction coefficients, wherein the template reduction coefficient is a real number and has a value range of (0,1], each sliding position in the sliding position set is an integer, and the sliding position refers to the dynamic coordinates of the first character cutting line among the plurality of character cutting lines and along the license plate character arrangement direction in the standard license plate image during the process of the standard cutting template sliding along the license plate character arrangement direction; The sliding retrieval module is respectively connected to the acquisition module and the set determination module for performing a sliding retrieval on the license plate image to be cut along the arrangement direction of the license plate characters according to the standard cutting template and the corresponding sliding position set for each template reduction coefficient, and calculating the total cumulative grayscale value of the projections of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions during the sliding retrieval process; The minimum value search module is communicatively connected to the sliding search module and is used to find the minimum value among all the calculated cumulative total values of the projection grayscales; The coordinate calculation module is respectively connected to the acquisition module and the minimum value search module for calculating the coordinates of each of the multiple character cutting lines in the license plate image to be cut according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value; The cutting execution module is used to perform license plate character cutting on the license plate image to be cut according to the coordinates of each character cutting line in the license plate image to be cut, so as to obtain a plurality of license plate character individual images.
6. A license plate recognition method, It is characterized in that include: Perform license plate frame recognition processing on the original image based on the target detection algorithm to obtain a license plate frame image; According to the color pixel ratio in the license plate frame image, determining whether the license plate frame image is a new energy vehicle license plate image or a fuel vehicle license plate image; Based on the license plate key point detection algorithm and the license plate size corresponding to the determination result, the license plate frame image is aligned to obtain a license plate image to be cut that is aligned with the standard license plate image, wherein the standard license plate image has a corresponding relationship with the determination result; Using the license plate character cutting method as claimed in any one of claims 1 to 4 to perform license plate character cutting processing on the license plate image to be cut, to obtain a plurality of license plate character individual images; For each individual license plate character image among the plurality of individual license plate character images, a corresponding character recognition result is obtained based on a character recognition algorithm.
7. The license plate recognition method according to claim 6, It is characterized in that Determining whether the license plate frame image is a new energy vehicle license plate image or a fuel vehicle license plate image according to the color pixel ratio in the license plate frame image includes: Counting the proportion of green pixels in the license plate frame image; Determine whether the proportion of the green pixels exceeds a preset threshold; If so, it is determined that the license plate frame image is a new energy license plate image, otherwise it is determined that the license plate frame image is a fuel license plate image.
8. A license plate recognition device, It is characterized in that It includes a license plate frame detection module, a license plate type determination module, a license plate image alignment module, a license plate character cutting module and a character recognition module which are sequentially connected in communication; The license plate frame detection module is used to perform license plate frame recognition processing on the original image based on the target detection algorithm to obtain a license plate frame image; The license plate type determination module is used to determine whether the license plate frame image is a new energy vehicle license plate image or a fuel vehicle license plate image according to the color pixel ratio in the license plate frame image; The license plate image alignment module is used to align the license plate frame image based on the license plate key point detection algorithm and the license plate size corresponding to the determination result to obtain the license plate image to be cut that is aligned with the standard license plate image, wherein the standard license plate image has a corresponding relationship with the determination result; The license plate character cutting module is used to perform license plate character cutting processing on the license plate image to be cut to obtain multiple license plate character individual images, wherein the license plate character cutting module includes an acquisition unit, a set determination unit, a sliding retrieval unit, a minimum value search unit, a coordinate calculation unit and a cutting execution unit; The acquisition unit is used to acquire the license plate image to be cut that is aligned with the standard license plate image and a standard cutting template preset according to the standard license plate image, wherein the standard cutting template includes coordinates of multiple character cutting lines in the standard license plate image, and the multiple character cutting lines refer to the required cutting lines for cutting out all license plate characters in the standard license plate image; The set determination unit is used to determine a corresponding sliding position set for each template reduction coefficient in a plurality of template reduction coefficients, wherein the template reduction coefficient is a real number and has a value range of (0,1], each sliding position in the sliding position set is an integer, and the sliding position refers to the dynamic coordinates of the first character cutting line in the plurality of character cutting lines and along the license plate character arrangement direction in the standard license plate image during the sliding of the standard cutting template along the license plate character arrangement direction; The sliding retrieval unit is respectively connected to the acquisition unit and the set determination unit for performing a sliding retrieval on the license plate image to be cut along the arrangement direction of the license plate characters according to the standard cutting template and the corresponding sliding position set for each template reduction coefficient, and calculates the total cumulative grayscale value of the projections of the plurality of character cutting lines when the first character cutting line is located at each corresponding sliding position during the sliding retrieval process; The minimum value search unit is communicatively connected to the sliding search unit and is used to find the minimum value among all the calculated cumulative total values of the projection grayscales; The coordinate calculation unit is respectively connected to the acquisition unit and the minimum value search unit for calculating the coordinates of each of the plurality of character cutting lines in the license plate image to be cut according to the standard cutting template and the template reduction coefficient and the sliding position corresponding to the minimum value; The cutting execution unit is used to perform license plate character cutting on the license plate image to be cut according to the coordinates of each character cutting line in the license plate image to be cut, so as to obtain a plurality of license plate character individual images; The character recognition module is used to obtain a corresponding character recognition result based on a character recognition algorithm for each individual license plate character image among the multiple individual license plate character images.
9. A computer device, It is characterized in that It includes a memory and a processor that are communicatively connected, wherein the memory is used to store a computer program, and the processor is used to read the computer program to execute the license plate character cutting method as described in any one of claims 1 to 4 or the license plate recognition method as described in any one of claims 6 to 7.
10. A computer-readable storage medium, Features The computer-readable storage medium stores instructions, and when the instructions are executed on the computer, the license plate character cutting method as described in any one of claims 1 to 4 or the license plate recognition method as described in any one of claims 6 to 7 is executed.
