WO2018130216A1 - Method and device for recognizing characters on license plate - Google Patents

Method and device for recognizing characters on license plate Download PDF

Info

Publication number
WO2018130216A1
WO2018130216A1 PCT/CN2018/072593 CN2018072593W WO2018130216A1 WO 2018130216 A1 WO2018130216 A1 WO 2018130216A1 CN 2018072593 W CN2018072593 W CN 2018072593W WO 2018130216 A1 WO2018130216 A1 WO 2018130216A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
sub
characters
area
segment
Prior art date
Application number
PCT/CN2018/072593
Other languages
French (fr)
Chinese (zh)
Inventor
丁超员
何海峰
钮毅
罗兵华
林翠翠
蔡晓蕙
钱华
韦立庆
Original Assignee
杭州海康威视数字技术股份有限公司
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 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Publication of WO2018130216A1 publication Critical patent/WO2018130216A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/63Scene text, e.g. street names
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/457Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by analysing connectivity, e.g. edge linking, connected component analysis or slices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/625License plates

Definitions

  • the present application relates to the field of intelligent transportation, and in particular to a method and apparatus for recognizing characters in a license plate.
  • the first step obtaining the license plate area corresponding to the license plate to be identified through the camera device;
  • the second step identifying characters in the license plate area
  • Step 3 split the characters in the license plate area according to the preset template
  • the fourth step comparing the characters in the divided license plate area with the individual character templates in the preset template to determine the characters in the license plate area.
  • the license plate is divided into a single-layer license plate and a double-layer license plate.
  • the characters in the single-layer license plate include not only a series of consecutive character sequences, but also other characters that differ in position or format from the character sequence.
  • the character sequence is generally referred to as a main segment character, and the other characters are referred to as sub-segment characters.
  • the types of license plates vary from country to country, and there is no uniform standard.
  • the Gulf Cooperation Council (GCC) national member of the UAE emirates has not only a wide range of license plates, but also various types of license plates.
  • the character styles are also different.
  • the method of recognizing the characters in the license plate cannot accurately identify the main segment characters and the sub-segment characters from the plurality of types of license plates. .
  • the purpose of the embodiments of the present application is to provide a method and apparatus for recognizing characters in a license plate, which can identify main segment characters and sub-segment characters in a plurality of license plate types.
  • the specific technical solutions are as follows:
  • An embodiment of the present application provides a method for recognizing a character in a license plate, the method comprising: acquiring a license plate area image of a license plate to be identified; determining a sequence of consecutive characters having the largest number of characters in the license plate area image as Determining an initial main segment character in the license plate; determining, according to the preset sub-segment character feature, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character; The character belonging to the left segment or the right end of the segment character is deleted, and the main segment character in the license plate to be identified is obtained; and the position of the main segment character in the license plate region image is determined according to the position of the main segment character in the license plate image. Subsection character.
  • the step of determining, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main-segment character includes: starting from the initial main segment character Extracting, by the left end, a first preset number of characters or extracting a second preset number of characters from the right end; determining whether the characters in the first preset number of characters or the second preset number of characters are the same; Determining, by the first preset number of characters or the second preset number of characters, a size of the first smaller number of the first preset number of characters, or the first a size of a second smaller one of the plurality of preset characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or the second smaller If the character is a letter, it is determined that the first smaller character or the second smaller character belongs to the sub-segment character; if the first preset number of
  • the step of determining, according to the location of the main segment character in the license plate area image, the sub-segment character in the license plate to be identified comprising: according to the main segment character in the license plate area a location in the image, determining a connected domain in which the sub-segment character is located in the license plate area image; determining, in the connected domain, a sub-segment area in which the sub-segment character is located; according to a preset classification model, Determining the sub-segment characters in the license plate to be identified in the sub-segment area.
  • the step of determining, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image including: according to the main segment character Determining, at a position in the license plate area image, a connected domain in which the sub-segment character is located to the left of the main segment character; or determining according to a location of the main segment character in the license plate area image The connected domain where the sub-segment character is located is located to the right of the main segment character.
  • the step of determining that the connected domain where the sub-segment character is located is located on the left side of the main segment character according to the location of the main segment character in the license plate area image includes: determining the first Whether the height of the area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is a connected domain in which the sub-segment character is located; The first area is an area from a left side of the main segment character to a third number of characters from the left side; or determining a height of the second area and the main segment character Whether the height is consistent; when the height of the second area is consistent with the height of the main segment character, determining that the second area is a connected domain in which the sub-segment character is located; wherein the second area is a slave
  • the left side of the main segment character is a region between a preset fourth number of characters and a predetermined fifth number of characters from the left side; when the height of
  • the step of determining, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located on a right side of the main segment character, including: determining a third Whether the lower bound of the region is consistent with the character of the main segment, and the height of the third region is three-quarters of the height of the main segment character; if yes, determining that the third region is the sub-segment character a connected domain; wherein the fourth area is an area between a sixth number of characters from a right side of the main character character and a seventh number of characters preset to the right side; Or determining whether the height of the fourth area is consistent with the height of the main segment character; if yes, determining that the fourth area is a connected domain where the sub-segment character is located; wherein the fourth area is a slave Determining, on the right side of the main segment character, an area between the preset eighth number of characters and a preset ninth number of characters from the right
  • the step of determining, according to the preset classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area including: determining, according to a preset first classification model, Whether the sub-segment character exists in the sub-segment area; if yes, determining the sub-segment character in the to-be-identified license plate in the sub-segment area according to a preset second classification model; And executing, according to the location of the main segment character in the license plate area image, determining a connected domain in which the sub-segment character is located in the license plate area image.
  • An embodiment of the present application further provides an apparatus for recognizing a character in a license plate, the apparatus comprising: an acquiring unit, configured to acquire an image of a license plate area of a license plate to be identified; and a first determining unit, configured to use the license plate area a sequence of consecutive characters having the largest number of characters in the image, determined as the initial main segment character in the license plate to be identified; and a determining unit configured to determine, according to the preset sub-segment character feature, the left end or the right end of the initial main segment character Whether the character belonging to the sub-segment character exists in the character; the deleting unit is configured to delete the character belonging to the sub-segment character located at the left end or the right end of the initial main segment character to obtain the main segment character in the to-be-identified license plate; And a second determining unit, configured to determine a sub-segment character in the license plate to be identified according to a location of the main segment character in the license plate area image.
  • the determining unit includes: an extracting subunit, a determining subunit, a first determining subunit, and a second determining subunit; and the extracting subunit is configured to extract from the left end of the initial main segment character a predetermined number of characters or a second preset number of characters from the right end; the determining subunit, configured to determine a character size of the first preset number of characters or the second preset number of characters Whether the first determining subunit is configured to determine the first preset number if the character sizes in the first preset number of characters or the second preset number of characters are not the same a size of a first smaller character in the character, or a size of a second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; Determining that the first smaller character or the second smaller character belongs to the sub-segment character; the second determining sub-unit, For the first preset number of characters or places The character size of the second preset number of characters is the
  • the second determining unit includes: a third determining subunit, a fourth determining subunit, and a fifth determining subunit; and the third determining subunit, configured to be according to the main segment character Determining, in a location in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image; the fourth determining sub-unit, configured to determine, in the connected domain, a sub-segment character a segment determining unit, configured to determine the sub-segment character in the to-be-identified license plate in the sub-segment region according to a preset classification model.
  • the third determining subunit includes: a sixth determining subunit and a seventh determining subunit; and the sixth determining subunit, configured to be located in the license plate area image according to the main segment character a location, determining that the connected domain where the sub-segment character is located is located to the left of the main segment character; or the seventh determining sub-unit for determining a location of the main segment character in the license plate area image And determining that the connected domain where the sub-segment character is located is located to the right of the main segment character.
  • the sixth determining subunit includes: an eighth determining subunit, a ninth determining subunit, and an executing subunit; and the eighth determining subunit, configured to determine a height of the first area and the main Whether the height of the segment character is consistent; when the height of the first region is consistent with the height of the main segment character, determining that the first region is a connected domain in which the sub-segment character is located; wherein the first region An area between the left side of the main segment character and a third number of characters from the left side; or the ninth determining subunit, configured to determine the height of the second area and the main Whether the height of the segment character is consistent; when the height of the second region is consistent with the height of the main segment character, determining that the second region is a connected domain in which the sub-segment character is located; wherein the second region An area between a fourth number of characters from a left side of the main segment character and a fifth number of characters preset from the left side; the execution subunit, when the The height
  • the seventh determining subunit includes: a tenth determining subunit, an eleventh determining subunit, and a twelfth determining subunit; and the tenth determining subunit, configured to determine a lower bound of the third region Whether it is consistent with the main segment character, and the height of the third region is three-quarters of the height of the main segment character; if yes, determining that the third region is the communication where the sub-segment character is located a region; wherein the fourth region is an area between a sixth number of characters from a right side of the main segment character and a seventh number of characters from the right side; or An eleven determining subunit, configured to determine whether a height of the fourth area is consistent with a height of the main segment character; if yes, determining that the fourth area is a connected domain where the sub-segment character is located; The fourth area is an area between an eighth number of characters from a right side of the main character character and a ninth number of characters preset to the right side distance;
  • the fifth determining subunit includes: a thirteenth determining subunit, a fourteenth determining subunit, and a fifteenth determining subunit; the thirteenth determining subunit, configured to be according to a preset a first classification model, determining whether the sub-segment character exists in the sub-segment area; the fourteenth determining sub-unit, configured to: if the sub-segment character exists in the sub-segment area, according to a preset a second classification model, the sub-segment character in the license plate to be identified is determined in the sub-segment area; the fifteenth determining sub-unit is configured to: if the sub-segment does not exist in the sub-segment area And performing, according to the position of the main segment character in the license plate area image, determining a connected domain in which the sub-segment character is located in the license plate area image.
  • An embodiment of the present application further provides a storage medium for storing executable code for performing a method of identifying characters in a license plate as described above at runtime.
  • An embodiment of the present application further proposes an application for performing a method of recognizing characters in a license plate as described above at runtime.
  • An embodiment of the present application further provides an apparatus for recognizing characters in a license plate, including: a processor and a memory;
  • the memory is for storing executable program code
  • the processor configured to execute a program corresponding to the executable program code by reading executable program code stored in the memory to perform a method of recognizing a character in a license plate as described in any of the above.
  • the method and device for recognizing a character in a license plate provided by the embodiment of the present application, firstly, determining the initial main segment character in the license plate to be identified in the obtained license plate area image of the license plate to be identified; and then determining the initial main segment character Whether the character belonging to the sub-segment character exists in the left or right end character; the character belonging to the sub-segment character at the left end or the right end of the initial main segment character is deleted, and the main segment character of the license plate to be recognized is obtained; finally, according to the main segment character The position of the sub-segment in the license plate to be identified.
  • the interference of the sub-segment characters that are tightly connected with the main segment character can be excluded, the accurate main segment character is obtained, and the sub-segment characters are determined according to the precise main segment character. Since the embodiment of the present application does not use a fixed template, multiple types of single-layer license plates can be identified according to different application scenarios, and the scope of application is wide.
  • FIG. 1 is a flow chart of a method for recognizing characters in a license plate according to an embodiment of the present application
  • FIG. 2 is a schematic view of a plurality of license plates according to an embodiment of the present application.
  • FIG. 3 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application
  • FIG. 4 is another flow chart of a method for recognizing characters in a license plate according to an embodiment of the present application.
  • FIG. 5 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application.
  • FIG. 6 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application.
  • FIG. 7 is a structural diagram of an apparatus for recognizing characters in a license plate according to an embodiment of the present application.
  • FIG. 8 is still another structural diagram of an apparatus for recognizing characters in a license plate according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of an apparatus for recognizing characters in a license plate according to an embodiment of the present application.
  • FIG. 1 is a flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application, including the following steps:
  • Step 101 Acquire an image of a license plate area of the license plate to be identified
  • Step 102 Determine a sequence of consecutive characters having the largest number of characters in the license plate area image as an initial main segment character in the to-be-identified license plate;
  • the embodiment of the present application is applied to identify a main segment character and a sub-segment character in a single-layer license plate.
  • the scene image including the license plate to be identified may be acquired by the image capturing device, and the license plate area image corresponding to the license plate to be identified is determined in the scene image;
  • the sub-segment character when included in the license plate to be identified, the sub-segment character may be included in the rough recognition main segment character.
  • FIG. 2 is a schematic diagram of various license plates according to an embodiment of the present application.
  • the rough identification main segment character corresponding to the license plate A1 may be 96078, and the rough identification main segment character corresponding to the license plate A2.
  • the rough identification main segment character corresponding to the license plate A3 may be 8308
  • the rough recognition main segment character corresponding to the license plate A4 may be 54977
  • the rough identification main segment character corresponding to the license plate A5 may be 62709
  • the rough identification main corresponding to the license plate A6 The segment character may be 58562
  • the rough recognition main segment character corresponding to the license plate A7 may be58626,
  • the rough recognition main segment character corresponding to the license plate A8 may be 45920
  • the rough recognition main segment character corresponding to the license plate A9 may be 32415
  • the license plate A10 corresponds to the coarse
  • the identification of the main segment character may be 98952
  • the rough recognition main segment character corresponding to the license plate A11 may be 40163
  • the rough recognition main segment character corresponding to the license plate A12 may be 9186
  • the rough recognition main segment character corresponding to the license plate B1 may be 26029
  • the rough recognition main segment character may be 3327
  • the rough recognition main segment character corresponding to the license plate D1 may be 3890GAA
  • the rough recognition main segment character corresponding to the license plate D2 may be 1021
  • the rough recognition main segment character corresponding to the license plate D3 may be 0528; visible
  • the corresponding rough recognition main segment character may not be an accurate main segment character, and may include sub-segment characters; for example, the rough recognition main segment character G4297 corresponding to the license plate C1 includes the sub-segment character G, and the coarse identification main segment character corresponding to D1
  • the sub-segment character GAA is included in the 3890GAA.
  • the continuous character sequence with the largest number of characters is determined as the initial main segment character; thus, the sub-segment characters far from the main segment character can be excluded from the coarse recognition main segment character, and further limited The range of the main segment characters.
  • the initial main segment character may be determined according to the pitch, width, and center distance information of the character in the rough identification main segment character.
  • the sub-segment characters may still be included in the left or right side of the initial main segment character.
  • the initial main segment character needs to be further defined.
  • Step 103 Determine, according to a preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character;
  • this step it is possible to determine whether there is a character belonging to the sub-segment character in the character at the left end of the initial main segment character, and whether there is a character belonging to the sub-segment character in the character at the right end of the initial main segment character.
  • the embodiment of the present application is described in the order of first determining the left end and then determining the right end.
  • the step of determining the left end may also be performed simultaneously with the step of determining the right end.
  • FIG. 3 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application.
  • Step 103 may specifically include:
  • Sub-step 11 extracting a first preset number of characters from the left end of the initial main segment character or extracting a second preset number of characters from the right end;
  • Sub-step 12 determining whether the character sizes in the first preset number of characters or the second preset number of characters are the same;
  • Sub-step 13 determining, if the character size of the first preset number of characters or the second preset number of characters is different, determining a size of the first smaller one of the first preset number of characters Or the size of the second smaller number of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or Determining that the second smaller character is a letter, and determining that the first smaller character or the second smaller character belongs to the sub-segment character;
  • Sub-step 14 if the characters of the first preset number of characters or the second preset number of characters are the same, or the first smaller character and the second smaller character are not letters Then, it is determined that there is no character belonging to the sub-segment character in the character at the left end or the right end of the initial main segment character.
  • the distance between some sub-segment characters and the main segment characters is relatively close, and in normal cases, the size of the sub-segment characters that are closer to the main segment characters is smaller than the size of the main segment characters, and the main segment characters are The closer sub-segment characters are letters; therefore, the initial main segment can be determined by determining the size of the character located to the left or right of the initial main segment character and determining whether the character at the left or right end of the initial main segment character is a letter. Whether the character at the left or right end of the character belongs to the sub-segment character.
  • the embodiment of the present application can be applied to determine a character in any license plate.
  • it can be used to determine a character in a license plate of a member of the GCC country in the UAE, or a character in another type of license plate, which is not limited in the embodiment of the present application.
  • the first preset number of characters may be two characters from left to right in the initial main segment character, and the second preset number of characters may be from left to right in the initial main segment character.
  • the fourth and fifth characters of course, the first preset number value and the second preset number value can be changed according to actual needs.
  • the first character and the second character may be extracted in the order from left to right at the left end of the initial main segment character; And determining whether the size of the first character and the second character are the same; if the size of the first character and the second character are different, the first character is usually less than the first character.
  • the other characters determine whether the first character is a letter after re-determining the size of the first character; if the first character is a letter, the first character It belongs to a sub-segment character; if the first character and the second character have the same size, or the first character is not a letter, the left end of the initial main segment character does not have a character belonging to the sub-segment character.
  • the first character in the initial main segment character, the first character is different in size from other characters, which may result in inaccurate recognition of the first character in the initial main segment character; therefore, After determining the size of the first character, the first character needs to be re-identified to determine whether the first character is a letter.
  • the fourth character and the fourth character after the left-to-right order may be extracted; And determining whether the size of the characters after the fourth character and the fourth character are the same; if the characters of the fourth character and the fourth character are different in size, the fifth character is usually If the character after the fifth character is smaller than other characters including the fourth character, the characters after the fourth character are re-determined, that is, after the fifth character and the fifth character.
  • the characters after the fourth character and the fourth character are different from the other characters, which may result in the initial main segment character being The recognition of the fifth character and the characters after the fifth character is inaccurate; therefore, after determining the size of the fifth character and the character after the fifth character, the fifth The character and the character after the fifth character are re-identified to determine whether the fifth character and the character after the fifth character are letters.
  • the size of the character G is smaller than the character 4, and there is a blank area in the upper part of the character 4, which may cause misidentification of the character G in the initial main segment character; therefore, it is necessary to re-recognize the character G after re-determining the size of the character G, when When it is determined that the character G is a letter, it can be determined that the left side of the initial main segment character corresponding to the license plate C1 is connected with the sub-segment character, and the first character G is a sub-segment character; and the initial main segment character corresponding to the license plate D1 is 3890GAA, According to the fourth character and the fourth character after the order from left to right, the characters are 0 and GAA respectively.
  • the size of the character GAA is smaller than the character 0, and the character GAA is an English letter, and the upper and lower parts of the character GAA are There is a blank area, which may cause misidentification of the character GAA in the initial main segment character; therefore, it is necessary to re-recognize the character GAA after re-determining the size of the character GAA, when determining that the character GAA is a letter
  • the initial character may determine the license plate main section E corresponding right sub-segment is connected to the character, and the fifth character after character GAA characters and fifth sub-segment characters.
  • the license plate middle sub-segment characters A scene in which the characters of the main segment are closer to each other, and a judgment rule that distinguishes the main segment character from the sub segment character close to the main segment character is summarized.
  • all the license plates whose sub-segment characters are located on the left or right side of the main segment character and are close to the main segment character may be selected, and the sub-segment characters in the license plate characters are summarized.
  • a judgment rule capable of distinguishing the sub-segment characters of the license plates is used to determine whether the left or right side of the rough-recognition main segment character is connected with the sub-segment characters.
  • the embodiment of the present application can expand on the basis of the original judgment rules according to the distribution of characters in the newly added license plate to identify the new license plate type. .
  • the application scenario of the embodiment of the present application is not limited to the members of the GCC countries in the UAE emirates. In practical applications, it can also be applied to identify license plate types of other countries and regions. Specifically, according to the license plates of other countries and regions.
  • the distribution of characters determines the judgment rule for judging whether the left or right side of the main character of the rough recognition is connected to the sub-segment character. For example, for license plates of members of the GCC countries in the UAE emirates, character recognition rules can be determined based on their character distribution.
  • Step 104 Delete a character belonging to a sub-segment character located at a left end or a right end of the initial main segment character to obtain a main segment character in the to-be-identified license plate;
  • the character belonging to the sub-segment character may be deleted from the left end or the right end of the initial sub-segment character to obtain an accurate main segment character.
  • the license plate C1 and the license plate D1 the initial main segment character corresponding to the license plate C1 is G4297, and the character G belongs to the sub-segment character, and the character G can be deleted from the initial main segment character to obtain an accurate main segment character.
  • the initial main segment character corresponding to the license plate D1 is 3890GAA
  • the character GAA belongs to the sub-segment character
  • the character GAA can be deleted from the initial main segment character 3890GAA
  • the exact main segment character is 3890.
  • Step 105 Determine a sub-segment character in the license plate to be identified according to a location of the main segment character in the license plate area image.
  • the accurate main segment character has been obtained, and then, the sub-segment character can be determined according to the accurate main segment character.
  • FIG. 4 is another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application.
  • the step 104 may include:
  • Sub-step 21 determining, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image;
  • Sub-step 22 determining, in the connected domain, a sub-segment area in which the sub-segment character is located;
  • Sub-step 23 determining the sub-segment characters in the to-be-identified license plate in the sub-segment area according to a preset classification model.
  • the connected domain in which the sub-segment character is located may be determined according to the position of the exact main segment character in the license plate area image; next, the minimum circumscribed rectangle including the sub-segment region is determined in the connected domain, and the minimum external connection may be considered The rectangle is the sub-segment area; finally, the sub-segment characters are identified in the sub-segment area according to the preset classification model.
  • FIG. 5 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application.
  • the sub-step 21 may specifically include:
  • Sub-step 31 determining, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located on the left side of the main segment character; or
  • Sub-step 32 determining, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located to the right of the main segment character.
  • the order in which the connected domain where the sub-segment character is located is located on the left or the right side of the main segment character is not limited, and the sub-segment character may be determined to be on the left side to determine whether the sub-segment character is in the right state. On the side, you can also determine whether the sub-segment character is on the right side and then determine whether the sub-segment character is on the left side.
  • sub-segment characters may only be located on the left or right side of the main segment character, it is impossible to be located at the left and right sides of the main segment character at the same time. Therefore, once it is determined that the connected field of the sub-segment character is located to the left or right of the main segment character, On the side, it is no longer necessary to continue to determine whether the sub-segment character is located on the other side of the main segment character, and sub-step 22 of determining the sub-segment region can be further performed.
  • the sub-step 31 may specifically include:
  • the height of the first area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is the sub-segment character a connected domain; wherein the first area is an area between a left side of the main section character and a distance from the left side to preset a third number of characters; or
  • the second area Determining whether the height of the second area is consistent with the height of the main segment character; when the height of the second area is consistent with the height of the main segment character, determining that the second area is the sub-segment character a connected domain; wherein the second area is an area between a predetermined fourth number of characters from a left side of the main character character and a fifth number of characters preset by a distance from the left side;
  • the preset third number of characters may be two characters, and the preset fourth number of characters may be three characters, and the preset fifth number of characters may be six characters.
  • the sub-step 32 may specifically include:
  • the right side of the main segment character is an area between a preset eighth number of characters and a distance from the right side preset by a ninth number of characters; or
  • the right side of the main segment character is a region between a preset tenth number of characters and a distance from the right side to preset an eleventh number of characters.
  • the preset sixth number of characters may be one character, and the preset seventh number of characters may be three characters, and the preset eighth number of characters may be one character, and the preset ninth number of characters may be four characters. Character, the preset tenth number of characters can be four characters, and the eleventh number of characters can be eight characters by default.
  • the license plate C1 and the license plate D1 in FIG. 2 For example, the license plate C1 and the license plate D1 in FIG. 2; the connected domain where the sub-segment characters in the license plate C1 are located in the first area on the left side of the main character 4297; the connected domain in which the sub-segment characters in the license plate D1 are located in the main segment The third area on the right side of the character 3890.
  • the sub-step 23 may specifically include:
  • the preset first classification model and the second classification model can be trained according to any license plate style, for example, according to the license plate style of the members of the GCC countries in the UAE.
  • the classification model may be a neural network model, or a support vector machine (SVM) classification model, a boost classification model, etc., and the specific form of the classification model is not limited in this application.
  • SVM support vector machine
  • the first classification model is used to determine whether there is a valid character in the sub-segment area, that is, whether there is a sub-segment character, and if there is a sub-segment character, the second classification model is used to identify the sub-segment character in the sub-segment area. .
  • the embodiment of the present application can determine the initial main segment character in the license plate to be identified in the acquired license plate area image of the license plate to be identified; next, determine whether the belonging character of the left end or the right end of the initial main segment character exists The character of the segment character; the character belonging to the sub-segment character at the left or right end of the initial main segment character is deleted, and the main segment character of the license plate to be identified is obtained; finally, the sub-segment in the license plate to be identified is determined according to the position of the main segment character character.
  • the interference of the sub-segment characters that are tightly connected with the main segment character can be excluded, the accurate main segment character is obtained, and the sub-segment characters are determined according to the precise main segment character. Since the fixed template is not used in the embodiment of the present application, multiple types of single-layer license plates can be identified according to different application scenarios, and the scope of application is wide.
  • FIG. 6 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application, including the following steps:
  • Step 601 Acquire a scene image that includes a license plate to be identified; and determine a sequence of consecutive characters having the largest number of characters in the license plate area image as an initial main segment character in the license plate to be identified;
  • Step 602 Extract two characters from left to right from the initial main segment characters.
  • Step 603 it is determined whether the first character from left to right is smaller than the second character; if yes, step 606 is performed, if not, step 604 is performed;
  • Step 604 it is determined whether the first character is a letter; if yes, step 605 is performed; if not, step 606 is performed;
  • Step 605 determining that the first character belongs to the sub-segment character, and deleting the first character from the initial main segment character to obtain an accurate main segment character; performing step 610;
  • the size of the first character can be determined, and the first character is re-identified to determine that the first character belongs to the sub-segment character; and the first character is deleted from the initial main segment character; Main segment character.
  • the license plate to be identified is a license plate of the Lebanese country.
  • Step 606 Extract, from the initial main segment character, a fourth character from left to right and a character after the fourth character;
  • Step 607 determining whether the fifth character and the character after the fifth character are smaller than the fourth character; if yes, the sub-segment character does not exist in the initial main segment character, if Otherwise, step 608 is performed;
  • Step 608 it is determined whether the fifth character and the character after the fifth character are letters; if yes, step 609 is performed; if not, the sub-segment character does not exist in the license plate to be identified;
  • Step 609 determining that the fifth character and the characters after the fifth character belong to the sub-segment character, and deleting the fifth character and the fifth character from the initial main segment character. Character, get the exact main segment character; perform step 610;
  • the fifth character and the characters after the fifth character may be determined, and the fifth character and the characters after the fifth character are re-identified, and the fifth character and the characters after the fifth character are determined. It belongs to the sub-segment character; and, the fifth character and the character after the fifth character are deleted from the initial main segment character; the exact main segment character is obtained.
  • the license plate to be identified is a license plate of the Saudi state.
  • Step 610 it is determined whether the height of the first area is consistent with the height of the main segment character; if yes, step 616 is performed; if not, step 611 is performed;
  • the first area is an area between two characters from a left side of the main segment character to a distance from the left side.
  • Step 611 it is determined whether the height of the second area is consistent with the height of the main segment character; if yes, step 616 is performed; if not, step 612 is performed;
  • the second area is an area between three characters from the left side of the main segment character and six characters from the left side.
  • Step 612 it is determined whether it is the first judgment; if yes, the color in the second area is reversed, and the process returns to step 611; if not, step 613 is performed;
  • Step 613 it is determined whether the lower boundary of the third area is consistent with the main segment character, and the height of the third area is three-quarters of the height of the main segment character; if yes, step 616 is performed; Otherwise, step 614 is performed;
  • the fourth area is an area between one character from a right side of the main segment character and three characters from a distance from the right side.
  • Step 614 it is determined whether the height of the fourth area is consistent with the height of the main segment character; if yes, step 616 is performed; if no, step 615 is performed;
  • the fourth area is an area between a character from a right side of the main segment character and a distance of four characters from the right side.
  • Step 615 it is determined whether the height of the fifth area is consistent with the height of the main segment character; if yes, step 616 is performed; if not, the sub-segment character does not exist in the to-be-identified license plate;
  • the fifth area is an area between four characters from a right side of the main segment character and eight characters from the right side.
  • Step 616 determining a connected domain where the sub-segment character is located
  • Step 617 Determine, in the connected domain, a sub-segment area where the sub-segment character is located;
  • the sub-segment area is a minimum circumscribed rectangle in the connected domain.
  • Step 618 Determine, according to the preset first classification model, whether the sub-segment character exists in the sub-segment area; if yes, perform step 619; if not, the sub-segment character does not exist in the to-be-identified license plate ;
  • Step 619 Determine, according to the preset second classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area.
  • the embodiment of the present application can identify the main segment character from the license plate to be identified.
  • the sub-segment character exists in the to-be-identified license plate, the sub-segment character is identified according to the position of the main segment character.
  • FIG. 7 is a structural diagram of a license plate type identification device according to an embodiment of the present application.
  • the device includes: an acquisition unit 701, a determining unit 702, a determining unit 703, a deleting unit 704, and a second determining unit 705;
  • the acquiring unit 701 is configured to acquire an image of a license plate area of the license plate to be identified;
  • the first determining unit 702 is configured to determine a sequence of consecutive characters having the largest number of characters in the license plate area image as an initial main segment character in the to-be-identified license plate;
  • the determining unit 703 is configured to determine, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character;
  • the deleting unit 704 is configured to delete a character belonging to a sub-segment character located at a left end or a right end of the initial main segment character to obtain a main segment character in the to-be-identified license plate;
  • the second determining unit 705 is configured to determine a sub-segment character in the license plate to be identified according to the location of the main segment character in the license plate area image.
  • the apparatus embodiment of the present application can obtain the license plate area corresponding to the license plate to be identified in the scene image; then, determine the character sequence and the background color in the license plate to be identified in the license plate area; next, according to the preset rule, the license plate The special pattern area corresponding to the license plate to be identified is determined in the area; finally, the license plate type of the license plate to be identified is determined according to the character sequence and the background color in the license plate to be identified, and the special pattern area. In this way, the embodiment of the present application can identify the license plate type corresponding to the license plate including the special pattern, and the application range is wider.
  • FIG. 8 is another structural diagram of a license plate type identification device according to an embodiment of the present application.
  • the device includes: an acquisition unit 701, a first determining unit 702, a determining unit 703, a deleting unit 704, and a second determining unit 705;
  • the determining unit 703 includes: an extracting subunit 801, a determining subunit 802, a first determining subunit 803, and a second determining subunit 804;
  • the extracting subunit 801 is configured to extract a first preset number of characters from the left end of the initial main segment character or a second preset number of characters from the right end;
  • the determining sub-unit 802 is configured to determine whether the character sizes in the first preset number of characters or the second preset number of characters are the same;
  • the first determining sub-unit 803 is configured to determine, in the first preset number of characters, that the characters in the first preset number of characters or the second preset number of characters are different in size Determining, by the size of the first smaller character, or the size of the second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; Determining that the first smaller character or the second smaller character belongs to the sub-segment character;
  • the second determining subunit 804 is configured to: if the first preset number of characters or the second preset number of characters have the same size, or the first smaller character or the first If the second smaller character is not a letter, it is determined that there is no character belonging to the sub-segment character in the character at the left or right end of the initial main segment character.
  • the second determining unit 705 includes: a third determining subunit 805, a fourth determining subunit 806, and a fifth determining subunit 807;
  • the third determining sub-unit 805 is configured to determine, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image;
  • the fourth determining sub-unit 806 is configured to determine, in the connected domain, a sub-segment area where the sub-segment character is located;
  • the fifth determining sub-unit 807 is configured to determine, in the sub-segment area, the sub-segment characters in the license plate to be identified according to a preset classification model.
  • the third determining subunit 805 includes: a sixth determining subunit 808 and a seventh determining subunit 809;
  • the sixth determining sub-unit 808 is configured to determine, according to the location of the main segment character in the license plate area image, the connected segment where the sub-segment character is located, where the sub-segment character is located in the main segment character Left side; or
  • the seventh determining sub-unit 809 is configured to determine, according to the location of the main segment character in the license plate area image, the connected segment where the sub-segment character is located, where the sub-segment character is located in the main segment character Right.
  • the embodiment of the present application can identify the license plate type corresponding to the license plate including the special pattern, and the application range is wider.
  • the embodiment of the present application further discloses a storage medium for storing executable code, and the executable code is configured to perform the following steps at runtime:
  • the sub-segment characters in the license plate to be identified are determined according to the position of the main segment character in the license plate area image.
  • the storage medium disclosed in the embodiment of the present application can determine the initial main segment character in the license plate to be identified in the obtained license plate area image of the license plate to be identified; next, determine the left end or the right end character of the initial main segment character. Whether there is a character belonging to the sub-segment character; the character belonging to the sub-segment character at the left end or the right end of the initial main segment character is deleted, and the main segment character of the license plate to be recognized is obtained; finally, the position to be identified is determined according to the position of the main segment character Sub-segment characters in the license plate.
  • the interference of the sub-segment characters that are tightly connected with the main segment character can be excluded, the accurate main segment character is obtained, and the sub-segment characters are determined according to the precise main segment character. Since the fixed template is not used in the embodiment of the present application, multiple types of single-layer license plates can be identified according to different application scenarios, and the scope of application is wide.
  • the step of determining, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character includes:
  • the size of the first preset number of characters or the second preset number of characters is different, determining a size of the first smaller number of the first preset number of characters, or a size of a second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or the second comparison The small character is a letter, and it is determined that the first smaller character or the second smaller character belongs to the sub-segment character;
  • the determining is located There are no characters belonging to the sub-segment characters in the characters at the left or right end of the initial main segment character.
  • the step of determining the sub-segment characters in the license plate to be identified according to the location of the main segment character in the license plate area image includes:
  • the step of determining, according to the location of the main segment character in the license plate area image, the connected domain of the sub-segment character in the license plate area image including:
  • the step of determining that the connected domain where the sub-segment character is located is located on a left side of the main segment character according to a location of the main segment character in the license plate area image ,include:
  • the height of the first area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is the sub-segment character a connectivity domain; wherein the first region is an area between a left side of the main segment character and a third number of characters from the left side; or
  • the second area Determining whether the height of the second area is consistent with the height of the main segment character; when the height of the second area is consistent with the height of the main segment character, determining that the second area is the sub-segment character a connectivity domain; wherein the second region is an area between a fourth number of characters from a left side of the main segment character and a fifth number of characters from the left side distance;
  • the step of determining, according to the location of the main segment character in the license plate area image, that the sub-segment character of the connected domain where the sub-segment character is located is located on a right side of the main segment character include:
  • the right side of the main segment character is an area between a preset eighth number of characters and a preset ninth number of characters from the right side; or
  • the right side of the main segment character is a region between a preset tenth number of characters and a predetermined eleventh number of characters from the right side.
  • the step of determining, according to the preset classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area including:
  • the storage medium disclosed in the present application is capable of recognizing a license plate type corresponding to a license plate including a special pattern, and has a wide application range.
  • the sub-segment characters in the license plate to be identified are determined according to the position of the main segment character in the license plate area image.
  • the application program disclosed in the embodiment of the present application can determine the initial main segment character in the license plate to be identified in the obtained license plate area image of the license plate to be identified; next, determine the left end or the right end character of the initial main segment character. Whether there is a character belonging to the sub-segment character; the character belonging to the sub-segment character at the left end or the right end of the initial main segment character is deleted, and the main segment character of the license plate to be recognized is obtained; finally, the position to be identified is determined according to the position of the main segment character Sub-segment characters in the license plate.
  • the interference of the sub-segment characters that are tightly connected with the main segment character can be excluded, the accurate main segment character is obtained, and the sub-segment characters are determined according to the precise main segment character. Since the fixed template is not used in the embodiment of the present application, multiple types of single-layer license plates can be identified according to different application scenarios, and the scope of application is wide.
  • the step of determining, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character includes:
  • the size of the first preset number of characters or the second preset number of characters is different, determining a size of the first smaller number of the first preset number of characters, or a size of a second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or the second comparison The small character is a letter, and it is determined that the first smaller character or the second smaller character belongs to the sub-segment character;
  • the determining is located There are no characters belonging to the sub-segment characters in the characters at the left or right end of the initial main segment character.
  • the step of determining the sub-segment characters in the license plate to be identified according to the location of the main segment character in the license plate area image includes:
  • the step of determining, according to the location of the main segment character in the license plate area image, the connected domain of the sub-segment character in the license plate area image including:
  • the step of determining that the connected domain where the sub-segment character is located is located on a left side of the main segment character according to a location of the main segment character in the license plate area image ,include:
  • the height of the first area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is the sub-segment character a connectivity domain; wherein the first region is an area between a left side of the main segment character and a third number of characters from the left side; or
  • the second area Determining whether the height of the second area is consistent with the height of the main segment character; when the height of the second area is consistent with the height of the main segment character, determining that the second area is the sub-segment character a connectivity domain; wherein the second region is an area between a fourth number of characters from a left side of the main segment character and a fifth number of characters from the left side distance;
  • the step of determining, according to the location of the main segment character in the license plate area image, that the sub-segment character of the connected domain where the sub-segment character is located is located on a right side of the main segment character include:
  • the right side of the main segment character is an area between a preset eighth number of characters and a preset ninth number of characters from the right side; or
  • the right side of the main segment character is a region between a preset tenth number of characters and a predetermined eleventh number of characters from the right side.
  • the step of determining, according to the preset classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area including:
  • the application disclosed in the present application can recognize the license plate type corresponding to the license plate including the special pattern, and has a wide application range.
  • FIG. 9 is a schematic diagram of an apparatus for recognizing characters in a license plate according to an embodiment of the present application.
  • the device for identifying characters in the license plate includes: a processor 901 and a memory 902;
  • the memory 902 is configured to store executable program code
  • the processor 901 is configured to run a program corresponding to the executable program code by reading executable program code stored in the memory 902 to perform the following steps:
  • the sub-segment characters in the license plate to be identified are determined according to the position of the main segment character in the license plate area image.
  • the device for recognizing characters in the license plate disclosed in the embodiment of the present application can determine the initial main segment character in the license plate to be identified in the acquired license plate region image of the license plate to be identified; and then, determine the left end of the initial main segment character. Or whether the character belonging to the sub-segment character exists in the character at the right end; the character belonging to the sub-segment character at the left or right end of the initial main segment character is deleted, and the main segment character of the license plate to be recognized is obtained; finally, according to the position of the main segment character , determine the sub-segment characters in the license plate to be identified.
  • the interference of the sub-segment characters that are tightly connected with the main segment character can be excluded, the accurate main segment character is obtained, and the sub-segment characters are determined according to the precise main segment character. Since the fixed template is not used in the embodiment of the present application, multiple types of single-layer license plates can be identified according to different application scenarios, and the scope of application is wide.
  • the step of determining, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character includes:
  • the size of the first preset number of characters or the second preset number of characters is different, determining a size of the first smaller number of the first preset number of characters, or a size of a second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or the second comparison The small character is a letter, and it is determined that the first smaller character or the second smaller character belongs to the sub-segment character;
  • the determining is located There are no characters belonging to the sub-segment characters in the characters at the left or right end of the initial main segment character.
  • the step of determining the sub-segment characters in the license plate to be identified according to the location of the main segment character in the license plate area image includes:
  • the step of determining, according to the location of the main segment character in the license plate area image, the connected domain of the sub-segment character in the license plate area image including:
  • the step of determining that the connected domain where the sub-segment character is located is located on a left side of the main segment character according to a location of the main segment character in the license plate area image ,include:
  • the height of the first area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is the sub-segment character a connectivity domain; wherein the first region is an area between a left side of the main segment character and a third number of characters from the left side; or
  • the second area Determining whether the height of the second area is consistent with the height of the main segment character; when the height of the second area is consistent with the height of the main segment character, determining that the second area is the sub-segment character a connectivity domain; wherein the second region is an area between a fourth number of characters from a left side of the main segment character and a fifth number of characters from the left side distance;
  • the step of determining, according to the location of the main segment character in the license plate area image, that the sub-segment character of the connected domain where the sub-segment character is located is located on a right side of the main segment character include:
  • the right side of the main segment character is an area between a preset eighth number of characters and a preset ninth number of characters from the right side; or
  • the right side of the main segment character is a region between a preset tenth number of characters and a predetermined eleventh number of characters from the right side.
  • the step of determining, according to the preset classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area including:
  • the device for recognizing characters in the license plate disclosed in the present application can recognize the license plate type corresponding to the license plate including the special pattern, and has a wide application range.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Traffic Control Systems (AREA)
  • Character Input (AREA)
  • Image Analysis (AREA)

Abstract

A method and a device for recognizing characters on a license plate. The method comprises: acquiring a license plate area image of a license plate to be recognized (101); determining a continuous character sequence having most characters in the license plate area image as initial primary segment characters of said license plate (102); determining, according to preset sub-segment character characteristics, whether the characters located at the left end or right end of the initial primary segment characters comprise characters belonging to sub-segment characters (103); deleting the characters which are located at the left end or right end of the initial primary segment characters and belong to the sub-segment characters, to obtain primary segment characters of said license plate (104); and determining the sub-segment characters of said license plate according to the location of the primary segment characters on the license plate area image (105). Said method is able to recognize primary segment characters and sub-segment characters of a plurality of types of license plates.

Description

一种识别车牌中字符的方法及装置Method and device for identifying characters in license plate
本申请要求于2017年01月16日提交中国专利局、申请号为201710028236.X发明名称为“一种识别车牌中字符的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application entitled "A Method and Apparatus for Recognizing Characters in License Plates" filed on January 16, 2017 by the Chinese Patent Office, Application No. 201710028236.X, the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请涉及智能交通领域,特别是涉及一种识别车牌中字符的方法及装置。The present application relates to the field of intelligent transportation, and in particular to a method and apparatus for recognizing characters in a license plate.
背景技术Background technique
随着车辆数量的急速增加,车牌的智能识别技术已经被广泛应用于停车场、城市道路和高速公路等区域进行车辆牌号的自动抓取和识别。With the rapid increase in the number of vehicles, the intelligent identification technology of license plates has been widely used in parking lots, urban roads and highways to automatically capture and identify vehicle grades.
目前,识别车牌中字符的方法为:Currently, the method for identifying characters in a license plate is:
第一步:通过摄像设备获取待识别车牌对应的车牌区域;The first step: obtaining the license plate area corresponding to the license plate to be identified through the camera device;
第二步:识别所述车牌区域中的字符;The second step: identifying characters in the license plate area;
第三步:根据预设模板分割车牌区域中的字符;Step 3: split the characters in the license plate area according to the preset template;
第四步:将分割后的车牌区域中的字符与预设模板中的各个字符模板分别进行比对,确定车牌区域中的字符。The fourth step: comparing the characters in the divided license plate area with the individual character templates in the preset template to determine the characters in the license plate area.
通常情况下,车牌分为单层车牌和双层车牌,单层车牌中的字符不仅包括一串连续的字符序列,还可能包括与所述字符序列在位置或者格式上存在差异的其他字符,为了方便说明,一般将所述字符序列称为主段字符,并且将所述其他字符称为子段字符。此外,全球各个国家和地区的车牌类型各不相同,并无统一的标准,尤其是海湾合作委员会(Gulf Cooperation Council,GCC)国家成员阿联酋各酋长国的车牌类型,不仅车牌类型繁多,而且各类型车牌中的字符样式也各不相同。由于上述识别车牌中字符的方法中使用的模板种类有限,因此,对于车牌类型繁多的应用场景,使用上述识别车牌中字符的方法无法从多种类型的车牌中准确识别出主段字符和子段字符。Usually, the license plate is divided into a single-layer license plate and a double-layer license plate. The characters in the single-layer license plate include not only a series of consecutive character sequences, but also other characters that differ in position or format from the character sequence. For convenience of description, the character sequence is generally referred to as a main segment character, and the other characters are referred to as sub-segment characters. In addition, the types of license plates vary from country to country, and there is no uniform standard. In particular, the Gulf Cooperation Council (GCC) national member of the UAE emirates has not only a wide range of license plates, but also various types of license plates. The character styles are also different. Since the above-mentioned method for recognizing characters in the license plate has a limited variety of templates, for the application scene with a wide variety of license plates, the method of recognizing the characters in the license plate cannot accurately identify the main segment characters and the sub-segment characters from the plurality of types of license plates. .
发明内容Summary of the invention
本申请实施例的目的在于提供一种识别车牌中字符的方法及装置,能够识别出多种车牌类型中的主段字符和子段字符。具体技术方案如下:The purpose of the embodiments of the present application is to provide a method and apparatus for recognizing characters in a license plate, which can identify main segment characters and sub-segment characters in a plurality of license plate types. The specific technical solutions are as follows:
本申请的一种实施例提出了一种识别车牌中字符的方法,所述方法包括:获取待识别车牌的车牌区域图像;将所述车牌区域图像中字符数量最多的连续字符序列、确定为所述待识别车牌中的初始主段字符;根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;将位于所述初始主段字符左端或右端的、属于子段字符的字符删除,得到所述待识别车牌中的主段字符;根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的子段字符。An embodiment of the present application provides a method for recognizing a character in a license plate, the method comprising: acquiring a license plate area image of a license plate to be identified; determining a sequence of consecutive characters having the largest number of characters in the license plate area image as Determining an initial main segment character in the license plate; determining, according to the preset sub-segment character feature, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character; The character belonging to the left segment or the right end of the segment character is deleted, and the main segment character in the license plate to be identified is obtained; and the position of the main segment character in the license plate region image is determined according to the position of the main segment character in the license plate image. Subsection character.
可选地,所述根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符的步骤,包括:从所述初始主段字符的左端提取第一预设数量个字符或从右端提取第二预设数量个字符;判断所述第一预设数量个字符或所述第二预设数量个字符中的字符大小是否相同;若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小不相同,则确定所述第一预设数量个字符中第一较小字符的大小、或所述第二预设数量个字符中第二较小字符的大小;判断所述第一较小字符或所述第二较小字符是否为字母;若所述第一较小字符或所述第二较小字符为字母,则确定所述第一较小字符或所述第二较小字符属于所述子段字符;若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小均相同,或者所述第一较小字符和所述第二较小字符不为字母,则确定位于所述初始主段字符的左端或右端的字符中不存在属于子段字符的字符。Optionally, the step of determining, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main-segment character, includes: starting from the initial main segment character Extracting, by the left end, a first preset number of characters or extracting a second preset number of characters from the right end; determining whether the characters in the first preset number of characters or the second preset number of characters are the same; Determining, by the first preset number of characters or the second preset number of characters, a size of the first smaller number of the first preset number of characters, or the first a size of a second smaller one of the plurality of preset characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or the second smaller If the character is a letter, it is determined that the first smaller character or the second smaller character belongs to the sub-segment character; if the first preset number of characters or the second preset number of characters The characters are the same size, or the first Small characters and the second character is not a small letter, it is determined that the character belongs to the character sub-segments not present in the initial main character at the character segment of the left or right.
可选地,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的所述子段字符的步骤,包括:根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域;在所述连通域中确定所述子段字符所在的子段区域;根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符。Optionally, the step of determining, according to the location of the main segment character in the license plate area image, the sub-segment character in the license plate to be identified, comprising: according to the main segment character in the license plate area a location in the image, determining a connected domain in which the sub-segment character is located in the license plate area image; determining, in the connected domain, a sub-segment area in which the sub-segment character is located; according to a preset classification model, Determining the sub-segment characters in the license plate to be identified in the sub-segment area.
可选地,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域的步骤,包括:根据所述 主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的左侧;或者根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的右侧。Optionally, the step of determining, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image, including: according to the main segment character Determining, at a position in the license plate area image, a connected domain in which the sub-segment character is located to the left of the main segment character; or determining according to a location of the main segment character in the license plate area image The connected domain where the sub-segment character is located is located to the right of the main segment character.
可选地,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的左侧的步骤,包括:判断第一区域的高度与所述主段字符的高度是否一致;当所述第一区域的高度与所述主段字符的高度一致时,确定所述第一区域为所述子段字符所在的连通域;其中,所述第一区域为从所述主段字符的左侧至与所述左侧距离预设第三数量个字符之间的区域;或者判断第二区域的高度与所述主段字符的高度是否一致;当所述第二区域的高度与所述主段字符的高度一致时,确定所述第二区域为所述子段字符所在的连通域;其中,所述第二区域为从与所述主段字符的左侧距离预设第四数量个字符至与所述左侧距离预设第五数量个字符之间的区域;当所述第二区域的高度与所述主段字符的高度不一致,且为第一次判断第二区域的高度与所述主段字符的高度是否一致时,反转所述第二区域中的颜色,执行所述判断第二区域的高度与所述主段字符的高度是否一致。Optionally, the step of determining that the connected domain where the sub-segment character is located is located on the left side of the main segment character according to the location of the main segment character in the license plate area image includes: determining the first Whether the height of the area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is a connected domain in which the sub-segment character is located; The first area is an area from a left side of the main segment character to a third number of characters from the left side; or determining a height of the second area and the main segment character Whether the height is consistent; when the height of the second area is consistent with the height of the main segment character, determining that the second area is a connected domain in which the sub-segment character is located; wherein the second area is a slave The left side of the main segment character is a region between a preset fourth number of characters and a predetermined fifth number of characters from the left side; when the height of the second region is different from the main segment character Highly inconsistent and the first judgment The height of the main section and the height of the character region when the two are the same, inverting the colors in the second region, determining whether to execute the second region and the height of the main section of the same character.
可选地,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的右侧的步骤,包括:判断第三区域的下界与所述主段字符是否一致,且所述第三区域的高度是否所述主段字符高度的四分之三;若为是,则确定所述第三区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第六数量个字符至与所述右侧距离预设第七数量个字符之间的区域;或者判断第四区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第四区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第八数量个字符至与所述右侧距离预设第九数量个字符之间的区域;或者判断第五区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第五区域为所述子段字符所在的连通域;其中,所述第五区域为从与所述主段字符的右侧距离预设第十数量个字符至与所述右侧距离预设第十一数量个字符之间的区域。Optionally, the step of determining, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located on a right side of the main segment character, including: determining a third Whether the lower bound of the region is consistent with the character of the main segment, and the height of the third region is three-quarters of the height of the main segment character; if yes, determining that the third region is the sub-segment character a connected domain; wherein the fourth area is an area between a sixth number of characters from a right side of the main character character and a seventh number of characters preset to the right side; Or determining whether the height of the fourth area is consistent with the height of the main segment character; if yes, determining that the fourth area is a connected domain where the sub-segment character is located; wherein the fourth area is a slave Determining, on the right side of the main segment character, an area between the preset eighth number of characters and a preset ninth number of characters from the right side; or determining the height of the fifth area and the height of the main segment character Whether it is consistent; if yes, then determine The fifth area is a connected domain in which the sub-segment character is located; wherein the fifth area is a preset tenth number of characters from a right side of the main segment character to a preset distance from the right side An area between eleven numbers of characters.
可选地,所述根据预设的分类模型,在所述子段区域中确定所述待识别 车牌中的所述子段字符的步骤,包括:根据预设的第一分类模型,判断所述子段区域中是否存在所述子段字符;若为是,则根据预设的第二分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符;若为否,则执行所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域。Optionally, the step of determining, according to the preset classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area, including: determining, according to a preset first classification model, Whether the sub-segment character exists in the sub-segment area; if yes, determining the sub-segment character in the to-be-identified license plate in the sub-segment area according to a preset second classification model; And executing, according to the location of the main segment character in the license plate area image, determining a connected domain in which the sub-segment character is located in the license plate area image.
本申请的一种实施例又提出了一种识别车牌中字符的装置,所述装置包括:获取单元,用于获取待识别车牌的车牌区域图像;第一确定单元,用于将所述车牌区域图像中字符数量最多的连续字符序列、确定为所述待识别车牌中的初始主段字符;判断单元,用于根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;删除单元,用于将位于所述初始主段字符左端或右端的、属于子段字符的字符删除,得到所述待识别车牌中的主段字符;第二确定单元,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的子段字符。An embodiment of the present application further provides an apparatus for recognizing a character in a license plate, the apparatus comprising: an acquiring unit, configured to acquire an image of a license plate area of a license plate to be identified; and a first determining unit, configured to use the license plate area a sequence of consecutive characters having the largest number of characters in the image, determined as the initial main segment character in the license plate to be identified; and a determining unit configured to determine, according to the preset sub-segment character feature, the left end or the right end of the initial main segment character Whether the character belonging to the sub-segment character exists in the character; the deleting unit is configured to delete the character belonging to the sub-segment character located at the left end or the right end of the initial main segment character to obtain the main segment character in the to-be-identified license plate; And a second determining unit, configured to determine a sub-segment character in the license plate to be identified according to a location of the main segment character in the license plate area image.
可选地,所述判断单元,包括:提取子单元、判断子单元、第一确定子单元和第二确定子单元;所述提取子单元,用于从所述初始主段字符的左端提取第一预设数量个字符或从右端提取第二预设数量个字符;所述判断子单元,用于判断所述第一预设数量个字符或所述第二预设数量个字符中的字符大小是否相同;所述第一确定子单元,用于若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小不相同,则确定所述第一预设数量个字符中第一较小字符的大小、或所述第二预设数量个字符中第二较小字符的大小;判断所述第一较小字符或所述第二较小字符是否为字母;若所述第一较小字符或所述第二较小字符为字母,则确定所述第一较小字符或所述第二较小字符属于所述子段字符;所述第二确定子单元,用于若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小均相同,或者所述第一较小字符和所述第二较小字符不为字母,则确定位于所述初始主段字符的左端或右端的字符中不存在属于子段字符的字符。Optionally, the determining unit includes: an extracting subunit, a determining subunit, a first determining subunit, and a second determining subunit; and the extracting subunit is configured to extract from the left end of the initial main segment character a predetermined number of characters or a second preset number of characters from the right end; the determining subunit, configured to determine a character size of the first preset number of characters or the second preset number of characters Whether the first determining subunit is configured to determine the first preset number if the character sizes in the first preset number of characters or the second preset number of characters are not the same a size of a first smaller character in the character, or a size of a second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; Determining that the first smaller character or the second smaller character belongs to the sub-segment character; the second determining sub-unit, For the first preset number of characters or places The character size of the second preset number of characters is the same, or the first smaller character and the second smaller character are not letters, and then the character is located at the left end or the right end of the initial main segment character. There are no characters belonging to the sub-segment characters.
可选地,所述第二确定单元,包括:第三确定子单元、第四确定子单元和第五确定子单元;所述第三确定子单元,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域;所述第四确定子单元,用于在所述连通域中确定所述子段字符所在的 子段区域;所述第五确定子单元,用于根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符。Optionally, the second determining unit includes: a third determining subunit, a fourth determining subunit, and a fifth determining subunit; and the third determining subunit, configured to be according to the main segment character Determining, in a location in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image; the fourth determining sub-unit, configured to determine, in the connected domain, a sub-segment character a segment determining unit, configured to determine the sub-segment character in the to-be-identified license plate in the sub-segment region according to a preset classification model.
可选地,所述第三确定子单元,包括:第六确定子单元和第七确定子单元;所述第六确定子单元,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的左侧;或者所述第七确定子单元,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的右侧。Optionally, the third determining subunit includes: a sixth determining subunit and a seventh determining subunit; and the sixth determining subunit, configured to be located in the license plate area image according to the main segment character a location, determining that the connected domain where the sub-segment character is located is located to the left of the main segment character; or the seventh determining sub-unit for determining a location of the main segment character in the license plate area image And determining that the connected domain where the sub-segment character is located is located to the right of the main segment character.
可选地,所述第六确定子单元,包括:第八确定子单元、第九确定子单元和执行子单元;所述第八确定子单元,用于判断第一区域的高度与所述主段字符的高度是否一致;当所述第一区域的高度与所述主段字符的高度一致时,确定所述第一区域为所述子段字符所在的连通域;其中,所述第一区域为从所述主段字符的左侧至与所述左侧距离预设第三数量个字符之间的区域;或者所述第九确定子单元,用于判断第二区域的高度与所述主段字符的高度是否一致;当所述第二区域的高度与所述主段字符的高度一致时,确定所述第二区域为所述子段字符所在的连通域;其中,所述第二区域为从与所述主段字符的左侧距离预设第四数量个字符至与所述左侧距离预设第五数量个字符之间的区域;所述执行子单元,用于当所述第二区域的高度与所述主段字符的高度不一致,且为第一次判断第二区域的高度与所述主段字符的高度是否一致时,反转所述第二区域中的颜色,执行所述判断第二区域的高度与所述主段字符的高度是否一致。Optionally, the sixth determining subunit includes: an eighth determining subunit, a ninth determining subunit, and an executing subunit; and the eighth determining subunit, configured to determine a height of the first area and the main Whether the height of the segment character is consistent; when the height of the first region is consistent with the height of the main segment character, determining that the first region is a connected domain in which the sub-segment character is located; wherein the first region An area between the left side of the main segment character and a third number of characters from the left side; or the ninth determining subunit, configured to determine the height of the second area and the main Whether the height of the segment character is consistent; when the height of the second region is consistent with the height of the main segment character, determining that the second region is a connected domain in which the sub-segment character is located; wherein the second region An area between a fourth number of characters from a left side of the main segment character and a fifth number of characters preset from the left side; the execution subunit, when the The height of the two regions and the height of the main segment character Consistently, and when it is determined for the first time whether the height of the second region is consistent with the height of the main segment character, the color in the second region is reversed, and the determining the height of the second region and the main segment are performed Whether the height of the characters is the same.
可选地,所述第七确定子单元,包括:第十确定子单元、第十一确定子单元和第十二确定子单元;所述第十确定子单元,用于判断第三区域的下界与所述主段字符是否一致,且所述第三区域的高度是否所述主段字符高度的四分之三;若为是,则确定所述第三区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符右侧距离预设第六数量个字符至与所述右侧距离预设第七数量个字符之间的区域;或者所述第十一确定子单元,用于判断第四区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第四区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第八数量个字符至与所述右侧距离预设第九数量个字符之间的区域;或者所述第十二确定子单元,用于判断第五区域的高度 与所述主段字符的高度是否一致;若为是,则确定所述第五区域为所述子段字符所在的连通域;其中,所述第五区域为从与所述主段字符的右侧距离预设第十数量个字符至与所述右侧距离预设第十一数量个字符之间的区域。Optionally, the seventh determining subunit includes: a tenth determining subunit, an eleventh determining subunit, and a twelfth determining subunit; and the tenth determining subunit, configured to determine a lower bound of the third region Whether it is consistent with the main segment character, and the height of the third region is three-quarters of the height of the main segment character; if yes, determining that the third region is the communication where the sub-segment character is located a region; wherein the fourth region is an area between a sixth number of characters from a right side of the main segment character and a seventh number of characters from the right side; or An eleven determining subunit, configured to determine whether a height of the fourth area is consistent with a height of the main segment character; if yes, determining that the fourth area is a connected domain where the sub-segment character is located; The fourth area is an area between an eighth number of characters from a right side of the main character character and a ninth number of characters preset to the right side distance; or the twelfth determiner a unit for determining a height of the fifth area and the main section Whether the height of the characters is consistent; if yes, determining that the fifth area is a connected domain where the sub-segment character is located; wherein the fifth area is a preset distance from a right side of the main segment character Tens of characters to an area between the eleventh number of characters preset to the right side.
可选地,所述第五确定子单元,包括:第十三确定子单元、第十四确定子单元和第十五确定子单元;所述第十三确定子单元,用于根据预设的第一分类模型,判断所述子段区域中是否存在所述子段字符;所述第十四确定子单元,用于若所述子段区域中存在所述子段字符,则根据预设的第二分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符;所述第十五确定子单元,用于若所述子段区域中不存在所述子段字符,则执行所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域。Optionally, the fifth determining subunit includes: a thirteenth determining subunit, a fourteenth determining subunit, and a fifteenth determining subunit; the thirteenth determining subunit, configured to be according to a preset a first classification model, determining whether the sub-segment character exists in the sub-segment area; the fourteenth determining sub-unit, configured to: if the sub-segment character exists in the sub-segment area, according to a preset a second classification model, the sub-segment character in the license plate to be identified is determined in the sub-segment area; the fifteenth determining sub-unit is configured to: if the sub-segment does not exist in the sub-segment area And performing, according to the position of the main segment character in the license plate area image, determining a connected domain in which the sub-segment character is located in the license plate area image.
本申请的一种实施例再提出了一种存储介质,用于存储可执行代码,所述可执行代码用于在运行时执行如上述任一所述的识别车牌中字符的方法。An embodiment of the present application further provides a storage medium for storing executable code for performing a method of identifying characters in a license plate as described above at runtime.
本申请的一种实施例再提出了一种应用程序,用于在运行时执行如上述任一所述的识别车牌中字符的方法。An embodiment of the present application further proposes an application for performing a method of recognizing characters in a license plate as described above at runtime.
本申请的一种实施例再提出了一种识别车牌中字符的设备,包括:处理器和存储器;An embodiment of the present application further provides an apparatus for recognizing characters in a license plate, including: a processor and a memory;
所述存储器用于存储可执行程序代码;The memory is for storing executable program code;
所述处理器,用于通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以执行如上述任一所述的识别车牌中字符的方法。The processor, configured to execute a program corresponding to the executable program code by reading executable program code stored in the memory to perform a method of recognizing a character in a license plate as described in any of the above.
本申请实施例提供的识别车牌中字符的方法及装置,首先,能够在获取到的待识别车牌的车牌区域图像中,确定待识别车牌中的初始主段字符;接下来,判断初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;将位于初始主段字符左端或右端的、属于子段字符的字符删除,得到待识别车牌的主段字符;最后,根据主段字符的位置,确定待识别车牌中的子段字符。这样,能够排除与主段字符连接较紧的子段字符的干扰,得到精准的主段字符,进而根据精确的主段字符确定子段字符。由于本申请实施例没 有使用固定模板,能够根据不同的应用场景识别多种类型的单层车牌,适用范围较广。The method and device for recognizing a character in a license plate provided by the embodiment of the present application, firstly, determining the initial main segment character in the license plate to be identified in the obtained license plate area image of the license plate to be identified; and then determining the initial main segment character Whether the character belonging to the sub-segment character exists in the left or right end character; the character belonging to the sub-segment character at the left end or the right end of the initial main segment character is deleted, and the main segment character of the license plate to be recognized is obtained; finally, according to the main segment character The position of the sub-segment in the license plate to be identified. In this way, the interference of the sub-segment characters that are tightly connected with the main segment character can be excluded, the accurate main segment character is obtained, and the sub-segment characters are determined according to the precise main segment character. Since the embodiment of the present application does not use a fixed template, multiple types of single-layer license plates can be identified according to different application scenarios, and the scope of application is wide.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings to be used in the embodiments or the related art description will be briefly described below. Obviously, the drawings in the following description are only Some embodiments of the application may also be used to obtain other figures from those of ordinary skill in the art without departing from the scope of the invention.
图1为本申请实施例的识别车牌中字符的方法的一种流程图;1 is a flow chart of a method for recognizing characters in a license plate according to an embodiment of the present application;
图2为本申请实施例的多种车牌的示意图;2 is a schematic view of a plurality of license plates according to an embodiment of the present application;
图3为本申请实施例的识别车牌中字符的方法的又一种流程图;FIG. 3 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application; FIG.
图4为本申请实施例的识别车牌中字符的方法的另一种流程图;4 is another flow chart of a method for recognizing characters in a license plate according to an embodiment of the present application;
图5为本申请实施例的识别车牌中字符的方法的再一种流程图;FIG. 5 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application; FIG.
图6为本申请实施例的识别车牌中字符的方法的再一种流程图;FIG. 6 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application; FIG.
图7为本申请实施例的识别车牌中字符的装置的一种结构图;7 is a structural diagram of an apparatus for recognizing characters in a license plate according to an embodiment of the present application;
图8为本申请实施例的识别车牌中字符的装置的又一种结构图;FIG. 8 is still another structural diagram of an apparatus for recognizing characters in a license plate according to an embodiment of the present application; FIG.
图9为本申请实施例的识别车牌中字符的设备的示意图。FIG. 9 is a schematic diagram of an apparatus for recognizing characters in a license plate according to an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
本申请实施例公开了一种识别车牌中字符的方法。参见图1,图1为本申请实施例的识别车牌中字符的方法的一种流程图,包括如下步骤:The embodiment of the present application discloses a method for recognizing characters in a license plate. Referring to FIG. 1, FIG. 1 is a flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application, including the following steps:
步骤101,获取待识别车牌的车牌区域图像;Step 101: Acquire an image of a license plate area of the license plate to be identified;
步骤102,将所述车牌区域图像中字符数量最多的连续字符序列、确定为所述待识别车牌中的初始主段字符;Step 102: Determine a sequence of consecutive characters having the largest number of characters in the license plate area image as an initial main segment character in the to-be-identified license plate;
本申请实施例应用于识别单层车牌中的主段字符和子段字符。The embodiment of the present application is applied to identify a main segment character and a sub-segment character in a single-layer license plate.
首先,可以通过摄像设备获取包含待识别车牌的场景图像,在场景图像中确定待识别车牌对应的车牌区域图像;First, the scene image including the license plate to be identified may be acquired by the image capturing device, and the license plate area image corresponding to the license plate to be identified is determined in the scene image;
然后,识别车牌区域图像中的所有字符,并将识别出的所有字符作为待识别车牌中的粗识别主段字符,但不包括位于底色与待识别车牌的主背景颜色相反区域的字符。Then, all the characters in the license plate area image are identified, and all the recognized characters are used as the rough recognition main segment characters in the license plate to be recognized, but the characters located in the opposite region of the main background color of the license plate to be recognized are not included.
可以理解的,当待识别车牌中包括子段字符时,粗识别主段字符中可能包括子段字符。It can be understood that when the sub-segment character is included in the license plate to be identified, the sub-segment character may be included in the rough recognition main segment character.
举例说明,如图2所示,图2为本申请实施例的多种车牌的示意图,在图2中,车牌A1对应的粗识别主段字符可能为96078,车牌A2对应的粗识别主段字符可能为54848,车牌A3对应的粗识别主段字符可能为8308,车牌A4对应的粗识别主段字符可能为54977,车牌A5对应的粗识别主段字符可能为62709,车牌A6对应的粗识别主段字符可能为58562,车牌A7对应的粗识别主段字符可能为58626,车牌A8对应的粗识别主段字符可能为45920,车牌A9对应的粗识别主段字符可能为32415,车牌A10对应的粗识别主段字符可能为98952,车牌A11对应的粗识别主段字符可能为40163,车牌A12对应的粗识别主段字符可能为9186,车牌B1对应的粗识别主段字符可能为26029,车牌B2对应的粗识别主段字符可能为3327,车牌B3对应的粗识别主段字符可能为7778D,车牌C1对应的粗识别主段字符可能为G4297,车牌C2对应的粗识别主段字符可能为8544,车牌D1对应的粗识别主段字符可能为3890GAA,车牌D2对应的粗识别主段字符可能为1021,车牌D3对应的粗识别主段字符可能为0528;可见,车牌对应的粗识别主段字符可能不是准确的主段字符,可能会包括子段字符;比如,车牌C1对应的粗识别主段字符G4297中包括了子段字符G,D1对应的粗识别主段字符3890GAA中包括了子段字符GAA。For example, as shown in FIG. 2, FIG. 2 is a schematic diagram of various license plates according to an embodiment of the present application. In FIG. 2, the rough identification main segment character corresponding to the license plate A1 may be 96078, and the rough identification main segment character corresponding to the license plate A2. May be 54848, the rough identification main segment character corresponding to the license plate A3 may be 8308, the rough recognition main segment character corresponding to the license plate A4 may be 54977, the rough identification main segment character corresponding to the license plate A5 may be 62709, the rough identification main corresponding to the license plate A6 The segment character may be 58562, the rough recognition main segment character corresponding to the license plate A7 may be58626, the rough recognition main segment character corresponding to the license plate A8 may be 45920, and the rough recognition main segment character corresponding to the license plate A9 may be 32415, and the license plate A10 corresponds to the coarse The identification of the main segment character may be 98952, the rough recognition main segment character corresponding to the license plate A11 may be 40163, the rough recognition main segment character corresponding to the license plate A12 may be 9186, and the rough recognition main segment character corresponding to the license plate B1 may be 26029, the license plate B2 corresponding The rough recognition main segment character may be 3327, the rough identification main segment character corresponding to the license plate B3 may be 7778D, and the rough recognition main segment character corresponding to the license plate C1 may be G4297, and the license plate C2 corresponds to the coarse The main character of the main segment may be 8544. The rough recognition main segment character corresponding to the license plate D1 may be 3890GAA, the rough recognition main segment character corresponding to the license plate D2 may be 1021, and the rough recognition main segment character corresponding to the license plate D3 may be 0528; visible, the license plate The corresponding rough recognition main segment character may not be an accurate main segment character, and may include sub-segment characters; for example, the rough recognition main segment character G4297 corresponding to the license plate C1 includes the sub-segment character G, and the coarse identification main segment character corresponding to D1 The sub-segment character GAA is included in the 3890GAA.
接下来,在粗识别字符中,将字符数量最多的连续字符序列确定为初始主段字符;这样,可以从粗识别主段字符中排除掉与主段字符距离较远的子段字符,进一步限定了主段字符的范围。具体地,可以在粗识别主段字符中,根据字符的间距、宽度及中心距信息,确定初始主段字符。但是,在子段字符距离主段字符的左侧或右侧较为接近的场景下,初始主段字符的左侧或右 侧中仍然可能包括子段字符。Next, in the coarse identification character, the continuous character sequence with the largest number of characters is determined as the initial main segment character; thus, the sub-segment characters far from the main segment character can be excluded from the coarse recognition main segment character, and further limited The range of the main segment characters. Specifically, the initial main segment character may be determined according to the pitch, width, and center distance information of the character in the rough identification main segment character. However, in a scene where the sub-segment characters are closer to the left or right side of the main segment character, the sub-segment characters may still be included in the left or right side of the initial main segment character.
因此,为了得到精确的主段字符,以及在精确主段字符的基础上确定子段字符,还需要对初始主段字符进行进一步限定。Therefore, in order to obtain an accurate main segment character and to determine the sub-segment character based on the exact main segment character, the initial main segment character needs to be further defined.
比如对于图2中的车牌C1和车牌D1,还需要对车牌C1和车牌D1对应的初始主段字符进行进一步的限定。For example, for the license plate C1 and the license plate D1 in FIG. 2, it is necessary to further define the initial main segment characters corresponding to the license plate C1 and the license plate D1.
步骤103,根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;Step 103: Determine, according to a preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character;
在本步骤中,可以分别判断位于初始主段字符的左端的字符中是否存在属于子段字符的字符,以及判断位于初始主段字符的右端的字符中是否存在属于子段字符的字符。为了方便理解,本申请实施例按照先判断左端再判断右端的顺序进行说明,当然,判断左端的步骤也可以与判断右端的步骤同时进行。需要说明的是,本申请对判断位于初始主段字符的左端的字符中是否存在属于子段字符的字符的步骤、与判断位于初始主段字符的右端的字符中是否存在属于子段字符的字符的步骤的执行先后顺序不加以限制。In this step, it is possible to determine whether there is a character belonging to the sub-segment character in the character at the left end of the initial main segment character, and whether there is a character belonging to the sub-segment character in the character at the right end of the initial main segment character. For ease of understanding, the embodiment of the present application is described in the order of first determining the left end and then determining the right end. Of course, the step of determining the left end may also be performed simultaneously with the step of determining the right end. It should be noted that, in the present application, whether there is a character belonging to the sub-segment character in the character located at the left end of the initial main segment character, and whether the character belonging to the sub-segment character exists in the character located at the right end of the initial main segment character The order of execution of the steps is not limited.
在本申请的一种优选实施例中,参见图3,图3为本申请实施例的识别车牌中字符的方法的又一种流程图,步骤103具体可以包括:In a preferred embodiment of the present application, referring to FIG. 3, FIG. 3 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application. Step 103 may specifically include:
子步骤11,从所述初始主段字符的左端提取第一预设数量个字符或从右端提取第二预设数量个字符;Sub-step 11, extracting a first preset number of characters from the left end of the initial main segment character or extracting a second preset number of characters from the right end;
子步骤12,判断所述第一预设数量个字符或所述第二预设数量个字符中的字符大小是否相同;Sub-step 12, determining whether the character sizes in the first preset number of characters or the second preset number of characters are the same;
子步骤13,若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小不相同,则确定所述第一预设数量个字符中第一较小字符的大小、或所述第二预设数量个字符中第二较小字符的大小;判断所述第一较小字符或所述第二较小字符是否为字母;若所述第一较小字符或所述第二较小字符为字母,则确定所述第一较小字符或所述第二较小字符属于所述子段字符;Sub-step 13, determining, if the character size of the first preset number of characters or the second preset number of characters is different, determining a size of the first smaller one of the first preset number of characters Or the size of the second smaller number of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or Determining that the second smaller character is a letter, and determining that the first smaller character or the second smaller character belongs to the sub-segment character;
子步骤14,若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小均相同,或者所述第一较小字符和所述第二较小字符不为字母,则确定位于所述初始主段字符的左端或右端的字符中不存在属于子段字符的字 符。Sub-step 14, if the characters of the first preset number of characters or the second preset number of characters are the same, or the first smaller character and the second smaller character are not letters Then, it is determined that there is no character belonging to the sub-segment character in the character at the left end or the right end of the initial main segment character.
在实际应用中,由于有些子段字符与主段字符的距离较为接近,并且在通常情况下,与主段字符较为接近的子段字符的大小会小于主段字符的大小,且与主段字符较为接近的子段字符为字母;因此,可以通过确定位于初始主段字符左侧或右侧的字符的大小,以及判断位于初始主段字符左端或右端的字符是否为字母来确定位于初始主段字符的左端或右端的字符是否属于子段字符。In practical applications, the distance between some sub-segment characters and the main segment characters is relatively close, and in normal cases, the size of the sub-segment characters that are closer to the main segment characters is smaller than the size of the main segment characters, and the main segment characters are The closer sub-segment characters are letters; therefore, the initial main segment can be determined by determining the size of the character located to the left or right of the initial main segment character and determining whether the character at the left or right end of the initial main segment character is a letter. Whether the character at the left or right end of the character belongs to the sub-segment character.
本申请实施例可以应用于确定任意车牌中的字符,如,可以用于确定GCC国家成员阿联酋各酋长国车牌中的字符,或者,其他类型车牌中的字符,本申请实施例对此不做限定。并且,在字符确定过程中,第一预设数量个字符可以是初始主段字符中从左往右的两个字符,第二预设数量个字符可以是初始主段字符中从左往右数的第四个和第五个字符;当然,可以根据实际需要,更改第一预设数量值和第二预设数量值。The embodiment of the present application can be applied to determine a character in any license plate. For example, it can be used to determine a character in a license plate of a member of the GCC country in the UAE, or a character in another type of license plate, which is not limited in the embodiment of the present application. Moreover, in the character determining process, the first preset number of characters may be two characters from left to right in the initial main segment character, and the second preset number of characters may be from left to right in the initial main segment character. The fourth and fifth characters; of course, the first preset number value and the second preset number value can be changed according to actual needs.
具体地,在判断初始主段字符的左侧是否与子段字符连接时,首先,可以在初始主段字符的左端,按照从左往右的顺序提取第一个字符和第二个字符;接下来,判断所述第一个字符和所述第二个字符的大小是否相同;若所述第一个字符和所述第二个字符的大小不同,通常情况下所述第一个字符小于包括第二字符在内的其他字符,则在重新确定第一个字符的大小之后,再确定所述第一个字符是否为字母;若所述第一个字符为字母,则所述第一个字符属于子段字符;若所述第一个字符和所述第二个字符的大小相同,或者所述第一个字符不为字母,则初始主段字符的左端不存属于子段字符的字符。Specifically, when determining whether the left side of the initial main segment character is connected to the sub-segment character, first, the first character and the second character may be extracted in the order from left to right at the left end of the initial main segment character; And determining whether the size of the first character and the second character are the same; if the size of the first character and the second character are different, the first character is usually less than the first character. The other characters, including the second character, determine whether the first character is a letter after re-determining the size of the first character; if the first character is a letter, the first character It belongs to a sub-segment character; if the first character and the second character have the same size, or the first character is not a letter, the left end of the initial main segment character does not have a character belonging to the sub-segment character.
需要说明的是,由于在初始主段字符中,所述第一个字符与其他字符的大小不同,这样可能导致在初始主段字符中,对所述第一个字符的识别不准确;因此,在确定所述第一个字符的大小之后,需要对所述第一个字符进行重新识别,以确定所述第一个字符是否为字母。It should be noted that, in the initial main segment character, the first character is different in size from other characters, which may result in inaccurate recognition of the first character in the initial main segment character; therefore, After determining the size of the first character, the first character needs to be re-identified to determine whether the first character is a letter.
在判断初始主段字符的右侧是否与子段字符连接时,首先,可以在初始主段字符的右端,按照从左到右顺序提取的第四个字符及第四个字符以后的字符;接下来,判断所述第四个字符及第四个字符以后的字符的大小是否相同;若所述第四个字符及第四个字符以后的字符大小不同,通常情况下所述 第五个字符及所述第五个字符以后的字符小于包括第四个字符在内的其他字符,则在重新确定所述第四个字符以后的字符,也即第五个字符及所述第五个字符以后的字符的大小之后,再确定所述第五个字符及所述第五个字符以后的字符是否为字母;若所述第五个字符及所述第五个字符以后的字符为字母,则所述第五个字符及所述第五个字符以后的字符属于子段字符;若所述第四个字符及所述第四个字符以后的字符的大小相同,或者所述第五个字符及所述第五个字符以后的字符不为字母,则初始主段字符的右端不存在属于子段字符的字符。When judging whether the right side of the initial main segment character is connected with the sub-segment character, first, at the right end of the initial main segment character, the fourth character and the fourth character after the left-to-right order may be extracted; And determining whether the size of the characters after the fourth character and the fourth character are the same; if the characters of the fourth character and the fourth character are different in size, the fifth character is usually If the character after the fifth character is smaller than other characters including the fourth character, the characters after the fourth character are re-determined, that is, after the fifth character and the fifth character. After the size of the character, determining whether the fifth character and the character after the fifth character are letters; if the fifth character and the character after the fifth character are letters, The fifth character and the character after the fifth character belong to the sub-segment character; if the fourth character and the character after the fourth character are the same size, or the fifth character and the fifth Characters after the characters are not letters, and there are no characters belonging to the sub-segment characters at the right end of the initial main segment character.
需要说明的是,同理,由于在初始主段字符中,所述第四个字符及第四个字符以后的字符与其他字符的大小不同,这样可能导致在初始主段字符中,对所述第五个字符及所述第五个字符以后的字符的识别不准确;因此,在确定所述第五个字符及所述第五个字符以后的字符的大小之后,需要对所述第五个字符及所述第五个字符以后的字符进行重新识别,以确定所述第五个字符及所述第五个字符以后的字符是否为字母。It should be noted that, in the initial main character, the characters after the fourth character and the fourth character are different from the other characters, which may result in the initial main segment character being The recognition of the fifth character and the characters after the fifth character is inaccurate; therefore, after determining the size of the fifth character and the character after the fifth character, the fifth The character and the character after the fifth character are re-identified to determine whether the fifth character and the character after the fifth character are letters.
举例说明,如图2中的车牌C1和车牌D1;其中,车牌C1对应的初始主段字符为G4297,按照从左到右顺序对应的第一个字符和第二个字符分别为G和4,可见,字符G的大小小于字符4,且字符4的上部存在空白区域,可能导致初始主段字符中对字符G的误识别;因此,需要在重新确定字符G的大小之后重新识别字符G,当确定字符G为字母时,可以确定车牌C1对应的初始主段字符的左侧与子段字符相连接,且第一个字符G为子段字符;而车牌D1对应的初始主段字符为3890GAA,按照从左到右顺序对应的第四个字符和第四个字符之后的字符分别为0和GAA,可见,字符GAA的大小小于字符0,且字符GAA为英文字母,且字符GAA的上部和下部均存在空白区域,可能导致初始主段字符中对字符GAA的误识别;因此,需要在重新确定字符GAA的大小之后重新识别字符GAA,当确定字符GAA为字母时,可以确定车牌E对应的初始主段字符的右侧与子段字符相连接,且第五个字符和第五个字符之后的字符GAA为子段字符。For example, the license plate C1 and the license plate D1 in FIG. 2; wherein the initial main segment character corresponding to the license plate C1 is G4297, and the first character and the second character corresponding to the order from left to right are G and 4, respectively. It can be seen that the size of the character G is smaller than the character 4, and there is a blank area in the upper part of the character 4, which may cause misidentification of the character G in the initial main segment character; therefore, it is necessary to re-recognize the character G after re-determining the size of the character G, when When it is determined that the character G is a letter, it can be determined that the left side of the initial main segment character corresponding to the license plate C1 is connected with the sub-segment character, and the first character G is a sub-segment character; and the initial main segment character corresponding to the license plate D1 is 3890GAA, According to the fourth character and the fourth character after the order from left to right, the characters are 0 and GAA respectively. It can be seen that the size of the character GAA is smaller than the character 0, and the character GAA is an English letter, and the upper and lower parts of the character GAA are There is a blank area, which may cause misidentification of the character GAA in the initial main segment character; therefore, it is necessary to re-recognize the character GAA after re-determining the size of the character GAA, when determining that the character GAA is a letter The initial character may determine the license plate main section E corresponding right sub-segment is connected to the character, and the fifth character after character GAA characters and fifth sub-segment characters.
需要说明的是,由于全球各国家或者地区的车牌类型非常多,且车牌中字符样式的差异也较大,为了更加准确的识别车牌中的字符,可以根据当前应用区域中,车牌中子段字符距离主段字符较为接近的场景,总结出区分主 段字符与接近主段字符的子段字符的判断规则。It should be noted that, because there are many types of license plates in various countries and regions around the world, and the difference in character styles in license plates is also large, in order to more accurately identify the characters in the license plate, according to the current application area, the license plate middle sub-segment characters A scene in which the characters of the main segment are closer to each other, and a judgment rule that distinguishes the main segment character from the sub segment character close to the main segment character is summarized.
具体地,可以根据当前应用区域中车牌中字符的样式,选取出子段字符位于主段字符的左侧或右侧且与主段字符距离较近的所有车牌,总结这些车牌中子段字符的特征,以及根据这些车牌中子段字符的特征,归纳出能够区分这些车牌中子段字符的判断规则,用于判断粗识别主段字符的左侧或右侧是否与子段字符相连接。Specifically, according to the style of the characters in the license plate in the current application area, all the license plates whose sub-segment characters are located on the left or right side of the main segment character and are close to the main segment character may be selected, and the sub-segment characters in the license plate characters are summarized. The feature, and according to the characteristics of the sub-segment characters in the license plates, a judgment rule capable of distinguishing the sub-segment characters of the license plates is used to determine whether the left or right side of the rough-recognition main segment character is connected with the sub-segment characters.
需要说明的是,随着GCC国家成员阿联酋各酋长国车牌类型的增加,本申请实施例可以根据新增车牌中的字符分布情况,在原有判断规则的基础上进行扩展,以识别新增的车牌类型。It should be noted that, with the increase of the license plate type of the Emirates emirates of the GCC countries, the embodiment of the present application can expand on the basis of the original judgment rules according to the distribution of characters in the newly added license plate to identify the new license plate type. .
当然,本申请实施例的应用场景不限于GCC国家成员阿联酋各酋长国,在实际应用中,还可以应用于识别其他国家和地区的车牌类型,具体地,可以根据所述其他国家和地区的车牌中的字符分布情况,确定用于判断粗识别主段字符的左侧或右侧是否与子段字符相连接的判断规则。例如,针对GCC国家成员阿联酋各酋长国的车牌,可以根据其字符分布情况,确定字符识别规则。Of course, the application scenario of the embodiment of the present application is not limited to the members of the GCC countries in the UAE emirates. In practical applications, it can also be applied to identify license plate types of other countries and regions. Specifically, according to the license plates of other countries and regions. The distribution of characters determines the judgment rule for judging whether the left or right side of the main character of the rough recognition is connected to the sub-segment character. For example, for license plates of members of the GCC countries in the UAE emirates, character recognition rules can be determined based on their character distribution.
步骤104,将位于所述初始主段字符左端或右端的、属于子段字符的字符删除,得到所述待识别车牌中的主段字符;Step 104: Delete a character belonging to a sub-segment character located at a left end or a right end of the initial main segment character to obtain a main segment character in the to-be-identified license plate;
在本步骤中,当确定位于初始主段字符的左端或者右端的字符属于子段字符时,可以从初始子段字符的左端或右端删除属于子段字符的字符,以得到精准的主段字符。In this step, when it is determined that the character located at the left end or the right end of the initial main segment character belongs to the sub-segment character, the character belonging to the sub-segment character may be deleted from the left end or the right end of the initial sub-segment character to obtain an accurate main segment character.
举例说明,如图2中的车牌C1和车牌D1,车牌C1对应的初始主段字符为G4297,且字符G属于子段字符,可以从初始主段字符中删除字符G,得到精确的主段字符为4297;车牌D1对应的初始主段字符为3890GAA,且字符GAA属于子段字符,可以从初始主段字符3890GAA中删除字符GAA,得到精确的主段字符为3890。For example, as shown in FIG. 2, the license plate C1 and the license plate D1, the initial main segment character corresponding to the license plate C1 is G4297, and the character G belongs to the sub-segment character, and the character G can be deleted from the initial main segment character to obtain an accurate main segment character. 4297; the initial main segment character corresponding to the license plate D1 is 3890GAA, and the character GAA belongs to the sub-segment character, and the character GAA can be deleted from the initial main segment character 3890GAA, and the exact main segment character is 3890.
步骤105,根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的子段字符。Step 105: Determine a sub-segment character in the license plate to be identified according to a location of the main segment character in the license plate area image.
具体地,通过步骤101~104的处理,已经得到了精准的主段字符,接下来, 可以根据精准主段字符来确定子段字符。Specifically, through the processing of steps 101-104, the accurate main segment character has been obtained, and then, the sub-segment character can be determined according to the accurate main segment character.
在本申请的再一种优选实施例中,参见图4,图4为本申请实施例的识别车牌中字符的方法的另一种流程图,所述步骤104可以包括:In another preferred embodiment of the present application, referring to FIG. 4, FIG. 4 is another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application. The step 104 may include:
子步骤21,根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域;Sub-step 21, determining, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image;
子步骤22,在所述连通域中确定所述子段字符所在的子段区域;Sub-step 22, determining, in the connected domain, a sub-segment area in which the sub-segment character is located;
子步骤23,根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符。Sub-step 23, determining the sub-segment characters in the to-be-identified license plate in the sub-segment area according to a preset classification model.
具体地,可以根据精确的主段字符在车牌区域图像中所处的位置,确定子段字符所在的连通域;接下来,在连通域中确定包括子段区域的最小外接矩形,可以认为最小外接矩形就是子段区域;最后,根据预设的分类模型,在子段区域中识别子段字符。Specifically, the connected domain in which the sub-segment character is located may be determined according to the position of the exact main segment character in the license plate area image; next, the minimum circumscribed rectangle including the sub-segment region is determined in the connected domain, and the minimum external connection may be considered The rectangle is the sub-segment area; finally, the sub-segment characters are identified in the sub-segment area according to the preset classification model.
进一步地,在本申请的一种优选实施例中,参见图5,图5为本申请实施例的识别车牌中字符的方法的再一种流程图,所述子步骤21,具体可以包括:Further, in a preferred embodiment of the present application, referring to FIG. 5, FIG. 5 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application. The sub-step 21 may specifically include:
子步骤31,根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的左侧;或者Sub-step 31, determining, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located on the left side of the main segment character; or
子步骤32,根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的右侧。Sub-step 32, determining, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located to the right of the main segment character.
需要说明的是,本申请对于确定子段字符所在的连通域位于主段字符的左侧或者右侧的顺序不加以限制,可以先判断子段字符是否处于左侧再判断子段字符是否处于右侧,也可以先判断子段字符是否处于右侧再判断子段字符是否处于左侧。It should be noted that, in this application, the order in which the connected domain where the sub-segment character is located is located on the left or the right side of the main segment character is not limited, and the sub-segment character may be determined to be on the left side to determine whether the sub-segment character is in the right state. On the side, you can also determine whether the sub-segment character is on the right side and then determine whether the sub-segment character is on the left side.
由于子段字符只可能位于主段字符的左侧或者右侧,不可能同时位于主段字符的左侧和右侧,因此,一旦确定子段字符所在连通域位于主段字符的左侧或者右侧,无需再继续判断子段字符是否位于主段字符的另一侧,就可进一步执行确定子段区域的子步骤22。Since the sub-segment characters may only be located on the left or right side of the main segment character, it is impossible to be located at the left and right sides of the main segment character at the same time. Therefore, once it is determined that the connected field of the sub-segment character is located to the left or right of the main segment character, On the side, it is no longer necessary to continue to determine whether the sub-segment character is located on the other side of the main segment character, and sub-step 22 of determining the sub-segment region can be further performed.
进一步地,在本申请的一种优选实施例中,子步骤31具体可以包括:Further, in a preferred embodiment of the present application, the sub-step 31 may specifically include:
判断第一区域的高度与所述主段字符的高度是否一致;当所述第一区域的高度与所述主段字符的高度一致时,确定所述第一区域为所述子段字符所在的连通域;其中,所述第一区域为从所述主段字符的左侧至与所述左侧的距离预设第三数量个字符之间的区域;或者Determining whether the height of the first area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is the sub-segment character a connected domain; wherein the first area is an area between a left side of the main section character and a distance from the left side to preset a third number of characters; or
判断第二区域的高度与所述主段字符的高度是否一致;当所述第二区域的高度与所述主段字符的高度一致时,确定所述第二区域为所述子段字符所在的连通域;其中,所述第二区域为从与所述主段字符的左侧距离预设第四数量个字符至与所述左侧的距离预设第五数量个字符之间的区域;Determining whether the height of the second area is consistent with the height of the main segment character; when the height of the second area is consistent with the height of the main segment character, determining that the second area is the sub-segment character a connected domain; wherein the second area is an area between a predetermined fourth number of characters from a left side of the main character character and a fifth number of characters preset by a distance from the left side;
当所述第二区域的高度与所述主段字符的高度不一致,且为第一次判断第二区域的高度与所述主段字符的高度是否一致时,反转所述第二区域中的颜色,执行所述判断第二区域的高度与所述主段字符的高度是否一致。When the height of the second area is inconsistent with the height of the main segment character, and is the first time determining whether the height of the second area is consistent with the height of the main segment character, inverting the second area Color, performing the determining whether the height of the second region is consistent with the height of the main segment character.
其中,预设第三数量个字符可以为两个字符,预设第四数量个字符可以为三个字符,预设第五数量个字符可以为六个字符。The preset third number of characters may be two characters, and the preset fourth number of characters may be three characters, and the preset fifth number of characters may be six characters.
需要说明的是,只有在第一次判断第二区域的高度与所述主段字符的高度不一致的情况下,才需要反转第二区域中的颜色,针对第二区域再执行一次判断处理,如果针对第二区域的第二次判断结果仍然为第二区域的高度与所述主段字符的高度不一致,则说明第二区域不为子段字符所在的连通域。It should be noted that, only when it is determined that the height of the second area is inconsistent with the height of the main segment character for the first time, it is necessary to invert the color in the second area, and perform another determination process for the second area. If the second judgment result for the second region is still that the height of the second region is inconsistent with the height of the main segment character, it indicates that the second region is not the connected domain in which the sub-segment character is located.
这样,就可以确定主段字符的左侧是否存在连通域,如果主段字符的左侧存在连通域,还可以确定连通域相对于主段字符的位置。In this way, it can be determined whether there is a connected domain on the left side of the main segment character, and if there is a connected domain on the left side of the main segment character, the position of the connected domain relative to the main segment character can also be determined.
在本申请的一种优选实施例中,子步骤32具体可以包括:In a preferred embodiment of the present application, the sub-step 32 may specifically include:
判断第三区域的下界与所述主段字符是否一致,且所述第三区域的高度是否所述主段字符高度的四分之三;若为是,则确定所述第三区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第六数量个字符至与所述右侧的距离预设第七数量个字符之间的区域;或者Determining whether a lower bound of the third region is consistent with the main segment character, and a height of the third region is three-quarters of a height of the main segment character; if yes, determining that the third region is the a connected domain in which the sub-segment character is located; wherein the fourth area is preset from a sixth number of characters from a right side of the main segment character to a distance from the right side to preset a seventh number of characters Area between; or
判断第四区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第四区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第八数量个字符至与所述右侧的距离预设第九数 量个字符之间的区域;或者Determining whether the height of the fourth area is consistent with the height of the main segment character; if yes, determining that the fourth area is a connected domain in which the sub-segment character is located; wherein the fourth area is a slave The right side of the main segment character is an area between a preset eighth number of characters and a distance from the right side preset by a ninth number of characters; or
判断第五区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第五区域为所述子段字符所在的连通域;其中,所述第五区域为从与所述主段字符的右侧距离预设第十数量个字符至与所述右侧的距离预设第十一数量个字符之间的区域。Determining whether the height of the fifth area is consistent with the height of the main segment character; if yes, determining that the fifth area is a connected domain in which the sub-segment character is located; wherein the fifth area is a slave The right side of the main segment character is a region between a preset tenth number of characters and a distance from the right side to preset an eleventh number of characters.
其中,预设第六数量个字符可以为一个字符,预设第七数量个字符可以为三个字符,预设第八数量个字符可以为一个字符,预设第九数量个字符可以为四个字符,预设第十数量个字符可以为四个字符,预设第十一数量个字符可以为八个字符。The preset sixth number of characters may be one character, and the preset seventh number of characters may be three characters, and the preset eighth number of characters may be one character, and the preset ninth number of characters may be four characters. Character, the preset tenth number of characters can be four characters, and the eleventh number of characters can be eight characters by default.
这样,就可以确定主段字符的右侧是否存在连通域,如果主段字符的右侧存在连通域,还可以确定连通域相对于主段字符的位置。In this way, it can be determined whether there is a connected domain on the right side of the main segment character, and if there is a connected domain on the right side of the main segment character, the position of the connected domain relative to the main segment character can also be determined.
举例说明,如图2中的车牌C1和车牌D1;车牌C1中子段字符所在的连通域位于主段字符4297左侧的第一区域中;车牌D1中子段字符所在的连通域位于主段字符3890右侧的第三区域中。For example, the license plate C1 and the license plate D1 in FIG. 2; the connected domain where the sub-segment characters in the license plate C1 are located in the first area on the left side of the main character 4297; the connected domain in which the sub-segment characters in the license plate D1 are located in the main segment The third area on the right side of the character 3890.
接下来,在本申请的一种优选实施例中,子步骤23具体可以包括:Next, in a preferred embodiment of the present application, the sub-step 23 may specifically include:
根据预设的第一分类模型,判断所述子段区域中是否存在所述子段字符;Determining, according to the preset first classification model, whether the sub-segment character exists in the sub-segment area;
若为是,则根据预设的第二分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符;If yes, determining, according to the preset second classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area;
若为否,则执行子步骤21。If no, sub-step 21 is performed.
其中,预设的第一分类模型和第二分类模型均可以根据任意的车牌样式训练得到,如,可以根据GCC国家成员阿联酋各酋长国的车牌样式训练得到。分类模型可以是神经网络模型,也可以是应用支持向量机(support vector machine,SVM)分类模型,boost分类模型等,本申请对分类模型的具体形式不加以限制。The preset first classification model and the second classification model can be trained according to any license plate style, for example, according to the license plate style of the members of the GCC countries in the UAE. The classification model may be a neural network model, or a support vector machine (SVM) classification model, a boost classification model, etc., and the specific form of the classification model is not limited in this application.
具体地,第一分类模型用于确定子段区域中是否存在有效字符,也即判断是否存在子段字符,如果存在子段字符,则使用第二分类模型来识别子段区域中的子段字符。Specifically, the first classification model is used to determine whether there is a valid character in the sub-segment area, that is, whether there is a sub-segment character, and if there is a sub-segment character, the second classification model is used to identify the sub-segment character in the sub-segment area. .
可见,本申请实施例能够在获取到的待识别车牌的车牌区域图像中,确定待识别车牌中的初始主段字符;接下来,判断初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;将位于初始主段字符左端或右端的、属于子段字符的字符删除,得到待识别车牌的主段字符;最后,根据主段字符的位置,确定待识别车牌中的子段字符。这样,能够排除与主段字符连接较紧的子段字符的干扰,得到精准的主段字符,进而根据精确的主段字符确定子段字符。由于本申请实施例没有使用固定模板,能够根据不同的应用场景识别多种类型的单层车牌,适用范围较广。It can be seen that the embodiment of the present application can determine the initial main segment character in the license plate to be identified in the acquired license plate area image of the license plate to be identified; next, determine whether the belonging character of the left end or the right end of the initial main segment character exists The character of the segment character; the character belonging to the sub-segment character at the left or right end of the initial main segment character is deleted, and the main segment character of the license plate to be identified is obtained; finally, the sub-segment in the license plate to be identified is determined according to the position of the main segment character character. In this way, the interference of the sub-segment characters that are tightly connected with the main segment character can be excluded, the accurate main segment character is obtained, and the sub-segment characters are determined according to the precise main segment character. Since the fixed template is not used in the embodiment of the present application, multiple types of single-layer license plates can be identified according to different application scenarios, and the scope of application is wide.
本申请实施例还公开了一种识别车牌中字符的方法。参见图6,图6为本申请实施例的识别车牌中字符的方法的再一种流程图,包括如下步骤:The embodiment of the present application also discloses a method for recognizing characters in a license plate. Referring to FIG. 6, FIG. 6 is still another flowchart of a method for recognizing characters in a license plate according to an embodiment of the present application, including the following steps:
步骤601,获取包含待识别车牌的场景图像;将所述车牌区域图像中字符数量最多的连续字符序列、确定为所述待识别车牌中的初始主段字符;Step 601: Acquire a scene image that includes a license plate to be identified; and determine a sequence of consecutive characters having the largest number of characters in the license plate area image as an initial main segment character in the license plate to be identified;
步骤602,从所述初始主段字符中,提取从左往右的两个字符;Step 602: Extract two characters from left to right from the initial main segment characters.
步骤603,判断所述从左往右的第一个字符是否小于第二个字符;若为是,则执行步骤606,若为否,则执行步骤604; Step 603, it is determined whether the first character from left to right is smaller than the second character; if yes, step 606 is performed, if not, step 604 is performed;
步骤604,判断所述第一个字符是否为字母;若为是,则执行步骤605;若为否,则执行步骤606; Step 604, it is determined whether the first character is a letter; if yes, step 605 is performed; if not, step 606 is performed;
步骤605,确定所述第一个字符属于子段字符,以及从所述初始主段字符中删除所述第一个字符,得到精确的主段字符;执行步骤610; Step 605, determining that the first character belongs to the sub-segment character, and deleting the first character from the initial main segment character to obtain an accurate main segment character; performing step 610;
具体地,可以确定第一个字符的小大,并且重新识别第一个字符,确定第一个字符属于子段字符;并且,从初始主段字符中删除所述第一个字符;得到精确的主段字符。Specifically, the size of the first character can be determined, and the first character is re-identified to determine that the first character belongs to the sub-segment character; and the first character is deleted from the initial main segment character; Main segment character.
在实际应用中,可以初步确定待识别车牌为黎巴嫩国家的车牌。In practical applications, it can be initially determined that the license plate to be identified is a license plate of the Lebanese country.
步骤606,从所述初始主段字符中,提取从左往右数的第四个字符以及所述第四个字符以后的字符;Step 606: Extract, from the initial main segment character, a fourth character from left to right and a character after the fourth character;
步骤607,判断所述第五个字符以及所述第五个字符以后的字符、是否 小于所述第四个字符;若为是,则所述初始主段字符中不存在子段字符,若为否,则执行步骤608; Step 607, determining whether the fifth character and the character after the fifth character are smaller than the fourth character; if yes, the sub-segment character does not exist in the initial main segment character, if Otherwise, step 608 is performed;
步骤608,判断所述第五个字符以及所述第五个字符以后的字符是否为字母;若为是,则执行步骤609;若为否,则待识别车牌中不存在子段字符; Step 608, it is determined whether the fifth character and the character after the fifth character are letters; if yes, step 609 is performed; if not, the sub-segment character does not exist in the license plate to be identified;
步骤609,确定所述第五个字符以及所述第五个字符以后的字符属于子段字符,以及从所述初始主段字符中删除所述第五个字符以及所述第五个字符以后的字符,得到精确的主段字符;执行步骤610;Step 609, determining that the fifth character and the characters after the fifth character belong to the sub-segment character, and deleting the fifth character and the fifth character from the initial main segment character. Character, get the exact main segment character; perform step 610;
具体地,可以确定第五个字符以及第五个字符以后的字符的小大,并且重新识别第五个字符以及第五个字符以后的字符,确定第五个字符以及第五个字符以后的字符属于子段字符;并且,从初始主段字符中删除第五个字符以及第五个字符以后的字符;得到精确的主段字符。Specifically, the fifth character and the characters after the fifth character may be determined, and the fifth character and the characters after the fifth character are re-identified, and the fifth character and the characters after the fifth character are determined. It belongs to the sub-segment character; and, the fifth character and the character after the fifth character are deleted from the initial main segment character; the exact main segment character is obtained.
在实际应用中,可以初步确定待识别车牌为沙特国家的车牌。In practical applications, it can be initially determined that the license plate to be identified is a license plate of the Saudi state.
步骤610,判断第一区域的高度与所述主段字符的高度是否一致;若为是,则执行步骤616;若为否,则执行步骤611; Step 610, it is determined whether the height of the first area is consistent with the height of the main segment character; if yes, step 616 is performed; if not, step 611 is performed;
其中,所述第一区域为从所述主段字符的左侧至与所述左侧的距离两个字符之间的区域。The first area is an area between two characters from a left side of the main segment character to a distance from the left side.
步骤611,判断第二区域的高度与所述主段字符的高度是否一致;若为是,则执行步骤616;若为否,则执行步骤612; Step 611, it is determined whether the height of the second area is consistent with the height of the main segment character; if yes, step 616 is performed; if not, step 612 is performed;
其中,所述第二区域为从与所述主段字符的左侧距离三个字符至与所述左侧的距离六个字符之间的区域。The second area is an area between three characters from the left side of the main segment character and six characters from the left side.
步骤612,判断是否为第一次判断;若为是,则反转所述第二区域中的颜色,返回执行步骤611;若为否,则执行步骤613; Step 612, it is determined whether it is the first judgment; if yes, the color in the second area is reversed, and the process returns to step 611; if not, step 613 is performed;
步骤613,判断第三区域的下界与所述主段字符是否一致,且所述第三区域的高度是否所述主段字符高度的四分之三;若为是,则执行步骤616;若为否,则执行步骤614; Step 613, it is determined whether the lower boundary of the third area is consistent with the main segment character, and the height of the third area is three-quarters of the height of the main segment character; if yes, step 616 is performed; Otherwise, step 614 is performed;
其中,所述第四区域为从与所述主段字符的右侧距离一个字符至与所述右侧的距离三个字符之间的区域。The fourth area is an area between one character from a right side of the main segment character and three characters from a distance from the right side.
步骤614,判断第四区域的高度与所述主段字符的高度是否一致;若为是,则执行步骤616;若为否,则执行步骤615; Step 614, it is determined whether the height of the fourth area is consistent with the height of the main segment character; if yes, step 616 is performed; if no, step 615 is performed;
其中,所述第四区域为从与所述主段字符的右侧距离一个字符至与所述右侧的距离四个字符之间的区域。The fourth area is an area between a character from a right side of the main segment character and a distance of four characters from the right side.
步骤615,判断第五区域的高度与所述主段字符的高度是否一致;若为是,则执行步骤616;若为否,则待识别车牌中不存在子段字符; Step 615, it is determined whether the height of the fifth area is consistent with the height of the main segment character; if yes, step 616 is performed; if not, the sub-segment character does not exist in the to-be-identified license plate;
其中,所述第五区域为从与所述主段字符的右侧距离四个字符至与所述右侧的距离八个字符之间的区域。The fifth area is an area between four characters from a right side of the main segment character and eight characters from the right side.
步骤616,确定子段字符所在的连通域; Step 616, determining a connected domain where the sub-segment character is located;
步骤617,在所述连通域中确定所述子段字符所在的子段区域;Step 617: Determine, in the connected domain, a sub-segment area where the sub-segment character is located;
其中,所述子段区域为所述连通域中的最小外接矩形。The sub-segment area is a minimum circumscribed rectangle in the connected domain.
步骤618,根据预设的第一分类模型,判断所述子段区域中是否存在所述子段字符;若为是,则执行步骤619;若为否,则待识别车牌中不存在子段字符;Step 618: Determine, according to the preset first classification model, whether the sub-segment character exists in the sub-segment area; if yes, perform step 619; if not, the sub-segment character does not exist in the to-be-identified license plate ;
步骤619,根据预设的第二分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符。Step 619: Determine, according to the preset second classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area.
可见,本申请实施例能够从待识别车牌中识别出主段字符,当待识别车牌中存在子段字符时,根据主段字符的位置,识别出子段字符。It can be seen that the embodiment of the present application can identify the main segment character from the license plate to be identified. When the sub-segment character exists in the to-be-identified license plate, the sub-segment character is identified according to the position of the main segment character.
本申请实施例又公开了一种车牌类型的识别装置,如图7所示,图7为本申请实施例的车牌类型的识别装置的一种结构图,所述装置包括:获取单元701、第一确定单元702、判断单元703、删除单元704和第二确定单元705;The embodiment of the present application further discloses a license plate type identification device. As shown in FIG. 7 , FIG. 7 is a structural diagram of a license plate type identification device according to an embodiment of the present application. The device includes: an acquisition unit 701, a determining unit 702, a determining unit 703, a deleting unit 704, and a second determining unit 705;
所述获取单元701,用于获取待识别车牌的车牌区域图像;The acquiring unit 701 is configured to acquire an image of a license plate area of the license plate to be identified;
所述第一确定单元702,用于将所述车牌区域图像中字符数量最多的连续字符序列、确定为所述待识别车牌中的初始主段字符;The first determining unit 702 is configured to determine a sequence of consecutive characters having the largest number of characters in the license plate area image as an initial main segment character in the to-be-identified license plate;
所述判断单元703,用于根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;The determining unit 703 is configured to determine, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character;
所述删除单元704,用于将位于所述初始主段字符左端或右端的、属于子段字符的字符删除,得到所述待识别车牌中的主段字符;The deleting unit 704 is configured to delete a character belonging to a sub-segment character located at a left end or a right end of the initial main segment character to obtain a main segment character in the to-be-identified license plate;
所述第二确定单元705,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的子段字符。The second determining unit 705 is configured to determine a sub-segment character in the license plate to be identified according to the location of the main segment character in the license plate area image.
可见,应用本申请装置实施例能够通获取场景图像中待识别车牌对应的车牌区域;然后,在车牌区域中确定待识别车牌中的字符序列和背景颜色;接下来,根据预设规则,在车牌区域中确定待识别车牌对应的特殊图案区域;最后,根据待识别车牌中的字符序列和背景颜色,以及特殊图案区域,确定待识别车牌的车牌类型。这样,通过本申请实施例能够识别包括特殊图案的车牌对应的车牌类型,适用范围较广。It can be seen that the apparatus embodiment of the present application can obtain the license plate area corresponding to the license plate to be identified in the scene image; then, determine the character sequence and the background color in the license plate to be identified in the license plate area; next, according to the preset rule, the license plate The special pattern area corresponding to the license plate to be identified is determined in the area; finally, the license plate type of the license plate to be identified is determined according to the character sequence and the background color in the license plate to be identified, and the special pattern area. In this way, the embodiment of the present application can identify the license plate type corresponding to the license plate including the special pattern, and the application range is wider.
本申请实施例另公开了一种车牌类型的识别装置,如图8所示,图8为本申请实施例的车牌类型的识别装置的又一种结构图,所述装置包括:获取单元701、第一确定单元702、判断单元703、删除单元704、第二确定单元705;The embodiment of the present application further discloses a license plate type identification device. As shown in FIG. 8 , FIG. 8 is another structural diagram of a license plate type identification device according to an embodiment of the present application. The device includes: an acquisition unit 701, a first determining unit 702, a determining unit 703, a deleting unit 704, and a second determining unit 705;
所述判断单元703,包括:提取子单元801、判断子单元802、第一确定子单元803和第二确定子单元804;The determining unit 703 includes: an extracting subunit 801, a determining subunit 802, a first determining subunit 803, and a second determining subunit 804;
所述提取子单元801,用于从所述初始主段字符的左端提取第一预设数量个字符或从右端提取第二预设数量个字符;The extracting subunit 801 is configured to extract a first preset number of characters from the left end of the initial main segment character or a second preset number of characters from the right end;
所述判断子单元802,用于判断所述第一预设数量个字符或所述第二预设数量个字符中的字符大小是否相同;The determining sub-unit 802 is configured to determine whether the character sizes in the first preset number of characters or the second preset number of characters are the same;
所述第一确定子单元803,用于若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小不相同,则确定所述第一预设数量个字符中第一较小字符的大小、或所述第二预设数量个字符中第二较小字符的大小;判断所述第一较小字符或所述第二较小字符是否为字母;若所述第一较小字符或所述第二较小字符为字母,则确定所述第一较小字符或所述第二较小字符属于所述子段字符;The first determining sub-unit 803 is configured to determine, in the first preset number of characters, that the characters in the first preset number of characters or the second preset number of characters are different in size Determining, by the size of the first smaller character, or the size of the second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; Determining that the first smaller character or the second smaller character belongs to the sub-segment character;
所述第二确定子单元804,用于若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小均相同,或者所述第一较小字符或所述第二较小 字符不为字母,则确定位于所述初始主段字符的左端或右端的字符中不存在属于子段字符的字符。The second determining subunit 804 is configured to: if the first preset number of characters or the second preset number of characters have the same size, or the first smaller character or the first If the second smaller character is not a letter, it is determined that there is no character belonging to the sub-segment character in the character at the left or right end of the initial main segment character.
所述第二确定单元705,包括:第三确定子单元805、第四确定子单元806和第五确定子单元807;The second determining unit 705 includes: a third determining subunit 805, a fourth determining subunit 806, and a fifth determining subunit 807;
所述第三确定子单元805,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域;The third determining sub-unit 805 is configured to determine, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image;
所述第四确定子单元806,用于在所述连通域中确定所述子段字符所在的子段区域;The fourth determining sub-unit 806 is configured to determine, in the connected domain, a sub-segment area where the sub-segment character is located;
所述第五确定子单元807,用于根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符。The fifth determining sub-unit 807 is configured to determine, in the sub-segment area, the sub-segment characters in the license plate to be identified according to a preset classification model.
所述第三确定子单元805,包括:第六确定子单元808和第七确定子单元809;The third determining subunit 805 includes: a sixth determining subunit 808 and a seventh determining subunit 809;
所述第六确定子单元808,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域所述子段字符位于所述主段字符的左侧;或者The sixth determining sub-unit 808 is configured to determine, according to the location of the main segment character in the license plate area image, the connected segment where the sub-segment character is located, where the sub-segment character is located in the main segment character Left side; or
所述第七确定子单元809,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域所述子段字符位于所述主段字符的右侧。The seventh determining sub-unit 809 is configured to determine, according to the location of the main segment character in the license plate area image, the connected segment where the sub-segment character is located, where the sub-segment character is located in the main segment character Right.
可见,本申请实施例能够识别包括特殊图案的车牌对应的车牌类型,适用范围较广。It can be seen that the embodiment of the present application can identify the license plate type corresponding to the license plate including the special pattern, and the application range is wider.
本申请实施例再公开了一种存储介质,用于存储可执行代码,所述可执行代码用于在运行时执行如下步骤:The embodiment of the present application further discloses a storage medium for storing executable code, and the executable code is configured to perform the following steps at runtime:
获取待识别车牌的车牌区域图像;Obtaining an image of the license plate area of the license plate to be identified;
将所述车牌区域图像中字符数量最多的连续字符序列、确定为所述待识别车牌中的初始主段字符;Determining, as the initial main segment character in the license plate to be identified, a continuous character sequence having the largest number of characters in the license plate area image;
根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;Determining, according to a preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character;
将位于所述初始主段字符左端或右端的、属于子段字符的字符删除,得到所述待识别车牌中的主段字符;Deleting a character belonging to a sub-segment character at a left end or a right end of the initial main segment character to obtain a main segment character in the to-be-identified license plate;
根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的子段字符。The sub-segment characters in the license plate to be identified are determined according to the position of the main segment character in the license plate area image.
可见,本申请实施例公开的存储介质,能够在获取到的待识别车牌的车牌区域图像中,确定待识别车牌中的初始主段字符;接下来,判断初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;将位于初始主段字符左端或右端的、属于子段字符的字符删除,得到待识别车牌的主段字符;最后,根据主段字符的位置,确定待识别车牌中的子段字符。这样,能够排除与主段字符连接较紧的子段字符的干扰,得到精准的主段字符,进而根据精确的主段字符确定子段字符。由于本申请实施例没有使用固定模板,能够根据不同的应用场景识别多种类型的单层车牌,适用范围较广。It can be seen that the storage medium disclosed in the embodiment of the present application can determine the initial main segment character in the license plate to be identified in the obtained license plate area image of the license plate to be identified; next, determine the left end or the right end character of the initial main segment character. Whether there is a character belonging to the sub-segment character; the character belonging to the sub-segment character at the left end or the right end of the initial main segment character is deleted, and the main segment character of the license plate to be recognized is obtained; finally, the position to be identified is determined according to the position of the main segment character Sub-segment characters in the license plate. In this way, the interference of the sub-segment characters that are tightly connected with the main segment character can be excluded, the accurate main segment character is obtained, and the sub-segment characters are determined according to the precise main segment character. Since the fixed template is not used in the embodiment of the present application, multiple types of single-layer license plates can be identified according to different application scenarios, and the scope of application is wide.
可选的,所述根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符的步骤,包括:Optionally, the step of determining, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character, includes:
从所述初始主段字符的左端提取第一预设数量个字符或从右端提取第二预设数量个字符;Extracting a first preset number of characters from the left end of the initial main segment character or extracting a second preset number of characters from the right end;
判断所述第一预设数量个字符或所述第二预设数量个字符中的字符大小是否相同;Determining whether the character sizes in the first preset number of characters or the second preset number of characters are the same;
若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小不相同,则确定所述第一预设数量个字符中第一较小字符的大小、或所述第二预设数量个字符中第二较小字符的大小;判断所述第一较小字符或所述第二较小字符是否为字母;若所述第一较小字符或所述第二较小字符为字母,则确定所述第一较小字符或所述第二较小字符属于所述子段字符;If the size of the first preset number of characters or the second preset number of characters is different, determining a size of the first smaller number of the first preset number of characters, or a size of a second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or the second comparison The small character is a letter, and it is determined that the first smaller character or the second smaller character belongs to the sub-segment character;
若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小均相同,或者所述第一较小字符和所述第二较小字符不为字母,则确定位于所述初始主段字符的左端或右端的字符中不存在属于子段字符的字符。If the characters in the first preset number of characters or the second preset number of characters are the same, or the first smaller character and the second smaller character are not letters, the determining is located There are no characters belonging to the sub-segment characters in the characters at the left or right end of the initial main segment character.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的所述子段字符的步骤,包括:Optionally, the step of determining the sub-segment characters in the license plate to be identified according to the location of the main segment character in the license plate area image includes:
根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域;Determining, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image;
在所述连通域中确定所述子段字符所在的子段区域;Determining, in the connected domain, a sub-segment area in which the sub-segment character is located;
根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符。Determining the sub-segment characters in the license plate to be identified in the sub-segment area according to a preset classification model.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域的步骤,包括:Optionally, the step of determining, according to the location of the main segment character in the license plate area image, the connected domain of the sub-segment character in the license plate area image, including:
根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的左侧;或者Determining, according to a location of the main segment character in the license plate area image, a connected domain where the sub-segment character is located to a left side of the main segment character; or
根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的右侧。And determining, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located to the right of the main segment character.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述子段字符位于所述主段字符的左侧的步骤,包括:Optionally, the step of determining that the connected domain where the sub-segment character is located is located on a left side of the main segment character according to a location of the main segment character in the license plate area image ,include:
判断第一区域的高度与所述主段字符的高度是否一致;当所述第一区域的高度与所述主段字符的高度一致时,确定所述第一区域为所述子段字符所在的连通域;其中,所述第一区域为从所述主段字符的左侧至与所述左侧距离预设第三数量个字符之间的区域;或者Determining whether the height of the first area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is the sub-segment character a connectivity domain; wherein the first region is an area between a left side of the main segment character and a third number of characters from the left side; or
判断第二区域的高度与所述主段字符的高度是否一致;当所述第二区域的高度与所述主段字符的高度一致时,确定所述第二区域为所述子段字符所在的连通域;其中,所述第二区域为从与所述主段字符的左侧距离预设第四数量个字符至与所述左侧距离预设第五数量个字符之间的区域;Determining whether the height of the second area is consistent with the height of the main segment character; when the height of the second area is consistent with the height of the main segment character, determining that the second area is the sub-segment character a connectivity domain; wherein the second region is an area between a fourth number of characters from a left side of the main segment character and a fifth number of characters from the left side distance;
当所述第二区域的高度与所述主段字符的高度不一致,且为第一次判断第二区域的高度与所述主段字符的高度是否一致时,反转所述第二区域中的颜色,执行所述判断第二区域的高度与所述主段字符的高度是否一致。When the height of the second area is inconsistent with the height of the main segment character, and is the first time determining whether the height of the second area is consistent with the height of the main segment character, inverting the second area Color, performing the determining whether the height of the second region is consistent with the height of the main segment character.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域所述子段字符位于所述主段字符的右侧的步骤,包括:Optionally, the step of determining, according to the location of the main segment character in the license plate area image, that the sub-segment character of the connected domain where the sub-segment character is located is located on a right side of the main segment character, include:
判断第三区域的下界与所述主段字符是否一致,且所述第三区域的高度是否所述主段字符高度的四分之三;若为是,则确定所述第三区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第六数量个字符至与所述右侧距离预设第七数量个字符之间的区域;或者Determining whether a lower bound of the third region is consistent with the main segment character, and a height of the third region is three-quarters of a height of the main segment character; if yes, determining that the third region is the a connected domain in which the sub-segment character is located; wherein the fourth region is between a sixth number of characters from a right side of the main segment character and a seventh number of characters from the right side Area; or
判断第四区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第四区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第八数量个字符至与所述右侧距离预设第九数量个字符之间的区域;或者Determining whether the height of the fourth area is consistent with the height of the main segment character; if yes, determining that the fourth area is a connected domain in which the sub-segment character is located; wherein the fourth area is a slave The right side of the main segment character is an area between a preset eighth number of characters and a preset ninth number of characters from the right side; or
判断第五区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第五区域为所述子段字符所在的连通域;其中,所述第五区域为从与所述主段字符的右侧距离预设第十数量个字符至与所述右侧距离预设第十一数量个字符之间的区域。Determining whether the height of the fifth area is consistent with the height of the main segment character; if yes, determining that the fifth area is a connected domain in which the sub-segment character is located; wherein the fifth area is a slave The right side of the main segment character is a region between a preset tenth number of characters and a predetermined eleventh number of characters from the right side.
可选的,所述根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符的步骤,包括:Optionally, the step of determining, according to the preset classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area, including:
根据预设的第一分类模型,判断所述子段区域中是否存在所述子段字符;Determining, according to the preset first classification model, whether the sub-segment character exists in the sub-segment area;
若为是,则根据预设的第二分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符;If yes, determining, according to the preset second classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area;
若为否,则执行所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域。If not, performing the determining according to the location of the main segment character in the license plate area image to determine a connected domain in which the sub-segment character is located in the license plate area image.
可见,本申请公开的存储介质能够识别包括特殊图案的车牌对应的车牌类型,适用范围较广。It can be seen that the storage medium disclosed in the present application is capable of recognizing a license plate type corresponding to a license plate including a special pattern, and has a wide application range.
本申请实施例再公开了一种应用程序,用于在运行时执行如下步骤:The embodiment of the present application further discloses an application for performing the following steps at runtime:
获取待识别车牌的车牌区域图像;Obtaining an image of the license plate area of the license plate to be identified;
将所述车牌区域图像中字符数量最多的连续字符序列、确定为所述待识别车牌中的初始主段字符;Determining, as the initial main segment character in the license plate to be identified, a continuous character sequence having the largest number of characters in the license plate area image;
根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;Determining, according to a preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character;
将位于所述初始主段字符左端或右端的、属于子段字符的字符删除,得到所述待识别车牌中的主段字符;Deleting a character belonging to a sub-segment character at a left end or a right end of the initial main segment character to obtain a main segment character in the to-be-identified license plate;
根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的子段字符。The sub-segment characters in the license plate to be identified are determined according to the position of the main segment character in the license plate area image.
可见,本申请实施例公开的应用程序,能够在获取到的待识别车牌的车牌区域图像中,确定待识别车牌中的初始主段字符;接下来,判断初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;将位于初始主段字符左端或右端的、属于子段字符的字符删除,得到待识别车牌的主段字符;最后,根据主段字符的位置,确定待识别车牌中的子段字符。这样,能够排除与主段字符连接较紧的子段字符的干扰,得到精准的主段字符,进而根据精确的主段字符确定子段字符。由于本申请实施例没有使用固定模板,能够根据不同的应用场景识别多种类型的单层车牌,适用范围较广。It can be seen that the application program disclosed in the embodiment of the present application can determine the initial main segment character in the license plate to be identified in the obtained license plate area image of the license plate to be identified; next, determine the left end or the right end character of the initial main segment character. Whether there is a character belonging to the sub-segment character; the character belonging to the sub-segment character at the left end or the right end of the initial main segment character is deleted, and the main segment character of the license plate to be recognized is obtained; finally, the position to be identified is determined according to the position of the main segment character Sub-segment characters in the license plate. In this way, the interference of the sub-segment characters that are tightly connected with the main segment character can be excluded, the accurate main segment character is obtained, and the sub-segment characters are determined according to the precise main segment character. Since the fixed template is not used in the embodiment of the present application, multiple types of single-layer license plates can be identified according to different application scenarios, and the scope of application is wide.
可选的,所述根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符的步骤,包括:Optionally, the step of determining, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character, includes:
从所述初始主段字符的左端提取第一预设数量个字符或从右端提取第二预设数量个字符;Extracting a first preset number of characters from the left end of the initial main segment character or extracting a second preset number of characters from the right end;
判断所述第一预设数量个字符或所述第二预设数量个字符中的字符大小是否相同;Determining whether the character sizes in the first preset number of characters or the second preset number of characters are the same;
若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小不相同,则确定所述第一预设数量个字符中第一较小字符的大小、或所述第二预设数量个字符中第二较小字符的大小;判断所述第一较小字符或所述第二较小字符是否为字母;若所述第一较小字符或所述第二较小字符为字母,则 确定所述第一较小字符或所述第二较小字符属于所述子段字符;If the size of the first preset number of characters or the second preset number of characters is different, determining a size of the first smaller number of the first preset number of characters, or a size of a second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or the second comparison The small character is a letter, and it is determined that the first smaller character or the second smaller character belongs to the sub-segment character;
若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小均相同,或者所述第一较小字符和所述第二较小字符不为字母,则确定位于所述初始主段字符的左端或右端的字符中不存在属于子段字符的字符。If the characters in the first preset number of characters or the second preset number of characters are the same, or the first smaller character and the second smaller character are not letters, the determining is located There are no characters belonging to the sub-segment characters in the characters at the left or right end of the initial main segment character.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的所述子段字符的步骤,包括:Optionally, the step of determining the sub-segment characters in the license plate to be identified according to the location of the main segment character in the license plate area image includes:
根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域;Determining, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image;
在所述连通域中确定所述子段字符所在的子段区域;Determining, in the connected domain, a sub-segment area in which the sub-segment character is located;
根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符。Determining the sub-segment characters in the license plate to be identified in the sub-segment area according to a preset classification model.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域的步骤,包括:Optionally, the step of determining, according to the location of the main segment character in the license plate area image, the connected domain of the sub-segment character in the license plate area image, including:
根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的左侧;或者Determining, according to a location of the main segment character in the license plate area image, a connected domain where the sub-segment character is located to a left side of the main segment character; or
根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的右侧。And determining, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located to the right of the main segment character.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述子段字符位于所述主段字符的左侧的步骤,包括:Optionally, the step of determining that the connected domain where the sub-segment character is located is located on a left side of the main segment character according to a location of the main segment character in the license plate area image ,include:
判断第一区域的高度与所述主段字符的高度是否一致;当所述第一区域的高度与所述主段字符的高度一致时,确定所述第一区域为所述子段字符所在的连通域;其中,所述第一区域为从所述主段字符的左侧至与所述左侧距离预设第三数量个字符之间的区域;或者Determining whether the height of the first area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is the sub-segment character a connectivity domain; wherein the first region is an area between a left side of the main segment character and a third number of characters from the left side; or
判断第二区域的高度与所述主段字符的高度是否一致;当所述第二区域的高度与所述主段字符的高度一致时,确定所述第二区域为所述子段字符所在的连通域;其中,所述第二区域为从与所述主段字符的左侧距离预设第四 数量个字符至与所述左侧距离预设第五数量个字符之间的区域;Determining whether the height of the second area is consistent with the height of the main segment character; when the height of the second area is consistent with the height of the main segment character, determining that the second area is the sub-segment character a connectivity domain; wherein the second region is an area between a fourth number of characters from a left side of the main segment character and a fifth number of characters from the left side distance;
当所述第二区域的高度与所述主段字符的高度不一致,且为第一次判断第二区域的高度与所述主段字符的高度是否一致时,反转所述第二区域中的颜色,执行所述判断第二区域的高度与所述主段字符的高度是否一致。When the height of the second area is inconsistent with the height of the main segment character, and is the first time determining whether the height of the second area is consistent with the height of the main segment character, inverting the second area Color, performing the determining whether the height of the second region is consistent with the height of the main segment character.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域所述子段字符位于所述主段字符的右侧的步骤,包括:Optionally, the step of determining, according to the location of the main segment character in the license plate area image, that the sub-segment character of the connected domain where the sub-segment character is located is located on a right side of the main segment character, include:
判断第三区域的下界与所述主段字符是否一致,且所述第三区域的高度是否所述主段字符高度的四分之三;若为是,则确定所述第三区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第六数量个字符至与所述右侧距离预设第七数量个字符之间的区域;或者Determining whether a lower bound of the third region is consistent with the main segment character, and a height of the third region is three-quarters of a height of the main segment character; if yes, determining that the third region is the a connected domain in which the sub-segment character is located; wherein the fourth region is between a sixth number of characters from a right side of the main segment character and a seventh number of characters from the right side Area; or
判断第四区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第四区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第八数量个字符至与所述右侧距离预设第九数量个字符之间的区域;或者Determining whether the height of the fourth area is consistent with the height of the main segment character; if yes, determining that the fourth area is a connected domain in which the sub-segment character is located; wherein the fourth area is a slave The right side of the main segment character is an area between a preset eighth number of characters and a preset ninth number of characters from the right side; or
判断第五区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第五区域为所述子段字符所在的连通域;其中,所述第五区域为从与所述主段字符的右侧距离预设第十数量个字符至与所述右侧距离预设第十一数量个字符之间的区域。Determining whether the height of the fifth area is consistent with the height of the main segment character; if yes, determining that the fifth area is a connected domain in which the sub-segment character is located; wherein the fifth area is a slave The right side of the main segment character is a region between a preset tenth number of characters and a predetermined eleventh number of characters from the right side.
可选的,所述根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符的步骤,包括:Optionally, the step of determining, according to the preset classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area, including:
根据预设的第一分类模型,判断所述子段区域中是否存在所述子段字符;Determining, according to the preset first classification model, whether the sub-segment character exists in the sub-segment area;
若为是,则根据预设的第二分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符;If yes, determining, according to the preset second classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area;
若为否,则执行所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域。If not, performing the determining according to the location of the main segment character in the license plate area image to determine a connected domain in which the sub-segment character is located in the license plate area image.
可见,本申请公开的应用程序能够识别包括特殊图案的车牌对应的车牌类型,适用范围较广。It can be seen that the application disclosed in the present application can recognize the license plate type corresponding to the license plate including the special pattern, and has a wide application range.
本申请实施例再公开了一种识别车牌中字符的设备,参考图9,图9为本申请实施例的识别车牌中字符的设备的示意图。如图9所示,识别车牌中字符的设备包括:处理器901和存储器902;An embodiment of the present application further discloses an apparatus for recognizing characters in a license plate. Referring to FIG. 9, FIG. 9 is a schematic diagram of an apparatus for recognizing characters in a license plate according to an embodiment of the present application. As shown in Figure 9, the device for identifying characters in the license plate includes: a processor 901 and a memory 902;
所述存储器902用于存储可执行程序代码;The memory 902 is configured to store executable program code;
所述处理器901,用于通过读取所述存储器902中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以执行如下步骤:The processor 901 is configured to run a program corresponding to the executable program code by reading executable program code stored in the memory 902 to perform the following steps:
获取待识别车牌的车牌区域图像;Obtaining an image of the license plate area of the license plate to be identified;
将所述车牌区域图像中字符数量最多的连续字符序列、确定为所述待识别车牌中的初始主段字符;Determining, as the initial main segment character in the license plate to be identified, a continuous character sequence having the largest number of characters in the license plate area image;
根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;Determining, according to a preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character;
将位于所述初始主段字符左端或右端的、属于子段字符的字符删除,得到所述待识别车牌中的主段字符;Deleting a character belonging to a sub-segment character at a left end or a right end of the initial main segment character to obtain a main segment character in the to-be-identified license plate;
根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的子段字符。The sub-segment characters in the license plate to be identified are determined according to the position of the main segment character in the license plate area image.
可见,本申请实施例公开的识别车牌中字符的设备,能够在获取到的待识别车牌的车牌区域图像中,确定待识别车牌中的初始主段字符;接下来,判断初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;将位于初始主段字符左端或右端的、属于子段字符的字符删除,得到待识别车牌的主段字符;最后,根据主段字符的位置,确定待识别车牌中的子段字符。这样,能够排除与主段字符连接较紧的子段字符的干扰,得到精准的主段字符,进而根据精确的主段字符确定子段字符。由于本申请实施例没有使用固定模板,能够根据不同的应用场景识别多种类型的单层车牌,适用范围较广。It can be seen that the device for recognizing characters in the license plate disclosed in the embodiment of the present application can determine the initial main segment character in the license plate to be identified in the acquired license plate region image of the license plate to be identified; and then, determine the left end of the initial main segment character. Or whether the character belonging to the sub-segment character exists in the character at the right end; the character belonging to the sub-segment character at the left or right end of the initial main segment character is deleted, and the main segment character of the license plate to be recognized is obtained; finally, according to the position of the main segment character , determine the sub-segment characters in the license plate to be identified. In this way, the interference of the sub-segment characters that are tightly connected with the main segment character can be excluded, the accurate main segment character is obtained, and the sub-segment characters are determined according to the precise main segment character. Since the fixed template is not used in the embodiment of the present application, multiple types of single-layer license plates can be identified according to different application scenarios, and the scope of application is wide.
可选的,所述根据预设的子段字符特征,判断位于所述初始主段字符的 左端或右端的字符中是否存在属于子段字符的字符的步骤,包括:Optionally, the step of determining, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character, includes:
从所述初始主段字符的左端提取第一预设数量个字符或从右端提取第二预设数量个字符;Extracting a first preset number of characters from the left end of the initial main segment character or extracting a second preset number of characters from the right end;
判断所述第一预设数量个字符或所述第二预设数量个字符中的字符大小是否相同;Determining whether the character sizes in the first preset number of characters or the second preset number of characters are the same;
若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小不相同,则确定所述第一预设数量个字符中第一较小字符的大小、或所述第二预设数量个字符中第二较小字符的大小;判断所述第一较小字符或所述第二较小字符是否为字母;若所述第一较小字符或所述第二较小字符为字母,则确定所述第一较小字符或所述第二较小字符属于所述子段字符;If the size of the first preset number of characters or the second preset number of characters is different, determining a size of the first smaller number of the first preset number of characters, or a size of a second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or the second comparison The small character is a letter, and it is determined that the first smaller character or the second smaller character belongs to the sub-segment character;
若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小均相同,或者所述第一较小字符和所述第二较小字符不为字母,则确定位于所述初始主段字符的左端或右端的字符中不存在属于子段字符的字符。If the characters in the first preset number of characters or the second preset number of characters are the same, or the first smaller character and the second smaller character are not letters, the determining is located There are no characters belonging to the sub-segment characters in the characters at the left or right end of the initial main segment character.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的所述子段字符的步骤,包括:Optionally, the step of determining the sub-segment characters in the license plate to be identified according to the location of the main segment character in the license plate area image includes:
根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域;Determining, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image;
在所述连通域中确定所述子段字符所在的子段区域;Determining, in the connected domain, a sub-segment area in which the sub-segment character is located;
根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符。Determining the sub-segment characters in the license plate to be identified in the sub-segment area according to a preset classification model.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域的步骤,包括:Optionally, the step of determining, according to the location of the main segment character in the license plate area image, the connected domain of the sub-segment character in the license plate area image, including:
根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的左侧;或者Determining, according to a location of the main segment character in the license plate area image, a connected domain where the sub-segment character is located to a left side of the main segment character; or
根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的右侧。And determining, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located to the right of the main segment character.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述子段字符位于所述主段字符的左侧的步骤,包括:Optionally, the step of determining that the connected domain where the sub-segment character is located is located on a left side of the main segment character according to a location of the main segment character in the license plate area image ,include:
判断第一区域的高度与所述主段字符的高度是否一致;当所述第一区域的高度与所述主段字符的高度一致时,确定所述第一区域为所述子段字符所在的连通域;其中,所述第一区域为从所述主段字符的左侧至与所述左侧距离预设第三数量个字符之间的区域;或者Determining whether the height of the first area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is the sub-segment character a connectivity domain; wherein the first region is an area between a left side of the main segment character and a third number of characters from the left side; or
判断第二区域的高度与所述主段字符的高度是否一致;当所述第二区域的高度与所述主段字符的高度一致时,确定所述第二区域为所述子段字符所在的连通域;其中,所述第二区域为从与所述主段字符的左侧距离预设第四数量个字符至与所述左侧距离预设第五数量个字符之间的区域;Determining whether the height of the second area is consistent with the height of the main segment character; when the height of the second area is consistent with the height of the main segment character, determining that the second area is the sub-segment character a connectivity domain; wherein the second region is an area between a fourth number of characters from a left side of the main segment character and a fifth number of characters from the left side distance;
当所述第二区域的高度与所述主段字符的高度不一致,且为第一次判断第二区域的高度与所述主段字符的高度是否一致时,反转所述第二区域中的颜色,执行所述判断第二区域的高度与所述主段字符的高度是否一致。When the height of the second area is inconsistent with the height of the main segment character, and is the first time determining whether the height of the second area is consistent with the height of the main segment character, inverting the second area Color, performing the determining whether the height of the second region is consistent with the height of the main segment character.
可选的,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域所述子段字符位于所述主段字符的右侧的步骤,包括:Optionally, the step of determining, according to the location of the main segment character in the license plate area image, that the sub-segment character of the connected domain where the sub-segment character is located is located on a right side of the main segment character, include:
判断第三区域的下界与所述主段字符是否一致,且所述第三区域的高度是否所述主段字符高度的四分之三;若为是,则确定所述第三区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第六数量个字符至与所述右侧距离预设第七数量个字符之间的区域;或者Determining whether a lower bound of the third region is consistent with the main segment character, and a height of the third region is three-quarters of a height of the main segment character; if yes, determining that the third region is the a connected domain in which the sub-segment character is located; wherein the fourth region is between a sixth number of characters from a right side of the main segment character and a seventh number of characters from the right side Area; or
判断第四区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第四区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第八数量个字符至与所述右侧距离预设第九数量个字符之间的区域;或者Determining whether the height of the fourth area is consistent with the height of the main segment character; if yes, determining that the fourth area is a connected domain in which the sub-segment character is located; wherein the fourth area is a slave The right side of the main segment character is an area between a preset eighth number of characters and a preset ninth number of characters from the right side; or
判断第五区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第五区域为所述子段字符所在的连通域;其中,所述第五区域为从与所 述主段字符的右侧距离预设第十数量个字符至与所述右侧距离预设第十一数量个字符之间的区域。Determining whether the height of the fifth area is consistent with the height of the main segment character; if yes, determining that the fifth area is a connected domain in which the sub-segment character is located; wherein the fifth area is a slave The right side of the main segment character is a region between a preset tenth number of characters and a predetermined eleventh number of characters from the right side.
可选的,所述根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符的步骤,包括:Optionally, the step of determining, according to the preset classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area, including:
根据预设的第一分类模型,判断所述子段区域中是否存在所述子段字符;Determining, according to the preset first classification model, whether the sub-segment character exists in the sub-segment area;
若为是,则根据预设的第二分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符;If yes, determining, according to the preset second classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area;
若为否,则执行所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域。If not, performing the determining according to the location of the main segment character in the license plate area image to determine a connected domain in which the sub-segment character is located in the license plate area image.
可见,本申请公开的识别车牌中字符的设备能够识别包括特殊图案的车牌对应的车牌类型,适用范围较广。It can be seen that the device for recognizing characters in the license plate disclosed in the present application can recognize the license plate type corresponding to the license plate including the special pattern, and has a wide application range.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply such entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the present specification are described in a related manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。The above description is only the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application are included in the scope of the present application.

Claims (17)

  1. 一种识别车牌中字符的方法,其特征在于,所述方法包括:A method for recognizing characters in a license plate, the method comprising:
    获取待识别车牌的车牌区域图像;Obtaining an image of the license plate area of the license plate to be identified;
    将所述车牌区域图像中字符数量最多的连续字符序列、确定为所述待识别车牌中的初始主段字符;Determining, as the initial main segment character in the license plate to be identified, a continuous character sequence having the largest number of characters in the license plate area image;
    根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;Determining, according to a preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character;
    将位于所述初始主段字符左端或右端的、属于子段字符的字符删除,得到所述待识别车牌中的主段字符;Deleting a character belonging to a sub-segment character at a left end or a right end of the initial main segment character to obtain a main segment character in the to-be-identified license plate;
    根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的子段字符。The sub-segment characters in the license plate to be identified are determined according to the position of the main segment character in the license plate area image.
  2. 根据权利要求1所述的方法,其特征在于,所述根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符的步骤,包括:The method according to claim 1, wherein the step of determining, according to the preset sub-segment character, whether there is a character belonging to the sub-segment character in the character at the left end or the right end of the initial main segment character, include:
    从所述初始主段字符的左端提取第一预设数量个字符或从右端提取第二预设数量个字符;Extracting a first preset number of characters from the left end of the initial main segment character or extracting a second preset number of characters from the right end;
    判断所述第一预设数量个字符或所述第二预设数量个字符中的字符大小是否相同;Determining whether the character sizes in the first preset number of characters or the second preset number of characters are the same;
    若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小不相同,则确定所述第一预设数量个字符中第一较小字符的大小、或所述第二预设数量个字符中第二较小字符的大小;判断所述第一较小字符或所述第二较小字符是否为字母;若所述第一较小字符或所述第二较小字符为字母,则确定所述第一较小字符或所述第二较小字符属于所述子段字符;If the size of the first preset number of characters or the second preset number of characters is different, determining a size of the first smaller number of the first preset number of characters, or a size of a second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; if the first smaller character or the second comparison The small character is a letter, and it is determined that the first smaller character or the second smaller character belongs to the sub-segment character;
    若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小均相同,或者所述第一较小字符和所述第二较小字符不为字母,则确定位于所述初始主段字符的左端或右端的字符中不存在属于子段字符的字符。If the characters in the first preset number of characters or the second preset number of characters are the same, or the first smaller character and the second smaller character are not letters, the determining is located There are no characters belonging to the sub-segment characters in the characters at the left or right end of the initial main segment character.
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述主段字符在 所述车牌区域图像中所在的位置,确定待识别车牌中的所述子段字符的步骤,包括:The method according to claim 1, wherein the step of determining the sub-segment characters in the license plate to be identified according to the location of the main segment character in the license plate area image comprises:
    根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域;Determining, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image;
    在所述连通域中确定所述子段字符所在的子段区域;Determining, in the connected domain, a sub-segment area in which the sub-segment character is located;
    根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符。Determining the sub-segment characters in the license plate to be identified in the sub-segment area according to a preset classification model.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域的步骤,包括:The method according to claim 3, wherein said step of determining a connected domain in which said sub-segment character is located in said license plate area image is based on a position of said main segment character in said license plate area image ,include:
    根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的左侧;或者Determining, according to a location of the main segment character in the license plate area image, a connected domain where the sub-segment character is located to a left side of the main segment character; or
    根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的右侧。And determining, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located to the right of the main segment character.
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述子段字符位于所述主段字符的左侧的步骤,包括:The method according to claim 4, wherein said determining, according to a position of said main segment character in said license plate region image, a connected domain in which said sub-segment character is located is located at said sub-segment character The steps to the left of the main segment character include:
    判断第一区域的高度与所述主段字符的高度是否一致;当所述第一区域的高度与所述主段字符的高度一致时,确定所述第一区域为所述子段字符所在的连通域;其中,所述第一区域为从所述主段字符的左侧至与所述左侧距离预设第三数量个字符之间的区域;或者Determining whether the height of the first area is consistent with the height of the main segment character; when the height of the first area is consistent with the height of the main segment character, determining that the first area is the sub-segment character a connectivity domain; wherein the first region is an area between a left side of the main segment character and a third number of characters from the left side; or
    判断第二区域的高度与所述主段字符的高度是否一致;当所述第二区域的高度与所述主段字符的高度一致时,确定所述第二区域为所述子段字符所在的连通域;其中,所述第二区域为从与所述主段字符的左侧距离预设第四数量个字符至与所述左侧距离预设第五数量个字符之间的区域;Determining whether the height of the second area is consistent with the height of the main segment character; when the height of the second area is consistent with the height of the main segment character, determining that the second area is the sub-segment character a connectivity domain; wherein the second region is an area between a fourth number of characters from a left side of the main segment character and a fifth number of characters from the left side distance;
    当所述第二区域的高度与所述主段字符的高度不一致,且为第一次判断第二区域的高度与所述主段字符的高度是否一致时,反转所述第二区域中的 颜色,执行所述判断第二区域的高度与所述主段字符的高度是否一致。When the height of the second area is inconsistent with the height of the main segment character, and is the first time determining whether the height of the second area is consistent with the height of the main segment character, inverting the second area Color, performing the determining whether the height of the second region is consistent with the height of the main segment character.
  6. 根据权利要求4所述的方法,其特征在于,所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域所述子段字符位于所述主段字符的右侧的步骤,包括:The method according to claim 4, wherein said determining, according to a position of said main segment character in said license plate region image, said connected sub-segment character in which said sub-segment character is located is located in said method The steps to the right of the main paragraph character, including:
    判断第三区域的下界与所述主段字符是否一致,且所述第三区域的高度是否所述主段字符高度的四分之三;若为是,则确定所述第三区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第六数量个字符至与所述右侧距离预设第七数量个字符之间的区域;或者Determining whether a lower bound of the third region is consistent with the main segment character, and a height of the third region is three-quarters of a height of the main segment character; if yes, determining that the third region is the a connected domain in which the sub-segment character is located; wherein the fourth region is between a sixth number of characters from a right side of the main segment character and a seventh number of characters from the right side Area; or
    判断第四区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第四区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第八数量个字符至与所述右侧距离预设第九数量个字符之间的区域;或者Determining whether the height of the fourth area is consistent with the height of the main segment character; if yes, determining that the fourth area is a connected domain in which the sub-segment character is located; wherein the fourth area is a slave The right side of the main segment character is an area between a preset eighth number of characters and a preset ninth number of characters from the right side; or
    判断第五区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第五区域为所述子段字符所在的连通域;其中,所述第五区域为从与所述主段字符的右侧距离预设第十数量个字符至与所述右侧距离预设第十一数量个字符之间的区域。Determining whether the height of the fifth area is consistent with the height of the main segment character; if yes, determining that the fifth area is a connected domain in which the sub-segment character is located; wherein the fifth area is a slave The right side of the main segment character is a region between a preset tenth number of characters and a predetermined eleventh number of characters from the right side.
  7. 根据权利要求3所述的方法,其特征在于,所述根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符的步骤,包括:The method according to claim 3, wherein the step of determining the sub-segment characters in the license plate to be identified in the sub-segment area according to a preset classification model comprises:
    根据预设的第一分类模型,判断所述子段区域中是否存在所述子段字符;Determining, according to the preset first classification model, whether the sub-segment character exists in the sub-segment area;
    若为是,则根据预设的第二分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符;If yes, determining, according to the preset second classification model, the sub-segment characters in the to-be-identified license plate in the sub-segment area;
    若为否,则执行所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域。If not, performing the determining according to the location of the main segment character in the license plate area image to determine a connected domain in which the sub-segment character is located in the license plate area image.
  8. 一种识别车牌中字符的装置,其特征在于,所述装置包括:A device for recognizing characters in a license plate, characterized in that the device comprises:
    获取单元,用于获取待识别车牌的车牌区域图像;An obtaining unit, configured to obtain an image of a license plate area of the license plate to be identified;
    第一确定单元,用于将所述车牌区域图像中字符数量最多的连续字符序 列、确定为所述待识别车牌中的初始主段字符;a first determining unit, configured to determine a continuous character sequence having the largest number of characters in the license plate area image as an initial main segment character in the to-be-identified license plate;
    判断单元,用于根据预设的子段字符特征,判断位于所述初始主段字符的左端或右端的字符中是否存在属于子段字符的字符;a determining unit, configured to determine, according to the preset sub-segment character, whether a character belonging to the sub-segment character exists in a character located at a left end or a right end of the initial main segment character;
    删除单元,用于将位于所述初始主段字符左端或右端的、属于子段字符的字符删除,得到所述待识别车牌中的主段字符;a deleting unit, configured to delete a character belonging to a sub-segment character located at a left end or a right end of the initial main segment character to obtain a main segment character in the to-be-identified license plate;
    第二确定单元,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定待识别车牌中的子段字符。And a second determining unit, configured to determine a sub-segment character in the license plate to be identified according to a location of the main segment character in the license plate area image.
  9. 根据权利要求8所述装置,其特征在于,所述判断单元,包括:提取子单元、判断子单元、第一确定子单元和第二确定子单元;The apparatus according to claim 8, wherein the determining unit comprises: an extracting subunit, a determining subunit, a first determining subunit, and a second determining subunit;
    所述提取子单元,用于从所述初始主段字符的左端提取第一预设数量个字符或从右端提取第二预设数量个字符;The extracting subunit is configured to extract a first preset number of characters from a left end of the initial main segment character or a second preset number of characters from a right end;
    所述判断子单元,用于判断所述第一预设数量个字符或所述第二预设数量个字符中的字符大小是否相同;The determining subunit is configured to determine whether the character sizes in the first preset number of characters or the second preset number of characters are the same;
    所述第一确定子单元,用于若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小不相同,则确定所述第一预设数量个字符中第一较小字符的大小、或所述第二预设数量个字符中第二较小字符的大小;判断所述第一较小字符或所述第二较小字符是否为字母;若所述第一较小字符或所述第二较小字符为字母,则确定所述第一较小字符或所述第二较小字符属于所述子段字符;Determining, by the first determining subunit, a first predetermined number of characters in the first preset number of characters or the second preset number of characters a size of a smaller character, or a size of a second smaller one of the second predetermined number of characters; determining whether the first smaller character or the second smaller character is a letter; Determining that the first smaller character or the second smaller character belongs to the sub-segment character;
    所述第二确定子单元,用于若所述第一预设数量个字符或所述第二预设数量个字符中的字符大小均相同,或者所述第一较小字符和所述第二较小字符不为字母,则确定位于所述初始主段字符的左端或右端的字符中不存在属于子段字符的字符。The second determining subunit is configured to: if the first preset number of characters or the second preset number of characters have the same size, or the first smaller character and the second If the smaller character is not a letter, it is determined that there is no character belonging to the sub-segment character in the character at the left or right end of the initial main segment character.
  10. 根据权利要求8所述装置,其特征在于,所述第二确定单元,包括:第三确定子单元、第四确定子单元和第五确定子单元;The apparatus according to claim 8, wherein the second determining unit comprises: a third determining subunit, a fourth determining subunit, and a fifth determining subunit;
    所述第三确定子单元,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域;The third determining subunit is configured to determine, according to a location of the main segment character in the license plate area image, a connected domain in which the sub-segment character is located in the license plate area image;
    所述第四确定子单元,用于在所述连通域中确定所述子段字符所在的子段区域;The fourth determining subunit is configured to determine, in the connected domain, a sub-segment area where the sub-segment character is located;
    所述第五确定子单元,用于根据预设的分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符。The fifth determining subunit is configured to determine, in the sub-segment area, the sub-segment characters in the license plate to be identified according to a preset classification model.
  11. 根据权利要求10所述装置,其特征在于,所述第三确定子单元,包括:第六确定子单元和第七确定子单元;The apparatus according to claim 10, wherein the third determining subunit comprises: a sixth determining subunit and a seventh determining subunit;
    所述第六确定子单元,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的左侧;或者The sixth determining subunit is configured to determine, according to a location where the main segment character is located in the license plate area image, a connected domain where the sub-segment character is located is located to a left side of the main segment character; or
    所述第七确定子单元,用于根据所述主段字符在所述车牌区域图像中所在的位置,确定所述子段字符所在的连通域位于所述主段字符的右侧。The seventh determining subunit is configured to determine, according to the location of the main segment character in the license plate area image, that the connected domain where the sub-segment character is located is located to the right of the main segment character.
  12. 根据权利要求11所述装置,其特征在于,所述第六确定子单元,包括:第八确定子单元、第九确定子单元和执行子单元;The apparatus according to claim 11, wherein said sixth determining subunit comprises: an eighth determining subunit, a ninth determining subunit, and an executing subunit;
    所述第八确定子单元,用于判断第一区域的高度与所述主段字符的高度是否一致;当所述第一区域的高度与所述主段字符的高度一致时,确定所述第一区域为所述子段字符所在的连通域;其中,所述第一区域为从所述主段字符的左侧至与所述左侧距离预设第三数量个字符之间的区域;或者The eighth determining subunit is configured to determine whether the height of the first area is consistent with the height of the main segment character; and when the height of the first area is consistent with the height of the main segment character, determining the first An area is a connected domain in which the sub-segment character is located; wherein the first area is an area between a left side of the main-segment character and a third-numbered character from the left side; or
    所述第九确定子单元,用于判断第二区域的高度与所述主段字符的高度是否一致;当所述第二区域的高度与所述主段字符的高度一致时,确定所述第二区域为所述子段字符所在的连通域;其中,所述第二区域为从与所述主段字符的左侧距离预设第四数量个字符至与所述左侧距离预设第五数量个字符之间的区域;The ninth determining subunit is configured to determine whether the height of the second area is consistent with the height of the main segment character; and when the height of the second area is consistent with the height of the main segment character, determining the The second area is a connected domain in which the sub-segment character is located; wherein the second area is a preset fourth number of characters from a left side of the main segment character to a fifth distance from the left side distance The area between a number of characters;
    所述执行子单元,用于当所述第二区域的高度与所述主段字符的高度不一致,且为第一次判断第二区域的高度与所述主段字符的高度是否一致时,反转所述第二区域中的颜色,执行所述判断第二区域的高度与所述主段字符的高度是否一致。The execution subunit is configured to: when the height of the second area is inconsistent with the height of the main segment character, and determine whether the height of the second area is consistent with the height of the main segment character for the first time, Turning the color in the second area, performing the determining whether the height of the second area is consistent with the height of the main segment character.
  13. 根据权利要求11所述装置,其特征在于,所述第七确定子单元,包括:第十确定子单元、第十一确定子单元和第十二确定子单元;The apparatus according to claim 11, wherein said seventh determining subunit comprises: a tenth determining subunit, an eleventh determining subunit, and a twelfth determining subunit;
    所述第十确定子单元,用于判断第三区域的下界与所述主段字符是否一致,且所述第三区域的高度是否所述主段字符高度的四分之三;若为是,则确定所述第三区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第六数量个字符至与所述右侧距离预设第七数量个字符之间的区域;或者The tenth determining subunit is configured to determine whether a lower bound of the third area is consistent with the main segment character, and a height of the third area is three quarters of a height of the main segment character; if yes, Determining that the third area is a connected domain in which the sub-segment character is located; wherein the fourth area is a preset sixth sixth number of characters from the right side of the main segment character to the right side The area between the preset seventh number of characters; or
    所述第十一确定子单元,用于判断第四区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第四区域为所述子段字符所在的连通域;其中,所述第四区域为从与所述主段字符的右侧距离预设第八数量个字符至与所述右侧距离预设第九数量个字符之间的区域;或者The eleventh determining subunit is configured to determine whether the height of the fourth area is consistent with the height of the main segment character; if yes, determining that the fourth area is a connected domain where the sub-segment character is located; The fourth area is an area between an eighth number of characters from a right side of the main character character and a ninth number of characters preset to the right side distance; or
    所述第十二确定子单元,用于判断第五区域的高度与所述主段字符的高度是否一致;若为是,则确定所述第五区域为所述子段字符所在的连通域;其中,所述第五区域为从与所述主段字符的右侧距离预设第十数量个字符至与所述右侧距离预设第十一数量个字符之间的区域。The twelfth determining subunit is configured to determine whether the height of the fifth area is consistent with the height of the main segment character; if yes, determining that the fifth area is a connected domain in which the sub-segment character is located; The fifth area is an area between a preset tenth number of characters from a right side of the main segment character and an eleventh number of characters preset from the right side distance.
  14. 根据权利要求10所述装置,其特征在于,所述第五确定子单元,包括:第十三确定子单元、第十四确定子单元和第十五确定子单元;The apparatus according to claim 10, wherein said fifth determining subunit comprises: a thirteenth determining subunit, a fourteenth determining subunit, and a fifteenth determining subunit;
    所述第十三确定子单元,用于根据预设的第一分类模型,判断所述子段区域中是否存在所述子段字符;The thirteenth determining subunit is configured to determine, according to the preset first classification model, whether the sub-segment character exists in the sub-segment area;
    所述第十四确定子单元,用于若所述子段区域中存在所述子段字符,则根据预设的第二分类模型,在所述子段区域中确定所述待识别车牌中的所述子段字符;The fourteenth determining subunit is configured to determine, in the sub-segment area, the to-be-identified license plate according to a preset second classification model if the sub-segment character exists in the sub-segment area The sub-segment character;
    所述第十五确定子单元,用于若所述子段区域中不存在所述子段字符,则执行所述根据所述主段字符在所述车牌区域图像中所在的位置,确定所述车牌区域图像中所述子段字符所在的连通域。The fifteenth determining subunit, configured to determine, according to a location of the main segment character in the license plate area image, if the sub-segment character does not exist in the sub-segment area, The connected domain in which the sub-segment character is located in the license plate area image.
  15. 一种存储介质,其特征在于,用于存储可执行代码,所述可执行代码用于在运行时执行如权利要求1-7任一项所述的识别车牌中字符的方法。A storage medium for storing executable code for performing a method of recognizing a character in a license plate according to any one of claims 1-7 at runtime.
  16. 一种应用程序,其特征在于,用于在运行时执行如权利要求1-7任一项所述的识别车牌中字符的方法。An application for performing a method of recognizing a character in a license plate according to any one of claims 1-7 at runtime.
  17. 一种识别车牌中字符的设备,其特征在于,包括:处理器和存储器;A device for recognizing characters in a license plate, comprising: a processor and a memory;
    所述存储器用于存储可执行程序代码;The memory is for storing executable program code;
    所述处理器,用于通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以执行如权利要求1-7任一项所述的识别车牌中字符的方法。The processor, configured to execute a program corresponding to the executable program code by reading executable program code stored in the memory to perform the identification of the license plate according to any one of claims 1-7 The method of characters.
PCT/CN2018/072593 2017-01-16 2018-01-15 Method and device for recognizing characters on license plate WO2018130216A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710028236.X 2017-01-16
CN201710028236.XA CN108319951B (en) 2017-01-16 2017-01-16 Method and device for recognizing characters in license plate

Publications (1)

Publication Number Publication Date
WO2018130216A1 true WO2018130216A1 (en) 2018-07-19

Family

ID=62839320

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/072593 WO2018130216A1 (en) 2017-01-16 2018-01-15 Method and device for recognizing characters on license plate

Country Status (2)

Country Link
CN (1) CN108319951B (en)
WO (1) WO2018130216A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110399880A (en) * 2019-07-31 2019-11-01 深圳市捷顺科技实业股份有限公司 Recognition methods, device and the equipment of a kind of characters on license plate and license plate classification
CN111582261A (en) * 2020-04-30 2020-08-25 浙江大华技术股份有限公司 License plate recognition method and device for non-motor vehicle

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008040519A (en) * 2006-08-01 2008-02-21 Hitachi Information & Control Solutions Ltd Portable type illegally parked vehicle photographing device
CN101567042A (en) * 2009-05-25 2009-10-28 公安部交通管理科学研究所 Method for recognizing characters of number plate images of armed police automobiles
CN102693431A (en) * 2012-05-31 2012-09-26 信帧电子技术(北京)有限公司 Method and device for identifying type of white number plate
CN104636748A (en) * 2013-11-14 2015-05-20 张伟伟 License plate recognition method and device
CN105809166A (en) * 2016-03-04 2016-07-27 深圳市佳信捷技术股份有限公司 Vehicle license plate recognition method, device and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101373517B (en) * 2007-08-22 2011-03-16 北京万集科技有限责任公司 Method and system for recognizing license plate
DE202007014130U1 (en) * 2007-10-09 2008-04-03 Rosmann, Marc Mark Caddies
CN101872416B (en) * 2010-05-06 2013-05-01 复旦大学 Vehicle license plate recognition method and system of road image
CN102147858B (en) * 2011-03-31 2012-08-01 重庆大学 License plate character identification method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008040519A (en) * 2006-08-01 2008-02-21 Hitachi Information & Control Solutions Ltd Portable type illegally parked vehicle photographing device
CN101567042A (en) * 2009-05-25 2009-10-28 公安部交通管理科学研究所 Method for recognizing characters of number plate images of armed police automobiles
CN102693431A (en) * 2012-05-31 2012-09-26 信帧电子技术(北京)有限公司 Method and device for identifying type of white number plate
CN104636748A (en) * 2013-11-14 2015-05-20 张伟伟 License plate recognition method and device
CN105809166A (en) * 2016-03-04 2016-07-27 深圳市佳信捷技术股份有限公司 Vehicle license plate recognition method, device and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110399880A (en) * 2019-07-31 2019-11-01 深圳市捷顺科技实业股份有限公司 Recognition methods, device and the equipment of a kind of characters on license plate and license plate classification
CN111582261A (en) * 2020-04-30 2020-08-25 浙江大华技术股份有限公司 License plate recognition method and device for non-motor vehicle
CN111582261B (en) * 2020-04-30 2024-01-19 浙江大华技术股份有限公司 License plate recognition method and license plate recognition device for non-motor vehicle

Also Published As

Publication number Publication date
CN108319951A (en) 2018-07-24
CN108319951B (en) 2020-10-02

Similar Documents

Publication Publication Date Title
CN109726643B (en) Method and device for identifying table information in image, electronic equipment and storage medium
WO2020125216A1 (en) Pedestrian re-identification method, device, electronic device and computer-readable storage medium
CN106874909B (en) A kind of recognition methods of image character and its device
CN110991465B (en) Object identification method, device, computing equipment and storage medium
CN111931664B (en) Mixed-pasting bill image processing method and device, computer equipment and storage medium
EP3620981B1 (en) Object detection method, device, apparatus and computer-readable storage medium
JP5500480B2 (en) Form recognition device and form recognition method
US20200311460A1 (en) Character identification method and device
CN104331682B (en) A kind of building automatic identifying method based on Fourier descriptor
CN112381775B (en) Image tampering detection method, terminal device and storage medium
CN109241528A (en) A kind of measurement of penalty prediction of result method, apparatus, equipment and storage medium
CN103218610B (en) The forming method of dog face detector and dog face detecting method
Do et al. Automatic license plate recognition using mobile device
CN108830275B (en) Method and device for identifying dot matrix characters and dot matrix numbers
WO2018130216A1 (en) Method and device for recognizing characters on license plate
CN104200228A (en) Recognizing method and system for safety belt
CN105930873A (en) Self-paced cross-modal matching method based on subspace
CN110532964A (en) Page number recognition methods and device, reading machine people, computer readable storage medium
CN103106409A (en) Composite character extraction method aiming at head shoulder detection
CN114038004A (en) Certificate information extraction method, device, equipment and storage medium
JP2017102622A (en) Image processing device, image processing method and program
CN108171229B (en) Method and system for identifying hollow adhesion verification code
Lin et al. Learning contour-fragment-based shape model with and-or tree representation
CN111680635B (en) Text recognition method and device, electronic equipment and storage medium
CN112380978A (en) Multi-face detection method, system and storage medium based on key point positioning

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18739341

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18739341

Country of ref document: EP

Kind code of ref document: A1