CN114005120A - License plate character cutting method, license plate recognition method, device, equipment and storage medium - Google Patents

License plate character cutting method, license plate recognition method, device, equipment and storage medium Download PDF

Info

Publication number
CN114005120A
CN114005120A CN202111272859.4A CN202111272859A CN114005120A CN 114005120 A CN114005120 A CN 114005120A CN 202111272859 A CN202111272859 A CN 202111272859A CN 114005120 A CN114005120 A CN 114005120A
Authority
CN
China
Prior art keywords
license plate
character
standard
image
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111272859.4A
Other languages
Chinese (zh)
Inventor
董勇
何翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Xinchao Media Group Co Ltd
Original Assignee
Chengdu Xinchao Media Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Xinchao Media Group Co Ltd filed Critical Chengdu Xinchao Media Group Co Ltd
Priority to CN202111272859.4A priority Critical patent/CN114005120A/en
Publication of CN114005120A publication Critical patent/CN114005120A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Character Input (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of artificial intelligence and computer vision processing, and discloses a license plate character cutting method, a license plate recognition method, a device, equipment and a storage medium, namely, based on the license plate character cutting method, after 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 are obtained, a template reduction coefficient and a sliding position which enable the projection gray scale accumulation total value of all character cutting lines to be minimum are found through a sliding retrieval method aiming at each template reduction coefficient in a plurality of template reduction coefficients, an optimal license plate character cutting scheme is obtained according to the search result, and then the search mode of each single character cutting line can resist the interference caused by reflection, stain, slight deformation, introduced errors of a license plate key point detection link and the like, and the precision and the accuracy of the license plate character cutting result are improved, and the precision and the accuracy of the final license plate recognition result are guaranteed.

Description

License plate character cutting method, license plate recognition method, device, equipment and storage medium
Technical Field
The 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 device, license plate recognition equipment and a storage medium.
Background
The license plate recognition is used as a core technology of traffic monitoring and is applied to multiple subsystems, such as a red light running monitoring system, an overspeed monitoring system, a reverse running monitoring system, a forbidden monitoring system, a bus lane monitoring system, a non-motor lane driving monitoring system, a double yellow line pressing monitoring system, an emergency stop belt driving monitoring system, a mobile vehicle inspection system, an intelligent multimedia network license plate recognition system and the like, wherein the intelligent multimedia network license plate recognition system is widely applied to the aspects of automatic registration, verification, road charging, vehicle safety inspection, community vehicle management, parking lot management and the like of passing vehicles.
The existing license plate recognition method has a scheme based on a traditional character recognition algorithm and a whole license plate depth recognition algorithm, wherein the latter has the problems of calculation redundancy, higher requirement on terminal calculation capacity and poor flexibility caused by the fact that a model needs to be retrained for a newly added license plate category; the former belongs to a scheme for recognizing license plate characters one by one, although the scheme is relatively flexible and has small calculation amount, 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 gray projection valley value, so that the searching mode of a single character cutting line is easily interfered, and the character cutting result and the license plate recognition result have large errors.
In detail, the license plate recognition method based on the traditional character recognition algorithm has a flow as shown in fig. 1, wherein the step of segmenting characters is to perform projection mapping based on a gray level image or a binary image, and perform detection segmentation according to gray level valleys: as shown in fig. 2, the image below the license plate image is the projection accumulated value of the gray value of the license plate pixel in the horizontal direction, and since there is a projection valley at the character interval, the character segmentation can be performed based on this feature. However, when the license plate image has the conditions of reflection, stain, slight deformation and the like, projection interference is caused, and cutting errors occur. Such as the projected accumulated valley of two marks in fig. 3 and preceding a "threo" character can cause the character cut line to look for errors or be confusing between true and false. In the license plate key point detection link, errors are introduced, so that left-right deviation and scaling deviation occur at corresponding positions of a real license plate region and a license plate detection region after rotation and/or stretching alignment, and search of single character cutting lines is interfered.
Disclosure of Invention
The invention aims to solve the problems that a searching mode of a single character cutting line is easily interfered in a license plate recognition scheme based on a traditional character recognition algorithm, and a character cutting result and a license plate recognition result have larger errors.
In a first aspect, the present invention provides a license plate character cutting method, including:
acquiring 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, wherein the standard cutting template comprises coordinates of a plurality of character cutting lines in the standard license plate image respectively, and the plurality of character cutting lines are required cutting lines for cutting all license plate characters in the standard license plate image;
determining a corresponding sliding position set aiming at each template reduction coefficient in a plurality of template reduction coefficients, wherein the template reduction coefficients are real numbers and have a value range of (0, 1), each sliding position in the sliding position set is an integer, and the sliding position refers to a dynamic coordinate of a first character cutting line in the plurality of character cutting lines and in the arrangement direction of license plate characters in the standard license plate image in the process that the standard cutting template slides along the arrangement direction of the license plate characters;
for each template reduction coefficient, performing 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, and calculating to obtain a projection gray level accumulation total value of the plurality of character cutting lines when the first character cutting line is located at each corresponding sliding position in the sliding retrieval process;
finding out the minimum value from the total value of all the calculated projection gray levels;
calculating the coordinates of each character cutting line in 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;
and according to the coordinates of the character cutting lines in the license plate image to be cut, carrying out license plate character cutting on the license plate image to be cut to obtain a plurality of license plate character individual images.
Based on the content of the invention, a new license plate character cutting scheme combining a template scaling algorithm and a sliding retrieval algorithm is provided, namely after 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 are obtained, aiming at each template reduction coefficient in a plurality of template reduction coefficients, the sliding retrieval along the arrangement direction of the license plate characters is carried out on the license plate image to be cut according to the standard cutting template and a corresponding sliding position set, the projection gray scale accumulation total value of all the character cutting lines when a first character cutting line is positioned at each corresponding sliding position is calculated in the sliding retrieval process, then the template reduction coefficient and the sliding position which enable the projection gray scale accumulation total value of all the character cutting lines to be minimum are found according to the calculation result, and finally the best license plate character cutting scheme is obtained according to the search result, and then the searching mode of each single character cutting line can resist the interference caused by reflection, stain, slight deformation, introduced errors in the license plate key point detection link and the like, the precision and the accuracy of the license plate character cutting result are improved, the precision and the accuracy of the final license plate recognition result are guaranteed, and the method is convenient for practical application and popularization.
In one possible design, the standard cutting template is usedThe coordinate set { x of the multiple character cutting lines1,x2,…,xk,…,xKExpressing, wherein K expresses the total number of the character cutting lines, K is an integer and the value range is [1, K ]],xkThe number of the standard license plate images is an integer and represents the coordinates of the k-th character cutting lines which are sequentially arranged along the arrangement direction of the license plate characters in the standard license plate images;
calculating the coordinates of each character cutting line in 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, wherein the coordinates comprise:
and calculating the coordinates of each character cutting line in the plurality of character cutting lines in the license plate image to be cut according to the standard cutting template, the template reduction coefficient corresponding to the minimum value and the sliding position according to the following formula:
Figure BDA0003329256770000031
in the formula (I), the compound is shown in the specification,
Figure BDA0003329256770000032
representing the coordinates of the k-th character cutting line in the license plate image to be cut, IF () representing an integer function, epsilonminRepresents a template reduction coefficient, x 'corresponding to the minimum value'minIndicating the sliding position corresponding to the minimum value.
In one possible design, the standard cut template is cut with a set of coordinates { x } of the plurality of character cut lines1,x2,…,xk,…,xKExpressing, wherein K expresses the total number of the character cutting lines, K is an integer and the value range is [1, K ]],xkThe number of the standard license plate images is an integer and represents the coordinates of the k-th character cutting lines which are sequentially arranged along the arrangement direction of the license plate characters in the standard license plate images;
when the license plate character arrangement direction is consistent with the pixel coordinate axis direction, determining a corresponding sliding position set aiming at each template reduction coefficient in a plurality of template reduction coefficients, wherein the sliding position set comprises:
for each template reduction coefficient in a plurality of template reduction coefficients, determining a corresponding sliding position set according to the last pixel coordinate in the license plate image to be cut in the license plate character arrangement direction, wherein the sliding position set is { x'm1,x′m2,…,x′mn,…,x′mNIs represented by, m and n are respectively positive integers, x'mnIndicates that the condition IF (ε) is satisfiedm(x′mn+xK-x1) X and corresponding to the mth template reduction coefficient among the plurality of template reduction coefficients, N represents that the condition IF (epsilon) is satisfiedm(x′mn+xK-x1) Total number of integers less than or equal to X, IF () represents a rounding function, εmRepresents the mth template reduction coefficient, and X represents the last pixel coordinate.
In one possible design, the standard cut template is cut with a set of coordinates { x } of the plurality of character cut lines1,x2,…,xk,…,xKExpressing, wherein K expresses the total number of the character cutting lines, K is an integer and the value range is [1, K ]],xkThe number of the standard license plate images is an integer and represents the coordinates of the k-th character cutting lines which are sequentially arranged along the arrangement direction of the license plate characters in the standard license plate images;
calculating the total projection gray level accumulation value of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions in the sliding retrieval process, wherein the total projection gray level accumulation value comprises the following steps:
in the sliding retrieval process, calculating and obtaining the projection gray scale accumulation total value of the plurality of character cutting lines when the first character cutting line is positioned at each sliding position according to the following formula:
Figure BDA0003329256770000033
in the formula, SmnRepresenting reduction coefficients for the plurality of templatesThe m-th template reduction coefficient in (1), the projection gray scale accumulation total value when the first character cutting line is located at the corresponding n-th sliding window position, i is a positive integer, xmiCoordinates representing the ith character cut line corresponding to the mth template reduction coefficient, Gray (x)mi) The image of the license plate to be cut is shown at a coordinate xmiAt a pixel gray value accumulation result, IF () represents a rounding function, εmRepresents the m-th template reduction coefficient, x'mnRepresents an nth sliding position, x, corresponding to the mth template reduction coefficientiAnd the number is an integer and represents the coordinates of the ith character cutting line sequentially arranged along the arrangement direction of the license plate characters in the standard license plate image.
In a second aspect, the invention provides a license plate character cutting device, which comprises an acquisition module, a set determination module, a sliding retrieval module, a minimum value searching module, a coordinate calculation module and a cutting execution module;
the system comprises an acquisition module, a standard license plate image acquisition module and a standard cutting template, wherein the acquisition module is used for acquiring a license plate image to be cut aligned with a standard license plate image and the standard cutting template is preset according to the standard license plate image, the standard cutting template comprises coordinates of a plurality of character cutting lines in the standard license plate image respectively, and the plurality of character cutting lines are required cutting lines for cutting all license plate characters in the standard license plate image;
the set determining module is configured to determine a corresponding sliding position set for each template reduction coefficient of the plurality of template reduction coefficients, where the template reduction coefficient is a real number and a value range is (0, 1), each sliding position in the sliding position set is an integer, and the sliding position is a dynamic coordinate of a first character cutting line in the plurality of character cutting lines and in the arrangement direction of the license plate characters in the standard license plate image in a process that the standard cutting template slides in the arrangement direction of the license plate characters;
the sliding retrieval module is respectively in communication connection with the acquisition module and the set determination module, and is used for performing 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 aiming at each template reduction coefficient, and calculating to obtain a projection gray level accumulation total value of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding position in the sliding retrieval process;
the minimum value searching module is in communication connection with the sliding retrieval module and is used for searching the minimum value in the total accumulated projection gray values obtained through calculation;
the coordinate calculation module is respectively in communication connection with the acquisition module and the minimum value search module, and is used for calculating and obtaining the coordinates of each character cutting line 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;
and the cutting execution module is used for cutting license plate characters of the license plate image to be cut according to the coordinates of the character cutting lines in the license plate image to be cut to obtain a plurality of license plate character individual images.
In a third aspect, the present invention provides a license plate recognition method, including:
carrying out license plate frame identification processing on the original image based on a target detection algorithm to obtain a license plate frame image;
determining the license plate frame image as a new energy license plate image or a fuel license plate image according to the color pixel proportion in the license plate frame image;
aligning the license plate frame image based on a license plate key point detection algorithm and a license plate size corresponding to a determination result to obtain a license plate image to be cut aligned with a standard license plate image, wherein the standard license plate image has a corresponding relation with the determination result;
performing license plate character cutting processing on the license plate image to be cut by adopting the license plate character cutting method which can be designed in any way in the first aspect or the first aspect to obtain a plurality of license plate character individual images;
and aiming at each license plate character individual image in the plurality of license plate character individual images, obtaining a corresponding character recognition result based on a character recognition algorithm.
Based on the content of the invention, on the basis of the first aspect or any possible design technical effect, after the license plate frame image is detected, the fuel license plate image or the new energy license plate image (with a larger green proportion) is distinguished according to the color proportion of the license plate area, so that in the alignment and stretching step, the fuel license plate image or the new energy license plate image is stretched and aligned according to the proportion of the fuel license plate size 44:14 or the new energy license plate size 48:14, and a proper standard cutting template is applied to perform license plate character cutting processing, so that the precision and the accuracy of the license plate character cutting result are further ensured, and the precision and the accuracy of the final license plate recognition result are improved.
In one possible design, determining that the license plate frame image is a new energy license plate image or a fuel license plate image according to a color pixel ratio in the license plate frame image comprises:
counting the proportion of green pixels in the license plate frame image;
judging whether the ratio of the green pixels exceeds a preset threshold value or not;
if so, determining that the license plate frame image is a new energy license plate image, otherwise, determining that the license plate frame image is a fuel license plate image.
In a fourth aspect, the invention provides a license plate recognition device, which comprises 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 in communication connection;
the license plate frame detection module is used for carrying out license plate frame identification processing on the original image based on a target detection algorithm to obtain a license plate frame image;
the license plate type determining module is used for determining the license plate frame image as a new energy license plate image or a fuel license plate image according to the color pixel proportion in the license plate frame image;
the license plate image alignment module is used for aligning the license plate frame image based on a license plate key point detection algorithm and the license plate size corresponding to the determination result to obtain a license plate image to be cut aligned with a standard license plate image, wherein the standard license plate image has a corresponding relation with the determination result;
the license plate character cutting module is used for performing license plate character cutting processing on the license plate image to be cut to obtain a plurality of license plate character individual images, and comprises an acquisition unit, a set determination unit, a sliding retrieval unit, a minimum value searching unit, a coordinate calculation unit and a cutting execution unit;
the license plate cutting device comprises an acquisition unit, a cutting unit and a cutting unit, wherein the acquisition unit is used for acquiring 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 standard cutting template comprises coordinates of a plurality of character cutting lines in the standard license plate image respectively, and the character cutting lines are required cutting lines for cutting all license plate characters in the standard license plate image;
the set determining unit is configured to determine a corresponding sliding position set for each template reduction coefficient of a plurality of template reduction coefficients, where the template reduction coefficient is a real number and a value range is (0, 1), each sliding position in the sliding position set is an integer, and the sliding position is a dynamic coordinate of a first character cutting line in the license plate character arrangement direction among the character cutting lines and in the standard license plate image in a process that the standard cutting template slides along the license plate character arrangement direction;
the sliding retrieval unit is respectively in communication connection with the acquisition unit and the set determination unit, and is used for performing 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 aiming at each template reduction coefficient, and calculating to obtain a projection gray level accumulation total value of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding position in the sliding retrieval process;
the minimum value searching unit is in communication connection with the sliding retrieval unit and is used for searching the minimum value in all the calculated projection gray scale accumulation total values;
the coordinate calculation unit is respectively in communication connection with the acquisition unit and the minimum value search unit, and is used for calculating and obtaining the coordinates of each character cutting line 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 for cutting license plate characters of the license plate image to be cut according to the coordinates of the character cutting lines in the license plate image to be cut to obtain a plurality of license plate character individual images;
and the character recognition module is used for obtaining a corresponding character recognition result for each license plate character individual image in the plurality of license plate character individual images based on a character recognition algorithm.
In a fifth aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory is used for storing a computer program, and the processor is used for reading the computer program, executing the license plate character cutting method according to the first aspect or any possible design in the first aspect, or executing the license plate recognition method according to any possible design in the third aspect or any possible design in the third aspect.
In a sixth aspect, the present invention provides a computer-readable storage medium, having stored thereon instructions that, when executed on a computer, perform the license plate character cutting method according to the first aspect or any possible design of the first aspect, or perform the license plate recognition method according to any possible design of the third aspect or any possible design of the third aspect.
In a seventh aspect, the present invention provides a computer program product comprising instructions, which when run on a computer, cause the computer to perform the license plate character cutting method according to the first aspect or any of the possible designs of the first aspect, or perform the license plate recognition method according to the third aspect or any of the possible designs of the third aspect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flow chart of a license plate recognition method based on a traditional character recognition algorithm.
Fig. 2 is an exemplary diagram of character segmentation by gray valleys based on a gray image.
Fig. 3 is a diagram showing an example of interference occurring in character segmentation in accordance with a gray valley value based on a gray image.
Fig. 4 is an exemplary diagram of four positional relationships between a real license plate region and a license plate detection region.
Fig. 5 is a schematic flow chart of a license plate character cutting method provided by the invention.
FIG. 6 is a diagram illustrating a relationship between a standard license plate image and a plurality of character cutting lines according to an embodiment of the present invention.
Fig. 7 is a schematic structural diagram of a license plate character cutting device provided by the invention.
Fig. 8 is a schematic flow chart of a license plate recognition method provided by the present invention.
Fig. 9 is a schematic structural diagram of a license plate recognition device provided by the present invention.
Fig. 10 is a schematic structural diagram of a computer device provided by the present invention.
In the above drawings: 100-real license plate area; 200-license plate detection area.
Detailed Description
The invention is further described with reference to the following figures and specific embodiments. It should be noted that the description of the embodiments is provided to help understanding of the present invention, but the present invention is not limited thereto. Specific structural and functional details disclosed herein are merely representative of exemplary embodiments of the invention. This invention may, however, be embodied in many alternate forms and should not be construed as limited to the embodiments set forth herein.
It will be understood that, although the terms first, 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. For example, a first object may be referred to as a second object, and similarly, a second object may be referred to as a first object, without departing from the scope of example embodiments of the present invention.
It should be understood that, for the term "and/or" as may appear herein, it is merely an associative relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, B exists alone or A and B exist at the same time; for the term "/and" as may appear herein, which describes another associative object relationship, it means that two relationships may exist, e.g., a/and B, may mean: a exists singly or A and B exist simultaneously; in addition, for the character "/" that may appear herein, it generally means that the former and latter associated objects are in an "or" relationship.
As shown in fig. 5 to 6, the license plate character cutting method provided in the first aspect of this embodiment may be, but not limited to, executed by a Computer device having certain computing resources, for example, an electronic device such as a Personal Computer (PC, which refers to a multipurpose Computer with a size, price, and performance suitable for Personal use, a desktop Computer, a notebook Computer, a mini-notebook Computer, a tablet Computer, a super-notebook, and the like, a smart phone, a Personal digital assistant (PAD), or a wearable device, so as to find the template reduction coefficient and the sliding position that minimize the total projected grayscale value of all the character cutting lines by a sliding search method performed for each template reduction coefficient of a plurality of template reduction coefficients after acquiring 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, and an optimal license plate character cutting scheme is obtained according to the search result, so that the search mode of each single character cutting line can resist the interference caused by reflection, stain, slight deformation, introduced errors in the license plate key point detection link and the like, the precision and the accuracy of the license plate character cutting result are improved, and the precision and the accuracy of the final license plate identification result are guaranteed. As shown in fig. 5, the license plate character cutting method may include, but is not limited to, the following steps S1 to S6.
The method comprises the steps of S1, 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, wherein the standard cutting template comprises coordinates of a plurality of character cutting lines in the standard license plate image respectively, and the plurality of character cutting lines are cutting lines required for cutting all license plate characters in the standard license plate image.
In the step S1, the standard license plate image is a standard image of a license plate, such as a license plate design image. The alignment of the license plate image to be cut and the standard license plate image refers to that the license plate image to be cut and the standard license plate image have the same width (for example, the same number of longitudinal pixels) and length (for example, the same number of transverse pixels) in the same pixel coordinate system through conventional processing modes such as rotation and/or stretching. In the standard license plate image of the fuel license plate as shown in fig. 6, the vertex of the lower left corner of the standard license plate image is the origin of the pixel coordinate system, and the vertex of the lower left corner of the license plate image to be cut is the origin of the pixel coordinate system. In addition, the license plate image to be cut and the standard cutting template can be read from a storage unit or transmitted by a transmission unit.
In step S1, the standard cutting template may use the coordinate sets { x } of the character cutting lines1,x2,…,xk,…,xKExpressing, wherein K expresses the total number of the character cutting lines, K is an integer and the value range is [1, K ]],xkIs an integer and represents the number one arranged in sequence along the arrangement direction of the license plate charactersAnd coordinates of the k character cutting lines in the standard license plate image. The standard cutting template can be obtained by manual marking according to the actual position of each license plate character in the standard license plate image, namely, manually marking the coordinates of the plurality of character cutting lines in the standard license plate image respectively; for example, as shown in fig. 6, for the standard license plate image of the fuel license plate, there are seven license plate characters and one dot character, the required cutting line is nine longitudinal cutting lines, the length and width pixels of the standard license plate image of the fuel license plate are 440 × a × 140 × a, a represents a proportionality coefficient, and when the license plate characters are arranged in the right direction, the transverse 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,x8373.5 aa and x9=430.5*a。
S2, determining a corresponding sliding position set aiming at each template reduction coefficient in the plurality of template reduction coefficients, wherein the template reduction coefficients are real numbers and have a value range of (0, 1), each sliding position in the sliding position set is an integer, and the sliding position refers to a dynamic coordinate of a first character cutting line in the plurality of character cutting lines and along the arrangement direction of license plate characters in the standard license plate image in the process that the standard cutting template slides along the arrangement direction of the license plate characters.
In the step S2, the template reduction coefficients refer to reduction coefficients of the plurality of candidate cutting templates obtained based on the standard cutting template with respect to the standard cutting template, and are, for example, 1 (i.e., the corresponding candidate cutting template is the standard cutting template), 0.9, 0.85, 0.8, 0.77, 0.74, 0.71, 0.68, and the like. Considering that in the actual license plate recognition process, the pixels of the license plate image are often controlled within 100 p-200 p, so for each pair of two adjacent template reduction coefficients in the plurality of template reduction coefficients, the reduction can be performed in a control manner that the difference between the average pixels of the corresponding cutting results (i.e., all license plate character individual images) in the license plate character arrangement direction is 1, that is, the configuration of the template reduction coefficients is used to make the average pixel number of all license plate character individual images corresponding to the previous template reduction coefficient in the license plate character arrangement direction 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 the pair of two adjacent template reduction coefficients in the plurality of template reduction coefficients. According to the gradual reduction mode, ten template reduction coefficients are usually configured to cover introduced errors in the license plate key point detection link.
In step S2, specifically, when the license plate character arrangement direction matches the pixel coordinate axis direction, determining a corresponding sliding position set for each of a plurality of template reduction coefficients, including: for each template reduction coefficient in a plurality of template reduction coefficients, determining a corresponding sliding position set according to the last pixel coordinate in the license plate image to be cut in the license plate character arrangement direction, wherein the sliding position set is { x'm1,x′m2,…,x′mn,…,x′mNIs represented by, m and n are respectively positive integers, x'mnIndicates that the condition IF (ε) is satisfiedm(x′mn+xK-x1) X and corresponding to the mth template reduction coefficient among the plurality of template reduction coefficients, N represents that the condition IF (epsilon) is satisfiedm(x′mn+xK-x1) Total number of integers less than or equal to X, IF () represents a rounding function, εmRepresents the mth template reduction coefficient, and X represents the last pixel coordinate. As shown in fig. 6, 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. Due to x'mnSatisfies the condition IF (εm(x′mn+xK-x1) X) or less, and the last character cutting line in the plurality of character cutting lines and in the arrangement direction of the license plate characters can be ensured to be still in the standard vehicle in the process that the standard cutting template slides along the arrangement direction of the license plate charactersAnd in the license plate image, otherwise, the last license plate character along the arrangement direction of the license plate characters cannot be accurately cut. Since N represents that the condition IF (ε) is satisfiedm(x′mn+xK-x1) X), the number of sliding positions of each template reduction coefficient may be different, but for each template reduction coefficient, the corresponding sliding process may be performed pixel by pixel along the license plate character arrangement direction, so as to ensure that the sliding position that minimizes the total value of the projection gray scale accumulation of all the character cutting lines can be found without omission. Furthermore, the rounding function may be, but is not limited to, a rounded rounding function, the set of sliding positions { x'm1,x′m2,…,x′mn,…,x′mN} may be exemplified by {0,1,2, …, x'mN}。
And S3, aiming at the reduction coefficients of the templates, performing 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, and calculating to obtain a projection gray level accumulation total value of the character cutting lines when the first character cutting line is located at the corresponding sliding position in the sliding retrieval process.
In step S3, specifically, the calculating, in the sliding search process, a total value of the projection grayscale accumulations of the character cut lines when the first character cut line is located at the corresponding respective sliding positions includes: in the sliding retrieval process, calculating and obtaining the projection gray scale accumulation total value of the plurality of character cutting lines when the first character cutting line is positioned at each sliding position according to the following formula:
Figure BDA0003329256770000101
in the formula, SmnRepresenting the total value of the projection gray scale accumulation when the first character cutting line is located at the corresponding nth sliding window position for the mth template reduction coefficient in the plurality of template reduction coefficients, i is positiveInteger, xmiCoordinates representing the ith character cut line corresponding to the mth template reduction coefficient, Gray (x)mi) The image of the license plate to be cut is shown at a coordinate xmiAt a pixel gray value accumulation result, IF () represents a rounding function, εmRepresents the m-th template reduction coefficient, x'mnRepresents an nth sliding position, x, corresponding to the mth template reduction coefficientiAnd the number is an integer and represents the coordinates of the ith character cutting line sequentially arranged along the arrangement direction of the license plate characters in the standard license plate image. As shown in fig. 6, when the vertex of the lower left corner of the standard license plate image is the origin of the pixel coordinate system,
Figure BDA0003329256770000102
wherein j is an integer, Y represents the largest vertical coordinate of the pixel in the standard license plate image, gray (x)miJ) represents a position in the image of the license plate to be cut at coordinate (x)miAnd j) (the value range of each pixel gray value is 0-255, wherein 0 represents all black, and 255 represents all white).
And S4, finding the minimum value in the total accumulated values of all the projection gray levels obtained by calculation.
In the step S4, considering that there is a projection valley at the character interval, it can be ensured that the plurality of character cutting lines obtained subsequently according to the search result and in the to-be-cut license plate image can be located at the optimal character interval in the to-be-cut license plate image, so as to obtain the optimal license plate character cutting scheme.
And S5, calculating to obtain the coordinates of each character cutting line in the plurality of character cutting lines in the license plate image to be cut according to the standard cutting template, the template reduction coefficient corresponding to the minimum value and the sliding position.
In step S5, specifically, calculating coordinates of each character cut line in the plurality of character cut lines in the to-be-cut license plate image according to the standard cut template and the template reduction coefficient and the sliding position corresponding to the minimum value includes: and calculating the coordinates of each character cutting line in the plurality of character cutting lines in the license plate image to be cut according to the standard cutting template, the template reduction coefficient corresponding to the minimum value and the sliding position according to the following formula:
Figure BDA0003329256770000103
in the formula (I), the compound is shown in the specification,
Figure BDA0003329256770000104
representing the coordinates of the k-th character cutting line in the license plate image to be cut, IF () representing an integer function, epsilonminRepresents a template reduction coefficient, x 'corresponding to the minimum value'minIndicating the sliding position corresponding to the minimum value.
And S6, according to the coordinates of the character cutting lines in the license plate image to be cut, license plate characters of the license plate image to be cut are cut, and a plurality of license plate character individual images are obtained.
In the step S6, since the plurality of character cutting lines obtained according to the search result and in the to-be-cut license plate image can be located at the optimal character interval in the to-be-cut license plate image, the license plate character cutting is performed on the to-be-cut license plate image based on the optimal license plate character cutting scheme, so that the cutting result can resist interference caused by reflection, stains, slight deformation, introduced errors in the license plate key point detection link, and the like, the cutting precision and accuracy are improved, and the precision and accuracy of the final license plate recognition result are ensured.
Thus, based on the license plate character cutting method described in the foregoing steps S1 to S6, a new license plate character cutting scheme combining a template scaling algorithm and a sliding search algorithm is provided, that is, after 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 are acquired, sliding search along the license plate character arrangement direction is performed on the license plate image to be cut according to the standard cutting template and a corresponding sliding position set for each template reduction coefficient in a plurality of template reduction coefficients, a projection gray scale accumulation total value of all character cutting lines is calculated in the sliding search process when a first character cutting line is located at each corresponding sliding position, and then a template reduction coefficient and a sliding position which minimize the projection gray scale accumulation total value of all character cutting lines are found according to the calculation result, and finally, obtaining an optimal license plate character cutting scheme according to the search result, so that the search mode of each single character cutting line can resist the interference caused by reflection, stain, slight deformation, introduced errors in the license plate key point detection link and the like, the precision and the accuracy of the license plate character cutting result are improved, the precision and the accuracy of the final license plate identification result are ensured, and the practical application and the popularization are facilitated.
As shown in fig. 7, a second aspect of the present embodiment provides a virtual device for implementing the license plate character cutting method according to the first aspect, including an obtaining module, a set determining module, a sliding retrieving module, a minimum value searching module, a coordinate calculating module, and a cutting executing module;
the system comprises an acquisition module, a standard license plate image acquisition module and a standard cutting template, wherein the acquisition module is used for acquiring a license plate image to be cut aligned with a standard license plate image and the standard cutting template is preset according to the standard license plate image, the standard cutting template comprises coordinates of a plurality of character cutting lines in the standard license plate image respectively, and the plurality of character cutting lines are required cutting lines for cutting all license plate characters in the standard license plate image;
the set determining module is configured to determine a corresponding sliding position set for each template reduction coefficient of the plurality of template reduction coefficients, where the template reduction coefficient is a real number and a value range is (0, 1), each sliding position in the sliding position set is an integer, and the sliding position is a dynamic coordinate of a first character cutting line in the plurality of character cutting lines and in the arrangement direction of the license plate characters in the standard license plate image in a process that the standard cutting template slides in the arrangement direction of the license plate characters;
the sliding retrieval module is respectively in communication connection with the acquisition module and the set determination module, and is used for performing 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 aiming at each template reduction coefficient, and calculating to obtain a projection gray level accumulation total value of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding position in the sliding retrieval process;
the minimum value searching module is in communication connection with the sliding retrieval module and is used for searching the minimum value in the total accumulated projection gray values obtained through calculation;
the coordinate calculation module is respectively in communication connection with the acquisition module and the minimum value search module, and is used for calculating and obtaining the coordinates of each character cutting line 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;
and the cutting execution module is used for cutting license plate characters of the license plate image to be cut according to the coordinates of the character cutting lines in the license plate image to be cut to obtain a plurality of license plate character individual images.
For the working process, working details and technical effects of the device provided in the second aspect of this embodiment, reference may be made to the license plate character cutting method in the first aspect, which is not described herein again.
As shown in fig. 8, the third aspect of this embodiment further provides a novel license plate recognition method based on the technical solution of the first aspect, including the following steps S10 to S50.
And S10, carrying out license plate frame identification processing on the original image based on a target detection algorithm to obtain a license plate frame image.
In the step S10, the target detection algorithm is an existing artificial intelligence recognition algorithm for recognizing objects in the picture and marking the positions of the objects, and specifically, but not limited to, the target detection algorithm was proposed in 2015 by using fast R-CNN (fast Regions with conditional Neural Networks, by hogel et al, which obtains multiple first target detection algorithms in ILSVRV and COCO race in 2015), SSD (Single Shot multi box Detector, which is one of the target detection algorithms proposed by Wei Liu on ECCV and is one of the currently popular main detection frames) or YOLO (young only look, which has been developed to V4 version recently, which has been widely applied in 2016, which is basically that 2016 is to divide the input image into 7x7 grids, predict 2 frames per grid, and then removing the target window with low possibility according to the threshold, and finally removing the redundant window by using a frame combination mode to obtain a detection result), a target detection algorithm and the like. Therefore, through a conventional sample training mode and a conventional identification processing mode, the license plate frame can be identified from the original image, and the license plate frame image can be obtained through cutting according to the identification result. Further, the original image may be, but is not limited to, a vehicle surveillance video image.
And S20, determining that the license plate frame image is a new energy license plate image or a fuel license plate image according to the color pixel proportion in the license plate frame image.
In the step S20, considering that the specification of a license plate in China is relatively limited, the license plate of new energy is 8 green characters, and the license plate of fuel oil is 7 characters, wherein the size of the license plate before new energy is 480 × 140mm, and the size of the license plate before fuel oil is 440 × 140mm, in order to ensure that the subsequent license plate frame images of different types can be aligned by applying an appropriate size of the license plate, and the license plate characters can be cut by applying an appropriate standard cutting template, the type of the license plate frame image (that is, the license plate image of new energy or the license plate image of fuel oil) is determined according to the color pixel ratio in the license plate frame image. Specifically, the license plate frame image is determined to be a new energy license plate image or a fuel license plate image according to the color pixel proportion in the license plate frame image, and the method includes but is not limited to the following steps of S201-S203: s201, counting the proportion of green pixels in the license plate frame image; s202, judging whether the ratio of the green pixels exceeds a preset threshold value or not; s203, if yes, determining that the license plate frame image is a new energy license plate image, and otherwise, determining that the license plate frame image is a fuel license plate image. In addition, the preset threshold may be 38% for example.
And S30, aligning the license plate frame image based on a license plate key point detection algorithm and the license plate size corresponding to the determination result to obtain a license plate image to be cut aligned with a standard license plate image, wherein the standard license plate image has a corresponding relation with the determination result.
In step S30, the license plate key point detection algorithm may adopt a detection algorithm based on a Multi-task convolutional neural network (MTCNN) model, and achieve stretch alignment based on a conventional coordinate rotation transformation, for example, when the license plate frame image is a new energy license plate image, the license plate frame image is stretch aligned to have a standard size image of 480 × 140mm, and when the license plate frame image is a fuel license plate image, the license plate frame image is stretch aligned to have a standard size image of 440 × 140 mm.
S40, license plate character cutting processing is carried out on the license plate image to be cut by adopting the license plate character cutting method in the first aspect, and a plurality of license plate character individual images are obtained.
And S50, aiming at each license plate character individual image in the plurality of license plate character individual images, obtaining a corresponding character recognition result based on a character recognition algorithm.
In the step S50, the character recognition algorithm may employ a conventional and depth model-based recognition algorithm, such as a depth model employing a residual network ResNet or the like.
Therefore, based on the technical effects of the first aspect, after the license plate frame image is detected, the fuel license plate image or the new energy license plate image (with a larger green color ratio) is distinguished according to the color ratio of the license plate area, so that in the alignment and stretching link, the fuel license plate is stretched and aligned according to the ratio of the fuel license plate size 44:14 or the new energy license plate size 48:14, and the license plate character is cut by using a proper standard cutting template, so that the precision and the accuracy of the license plate character cutting result are further ensured, and the precision and the accuracy of the final license plate recognition result are improved.
As shown in fig. 9, a fourth aspect of this embodiment provides a virtual device for implementing the license plate recognition method according to the third aspect, including 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 a communication manner;
the license plate frame detection module is used for carrying out license plate frame identification processing on the original image based on a target detection algorithm to obtain a license plate frame image;
the license plate type determining module is used for determining the license plate frame image as a new energy license plate image or a fuel license plate image according to the color pixel proportion in the license plate frame image;
the license plate image alignment module is used for aligning the license plate frame image based on a license plate key point detection algorithm and the license plate size corresponding to the determination result to obtain a license plate image to be cut aligned with a standard license plate image, wherein the standard license plate image has a corresponding relation with the determination result;
the license plate character cutting module is used for performing license plate character cutting processing on the license plate image to be cut to obtain a plurality of license plate character individual images, and comprises an acquisition unit, a set determination unit, a sliding retrieval unit, a minimum value searching unit, a coordinate calculation unit and a cutting execution unit;
the license plate cutting device comprises an acquisition unit, a cutting unit and a cutting unit, wherein the acquisition unit is used for acquiring 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 standard cutting template comprises coordinates of a plurality of character cutting lines in the standard license plate image respectively, and the character cutting lines are required cutting lines for cutting all license plate characters in the standard license plate image;
the set determining unit is configured to determine a corresponding sliding position set for each template reduction coefficient of a plurality of template reduction coefficients, where the template reduction coefficient is a real number and a value range is (0, 1), each sliding position in the sliding position set is an integer, and the sliding position is a dynamic coordinate of a first character cutting line in the license plate character arrangement direction among the character cutting lines and in the standard license plate image in a process that the standard cutting template slides along the license plate character arrangement direction;
the sliding retrieval unit is respectively in communication connection with the acquisition unit and the set determination unit, and is used for performing 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 aiming at each template reduction coefficient, and calculating to obtain a projection gray level accumulation total value of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding position in the sliding retrieval process;
the minimum value searching unit is in communication connection with the sliding retrieval unit and is used for searching the minimum value in all the calculated projection gray scale accumulation total values;
the coordinate calculation unit is respectively in communication connection with the acquisition unit and the minimum value search unit, and is used for calculating and obtaining the coordinates of each character cutting line 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 for cutting license plate characters of the license plate image to be cut according to the coordinates of the character cutting lines in the license plate image to be cut to obtain a plurality of license plate character individual images;
and the character recognition module is used for obtaining a corresponding character recognition result for each license plate character individual image in the plurality of license plate character individual images based on a character recognition algorithm.
For the working process, working details and technical effects of the device provided in the fourth aspect of this embodiment, reference may be made to the license plate recognition method in the third aspect, which is not described herein again.
As shown in fig. 10, a fifth aspect of the present embodiment provides a computer device for executing the license plate character cutting method according to the first aspect or the license plate recognition method according to the third aspect, and the computer device includes a memory and a processor, which are communicatively connected, where the memory is used for storing a computer program, and the processor is used for reading the computer program and executing the license plate character cutting method according to the first aspect or the license plate recognition method according to the third aspect. For example, the Memory may include, but is not limited to, a Random-Access Memory (RAM), a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a First-in First-out (FIFO), and/or a First-in Last-out (FILO), and the like; the processor may be, but is not limited to, a microprocessor of the model number STM32F105 family. In addition, the computer device may also include, but is not limited to, a power module, a display screen, and other necessary components.
For the working process, working details, and technical effects of the computer device provided in the fifth aspect of this embodiment, reference may be made to the license plate character cutting method in the first aspect or the license plate recognition method in the third aspect, which is not described herein again.
A sixth aspect of the present invention provides a computer-readable storage medium storing instructions including the license plate character cutting method according to the first aspect or the license plate recognition method according to the third aspect, where the instructions are stored on the computer-readable storage medium, and when the instructions are executed on a computer, the license plate character cutting method according to the first aspect or the license plate recognition method according to the third aspect is performed. The computer-readable storage medium refers to a carrier for storing data, and may include, but is not limited to, a computer-readable storage medium such as a floppy disk, an optical disk, a hard disk, a flash Memory, a flash disk and/or a Memory Stick (Memory Stick), and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
The working process, working details and technical effects of the computer-readable storage medium provided in the sixth aspect of this embodiment may refer to the license plate character cutting method according to the first aspect or the license plate recognition method according to the third aspect, which are not described herein again.
A seventh aspect of the present embodiment provides a computer program product containing instructions, which when executed on a computer, cause the computer to execute the license plate character cutting method according to the first aspect or the license plate recognition method according to the third aspect. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable devices.
Finally, it should be noted that the present invention is not limited to the above alternative embodiments, and that various other forms of products can be obtained by anyone in light of the present invention. The above detailed description should not be taken as limiting the scope of the invention, which is defined in the claims, and which the description is intended to be interpreted accordingly.

Claims (10)

1. A license plate character cutting method is characterized by comprising the following steps:
acquiring 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, wherein the standard cutting template comprises coordinates of a plurality of character cutting lines in the standard license plate image respectively, and the plurality of character cutting lines are required cutting lines for cutting all license plate characters in the standard license plate image;
determining a corresponding sliding position set aiming at each template reduction coefficient in a plurality of template reduction coefficients, wherein the template reduction coefficients are real numbers and have a value range of (0, 1), each sliding position in the sliding position set is an integer, and the sliding position refers to a dynamic coordinate of a first character cutting line in the plurality of character cutting lines and in the arrangement direction of license plate characters in the standard license plate image in the process that the standard cutting template slides along the arrangement direction of the license plate characters;
for each template reduction coefficient, performing 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, and calculating to obtain a projection gray level accumulation total value of the plurality of character cutting lines when the first character cutting line is located at each corresponding sliding position in the sliding retrieval process;
finding out the minimum value from the total value of all the calculated projection gray levels;
calculating the coordinates of each character cutting line in 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;
and according to the coordinates of the character cutting lines in the license plate image to be cut, carrying out license plate character cutting on the license plate image to be cut to obtain a plurality of license plate character individual images.
2. The method of claim 1, wherein the standard cutting template uses a coordinate set { x } of the plurality of character cutting lines1,x2,…,xk,…,xKExpressing, wherein K expresses the total number of the character cutting lines, K is an integer and the value range is [1, K ]],xkThe number of the standard license plate images is an integer and represents the coordinates of the k-th character cutting lines which are sequentially arranged along the arrangement direction of the license plate characters in the standard license plate images;
calculating the coordinates of each character cutting line in 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, wherein the coordinates comprise:
and calculating the coordinates of each character cutting line in the plurality of character cutting lines in the license plate image to be cut according to the standard cutting template, the template reduction coefficient corresponding to the minimum value and the sliding position according to the following formula:
Figure FDA0003329256760000011
in the formula (I), the compound is shown in the specification,
Figure FDA0003329256760000012
representing the coordinates of the k-th character cutting line in the license plate image to be cut, IF () representing an integer function, epsilonminRepresents a template reduction coefficient, x 'corresponding to the minimum value'minIndicating the sliding position corresponding to the minimum value.
3. The method of claim 1, wherein the standard cutting template uses a coordinate set { x } of the plurality of character cutting lines1,x2,…,xk,…,xKExpressing, wherein K expresses the total number of the character cutting lines, K is an integer and the value range is [1, K ]],xkThe number of the standard license plate images is an integer and represents the coordinates of the k-th character cutting lines which are sequentially arranged along the arrangement direction of the license plate characters in the standard license plate images;
when the license plate character arrangement direction is consistent with the pixel coordinate axis direction, determining a corresponding sliding position set aiming at each template reduction coefficient in a plurality of template reduction coefficients, wherein the sliding position set comprises:
for each template reduction coefficient in a plurality of template reduction coefficients, determining a corresponding sliding position set according to the last pixel coordinate in the license plate image to be cut in the license plate character arrangement direction, wherein the sliding position set is { x'm1,x′m2,…,x′mn,…,x′mNIs represented by, m and n are respectively positive integers, x'mnIndicates that the condition IF (ε) is satisfiedm(x′mn+xK-x1) X and corresponding to the mth template reduction coefficient among the plurality of template reduction coefficients, N represents that the condition IF (epsilon) is satisfiedm(x′mn+xK-x1) Total number of integers less than or equal to X, IF () represents a rounding function, εmRepresents the mth template reduction coefficient, and X represents the last pixel coordinate.
4. The method of claim 1, wherein the standard cutting template uses a coordinate set { x } of the plurality of character cutting lines1,x2,…,xk,…,xKExpressing, wherein K expresses the total number of the character cutting lines, K is an integer and the value range is [1, K ]],xkThe number of the standard license plate images is an integer and represents the coordinates of the k-th character cutting lines which are sequentially arranged along the arrangement direction of the license plate characters in the standard license plate images;
calculating the total projection gray level accumulation value of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding positions in the sliding retrieval process, wherein the total projection gray level accumulation value comprises the following steps:
in the sliding retrieval process, calculating and obtaining the projection gray scale accumulation total value of the plurality of character cutting lines when the first character cutting line is positioned at each sliding position according to the following formula:
Figure FDA0003329256760000021
in the formula, SmnRepresenting the total value of the projection gray scale accumulation when the first character cutting line is located at the corresponding nth sliding window position for the mth template reduction coefficient in the plurality of template reduction coefficients, i is a positive integer, xmiCoordinates representing the ith character cut line corresponding to the mth template reduction coefficient, Gray (x)mi) The image of the license plate to be cut is shown at a coordinate xmiAt a pixel gray value accumulation result, IF () represents a rounding function, εmRepresents the m-th template reduction coefficient, x'mnRepresents an nth sliding position, x, corresponding to the mth template reduction coefficientiAnd the number is an integer and represents the coordinates of the ith character cutting line sequentially arranged along the arrangement direction of the license plate characters in the standard license plate image.
5. A license plate character cutting device is characterized by comprising an acquisition module, a set determination module, a sliding retrieval module, a minimum value searching module, a coordinate calculation module and a cutting execution module;
the system comprises an acquisition module, a standard license plate image acquisition module and a standard cutting template, wherein the acquisition module is used for acquiring a license plate image to be cut aligned with a standard license plate image and the standard cutting template is preset according to the standard license plate image, the standard cutting template comprises coordinates of a plurality of character cutting lines in the standard license plate image respectively, and the plurality of character cutting lines are required cutting lines for cutting all license plate characters in the standard license plate image;
the set determining module is configured to determine a corresponding sliding position set for each template reduction coefficient of the plurality of template reduction coefficients, where the template reduction coefficient is a real number and a value range is (0, 1), each sliding position in the sliding position set is an integer, and the sliding position is a dynamic coordinate of a first character cutting line in the plurality of character cutting lines and in the arrangement direction of the license plate characters in the standard license plate image in a process that the standard cutting template slides in the arrangement direction of the license plate characters;
the sliding retrieval module is respectively in communication connection with the acquisition module and the set determination module, and is used for performing 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 aiming at each template reduction coefficient, and calculating to obtain a projection gray level accumulation total value of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding position in the sliding retrieval process;
the minimum value searching module is in communication connection with the sliding retrieval module and is used for searching the minimum value in the total accumulated projection gray values obtained through calculation;
the coordinate calculation module is respectively in communication connection with the acquisition module and the minimum value search module, and is used for calculating and obtaining the coordinates of each character cutting line 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;
and the cutting execution module is used for cutting license plate characters of the license plate image to be cut according to the coordinates of the character cutting lines in the license plate image to be cut to obtain a plurality of license plate character individual images.
6. A license plate recognition method is characterized by comprising the following steps:
carrying out license plate frame identification processing on the original image based on a target detection algorithm to obtain a license plate frame image;
determining the license plate frame image as a new energy license plate image or a fuel license plate image according to the color pixel proportion in the license plate frame image;
aligning the license plate frame image based on a license plate key point detection algorithm and a license plate size corresponding to a determination result to obtain a license plate image to be cut aligned with a standard license plate image, wherein the standard license plate image has a corresponding relation with the determination result;
the license plate character cutting method according to any one of claims 1 to 4 is adopted to carry out license plate character cutting processing on the license plate image to be cut to obtain a plurality of license plate character individual images;
and aiming at each license plate character individual image in the plurality of license plate character individual images, obtaining a corresponding character recognition result based on a character recognition algorithm.
7. The license plate recognition method of claim 6, wherein determining the license plate frame image as a new energy license plate image or a fuel license plate image according to a color pixel ratio in the license plate frame image comprises:
counting the proportion of green pixels in the license plate frame image;
judging whether the ratio of the green pixels exceeds a preset threshold value or not;
if so, determining that the license plate frame image is a new energy license plate image, otherwise, determining that the license plate frame image is a fuel license plate image.
8. A license plate recognition device is characterized by 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 in communication connection;
the license plate frame detection module is used for carrying out license plate frame identification processing on the original image based on a target detection algorithm to obtain a license plate frame image;
the license plate type determining module is used for determining the license plate frame image as a new energy license plate image or a fuel license plate image according to the color pixel proportion in the license plate frame image;
the license plate image alignment module is used for aligning the license plate frame image based on a license plate key point detection algorithm and the license plate size corresponding to the determination result to obtain a license plate image to be cut aligned with a standard license plate image, wherein the standard license plate image has a corresponding relation with the determination result;
the license plate character cutting module is used for performing license plate character cutting processing on the license plate image to be cut to obtain a plurality of license plate character individual images, and comprises an acquisition unit, a set determination unit, a sliding retrieval unit, a minimum value searching unit, a coordinate calculation unit and a cutting execution unit;
the license plate cutting device comprises an acquisition unit, a cutting unit and a cutting unit, wherein the acquisition unit is used for acquiring 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 standard cutting template comprises coordinates of a plurality of character cutting lines in the standard license plate image respectively, and the character cutting lines are required cutting lines for cutting all license plate characters in the standard license plate image;
the set determining unit is configured to determine a corresponding sliding position set for each template reduction coefficient of a plurality of template reduction coefficients, where the template reduction coefficient is a real number and a value range is (0, 1), each sliding position in the sliding position set is an integer, and the sliding position is a dynamic coordinate of a first character cutting line in the license plate character arrangement direction among the character cutting lines and in the standard license plate image in a process that the standard cutting template slides along the license plate character arrangement direction;
the sliding retrieval unit is respectively in communication connection with the acquisition unit and the set determination unit, and is used for performing 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 aiming at each template reduction coefficient, and calculating to obtain a projection gray level accumulation total value of the plurality of character cutting lines when the first character cutting line is located at the corresponding sliding position in the sliding retrieval process;
the minimum value searching unit is in communication connection with the sliding retrieval unit and is used for searching the minimum value in all the calculated projection gray scale accumulation total values;
the coordinate calculation unit is respectively in communication connection with the acquisition unit and the minimum value search unit, and is used for calculating and obtaining the coordinates of each character cutting line 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 for cutting license plate characters of the license plate image to be cut according to the coordinates of the character cutting lines in the license plate image to be cut to obtain a plurality of license plate character individual images;
and the character recognition module is used for obtaining a corresponding character recognition result for each license plate character individual image in the plurality of license plate character individual images based on a character recognition algorithm.
9. A computer device, comprising a memory and a processor, wherein the memory is connected in communication, the memory is used for storing a computer program, and the processor is used for reading the computer program and executing the license plate character cutting method according to any one of claims 1 to 4 or the license plate recognition method according to any one of claims 6 to 7.
10. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed on a computer, perform the license plate character cutting method according to any one of claims 1 to 4 or the license plate recognition method according to any one of claims 6 to 7.
CN202111272859.4A 2021-10-29 2021-10-29 License plate character cutting method, license plate recognition method, device, equipment and storage medium Pending CN114005120A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111272859.4A CN114005120A (en) 2021-10-29 2021-10-29 License plate character cutting method, license plate recognition method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111272859.4A CN114005120A (en) 2021-10-29 2021-10-29 License plate character cutting method, license plate recognition method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114005120A true CN114005120A (en) 2022-02-01

Family

ID=79925221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111272859.4A Pending CN114005120A (en) 2021-10-29 2021-10-29 License plate character cutting method, license plate recognition method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114005120A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114445784A (en) * 2022-03-01 2022-05-06 武汉聚智惠仁信息技术有限公司 Method and system for acquiring CRRT screen parameters in real time
CN115131776A (en) * 2022-04-12 2022-09-30 公安部交通管理科学研究所 License plate image character classification and recognition method fusing new energy automobile features

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114445784A (en) * 2022-03-01 2022-05-06 武汉聚智惠仁信息技术有限公司 Method and system for acquiring CRRT screen parameters in real time
CN115131776A (en) * 2022-04-12 2022-09-30 公安部交通管理科学研究所 License plate image character classification and recognition method fusing new energy automobile features
CN115131776B (en) * 2022-04-12 2023-05-12 公安部交通管理科学研究所 License plate image character classification recognition method integrating new energy automobile features

Similar Documents

Publication Publication Date Title
CN110738207B (en) Character detection method for fusing character area edge information in character image
CN108038474B (en) Face detection method, convolutional neural network parameter training method, device and medium
CN108121986B (en) Object detection method and device, computer device and computer readable storage medium
CN110060237B (en) Fault detection method, device, equipment and system
CN112528878A (en) Method and device for detecting lane line, terminal device and readable storage medium
CN112418216B (en) Text detection method in complex natural scene image
CN111797829A (en) License plate detection method and device, electronic equipment and storage medium
CN114005120A (en) License plate character cutting method, license plate recognition method, device, equipment and storage medium
CN110443242B (en) Reading frame detection method, target recognition model training method and related device
CN110766708B (en) Image comparison method based on contour similarity
CN114581887B (en) Method, device, equipment and computer readable storage medium for detecting lane line
CN101727580A (en) Image processing apparatus, electronic medium, and image processing method
CN111382625A (en) Road sign identification method and device and electronic equipment
CN110599453A (en) Panel defect detection method and device based on image fusion and equipment terminal
CN112990331A (en) Image processing method, electronic device, and storage medium
CN111738295B (en) Image segmentation method and storage medium
CN110852327A (en) Image processing method, image processing device, electronic equipment and storage medium
CN112966687B (en) Image segmentation model training method and device and communication equipment
CN113449702A (en) Target detection method and device for remote sensing image, storage medium and electronic equipment
CN116229406B (en) Lane line detection method, system, electronic equipment and storage medium
CN112634294A (en) Method for measuring boundary performance of semantic segmentation network
CN117011819A (en) Lane line detection method, device and equipment based on feature guidance attention
CN116994034A (en) Small target detection algorithm based on feature pyramid
CN115713750A (en) Lane line detection method and device, electronic equipment and storage medium
CN115345859A (en) Intelligent detection method, device and equipment for tunnel leakage water image and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination