CN114882484A - License plate positioning method and device, electronic equipment and computer readable storage medium - Google Patents

License plate positioning method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114882484A
CN114882484A CN202210434211.0A CN202210434211A CN114882484A CN 114882484 A CN114882484 A CN 114882484A CN 202210434211 A CN202210434211 A CN 202210434211A CN 114882484 A CN114882484 A CN 114882484A
Authority
CN
China
Prior art keywords
license plate
image
initial
plate region
initial license
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
CN202210434211.0A
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.)
Jiangsu Zejing Automobile Electronic Co ltd
Original Assignee
Jiangsu Zejing Automobile Electronic 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 Jiangsu Zejing Automobile Electronic Co ltd filed Critical Jiangsu Zejing Automobile Electronic Co ltd
Priority to CN202210434211.0A priority Critical patent/CN114882484A/en
Publication of CN114882484A publication Critical patent/CN114882484A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/02Affine transformations

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Character Input (AREA)

Abstract

The embodiment of the application discloses a license plate positioning method, a license plate positioning device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: acquiring an image to be processed, wherein the image to be processed comprises a license plate area; carrying out image preprocessing on an image to be processed to obtain a binary image, wherein the binary image comprises an initial license plate area; then, the inclined initial license plate area can be subjected to inclination detection and correction; and then, vertically projecting the initial license plate area and horizontally projecting the initial license plate area to determine the left, right, upper and lower boundaries of the license plate area. Therefore, the method and the device have the advantages that the inclined license plate region is subjected to secondary affine transformation to reduce inclination and overlapping, the binarized gray level image is subjected to vertical projection and horizontal projection, the false positioning phenomenon caused by edge fracture in the license plate positioning stage is reduced, the character characteristics of the license plate region in the automobile image are fully utilized, and the license plate positioning accuracy is improved.

Description

License plate positioning method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of license plate recognition technologies, and in particular, to a license plate positioning method and apparatus, an electronic device, and a computer-readable storage medium.
Background
A License Plate Recognition system (VLPR) is an application of computer image Recognition technology in Vehicle License Plate Recognition, which can detect vehicles on a monitored road surface and automatically extract Vehicle License Plate information (including chinese characters, english letters, arabic numerals and License Plate colors) for processing, and automatically recognize License Plate numbers and License Plate colors by using dynamic videos or static images of the vehicles.
Generally, license plate recognition comprises a positioning stage and a recognition stage, namely, a license plate region is positioned in an image containing a license plate, and then the positioned license plate region is recognized to obtain a license plate recognition result. The license plate positioning is an important part for automatically identifying the license plate, and the accuracy of the license plate positioning of the automobile greatly restricts the realization of a license plate identification system. Only if the license plate with accurate positioning is obtained, the character recognition can be correctly carried out on the license plate.
At present, false positioning can easily occur in the license plate positioning stage, and further the license plate positioning is inaccurate.
Disclosure of Invention
The embodiment of the application provides a license plate positioning method and device, electronic equipment and a computer readable storage medium, and can solve the problem that the license plate positioning accuracy is low due to a virtual positioning phenomenon in the prior art.
In a first aspect, an embodiment of the present application provides a license plate positioning method, including:
acquiring an image to be processed, wherein the image to be processed comprises a license plate area;
carrying out image preprocessing on an image to be processed to obtain a binary image, wherein the binary image comprises an initial license plate area;
and performing vertical projection on the initial license plate area and then performing horizontal projection to determine a target license plate area.
Therefore, the license plate positioning method and device have the advantages that vertical projection is firstly carried out, then horizontal projection is carried out, false positioning caused by edge fracture in the license plate positioning stage is reduced, and license plate positioning accuracy is improved.
In some possible implementations of the first aspect, before vertically projecting the initial license plate region and then horizontally projecting the initial license plate region to determine the target license plate region, the method further includes:
detecting whether the initial license plate area is inclined;
if the initial license plate region is inclined, carrying out affine transformation on the initial license plate region to obtain the initial license plate region after the first affine transformation;
and carrying out affine transformation on the initial license plate region after the first affine transformation to obtain the initial license plate region after the second affine transformation.
In the implementation mode, the license plate is corrected through the first affine transformation, the overlapping of the character rectangular areas is reduced through the second affine transformation, and then the subsequent license plate positioning accuracy is higher.
In some possible implementations of the first aspect, detecting whether the initial license plate region is tilted includes:
detecting the inclination angle of a straight line enclosing an initial license plate region, and judging whether the initial license plate region is a standard rectangle or not according to the inclination angle of the straight line;
if the initial license plate area is a standard rectangle, determining that the initial license plate area is not inclined;
and if the initial license plate area is not the standard rectangle, determining that the initial license plate area inclines.
In some possible implementation manners of the first aspect, performing image preprocessing on an image to be processed to obtain a binarized image includes:
performing preset operation on an image to be processed to obtain a binary image, wherein the preset operation comprises graying, filtering, binarization and closed operation;
and determining an initial license plate region in the binary image through edge detection.
In some possible implementations of the first aspect, the vertically projecting an initial license plate region and then horizontally projecting the initial license plate region to determine a target license plate region includes:
performing first-order difference operation in the vertical direction on the initial license plate area to obtain a vertical difference image;
accumulating pixels of each column in the vertical differential image along the vertical direction to obtain a first accumulated value of each column, and generating a vertical projection image;
when the first accumulated value is larger than a first threshold value, determining an area corresponding to the first accumulated value as a target license plate area;
performing first-order difference operation in the horizontal direction on the vertical projection drawing to obtain a horizontal difference image;
accumulating pixels of each line in the horizontal differential image along the horizontal direction to obtain a second accumulated value of each line;
and when the second accumulated value is larger than a second threshold value, determining the area corresponding to the second accumulated value as a target license plate area.
In some possible implementations of the first aspect, after the initial license plate region is vertically projected and then horizontally projected to determine the target license plate region, the method further includes:
and performing character segmentation and character recognition on the target license plate area to obtain a license plate recognition result.
In a second aspect, an embodiment of the present application provides a license plate positioning device, including:
the image acquisition module is used for acquiring an image to be processed, and the image to be processed comprises a license plate area;
the system comprises a preprocessing module, a storage module and a processing module, wherein the preprocessing module is used for preprocessing an image to be processed to obtain a binary image, and the binary image comprises an initial license plate area;
and the projection positioning module is used for performing vertical projection on the initial license plate area and then performing horizontal projection on the initial license plate area so as to determine a target license plate area.
In some possible implementations of the second aspect, the method further includes:
the inclination detection module is used for detecting whether the initial license plate area is inclined or not;
the primary affine transformation module is used for carrying out affine transformation on the initial license plate area if the initial license plate area inclines to obtain the initial license plate area after the primary affine transformation;
and the secondary affine transformation module is used for carrying out affine transformation on the initial license plate region after the first affine transformation to obtain the initial license plate region after the second affine transformation.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method according to any one of the first aspect is implemented.
In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program is executed by a processor to implement the method according to any one of the above first aspects.
In a fifth aspect, embodiments of the present application provide a computer program product, which, when run on an electronic device, causes the electronic device to perform the method of any one of the above first aspects.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic diagram of a license plate recognition system of a parking lot according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a license plate location method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a feature map after vertical projection according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a feature map after horizontal projection according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a feature map projected vertically and then horizontally according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a feature map projected horizontally and then vertically according to an embodiment of the present disclosure;
fig. 7 is a schematic block diagram of another flow chart of a license plate location method according to an embodiment of the present disclosure;
fig. 8 is a schematic block diagram of a license plate positioning device according to an embodiment of the present disclosure;
fig. 9 is a block diagram schematically illustrating a structure of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The following first presents an exemplary description of an application scenario and a system architecture that may be involved in embodiments of the present application.
Referring to fig. 1, a schematic diagram of a license plate recognition system of a parking lot according to an embodiment of the present disclosure is shown.
The image acquisition equipment is used for capturing images containing license plates and sending the images to the processing equipment. The processing equipment is used for processing the image through a license plate positioning and recognition algorithm, positioning a license plate area in the image, and outputting a license plate recognition result after recognizing characters in the license plate area.
In fig. 1, the image capturing device is, for example, a CCD industrial camera, and the processing device is, for example, a computer at the office end. At the moment, when the vehicle is detected to enter the video acquisition area, the video camera is triggered to automatically capture the image of the vehicle, and the image is transmitted to the computer at the office end through the network. The computer processes the image by using a license plate positioning and identifying algorithm, identifies the license plate number, and searches the related information of the license plate number from the database so as to carry out operations such as parking fee collection, vehicle management and the like.
In fig. 1, a ground induction coil is further arranged at a position of a deceleration strip 4-10cm in front of a barrier gate of a parking lot, and when a vehicle passes through the deceleration strip, the ground induction coil is triggered to further trigger a camera to shoot an image containing a license plate. The area 4-10cm in front of the barrier is a video identification area.
The license plate positioning method provided by the embodiment of the application can be applied to a parking lot scene shown in fig. 1 and can also be applied to other scenes, such as a road traffic monitoring scene and the like.
After the system architecture and the scenes that may be related to the embodiments of the present application are introduced, the license plate location method provided by the embodiments of the present application is described in detail below.
Referring to fig. 2, a schematic flow chart of a license plate location method provided in the embodiment of the present application is shown, where the method may be applied to an electronic device, and the electronic device may be, for example, an office computer in the scenario shown in fig. 1. The method may comprise the steps of:
step S201, an image to be processed is obtained, and the image to be processed comprises a license plate area.
Taking the scene shown in fig. 1 as an example, when a vehicle passes through, the camera captures an image including a license plate region, and transmits the image to the electronic device, and the electronic device can acquire the image to be processed.
Step S202, image preprocessing is carried out on the image to be processed to obtain a binary image, and the binary image comprises an initial license plate area.
The preprocessing may include, but is not limited to, graying, binarization, edge detection, filtering, and the like. Here, graying refers to converting an RGB image having brightness and color into a grayscale image. The gray image is a monochrome image composed of 256 gray levels, and it is always desirable to reduce the interference of the background region as much as possible and to preserve or enhance the degree of pigmentation of the target region for the target search. And binarization of the image can divide the gray level of the pixel into two levels, ideally the pixel of the target area is taken as 1 and the pixel of the background area is taken as 0. The binarization means that the value of a pixel point on the image is set to be 0 or 1 so as to enable the image to show obvious black and white effect; the binary image is a gray image with only black and white gray scales and no other levels, and can highlight the outline of the target. Under a normal condition, whether the value of each pixel point on the gray-scale image is larger than a preset threshold value or not is judged, when the pixel value is larger than the preset threshold value, the value of the pixel point is set to be 0 or 1, and correspondingly, when the pixel value is smaller than the preset threshold value, the value of the pixel point is set to be 1 or 0.
The edge detection is used for rough positioning to roughly position an initial license plate region in the image. The filtering is used for suppressing the image noise on the premise of keeping the detail characteristics of the image as much as possible.
In some embodiments, a preset operation may be performed on the image to be processed first to obtain a binarized image. The preset operation comprises graying, filtering, binarization and closing operation. The closed operation refers to an operation of expansion and corrosion, and is used for removing certain black points and angles in the image to enable the image area after binarization to be smoother. And then, determining an initial license plate region in the binary image through edge detection.
Step S203, the initial license plate area is firstly vertically projected and then horizontally projected so as to determine a target license plate area.
After the initial license plate area is determined, according to the character element density and the violent gray level jump characteristic in the license plate and the geometric characteristics of the license plate, the initial license plate area is vertically projected and then horizontally projected to perform accurate license plate positioning so as to determine the left, right, upper and lower boundaries of the license plate.
In general, vertical projection is to scan a binary license plate image row by row, count the number of gray scale changes between adjacent pixels in each row from left to right, and determine the left and right boundaries of the license plate by using the black and white jump rules of the pixels in each row. When the change times of a certain column are greater than a critical value for the first time, the column is assumed to be the initial column of the license plate to be searched; and then, continuing to search backwards, and when the change times of a certain column is smaller than a critical value for the first time, assuming that the column is the last column of the license plate to be searched, so that the left and right boundaries of the target license plate area can be determined.
Horizontal projection means that the binary license plate image is scanned line by line, the number of gray level changes between adjacent pixels of each line is counted from top to bottom, and the black and white jump rules of the pixels of each line are utilized to determine the upper and lower boundaries of the license plate. When the change times of a certain row are greater than a critical value for the first time, the highest row of the license plate to be searched for in the row is assumed; and then continuing searching downwards, and assuming that the line is the bottommost line of the license plate to be searched when the change times of the line is smaller than a critical value for the first time, so that the upper and lower boundaries of the target license plate area can be determined.
Different from the existing license plate positioning mode, the embodiment of the application performs vertical projection on the binary image to generate a vertical projection image, and then performs horizontal projection on the vertical projection image.
It should be noted that, after the image preprocessing operation, the license plate region has relatively concentrated and regular texture features. The projection method mainly adopts the analysis of the projection value of the image to determine the position of the license plate, and the projection value refers to the number of 0 or 1 in each row or each column of the image to be processed after binarization.
The height and width of the license plate in China are 1400mmx1400mm, except the temporary entry license plate and part of large license plates, and the license plate number has the characteristics of equal height and equal width, so that the horizontal projection and the vertical projection of the license plate have obvious rules. For the value of the gray scale area in the vertical direction, the license plate area is characterized by wave crests, wave troughs and wave crests after being subjected to binarization processing. For example, as shown in the schematic diagram of the post-perpendicular projection feature map shown in FIG. 3; for the value of the gray scale area in the horizontal direction, the feature of the license plate area after the binarization processing is jump, and the jump is expressed very frequently and obviously. For example, as shown in the schematic diagram of the horizontal projected feature diagram shown in fig. 4, each occurrence of a peak can be regarded as one jump, and the license plate boundary is determined according to the number of black and white jumps of the license plate region. In a specific application, if a certain row passes through a license plate region, the change from white to black or black to white in the row is recorded as a jump. The edge of each character in the license plate and the background of the license plate can jump at least twice. Since the license plate generally has 7 characters, the minimum number of jumping points can be 14 or 16, and when the jumping frequency of a certain row is greater than 14 or 16, the row is considered to be the position of the license plate region. The positioning of the license plate region can be carried out and realized according to the characteristics.
The principle of horizontal projection and vertical projection is exemplarily described below.
Horizontal projection: first, a first order difference operation in the horizontal direction is performed on the binary image to obtain a horizontal difference image. At this time, the binary image is scanned line by line from top to bottom, and the scanning lines can be represented as f (i), i ═ 1,2,3, ·, N; let d (i) ═ f (i) — f (i-1). Then, pixels in the horizontal differential image are accumulated in the horizontal direction, that is, pixel values of each row are accumulated to obtain a horizontal projection view and an accumulated value S. At this time, the number of transitions (i.e., the accumulated value) per row is
Figure BDA0003612325230000091
It will be appreciated that horizontal projection is a progressive scan of the image from top to bottom, adding the pixel values of each row to obtain a one-dimensional function S. This allows the two-dimensional function to be converted to a one-dimensional function, the resulting one-dimensional function S being the pixel statistics for each line of the image.
The vertical projection and the horizontal projection have different directions, but the principle is the same, namely the vertical projection is to perform a difference operation in the vertical direction on the image, and then to accumulate the pixels of each column to generate a feature map after vertical projection.
Compared with the horizontal projection and the vertical projection, the vertical projection and the horizontal projection can reduce the false positioning phenomenon caused by edge fracture, and the positioning accuracy is higher.
Specifically, there are large blank areas between the Chinese characters and the numbers in the license plate, for example, the blank area between shan K8887X, "shan K" and "8887X" is large. If horizontal projection is performed before vertical projection, the horizontal projection is easy to be positioned only to numbers, namely only to '8887X', but not to 'shan K', some characters are omitted, and further a false positioning phenomenon is generated. The false positioning phenomenon can cause low accuracy of subsequent license plate identification.
In the mode of first vertical projection and then horizontal projection, even if the blank area between the license plate characters is large, the vertical projection can also position each character, so that the characters are rarely missed, and the phenomenon of false positioning is reduced.
Illustratively, comparing the schematic diagram of the feature map projected vertically and then horizontally shown in fig. 5 with the schematic diagram of the feature map projected horizontally and then vertically shown in fig. 6, it can be seen that the feature maps obtained by two projection sequences are different, and the features in the feature map obtained by horizontal projection and then vertical projection (i.e. fig. 6) are obviously reduced.
In some embodiments, a first-order difference operation in the vertical direction may be performed on the initial license plate region to obtain a vertical difference image, where the difference image is an image produced by assigning different values to pixels with changed gray scale and pixels with unchanged gray scale through threshold division; and accumulating the pixels of each column in the vertical differential image along the vertical direction to obtain a vertical projection image and a first accumulated value of each column. Then, the pixels whose accumulated values are larger than the threshold value are determined as belonging to the specific object region. In the embodiment of the application, when the first accumulated value is larger than a first threshold value, determining a region corresponding to the first accumulated value as a target license plate region; and when the first accumulated value is 0 or less than a first threshold value, the corresponding region is considered as a non-license plate region, and the left and right boundaries of the license plate can be determined by utilizing the characteristic.
After the feature map of the vertical projection is obtained, horizontal projection is carried out based on the feature map of the vertical projection to obtain a final projection feature map, namely, first-order difference operation in the horizontal direction is carried out on the vertical projection map to obtain a horizontal difference image; and accumulating the pixels of each line in the horizontal differential image along the horizontal direction to obtain a second accumulated value of each line and a final projection characteristic diagram. And when the second accumulated value is greater than a second threshold value, determining the area corresponding to the second accumulated value as a target license plate area, otherwise, when the second accumulated value is 0 or less than the second threshold value, determining the area corresponding to the second accumulated value as a non-license plate area. The upper and lower boundaries of the license plate can be determined by utilizing the characteristic.
That is, after horizontal projection or vertical projection, the one-dimensional function S is obtained by accumulating pixels. When the value of S is larger, the license plate area is considered to correspond to the S; and when the value of S is smaller or 0, the S is considered to correspond to the non-license plate area. Further, when an image of the S value of the function is drawn, it can be found that when the S value is not 0, a pixel point exists in a corresponding vertical or horizontal direction of the point. And when the S value is 0, no pixel point exists in the corresponding vertical or horizontal direction.
It can be understood that the initial license plate region refers to a strip-shaped region determined through rough positioning, and the target license plate region refers to the position of each character in the strip-shaped region. There are usually multiple characters in one license plate, so there are multiple target license plate regions.
Therefore, the license plate positioning method and device have the advantages that vertical projection is firstly carried out, then horizontal projection is carried out, false positioning caused by edge fracture in the license plate positioning stage is reduced, and license plate positioning accuracy is improved.
In some embodiments, the license plate in the image to be processed may be tilted to some extent due to the shooting conditions. In order to ensure the accuracy of subsequent license plate recognition, license plate correction is required. In the prior art, license plate correction is usually performed only once through affine transformation. However, after one affine transformation, a phenomenon that character rectangular regions overlap often occurs, and the more the character rectangular regions overlap, the greater the challenge for subsequent character recognition is.
In the embodiment of the application, in order to reduce the character overlapping area, after affine transformation is performed once, affine transformation is performed again, so that the subsequent license plate positioning and recognition effects are further improved.
Referring to fig. 7, there is shown another schematic flow chart of a license plate location method according to an embodiment of the present disclosure, where the method may be applied to an electronic device, and the method may include the following steps:
step S701, an image to be processed is obtained, and the image to be processed comprises a license plate area.
Step S702, image preprocessing is carried out on the image to be processed to obtain a binary image, and the binary image comprises an initial license plate area.
Step S703, detecting whether the initial license plate area is inclined; if the initial license plate region is tilted, the process proceeds to step S704, and if the initial license plate region is not tilted, the process proceeds to step S705.
It can be understood that, besides the positioning method itself, the failure of positioning the general license plate region image is mainly caused by the large inclination angle of the photographed license plate image. In the embodiment of the application, the inclination detection of the running license plate is carried out before projection. If the license plate inclines, performing affine transformation twice continuously, and then entering the step S705; if the license plate is not inclined, the license plate correction is not needed, and the process directly proceeds to step S705.
Specifically, the process of detecting whether the initial license plate region is inclined includes: detecting the inclination angle of a straight line enclosing an initial license plate region, and judging whether the initial license plate region is a standard rectangle or not according to the inclination angle of the straight line; if the initial license plate area is a standard rectangle, determining that the initial license plate area is not inclined; and if the initial license plate area is not the standard rectangle, determining that the initial license plate area inclines. In some embodiments, the slope detection of the above process may be performed by hough transform, and the principle of hough transform is not described herein.
Step S704, carrying out affine transformation on the initial license plate area to obtain an initial license plate area after the first affine transformation; and carrying out affine transformation on the initial license plate region after the first affine transformation to obtain the initial license plate region after the second affine transformation.
It is noted that the first affine transformation is used for license plate correction and the second affine transformation is used for reducing character overlap regions. Compared with the method and the device for carrying out affine transformation only once, the method and the device for carrying out affine transformation continuously twice improve the effects of subsequent license plate positioning and license plate identification.
Step S705, the initial license plate area is firstly vertically projected and then horizontally projected so as to determine the target license plate area.
Optionally, the method may further include step S706 of performing character segmentation and character recognition on the target license plate region to obtain a license plate recognition result.
The same points in fig. 7 and fig. 2 can be referred to above and will not be described herein.
It should be noted that the target license plate region is used to represent the position of each character in the license plate. After the license plate is positioned, the character segmentation and the character recognition are carried out on the target license plate area, and then the license plate number can be recognized.
Therefore, the license plate is corrected through the first affine transformation, the overlapping of the character rectangular areas is reduced through the second affine transformation, and the subsequent license plate positioning accuracy is higher. And the license plate is positioned by first vertical projection and then horizontal projection, so that the phenomenon of virtual positioning is reduced, and the license plate positioning accuracy is further improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 8 shows a structural block diagram of the license plate location device provided in the embodiment of the present application, which corresponds to the license plate location method described in the foregoing embodiment, and only shows portions related to the embodiment of the present application for convenience of description.
Referring to fig. 8, the apparatus includes:
the image acquisition module 81 is used for acquiring an image to be processed, wherein the image to be processed comprises a license plate area;
the preprocessing module 82 is used for preprocessing an image to be processed to obtain a binary image, wherein the binary image comprises an initial license plate area;
and the projection positioning module 83 is configured to perform vertical projection and then horizontal projection on the initial license plate region to determine a target license plate region.
In some possible implementations, the apparatus further includes:
the inclination detection module is used for detecting whether the initial license plate area is inclined or not;
the primary affine transformation module is used for carrying out affine transformation on the initial license plate area if the initial license plate area inclines to obtain the initial license plate area after the primary affine transformation;
and the secondary affine transformation module is used for carrying out affine transformation on the initial license plate region after the first affine transformation to obtain the initial license plate region after the second affine transformation.
In some possible implementations, the tilt detection module is specifically configured to:
detecting the inclination angle of a straight line enclosing an initial license plate region, and judging whether the initial license plate region is a standard rectangle or not according to the inclination angle of the straight line;
if the initial license plate area is a standard rectangle, determining that the initial license plate area is not inclined;
and if the initial license plate area is not the standard rectangle, determining that the initial license plate area inclines.
In some possible implementations, the preprocessing module is specifically configured to: performing preset operation on an image to be processed to obtain a binary image, wherein the preset operation comprises graying, filtering, binarization and closed operation; and determining an initial license plate region in the binary image through edge detection.
In some possible implementations, the projection positioning module is specifically configured to:
performing first-order difference operation in the vertical direction on the initial license plate area to obtain a vertical difference image;
accumulating pixels of each column in the vertical differential image along the vertical direction to obtain a first accumulated value of each column, and generating a vertical projection image;
when the first accumulated value is larger than a first threshold value, determining a region corresponding to the first accumulated value as a target license plate region;
performing first-order difference operation in the horizontal direction on the vertical projection drawing to obtain a horizontal difference image;
accumulating pixels of each line in the horizontal differential image along the horizontal direction to obtain a second accumulated value of each line;
and when the second accumulated value is larger than a second threshold value, determining the area corresponding to the second accumulated value as a target license plate area.
In some possible implementation manners, the device further comprises a license plate recognition module, which is used for performing character segmentation and character recognition on the target license plate region to obtain a license plate recognition result. For example, the license plate recognition result of the embodiment of the application may be displayed in a UI operation interface of the programming. The left area of the UI operation interface displays Identification information (Identification results), and the Identification information may include a picture name, read entry time, a license plate number, a license plate color, and information of a location to which the license plate belongs. The right side of the UI operation interface can be divided into 3 areas, and the top area comprises functions of minimizing, maximizing and closing the window; the middle area displays an Original picture (Original _ image) of the read vehicle; the bottom area includes a License plate display area (License plate area), picture reading (Open), and Export data (Export data). And displaying and storing various types of information of the license plate according to the automatic identification result.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the method embodiment in the embodiment of the present application, which may be referred to in the method embodiment section specifically, and are not described herein again.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 9, the electronic apparatus 9 of this embodiment includes: at least one processor 90 (only one shown in fig. 9), a memory 91, and a computer program 92 stored in the memory 91 and executable on the at least one processor 90, the processor 90 implementing the steps in any of the various object tracking method embodiments described above when executing the computer program 92.
The electronic device 9 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The electronic device may include, but is not limited to, a processor 90, a memory 91. Those skilled in the art will appreciate that fig. 9 is merely an example of the electronic device 9, and does not constitute a limitation of the electronic device 9, and may include more or less components than those shown, or combine some of the components, or different components, such as an input-output device, a network access device, etc.
The Processor 90 may be a Central Processing Unit (CPU), and the Processor 90 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 91 may in some embodiments be an internal storage unit of the electronic device 9, such as a hard disk or a memory of the electronic device 9. The memory 91 may also be an external storage device of the electronic device 9 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 9. Further, the memory 91 may also include both an internal storage unit and an external storage device of the electronic device 9. The memory 91 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 91 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
An embodiment of the present application further provides an electronic device, including: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on an electronic device, enables the electronic device to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus, electronic device and method may be implemented in other ways. For example, the above-described apparatus/electronic device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A license plate positioning method is characterized by comprising the following steps:
acquiring an image to be processed, wherein the image to be processed comprises a license plate area;
carrying out image preprocessing on the image to be processed to obtain a binary image, wherein the binary image comprises an initial license plate area;
and performing vertical projection on the initial license plate area and then performing horizontal projection to determine a target license plate area.
2. The method of claim 1, wherein prior to vertically projecting the initial license plate region and then horizontally projecting the initial license plate region to determine a target license plate region, further comprising:
detecting whether the initial license plate area is inclined;
if the initial license plate region is inclined, carrying out affine transformation on the initial license plate region to obtain an initial license plate region after the first affine transformation;
and carrying out affine transformation on the initial license plate region after the first affine transformation to obtain the initial license plate region after the second affine transformation.
3. The method of claim 2, wherein detecting whether the initial license plate region is tilted comprises:
detecting the inclination angle of a straight line enclosing the initial license plate region, and judging whether the initial license plate region is a standard rectangle or not according to the inclination angle of the straight line;
if the initial license plate region is the standard rectangle, determining that the initial license plate region is not inclined;
and if the initial license plate region is not the standard rectangle, determining that the initial license plate region is inclined.
4. The method as claimed in claim 1, wherein the image preprocessing is performed on the image to be processed to obtain a binarized image, comprising:
performing preset operation on the image to be processed to obtain the binary image, wherein the preset operation comprises graying, filtering, binaryzation and closing operation;
and determining the initial license plate region in the binary image through edge detection.
5. The method of claim 1, wherein vertically projecting the initial license plate region followed by horizontally projecting the initial license plate region to determine a target license plate region comprises:
performing first-order difference operation in the vertical direction on the initial license plate region to obtain a vertical difference image;
accumulating pixels of each column in the vertical differential image along the vertical direction to obtain a first accumulated value of each column, and generating a vertical projection image;
when the first accumulated value is larger than a first threshold value, determining a region corresponding to the first accumulated value as the target license plate region;
performing first-order difference operation in the horizontal direction on the vertical projection drawing to obtain a horizontal difference image;
accumulating pixels of each line in the horizontal differential image along the horizontal direction to obtain a second accumulated value of each line;
and when the second accumulated value is larger than a second threshold value, determining a region corresponding to the second accumulated value as the target license plate region.
6. The method of any one of claims 1 to 5, wherein after vertically projecting the initial license plate region and then horizontally projecting to determine a target license plate region, the method further comprises:
and performing character segmentation and character recognition on the target license plate area to obtain a license plate recognition result.
7. A license plate positioning device, comprising:
the image acquisition module is used for acquiring an image to be processed, and the image to be processed comprises a license plate area;
the preprocessing module is used for preprocessing the image to be processed to obtain a binary image, and the binary image comprises an initial license plate area;
and the projection positioning module is used for performing vertical projection on the initial license plate area and then performing horizontal projection to determine a target license plate area.
8. The apparatus of claim 7, further comprising:
the inclination detection module is used for detecting whether the initial license plate area is inclined or not;
the primary affine transformation module is used for carrying out affine transformation on the initial license plate area if the initial license plate area inclines to obtain an initial license plate area after the primary affine transformation;
and the secondary affine transformation module is used for carrying out affine transformation on the initial license plate region after the first affine transformation to obtain the initial license plate region after the second affine transformation.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
CN202210434211.0A 2022-04-24 2022-04-24 License plate positioning method and device, electronic equipment and computer readable storage medium Pending CN114882484A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210434211.0A CN114882484A (en) 2022-04-24 2022-04-24 License plate positioning method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210434211.0A CN114882484A (en) 2022-04-24 2022-04-24 License plate positioning method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114882484A true CN114882484A (en) 2022-08-09

Family

ID=82672626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210434211.0A Pending CN114882484A (en) 2022-04-24 2022-04-24 License plate positioning method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114882484A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739566A (en) * 2009-12-04 2010-06-16 重庆大学 Self-adapting projection template method-based automobile plate positioning method
CN106778731A (en) * 2017-01-13 2017-05-31 深圳市华尊科技股份有限公司 A kind of license plate locating method and terminal
CN107992785A (en) * 2016-10-26 2018-05-04 北京君正集成电路股份有限公司 The recognition methods of fuzzy license plate and device
CN108830274A (en) * 2018-05-03 2018-11-16 南京邮电大学 Characters on license plate detects positioning and recognition methods automatically under a kind of complex background environment
CN111027535A (en) * 2018-10-09 2020-04-17 中控智慧科技股份有限公司 License plate recognition method and related equipment
CN114387591A (en) * 2022-01-12 2022-04-22 平安普惠企业管理有限公司 License plate recognition method, system, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739566A (en) * 2009-12-04 2010-06-16 重庆大学 Self-adapting projection template method-based automobile plate positioning method
CN107992785A (en) * 2016-10-26 2018-05-04 北京君正集成电路股份有限公司 The recognition methods of fuzzy license plate and device
CN106778731A (en) * 2017-01-13 2017-05-31 深圳市华尊科技股份有限公司 A kind of license plate locating method and terminal
CN108830274A (en) * 2018-05-03 2018-11-16 南京邮电大学 Characters on license plate detects positioning and recognition methods automatically under a kind of complex background environment
CN111027535A (en) * 2018-10-09 2020-04-17 中控智慧科技股份有限公司 License plate recognition method and related equipment
CN114387591A (en) * 2022-01-12 2022-04-22 平安普惠企业管理有限公司 License plate recognition method, system, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111382704B (en) Vehicle line pressing violation judging method and device based on deep learning and storage medium
US8611662B2 (en) Text detection using multi-layer connected components with histograms
US6754369B1 (en) License plate reading apparatus and method
US7787705B2 (en) Video text processing apparatus
US9076056B2 (en) Text detection in natural images
US9311533B2 (en) Device and method for detecting the presence of a logo in a picture
US9251430B2 (en) Apparatus, method, and program for character recognition using minimum intensity curve of image data
CN111461131B (en) Identification method, device, equipment and storage medium for ID card number information
CN110969164A (en) Low-illumination imaging license plate recognition method and device based on deep learning end-to-end
CN112927283A (en) Distance measuring method and device, storage medium and electronic equipment
CN116249015A (en) Camera shielding detection method and device, camera equipment and storage medium
KR101282663B1 (en) Apparatus for detecting image region of vehicle number plate and method thereof
JP4224328B2 (en) Car number recognition device
US20210182591A1 (en) Image identification apparatus, image identification method, and non-transitory computer-readable storage medium for storing image identification program
CN110059695B (en) Character segmentation method based on vertical projection and terminal
CN116863458A (en) License plate recognition method, device, system and storage medium
CN114882484A (en) License plate positioning method and device, electronic equipment and computer readable storage medium
CN112040087B (en) Blank image recognition method, device, equipment and storage medium
JP2001307017A (en) Character plate recognizing device
Jianyong et al. An edge-based approach for video text extraction
Tian et al. A new algorithm for license plate localization in open environment using color pair and stroke width features of character
Tam et al. Quadrilateral Signboard Detection and Text Extraction.
Anthimopoulos et al. Detecting text in video frames
Wenzel et al. Additional Traffic Sign Detection--A Comparative Study
CN111126387A (en) License plate recognition method, device and system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220809

RJ01 Rejection of invention patent application after publication