WO2018028306A1 - 一种车牌号码识别方法及装置 - Google Patents
一种车牌号码识别方法及装置 Download PDFInfo
- Publication number
- WO2018028306A1 WO2018028306A1 PCT/CN2017/088709 CN2017088709W WO2018028306A1 WO 2018028306 A1 WO2018028306 A1 WO 2018028306A1 CN 2017088709 W CN2017088709 W CN 2017088709W WO 2018028306 A1 WO2018028306 A1 WO 2018028306A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- character
- pixel
- license plate
- line segment
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 127
- 239000002356 single layer Substances 0.000 claims description 25
- 238000003709 image segmentation Methods 0.000 claims description 21
- 230000011218 segmentation Effects 0.000 claims description 21
- 238000012937 correction Methods 0.000 claims description 18
- 239000002355 dual-layer Substances 0.000 claims description 7
- 238000006243 chemical reaction Methods 0.000 claims description 6
- 238000012216 screening Methods 0.000 claims description 6
- 238000003702 image correction Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 abstract description 12
- 239000010410 layer Substances 0.000 description 12
- 238000012545 processing Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 7
- 238000010801 machine learning Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000005286 illumination Methods 0.000 description 3
- 235000008694 Humulus lupulus Nutrition 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000017525 heat dissipation Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 229920001690 polydopamine Polymers 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/60—Type of objects
- G06V20/62—Text, e.g. of license plates, overlay texts or captions on TV images
- G06V20/625—License plates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
- G06V10/267—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/24—Aligning, centring, orientation detection or correction of the image
- G06V10/247—Aligning, centring, orientation detection or correction of the image by affine transforms, e.g. correction due to perspective effects; Quadrilaterals, e.g. trapezoids
Definitions
- the present application relates to the field of intelligent transportation technologies, and in particular, to a license plate number identification method and apparatus.
- the license plate number is the "identity card" of the vehicle and is an important basis for identifying motor vehicles.
- the license plate number recognition technology has been widely used in scenes such as bayonet, parking lot and electronic police to obtain the number plate information of vehicles in the scene, and plays an important role in many aspects such as public security management.
- the license plate number is usually identified from the image by the following three steps: first, the license plate area is located from the image, and then the license plate is divided. The characters in the area, and finally the divided characters are recognized to obtain the license plate number.
- the purpose of the embodiment of the present application is to provide a method and a device for identifying a license plate number, which can improve the versatility of license plate number recognition.
- the present application discloses a license plate number identification method, and the method includes:
- the pixels are connected into a line segment;
- the characters in the N character images are identified according to the character characteristics of each country and region stored in advance, and the license plate number corresponding to the first image is obtained.
- the preset condition is one or more of the following conditions:
- the hopping interval of the abscissa of the adjacent peak feature points and the trough feature points in the candidate area is identified, and whether all the hop intervals in the candidate area are uniform is determined.
- the method before the setting the sibling attribute to the line segment and the adjacent line segment, the method further includes:
- the selecting, by the each of the license plate positioning block images, the second image corresponding to the license plate number area of the first image includes:
- the real license plate positioning block image is determined as a second image corresponding to the license plate number area of the first image.
- the method before obtaining a vertical projection view of the pixel value of the second image according to a vertical projection method for each second image, the method further includes:
- a vertical projection view of the pixel values of the second image according to a vertical projection method including:
- a vertical projection view of the pixel values of the second image is obtained according to a vertical projection method.
- the second image is segmented according to the vertical projection view, and the obtained image is obtained.
- the N character images included in the second image include:
- each connected domain included in the second image and a first location of each connected domain according to a connected domain method and calculating the connectivity according to the connected domain and the first location
- An average width of the domain, the average width being determined as an average character width of the second image
- the correcting the first character image according to the first location includes:
- the dividing the second image according to the vertical projection image to obtain the N character images included in the second image including:
- the character classifier is a classifier set according to character features of each country and region;
- the at least two second character images included in the image to be corrected are combined according to the position of the corresponding target character image to obtain N character images included in the second image.
- the method before obtaining a vertical projection view of the pixel value of the second image according to a vertical projection method for each second image, the method further includes:
- a vertical projection view of the pixel values of the second image according to a vertical projection method including:
- a vertical projection view of the pixel values of the second image is obtained according to a vertical projection method.
- the converting the second image into a single-layer license plate image according to the upper positioning block and the lower positioning block comprises:
- the upper positioning block is placed on the left side of the lower positioning block to convert the second image into a single layer license plate image.
- the present application discloses a license plate number identifying device, the device comprising:
- a first image acquisition module configured to acquire a first image of a license plate number to be identified
- a pixel value graph drawing module configured to map the pixel for each pixel in the first image a pixel value map of each pixel in the pixel row, wherein the abscissa of the pixel value map is pixel point coordinates, and the ordinate is a pixel value of the pixel point;
- a pixel point connection module configured to identify a peak feature point and a trough feature point in the pixel value map for each pixel value map; and divide the pixel value map into a first number of candidate areas according to a preset width And identifying, for each candidate area, a peak feature point or a trough feature point included in the candidate area, determining whether the peak feature point or the trough feature point meets a preset condition, and if yes, selecting the candidate Pixels in the first image corresponding to the region are connected into a line segment;
- a positioning block obtaining module configured to determine, for each line segment, an adjacent line segment below the line segment, and calculate a second distance between a left end point of the line segment and a left end point of the adjacent line segment, and calculate the line segment a third distance between the right end point and the right end point of the adjacent line segment, determining whether the second distance and the third distance are both smaller than a preset first distance threshold, and if so, the line segment and the adjacent
- the line segments are set with the sibling attribute; the line segments set to the same sibling attribute are spliced into blocks, and each license plate positioning block image is obtained;
- a second image selection module configured to select a second image corresponding to the license plate number region of the first image from each of the license plate positioning block images
- a second image segmentation module configured to obtain, for each second image, a vertical projection view of pixel values of the second image according to a vertical projection method; and segment the second image according to the vertical projection image, Obtaining N character images included in the second image;
- the image character recognition module is configured to identify characters in the N character images according to character features of each country and region stored in advance, and obtain a license plate number corresponding to the first image.
- the preset condition is one or more of the following conditions:
- the hopping interval of the abscissa of the adjacent peak feature points and the trough feature points in the candidate area is identified, and whether all the hop intervals in the candidate area are uniform is determined.
- the positioning block obtaining module is further configured to:
- the second image selection module is specifically configured to:
- the device further includes a second image correction module
- the second image correcting module is configured to convert the second image into a bright dark background before obtaining a vertical projection view of the pixel value of the second image according to a vertical projection method for each second image a grayscale image; performing license plate tilt correction on the grayscale image; performing license plate character distortion correction on the license plate tilt corrected image;
- the second image segmentation module is specifically configured to obtain a vertical projection view of the pixel value of the second image according to a vertical projection method for each second image after the license plate distortion is corrected; according to the vertical projection view, Segmenting the second image to obtain N character images included in the second image.
- the second image segmentation module includes:
- a first obtaining submodule configured to divide the second image according to the vertical projection view, Obtaining N character images to be corrected included in the second image;
- a first calculating submodule configured to obtain, for the second image, each connected domain included in the second image and a first location of each connected domain according to the connected domain method, according to the connected domain and the a first position, calculating an average width of the connected domain, and determining the average width as an average character width of the second image;
- a first determining sub-module configured to determine, according to the average character width, whether the first character image whose character image width is greater than a preset first width threshold exists in the N character images to be corrected;
- a first determining submodule configured to: when the first character image whose character image width is greater than a preset first width threshold exists in the N character images to be corrected, correct the first character image according to the first position And determining, according to the corrected first character image, the N character images included in the second image.
- the first determining submodule is specifically configured to:
- the second image segmentation module includes:
- a second obtaining submodule configured to divide the second image according to the vertical projection view, and obtain N character images to be corrected included in the second image
- a second determining sub-module configured to determine whether there is a second character image in which the character image width is smaller than a preset second width threshold in the N character images to be corrected
- a second determining submodule configured to determine, when the character image width is less than a preset second width threshold, in the N character images to be corrected, determining at least two adjacent second character images as The character image to be corrected;
- An image segmentation sub-module configured to obtain an edge map of the second image, perform character segmentation on the edge image according to a vertical projection method, and determine, from the segmented edge image, a position corresponding to the image position of the character to be corrected Target character image;
- a third obtaining sub-module configured to input the to-be-corrected character image and the corresponding target character image into a character classifier, to obtain a confidence degree of each character image, where the character classifier is based on character characteristics of each country and region Set the classifier;
- a third determining sub-module configured to determine whether at least two confidence levels of the to-be-corrected character image are less than a confidence level of the corresponding target character image
- the image merging sub-module is configured to: when the at least two confidence degrees of the character image to be corrected are less than the confidence of the corresponding target character image, the image to be corrected according to the position of the corresponding target character image The at least two second character images included are combined to obtain N character images included in the second image.
- the device further includes:
- a fourth determining sub-module configured to obtain, according to a vertical projection method, a vertical projection map of pixel values of the second image according to a vertical projection method, according to a width ratio of the second image and a preset ratio a threshold value, determining whether the second image belongs to a double deck license plate;
- An eigenvalue obtaining submodule configured to determine, for each pixel row in the second image, each pixel point included in the pixel row and an adjacent pixel point thereof when the second image belongs to a dual layer license plate An absolute value of a difference value of the pixel values, and summing the absolute values to obtain a pixel hopping feature value of the pixel row;
- a positioning block obtaining submodule configured, for each pixel row, determining adjacent pixel rows below the pixel row, and determining an absolute value of a difference between the pixel row and a pixel hopping feature value of the adjacent pixel row; Determining whether the absolute value is less than a preset second hopping feature threshold, and if so, setting the pixel row and the adjacent pixel row to a sibling attribute; splicing the pixel rows set to the same sibling attribute into a block, obtaining the
- the second image includes an upper positioning block and a lower positioning block;
- a dual-layer image conversion sub-module configured to convert the second image into a single-layer license plate image according to the upper positioning block and the lower positioning block;
- the second image segmentation module is specifically configured to obtain, for each second image after being converted into a single-layer license plate image, a vertical projection view of the pixel value of the second image according to a vertical projection method; The image is segmented to obtain N character images included in the second image.
- the dual-layer image conversion sub-module is specifically configured to:
- the upper positioning block is placed on the left side of the lower positioning block to convert the second image into a single layer license plate image.
- the electronic device includes:
- the circuit board is disposed inside the space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power supply circuit is used for each circuit of the electronic device or The device is powered;
- the memory is for storing executable program code;
- the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory for performing the following steps:
- the pixels are connected into a line segment;
- the characters in the N character images are identified according to the character characteristics of each country and region stored in advance, and the license plate number corresponding to the first image is obtained.
- the present application discloses an application program for performing a license plate number identification method provided by an embodiment of the present application at runtime.
- the license plate number identification method comprises:
- the pixels are connected into a line segment;
- the characters in the N character images are identified according to the character characteristics of each country and region stored in advance, and the license plate number corresponding to the first image is obtained.
- the present application discloses a storage medium for storing executable code, which is used to execute the license plate number identification method provided by the embodiment of the present application at runtime.
- the license plate number identification method comprises:
- the characters in the N character images are identified according to the character characteristics of each country and region stored in advance, and the license plate number corresponding to the first image is obtained.
- a pixel value map is drawn for each pixel row in the first image of the license plate number to be identified, and a peak feature point or a trough feature point of the candidate region in the pixel value map is selected.
- the preset condition is met, the pixel points in the first image corresponding to the candidate area are connected into a line segment.
- each license plate positioning block image is obtained, and then the license plate number region corresponding to the first image is selected from each license plate positioning block image.
- a second image then performing character segmentation on the second image to obtain N character images included in the second image, and finally, identifying characters in the N character images according to character features of each country and region stored in advance, and obtaining The license plate number corresponding to the first image.
- the license plate positioning block image is obtained according to the difference between the pixel value of the character and the background pixel value of the license plate of each country and the feature point of the license plate area; A character feature of each country and region stored, identifying characters in the N character images.
- the embodiment of the present application utilizes the common features of the license plates of each country, obtains the image of the license plate positioning block, and performs character recognition according to the character features of each country and region stored in advance, thereby being able to identify the license plates of each country, and the present Compared with technology, it improves versatility.
- Figure 1 is an example diagram of license plate types in some countries and regions
- FIG. 2 is a schematic flowchart of a method for identifying a license plate number according to an embodiment of the present application
- Figure 2a is an example of a pixel value map in an image of a license plate number to be identified
- step S206 of the embodiment shown in FIG. 2 is a schematic flow chart of step S206 of the embodiment shown in FIG. 2;
- Figure 4 is a diagram showing an example in which the numbers 7 and 4 in the license plate are embedded with each other;
- FIG. 5 is another schematic flowchart of step S206 of the embodiment shown in FIG. 2;
- FIG. 6 is another schematic flowchart of a license plate number identification method according to an embodiment of the present application.
- FIG. 7 is a schematic structural diagram of a license plate number identifying apparatus according to an embodiment of the present application.
- FIG. 8 is a schematic structural diagram of a second image segmentation module 706 of FIG. 7;
- FIG. 9 is another schematic structural diagram of the second image segmentation module 706 of FIG. 7;
- FIG. 10 is another schematic structural diagram of a license plate number identifying apparatus according to an embodiment of the present application.
- Figure 1 is an example of a license plate type for some countries and regions.
- 1 is an example of a license plate in Hong Kong, China, in which the number of license plate characters is between 3 and 6, and the license plate color is black and white
- 2 is an example of a license plate in Macau, China, where the number of characters is 6, the license plate color It is a black and white black background, and the character also includes a short connecting line
- 3 is an Indian license plate example, in which the number of characters is 10, the license plate color is black and yellow and black and white, and the characters are The period is separated by a period
- 4 is an example of a license plate in the Philippines, in which the number of characters is 6, the color of the license plate is black and yellow
- 5 is the example of a license plate in Korea, wherein the number of characters is 7, and the color of the license plate is black and white
- Thai license plate example where characters The number is 6, and the license plate color is black and white.
- License plate structure including single-layer license plates and double-layer license plates
- Types of fonts Not only are the fonts used in different countries very different, but the license plate fonts in the same country are also different, such as India.
- Character type Arabic, English, Thai, Korean, Chinese, Japanese, etc.
- vehicle licenses are generally identified for each local license plate structure in various countries or regions.
- Chinese license plate number recognition is based on information such as Chinese license plate structure, color, font type, etc. This identification method cannot identify many countries and regions.
- the versatility of license plate recognition is not strong.
- the embodiment of the present application provides a method and a device for identifying a license plate number, which can improve the versatility of license plate number recognition.
- Embodiments of the present application can be applied to electronic devices having processors, such as desktop computers, tablet computers, notebook computers, smart phones, and the like.
- FIG. 2 is a schematic flowchart of a method for identifying a license plate number according to an embodiment of the present disclosure, where the method includes the following steps:
- Step S201 Acquire a first image of the license plate number to be identified.
- the first image of the license plate number to be identified may be a frame image in the surveillance video, or may be a captured image, and may be any image of the license plate number to be identified.
- the application does not specifically address the source of the first image. limited.
- the first image should generally contain an image of the vehicle to be identified with the license plate number, and since the first image is often an image taken by the electronic device, it may also contain other complex background images, which may be trees, people, roads, fence, etc.
- Step S202 Draw a pixel value map of each pixel in the pixel row for each pixel row in the first image, where the abscissa of the pixel value map is the pixel point coordinate, and the ordinate is the pixel value of the pixel point. .
- Fig. 2a is an example of a pixel value map in which a curve having a peak trough shape is a pixel value map of a pixel row indicated by a black line in the figure.
- Step S203 Identify, for each pixel value map, a peak feature point and a trough feature point in the pixel value map; and divide the pixel value map into a first number of candidate areas according to a preset width, for each a candidate area, identifying a peak feature point or a trough feature point included in the candidate area, determining whether the peak feature point or the trough feature point satisfies a preset condition, and if yes, the first image corresponding to the candidate area
- the pixels in the middle are connected into a line segment.
- the preset condition may be one or more of the following conditions:
- Condition 1 for each candidate area, identifying the number of peak feature points or the number of trough feature points included in the candidate area, and determining whether the number of peak feature points or the number of trough feature points meets a preset feature point number threshold.
- Condition 3 for each candidate area, identifying a pixel value of a peak feature point or a pixel value of a trough feature point included in the candidate area, and determining adjacent peak feature points and trough feature point pixels in the candidate area
- the magnitude of the jump is calculated, and the difference between the amplitudes of each of the two hop amplitudes is calculated to determine whether all of the amplitude differences in the candidate region are not greater than a preset amplitude difference threshold.
- the peak feature points and the trough feature points in the pixel value map of the license plate area have the following characteristics:
- the pixel value of the vertical feature point has a large amplitude of the jump
- the hopping amplitude of the feature points is basically the same;
- the horizontal jump interval between feature points is relatively uniform.
- the pixel value map can also be scaled and smoothed before the peak feature points or trough feature points in the pixel value map are identified. After marking the peak feature points and the trough feature points, the glitch of the peak-to-valley curve in the pixel value map can also be removed.
- Step S204 For each line segment, determine an adjacent line segment below the line segment, and calculate a second distance between a left end point of the line segment and a left end point of the adjacent line segment, and calculate a right end point of the line segment and a third distance between the right end points of the adjacent line segments, determining whether the second distance and the third distance are both smaller than a preset first distance threshold, and if yes, setting a sibling attribute to the line segment and the adjacent line segment, The line segments set to the same sibling attribute are spliced into blocks to obtain an image of each license plate positioning block.
- determining an adjacent line segment below the line segment may include determining, for each line segment, an adjacent line segment in a pixel row below the line segment.
- the preset first distance threshold may be obtained by offline learning the characteristics of the characters in the license plate in advance. Specifically, a preset machine learning method can be used to learn samples of license plates in various countries and regions.
- the method may further include: before setting the sibling attribute to the line segment and the adjacent line segment, the method further includes:
- Step 1 determining an absolute value of a difference between each pixel point of the line segment and a pixel value of an adjacent pixel, and summing the absolute value to obtain a pixel hopping characteristic value of the line segment; determining the An absolute value of a difference between each pixel point of the adjacent line segment and a pixel value of the adjacent pixel point, and summing the absolute values to obtain a pixel hopping characteristic value of the adjacent line segment.
- Step 2 Determine whether the absolute value of the difference between the pixel hopping feature value of the line segment and the adjacent line segment is less than a preset first hopping feature threshold, and if yes, perform execution on the line segment and the adjacent line segment. Steps to set the sibling properties.
- the two line segments have similar pixel hopping eigenvalues.
- the absolute value of the difference between the pixel hopping feature values of the line segment and the adjacent line segment is not less than the preset first hopping feature threshold, it indicates that the two line segments do not have similar pixel hopping feature values, and These two line segments set the sibling attribute.
- another sibling attribute is set for the line segment and the adjacent line segment, the sibling attribute Different from the above brother attribute.
- ten line segments numbered 1 to 10 are identified in the image, and the ten line segments are numbered in order. Adjacent to the top and bottom, when it is determined that three consecutive line segments 1, 2, and 3 have similar pixel hopping eigenvalues, the fraternal attribute A is set for the three line segments; line segment 3 and line segment 4 do not have similar pixel hopping characteristics. Values, line segments 4 to 10 all have similar pixel hopping feature values, and the sibling attribute B is set for both segments 4-10.
- the first image usually includes a more complicated image background, there may be more than one license plate positioning block image obtained from the first image, which may include a non-license card area, such as a lamp area and a logo area. Wait.
- Step S205 Select a second image corresponding to the license plate number area of the first image from each license plate positioning block image.
- the obtained license plate positioning block image may be relatively rough, such as an irregular edge, a frame including a license plate, and the like.
- the second image can also be finely positioned. That is to say, after selecting the second image from each of the license plate positioning block images, the license plate number area in the second image may be finely positioned so that the edge of the second image is stuck as much as possible in the license plate internal character. At the edge.
- the specific fine positioning process may be similar to steps S202 to S204 except that the values of the respective thresholds are reset.
- the fine positioning processing may be performed before step S205, that is, fine positioning processing is performed on each license plate positioning block image, and then the second image is selected from each license plate positioning block image after the fine positioning processing. It can be understood that the fine positioning process is performed after step S205, and the processing speed can be increased more than before the step S205. This is because, when implemented after step S205, it is only necessary to perform fine positioning processing on the second image, and the number of processed images is small, which is advantageous for increasing the processing speed.
- the license plate positioning block image may include a non-license plate area, for example, the front heat dissipation area is also positioned.
- the license plate positioning block image may include a non-license plate area, for example, the front heat dissipation area is also positioned.
- selecting the second image from each license plate positioning block image may include various embodiments, such as selecting an average value of pixel values of each license plate positioning block image, or locating the size of the block image according to each license plate. Make a choice.
- the step S205 in this embodiment may specifically include:
- the license plate authenticity screening is performed for each license plate positioning block image, the real license plate positioning block image is obtained, and the real license plate positioning block image is determined as the license plate number region of the first image.
- the pre-stored license plate characteristics of each country and region may be the aspect ratio of the license plate, the number of characters in the license plate, the font of the character and the trend of the stroke, for example, the number of characters of the license plate in most countries or regions is 3 ⁇ Between 10 characters.
- the positioning block image is a real license plate positioning block image.
- Step S206 For each second image, obtain a vertical projection view of the pixel value of the second image according to the vertical projection method, and divide the second image according to the vertical projection image to obtain N characters included in the second image. image.
- the obtaining a vertical projection view of the pixel value of the second image may include: obtaining a vertical projection view of the pixel value of the second image by using the horizontal coordinate as the horizontal axis and the vertical pixel value as the vertical axis. More specifically, the process of obtaining a vertical projection map of pixel values of an image according to a vertical projection method will not be described again.
- the vertical projection map contains multiple peaks and troughs. According to the position of each peak and trough, the left and right boundaries of each character in the second image can be determined to obtain N character images, N is generally between [3, 10]. .
- Step S207 Identify characters in the N character images according to the character features of each country and region stored in advance, and obtain a license plate number corresponding to the first image.
- the pre-stored character characteristics of each country and region include the font features of various characters such as Arabic numerals, English, Chinese, Korean, Thai, Japanese, and stroke characteristics. These features can also be learned from a large number of license plate samples using machine learning algorithms, where the license plate samples include license plates for each country or region.
- the character image of the N character images may be filtered according to the character features of each country and region stored in advance, and the real character image is determined, and the real character image is identified.
- a character which composes each character into a character string in a preset order, and determines the character string as the license plate number corresponding to the first image.
- each string can be input into the character classifier to obtain the confidence of each string, and the string with the highest confidence is determined as the first image.
- the corresponding license plate number is the number of the license plate.
- the license plate positioning block image is obtained according to the difference between the pixel value of the character and the background pixel value of the license plate of each country and the feature point of the license plate area, and is obtained according to the character segmentation.
- Character characters in each of the N character images are identified by pre-stored character features of each country and region. It can be seen that the present embodiment utilizes the characteristics common to the license plates of each country, obtains the license plate positioning block image, and performs character recognition according to the character features of each country and region stored in advance, thereby being able to identify the license plates of each country, and existing Compared with technology, it improves versatility.
- the selected second image may be subjected to corresponding pre-processing, so that FIG. 2 can be The illustrated embodiment is modified. Specifically, before the vertical projection of the pixel value of the second image is obtained according to the vertical projection method, the method may further include:
- Step 1 Convert the second image to a grayscale image with a dark background.
- Step 2 Perform license plate tilt correction on the grayscale image.
- the license plate tilt correction means that the center point of each character in the license plate is on a horizontal line.
- the Indian license plate in Fig. 1 has the problem of license plate tilt, and the license plate tilt correction needs to correct such license plate.
- Step 3 Perform license plate character distortion correction on the license plate tilt corrected image.
- the step of obtaining a vertical projection view of the pixel values of the second image according to the vertical projection method may include: each of the corrected for the license plate character distortion
- the second image is obtained by a vertical projection method to obtain a vertical projection view of the pixel values of the second image.
- the present embodiment performs gradation processing, tilt correction, and distortion correction on the second image, and performs a vertical projection operation on the corrected second image, which can improve the accuracy of the character segmentation and character recognition process.
- the embodiment shown in Fig. 2 can be modified. Specifically, in step S206 of FIG. 2, the second image is segmented according to the vertical projection image, and the N character images included in the second image are obtained, which may be performed according to the flow diagram shown in FIG. 3, that is, the following steps are included. :
- Step S301 Segment the second image according to the vertical projection image, and obtain N character images to be corrected included in the second image.
- Step S302 For the second image, according to the connected domain method, obtain each connected domain included in the second image and the first location of each connected domain, and calculate an average of the connected domain according to the connected domain and the first location. The width is determined as the average character width of the second image.
- the connected domain method utilizes the characteristics of each character or part of a character to form a connected domain, and segments the connected domains, that is, each character image is segmented, and at the same time, the first position of each connected domain can be obtained.
- Step S303 Determine, according to the average character width, whether the first character image whose character image width is greater than a preset first width threshold exists in the N character images to be corrected, and if yes, execute step S304.
- the N character images to be corrected are directly taken as the N images included in the second image.
- Step S304 Correcting the first character image according to the first position, and determining N character images included in the second image according to the corrected first character image.
- the process of correcting the first character image for different situations is different. These situations include that the first and last characters of the license plate are stuck with the rivets, or the license plate characters are embedded with each other. In both cases, the N character images will be There are cases where the characters are too wide.
- the first character image may be modified according to the first position.
- Step 1 Determine a target connected domain corresponding to the location of the first character image from the connected domain according to the location of the first character image.
- the target connected domain may include at least two connected domains. That is, The first character image is actually a combination of a rivet and an English letter, and its corresponding target connected domain includes a rivet connected domain and an English letter connected domain.
- Step 2 Segment the first character image or re-determine the position of the first character image according to the target connected domain and the corresponding first location.
- the position of the first character image is [20, 30]
- the first position of the target connected domain is [20, 25] and [25, 30], in which case two characters are stuck, or there is a stain on the license plate. , stains and characters stick together.
- the position of the first character image can be corrected to [20, 25] and [25, 30], that is, the first character image is divided into two character images. If the first position of the target connected domain is [20, 22] and [21, 30], respectively, the position of the first target connected domain and the location of the second target connected domain, which are rivets and character sticking.
- the width of the first target connected domain is too small (width is 2) according to the average character width (assumed to be 10)
- the first target connected domain can be discarded, and the position of the second target connected domain can be determined as The position of the first character image.
- the position of the first character image is [20, 30] and the first position of the target connected domain is [20, 27] and [23, 30], in which case the characters are embedded in each other. Then, the position of the first character image can be corrected to [20, 25] and [25, 30], that is, the average value 25 of 23 and 27 is taken as the division point of the two-character image.
- Fig. 4 is a view showing a state in which vertical projections of characters 7 and 4 are embedded with each other. Among them, when the license plate is subjected to character division according to the vertical projection method, 7 and 4 are divided into one character, and therefore 7 and 4 are considered to be embedded with each other. This embodiment can separate such mutually embedded characters.
- the connected domain method is further used to further correct the segmented N character images to be corrected, and the character sticking, the first and last character positions are not accurate enough, and the characters are embedded in the actual application. Improve the accuracy of character segmentation results.
- the embodiment shown in FIG. 2 may be improved for the above problem, wherein, in step S206, the second image is segmented according to the vertical projection image, and the second image is obtained.
- the N character images included in the second image can be performed according to the flow diagram shown in FIG. 5.
- Figure 5 includes the following steps:
- Step S501 Perform segmentation on the second image according to the vertical projection image, and obtain N character images to be corrected included in the second image.
- Step S502 determining whether there is a second character image whose character image width is smaller than a preset second width threshold in the N character images to be corrected, and if yes, executing step S503.
- step S207 is executed.
- the step of identifying the characters in the N character images and obtaining the license plate number corresponding to the first image may be performed according to the character characteristics of each country and region stored in advance.
- Step S503 Determine at least two adjacent second character images as the character image to be corrected.
- Step S504 Obtain an edge image of the second image, perform character segmentation on the edge image according to a vertical projection method, and determine a target character image corresponding to the image position of the character to be corrected from the segmented edge image.
- Step S505 Input the character to be corrected and the corresponding target character image into the character classifier to obtain the confidence of each character image.
- the character classifier is a classifier set according to character features of each country and region. Character characteristics in various countries and regions can be learned from a large number of license plates containing various countries and regions using machine learning algorithms.
- Step S506 It is determined whether at least two confidence levels of the character image to be corrected are less than a confidence level of the corresponding target character image, and if yes, step S507 is performed.
- the target character image is not completely trusted.
- the N character images to be corrected are used as the N character images included in the second image, and step S207 is continued.
- Step S507 Combine at least two second character images included in the image to be corrected according to the position of the corresponding target character image to obtain N character images included in the second image.
- the position of the target character image K is [20, 30]
- the positions of the two second character images A and B included in the character image to be corrected are [20, 23] and [26, 30], respectively, where A, B
- the confidence levels of K and K are 0.2, 0.3, and 0.9, respectively, then it can be judged that the confidence levels of A and B are both less than the confidence of K.
- a and B are combined to obtain the position of the corrected character image as [ 20, 30].
- the character image width of the N character images to be corrected is smaller than the preset second width threshold, it indicates that there is a case where the characters are split in the N character images to be corrected.
- Character segmentation is performed on the edge image of the second image, and the N character images to be corrected are corrected based on the character image obtained from the edge map. Since the segmentation result of the edge image of the second image is obtained, the segmentation result obtained may be different from the segmentation result obtained by directly segmenting the character of the second image, and the edge image is less affected by external influences such as uneven illumination, and can be more accurately Identify the characters on the license plate where the illumination is uneven. Therefore, the solution of the embodiment can improve the accuracy of the character segmentation result.
- FIG. 6 is a schematic flowchart of another method for identifying a license plate number according to an embodiment of the present disclosure. Steps S601 to S605 are the same as steps S201 to S205 in the embodiment shown in FIG. 2, and details are not described herein again.
- Step S606 determining whether the second image belongs to the double-layer license plate according to the aspect ratio of the second image and the preset ratio threshold, and if yes, executing step S607.
- the second image does not belong to the double-layer license plate, and for each second image, a vertical projection view of the pixel value of the second image is obtained according to the vertical projection method, and the second image is obtained according to the vertical projection image.
- the step of dividing to obtain N character images included in the second image may be performed.
- the third license plate in the Chinese Hong Kong license plate in Fig. 1 is a double deck license plate.
- the license plate of the world is generally between 50 and 300 pixels, and the height is between 15 and 50 pixels.
- the preset ratio threshold can be determined based on the information.
- Step S607 Obtain an upper positioning block and a lower positioning block included in each second image from the second image, specifically:
- the pixel hopping feature value of the character portion is significantly larger than the pixel hopping feature value of the gap portion. Therefore, according to the preset second hopping feature threshold, the pixel row having the similar pixel hopping feature value can be identified and the sibling attribute is set. . Since the upper character portion has a sibling attribute different from the lower character portion, the upper positioning block and the lower positioning block included in the second image can be obtained according to the value of the sibling attribute.
- Step S608 Convert the second image into a single-layer license plate image according to the upper positioning block and the lower positioning block.
- converting the second image into a single-layer license plate image according to the upper positioning block and the lower positioning block may include: placing the upper positioning block on the left side of the lower positioning block, and converting the second image into a single layer.
- the license plate image may also include: placing the lower positioning block on the right side of the upper positioning block to convert the second image into a single layer license plate image.
- Step S609 For each second image after being converted into a single-layer license plate image, obtain a vertical projection view of the pixel value of the second image according to a vertical projection method, and divide the second image according to the vertical projection image. Obtaining N character images included in the second image.
- Step S610 Identify characters in the N character images according to the character features of each country and region stored in advance, and obtain a license plate number corresponding to the first image.
- the step S610 is the same as the step S207 in the embodiment shown in FIG. 2, and details are not described herein again.
- the double-layer license plate can be converted into a single-layer license plate according to a certain interval between the upper layer and the lower layer in the double-layer license plate, so that when the license plate character of the second image is divided, Make the segmentation result more accurate.
- FIG. 7 is a schematic structural diagram of a license plate number identifying apparatus according to an embodiment of the present disclosure, where the apparatus includes:
- the first image obtaining module 701 is configured to acquire a first image of the license plate number to be identified
- a pixel value map drawing module 702 configured to draw a pixel value map of each pixel point in the pixel row for each pixel row in the first image, where an abscissa of the pixel value map is a pixel point coordinate, The ordinate is the pixel value of the pixel;
- a pixel point connection module 703 configured to identify a peak feature point and a trough feature point in the pixel value map for each pixel value map; and divide the pixel value map into a first number of candidate points according to a preset width a region, for each candidate region, identifying a peak feature point or a trough feature point included in the candidate region, and determining whether the peak feature point or the trough feature point meets a preset condition, and if yes, the Selecting pixel points in the first image corresponding to the selected area into line segments;
- a positioning block obtaining module 704 configured to determine, for each line segment, an adjacent line segment below the line segment, and calculate a second distance between a left end point of the line segment and a left end point of the adjacent line segment, and calculate the a third distance between the right end point of the line segment and the right end point of the adjacent line segment, determining whether the second distance and the third distance are both smaller than a preset first distance threshold, and if so, the line segment and the phase
- the neighboring line segments are all set with the sibling attribute; the line segments set to the same sibling attribute are spliced into blocks, and each license plate positioning block image is obtained;
- a second image selection module 705, configured to select, from each of the license plate positioning block images, a second image corresponding to the license plate number region of the first image
- a second image segmentation module 706, configured to obtain, for each second image, a vertical projection view of pixel values of the second image according to a vertical projection method; and segment the second image according to the vertical projection image Obtaining N character images included in the second image;
- the image character recognition module 707 is configured to identify characters in the N character images according to character features of each country and region stored in advance, and obtain a license plate number corresponding to the first image.
- the preset condition may be one or more of the following conditions:
- the hopping interval of the abscissa of the adjacent peak feature points and the trough feature points in the candidate area is identified, and whether all the hop intervals in the candidate area are uniform is determined.
- the positioning block obtaining module 704 can also be used to:
- the second image selection module 705 can be specifically configured to:
- the license plate authenticity screening is performed on each license plate positioning block image to obtain the real license plate positioning block image; the real license plate positioning block image is determined as the license plate number region corresponding to the first image. Second image.
- the apparatus may further include a second image correction module (not shown);
- the second image correcting module is configured to convert the second image into a bright dark background before obtaining a vertical projection view of the pixel value of the second image according to a vertical projection method for each second image. a grayscale image; performing license plate tilt correction on the grayscale image; performing license plate character distortion correction on the license plate tilt corrected image;
- the second image segmentation module 706 is specifically configured to obtain, for each second image corrected by the license plate character distortion, a vertical projection view of the pixel value of the second image according to a vertical projection method; Projecting a picture, dividing the second image to obtain N character images included in the second image.
- the second image segmentation module 706 can include a first obtaining submodule 801 , a first computing submodule 802 , a first determining submodule 803 , and a first determining submodule 804 . These modules are shown in Figure 8, corresponding to the method embodiment shown in Figure 3.
- the first obtaining sub-module 801 is configured to divide the second image according to the vertical projection view, and obtain N character images to be corrected included in the second image;
- a first calculating sub-module 802 configured to obtain, for the second image, each connected domain included in the second image and a first location of each connected domain according to the connected domain method, according to the connected domain and the a first position, calculating an average width of the connected domain, and determining the average width as an average character width of the second image;
- a first determining sub-module 803 configured to determine, according to the average character width, whether the first character image whose character image width is greater than a preset first width threshold exists in the N character images to be corrected;
- a first determining sub-module 804 configured to: when the first character image whose character image width is greater than a preset first width threshold exists in the N character images to be corrected, correct the first character according to the first position And determining an N character image included in the second image according to the corrected first character image.
- the first determining submodule 804 can be used to:
- the second image segmentation module 706 can include a second obtaining submodule 901 , a second determining submodule 902 , a second determining submodule 903 , an image segmentation submodule 904 , and a third obtaining submodule 905 .
- the third judging sub-module 906 and the image merging sub-module 907, which are shown in FIG. 9, correspond to the method embodiment shown in FIG. 5.
- the second obtaining sub-module 901 is configured to segment the second image according to the vertical projection view, and obtain N character images to be corrected included in the second image;
- a second determining sub-module 902 configured to determine whether a second character image whose character image width is smaller than a preset second width threshold exists in the N character images to be corrected
- a second determining sub-module 903 configured to: determine, when the second character image whose character image width is smaller than a preset second width threshold, in the N character images to be corrected, determine at least two adjacent second character images Character image to be corrected;
- the image segmentation sub-module 904 is configured to obtain an edge map of the second image, perform character segmentation on the edge image according to a vertical projection method, and determine, from the segmented edge image, a position corresponding to the image position of the character to be modified.
- Target character image
- a third obtaining sub-module 905 configured to input the to-be-corrected character image and the corresponding target character image into a character classifier, to obtain a confidence level of each character image, where the character classifier is a character according to each country and region Classifier for feature setting;
- the third determining sub-module 906 is configured to determine whether at least two confidence levels of the to-be-corrected character image are less than a confidence level of the corresponding target character image;
- the image merging sub-module 907 is configured to: when the at least two confidence degrees of the character image to be corrected are less than the confidence of the corresponding target character image, the character to be modified according to the position of the corresponding target character image The at least two second character images included in the image are combined to obtain N character images included in the second image.
- FIG. 10 is another schematic structural diagram of a license plate number identifying apparatus according to an embodiment of the present application, corresponding to the method embodiment shown in FIG. 6.
- the modules 1001 to 1005 in the device are the same as the modules 701 to 705 of the embodiment shown in FIG. 7, and are not described herein again.
- a fourth determining sub-module 1006 configured to, according to a vertical projection method, obtain a vertical projection view of the pixel value of the second image for each second image, according to a width ratio of the second image, and a preset a ratio threshold, determining whether the second image belongs to a double deck license plate;
- the feature value obtaining sub-module 1007 is configured to, when the second image belongs to the double-layer license plate, determine each pixel point included in the pixel row and its adjacent pixel point for each pixel row in the second image An absolute value of a difference value of the pixel values, and summing the absolute values to obtain a pixel hopping feature value of the pixel row;
- a positioning block obtaining sub-module 1008 configured to determine, for each pixel row, adjacent pixel rows below the pixel row, and determine an absolute value of a difference between the pixel row and a pixel hopping feature value of the adjacent pixel row Determining whether the absolute value is less than a preset second hopping feature threshold, and if so, setting the pixel row and the adjacent pixel row to a sibling attribute; splicing the pixel rows set to the same sibling attribute into a block, obtaining the Depicting an upper positioning block and a lower positioning block included in the second image;
- a two-layer image conversion sub-module 1009 configured to convert the second image into a single-layer license plate image according to the upper positioning block and the lower positioning block;
- a second image segmentation module 1010 configured to obtain, for each second image after being converted into a single-layer license plate image, a vertical projection view of pixel values of the second image according to a vertical projection method; according to the vertical projection view, Segmenting the second image to obtain N character images included in the second image.
- the image character recognition module 1011 is configured to identify characters in the N character images according to character features of each country and region stored in advance, and obtain a license plate number corresponding to the first image.
- the module 1011 can be identical to the module 207 in FIG.
- the dual-layer image conversion sub-module 1009 can be specifically used to:
- the upper positioning block is placed on the left side of the lower positioning block to convert the second image into a single layer license plate image.
- the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
- the embodiment of the present application provides an electronic device, which is applicable to license plate number identification, and the electronic device includes:
- the circuit board is disposed inside the space enclosed by the housing, the processor and the memory are disposed on the circuit board; and the power supply circuit is used for each circuit of the electronic device or The device is powered;
- the memory is for storing executable program code;
- the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory for performing the following steps:
- the pixels are connected into a line segment;
- the characters in the N character images are identified according to the character characteristics of each country and region stored in advance, and the license plate number corresponding to the first image is obtained.
- the electronic device can exist in various forms, including but not limited to:
- Mobile communication devices These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication.
- Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
- Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access.
- Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
- Portable entertainment devices These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
- the server consists of a processor, a hard disk, a memory, a system bus, etc.
- the server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
- the embodiment of the present application can obtain the license plate positioning block image according to the difference between the pixel values of the characters and the background of the license plate of each country and the feature points of the license plate area. And after the character division, the characters in the N character images are identified according to the character features of each country and region stored in advance. It can be seen that the embodiment of the present application utilizes the common features of the license plates of each country, obtains the image of the license plate positioning block, and performs character recognition according to the character features of each country and region stored in advance, thereby being able to identify the license plates of each country, and the present Compared with technology, it improves versatility.
- the application provides an application program for executing the license plate number identification method provided by the embodiment of the present application at runtime.
- the license plate number identification method comprises:
- the pixels are connected into a line segment;
- the characters in the N character images are identified according to the character characteristics of each country and region stored in advance, and the license plate number corresponding to the first image is obtained.
- the embodiment of the present application can obtain the license plate positioning block image according to the difference between the pixel values of the characters and the background of the license plate of each country and the feature points of the license plate area. And after the character division, the characters in the N character images are identified according to the character features of each country and region stored in advance. It can be seen that the embodiment of the present application utilizes the common features of the license plates of each country, obtains the image of the license plate positioning block, and performs character recognition according to the character features of each country and region stored in advance, thereby being able to identify the license plates of each country, and the present Compared with technology, it improves versatility.
- the present application provides a storage medium for storing executable code, which is used to execute the license plate number identification method provided by the embodiment of the present application at runtime.
- the license plate number identification method comprises:
- the pixels are connected into a line segment;
- the characters in the N character images are identified according to the character characteristics of each country and region stored in advance, and the license plate number corresponding to the first image is obtained.
- the embodiments of the present application can be based on the characters and backgrounds of license plates in various countries.
- the difference between the pixel values and the feature points of the license plate area are concentrated, and the license plate positioning block image is obtained; and after the character division, the characters in the N character images are identified according to the character features of each country and region stored in advance.
- the embodiment of the present application utilizes the common features of the license plates of each country, obtains the image of the license plate positioning block, and performs character recognition according to the character features of each country and region stored in advance, thereby being able to identify the license plates of each country, and the present Compared with technology, it improves versatility.
- the storage medium referred to herein means a ROM/RAM, a magnetic disk, an optical disk, or the like.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Data Mining & Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Computation (AREA)
- Evolutionary Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Character Input (AREA)
- Image Analysis (AREA)
Abstract
本申请实施例提供了一种车牌号码识别方法及装置。所述方法包括:针对待识别车牌号码的第一图像,绘制每个像素行对应的像素值图,根据像素值图中波峰特征点和波谷特征点是否满足预设条件,将第一图像中的对应像素点连接成线段;根据线段之间的距离,对线段和相邻线段均设置兄弟属性;将相同兄弟属性的线段拼接成块,获得每个车牌定位块图像,并选择第一图像的车牌号码区域对应的第二图像;根据垂直投影法,获得第二图像的像素值的垂直投影图,并对第二图像进行分割,获得N个字符图像;根据预先存储的每个国家和地区的字符特征,识别N个字符图像中的字符,获得第一图像对应的车牌号码。本实施例能够提高车牌号码识别的通用性。
Description
本申请要求于2016年08月11日提交中国专利局、申请号为201610657870.5、发明名称为“一种车牌号码识别方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及智能交通技术领域,特别涉及一种车牌号码识别方法及装置。
车牌号码是车辆的“身份证”,是识别机动车辆的一项重要依据。车牌号码识别技术已被广泛应用在卡口、停车场和电子警察等场景中,以获取场景内车辆的号牌信息,在治安管理等众多方面发挥着重要作用。
现有技术中,当从监控摄像机拍摄的视频中抓取到包含车辆的车牌号码的图像后,通常通过以下三步从该图像中识别出车牌号码:首先从图像中定位车牌区域,然后分割车牌区域中的字符,最后识别分割后的字符,得到车牌号码。
在对图像进行定位、分割和识别时,一般根据本国或本地区车牌的先验信息进行。但是,面对其他国家或地区的车牌,由于其他国家或地区的车牌具有与本国车牌的先验信息不同的信息,因此无法根据本国或本地区车牌的先验信息识别其他国家或地区的车牌号码,车牌号码识别的通用性不强。
例如,通常根据车牌区域为白字蓝底或黑字黄底的颜色信息定位本国或本地区车牌区域,但是这种方法难以定位其他国家黄字黑底或白字黑底的车牌;通常根据本国车牌中的二五结构对车牌字符进行分割,但是这种方法难以分割其他国家三三结构或二四结构的车牌。
发明内容
本申请实施例的目的在于提供了一种车牌号码识别方法及装置,能够提高车牌号码识别的通用性。
为了达到上述目的,本申请公开了一种车牌号码识别方法,所述方法包括:
获取待识别车牌号码的第一图像;
针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;
针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;
针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;
从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;
针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;
根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
可选的,所述预设条件为下述条件中的一种或多种:
针对每个待选区域,识别所述待选区域中包含的波峰特征点数量或波谷特征点数量,判断所述波峰特征点数量或波谷特征点数量是否满足预设特征点数量阈值;或,
针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像素值的跳变幅值,判断所述待选区域的所有跳变幅值是否均大于预设跳变幅值阈值;或,
针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像
素值的跳变幅值,计算每两个跳变幅值之间的幅值差值,判断所述待选区域中的所有幅值差值是否均不大于预设幅值差值阈值;或,
针对每个待选区域,识别所述待选区域中相邻波峰特征点与波谷特征点的横坐标的跳变间隔,判断所述待选区域中的所有跳变间隔是否均匀。
可选的,在所述对所述线段和相邻线段均设置兄弟属性之前,所述方法还包括:
确定所述线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述线段的像素跳变特征值;确定所述相邻线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述相邻线段的像素跳变特征值;
判断所述线段与所述相邻线段的像素跳变特征值的差值的绝对值是否小于预设第一跳变特征阈值,如果是,则执行所述对所述线段和相邻线段均设置兄弟属性的步骤。
可选的,所述从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像,包括:
根据预先存储的每个国家和地区的车牌特征,对所述每个车牌定位块图像进行车牌真伪筛选,获得真实车牌定位块图像;
将所述真实车牌定位块图像确定为所述第一图像的车牌号码区域对应的第二图像。
可选的,在针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,所述方法还包括:
将所述第二图像转换为亮字暗底的灰度图像;
对所述灰度图像进行车牌倾斜校正;
对车牌倾斜校正后的图像进行车牌字符畸变校正;
所述针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图,包括:
针对车牌字符畸变校正后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图。
可选的,所述根据所述垂直投影图,对所述第二图像进行分割,获得所
述第二图像包含的N个字符图像,包括:
根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的待修正的N个字符图像;
针对所述第二图像,根据连通域法,获得所述第二图像包含的每个连通域以及每个连通域的第一位置,根据所述连通域和所述第一位置,计算所述连通域的平均宽度,将所述平均宽度确定为所述第二图像的平均字符宽度;
根据所述平均字符宽度,判断所述待修正的N个字符图像中是否存在字符图像宽度大于预设第一宽度阈值的第一字符图像;
如果存在,则根据所述第一位置修正所述第一字符图像,根据修正后的第一字符图像,确定所述第二图像包含的N个字符图像。
可选的,所述根据所述第一位置修正所述第一字符图像,包括:
根据所述第一字符图像的位置,从所述连通域中确定与所述第一字符图像的位置对应的目标连通域;
根据所述目标连通域及对应的第一位置,对所述第一字符图像进行分割或者重新确定第一字符图像的位置。
可选的,所述根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像,包括:
根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的待修正的N个字符图像;
判断所述待修正的N个字符图像中是否存在字符图像宽度小于预设第二宽度阈值的第二字符图像;
如果存在,则将相邻的至少两个第二字符图像确定为待修正字符图像;
获得所述第二图像的边缘图,根据垂直投影法,对所述边缘图进行字符分割,并从分割后的边缘图中确定与所述待修正字符图像位置对应的目标字符图像;
将所述待修正字符图像和对应的目标字符图像均输入字符分类器,获得每个字符图像的置信度,所述字符分类器为根据各个国家和地区的字符特征设置的分类器;
判断所述待修正字符图像的至少两个置信度是否均小于对应的目标字符
图像的置信度;
如果是,则根据所述对应的目标字符图像的位置,将所述待修正字符图像包含的至少两个第二字符图像进行合并,获得所述第二图像包含的N个字符图像。
可选的,在针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,所述方法还包括:
根据所述第二图像的宽高比例以及预设比例阈值,判断所述第二图像是否属于双层车牌;
如果是,则针对所述第二图像中的每个像素行,确定所述像素行包含的每个像素点与其相邻像素点的像素值的差值的绝对值,并将所述绝对值求和,获得所述像素行的像素跳变特征值;
针对每个像素行,确定所述像素行下方的相邻像素行,并确定所述像素行与相邻像素行的像素跳变特征值的差值的绝对值;判断所述绝对值是否小于预设第二跳变特征阈值,如果是,则将所述像素行和相邻像素行设置兄弟属性;将设置为相同兄弟属性的像素行拼接成块,获得所述第二图像包含的上定位块和下定位块;
根据所述上定位块和下定位块,将所述第二图像转换成单层车牌图像;
所述针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图,包括:
针对转换成单层车牌图像后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图。
可选的,所述根据所述上定位块和下定位块,将所述第二图像转换成单层车牌图像,包括:
将所述上定位块放置在所述下定位块左侧,进而将所述第二图像转换成单层车牌图像。
为了达到上述目的,本申请公开了一种车牌号码识别装置,所述装置包括:
第一图像获取模块,用于获取待识别车牌号码的第一图像;
像素值图绘制模块,用于针对所述第一图像中的每一像素行,绘制所述
像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;
像素点连接模块,用于针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;
定位块获得模块,用于针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;
第二图像选择模块,用于从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;
第二图像分割模块,用于针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;
图像字符识别模块,用于根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
可选的,所述预设条件为下述条件中的一种或多种:
针对每个待选区域,识别所述待选区域中包含的波峰特征点数量或波谷特征点数量,判断所述波峰特征点数量或波谷特征点数量是否满足预设特征点数量阈值;或,
针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像素值的跳变幅值,判断所述待选区域的所有跳变幅值是否均大于预设跳变幅值阈值;或,
针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或
波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像素值的跳变幅值,计算每两个跳变幅值之间的幅值差值,判断所述待选区域中的所有幅值差值是否均不大于预设幅值差值阈值;或,
针对每个待选区域,识别所述待选区域中相邻波峰特征点与波谷特征点的横坐标的跳变间隔,判断所述待选区域中的所有跳变间隔是否均匀。
可选的,所述定位块获得模块还用于:
在所述对所述线段和相邻线段均设置兄弟属性之前,确定所述线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述线段的像素跳变特征值;确定所述相邻线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述相邻线段的像素跳变特征值;
判断所述线段的像素跳变特征值与所述相邻线段的像素跳变特征值的差值的绝对值是否小于预设第一跳变特征阈值,如果是,则对所述线段和相邻线段均设置兄弟属性。
可选的,所述第二图像选择模块,具体用于:
根据预先存储的每个国家和地区的车牌特征,对所述每个车牌定位块图像进行车牌真伪筛选,获得真实车牌定位块图像;将所述真实车牌定位块图像确定为所述第一图像的车牌号码区域对应的第二图像。
可选的,所述装置还包括第二图像校正模块;
所述第二图像校正模块,用于在针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,将所述第二图像转换为亮字暗底的灰度图像;对所述灰度图像进行车牌倾斜校正;对车牌倾斜校正后的图像进行车牌字符畸变校正;
所述第二图像分割模块,具体用于针对车牌字符畸变校正后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像。
可选的,所述第二图像分割模块包括:
第一获得子模块,用于根据所述垂直投影图,对所述第二图像进行分割,
获得所述第二图像包含的待修正的N个字符图像;
第一计算子模块,用于针对所述第二图像,根据连通域法,获得所述第二图像包含的每个连通域以及每个连通域的第一位置,根据所述连通域和所述第一位置,计算所述连通域的平均宽度,将所述平均宽度确定为所述第二图像的平均字符宽度;
第一判断子模块,用于根据所述平均字符宽度,判断所述待修正的N个字符图像中是否存在字符图像宽度大于预设第一宽度阈值的第一字符图像;
第一确定子模块,用于当所述待修正的N个字符图像中存在字符图像宽度大于预设第一宽度阈值的第一字符图像时,根据所述第一位置修正所述第一字符图像,根据修正后的第一字符图像,确定所述第二图像包含的N个字符图像。
可选的,所述第一确定子模块,具体用于:
根据所述第一字符图像的位置,从所述连通域中确定与所述第一字符图像的位置对应的目标连通域;根据所述目标连通域及对应的第一位置,对所述第一字符图像进行分割或者重新确定第一字符图像的位置。
可选的,所述第二图像分割模块包括:
第二获得子模块,用于根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的待修正的N个字符图像;
第二判断子模块,用于判断所述待修正的N个字符图像中是否存在字符图像宽度小于预设第二宽度阈值的第二字符图像;
第二确定子模块,用于当所述待修正的N个字符图像中存在字符图像宽度小于预设第二宽度阈值的第二字符图像时,将相邻的至少两个第二字符图像确定为待修正字符图像;
图像分割子模块,用于获得所述第二图像的边缘图,根据垂直投影法,对所述边缘图进行字符分割,并从分割后的边缘图中确定与所述待修正字符图像位置对应的目标字符图像;
第三获得子模块,用于将所述待修正字符图像和对应的目标字符图像均输入字符分类器,获得每个字符图像的置信度,所述字符分类器为根据各个国家和地区的字符特征设置的分类器;
第三判断子模块,用于判断所述待修正字符图像的至少两个置信度是否均小于对应的目标字符图像的置信度;
图像合并子模块,用于当所述待修正字符图像的至少两个置信度均小于对应的目标字符图像的置信度时,根据所述对应的目标字符图像的位置,将所述待修正字符图像包含的至少两个第二字符图像进行合并,获得所述第二图像包含的N个字符图像。
可选的,所述装置还包括:
第四判断子模块,用于在针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,根据所述第二图像的宽高比例以及预设比例阈值,判断所述第二图像是否属于双层车牌;
特征值获得子模块,用于当所述第二图像属于双层车牌时,针对所述第二图像中的每个像素行,确定所述像素行包含的每个像素点与其相邻像素点的像素值的差值的绝对值,并将所述绝对值求和,获得所述像素行的像素跳变特征值;
定位块获得子模块,用于针对每个像素行,确定所述像素行下方的相邻像素行,并确定所述像素行与相邻像素行的像素跳变特征值的差值的绝对值;判断所述绝对值是否小于预设第二跳变特征阈值,如果是,则将所述像素行和相邻像素行设置兄弟属性;将设置为相同兄弟属性的像素行拼接成块,获得所述第二图像包含的上定位块和下定位块;
双层图像转换子模块,用于根据所述上定位块和下定位块,将所述第二图像转换成单层车牌图像;
所述第二图像分割模块,具体用于针对转换成单层车牌图像后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像。
可选的,所述双层图像转换子模块具体用于:
将所述上定位块放置在所述下定位块左侧,进而将所述第二图像转换成单层车牌图像。
为了达到上述目的,本申请公开了一种电子设备,适用于车牌号码识别,
所述电子设备包括:
壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行以下步骤:
获取待识别车牌号码的第一图像;
针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;
针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;
针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;
从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;
针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;
根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
为了达到上述目的,本申请公开了一种应用程序,所述应用程序用于在运行时执行本申请实施例提供的车牌号码识别方法。其中,该车牌号码识别方法包括:
获取待识别车牌号码的第一图像;
针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;
针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;
针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;
从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;
针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;
根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
为了达到上述目的,本申请公开了一种存储介质,用于存储可执行代码,所述可执行代码在运行时用于执行本申请实施例提供的车牌号码识别方法。其中,该车牌号码识别方法包括:
获取待识别车牌号码的第一图像;
针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;
针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰
特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;
针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;
从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;
针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;
根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
由上述技术方案可见,本申请实施例中,首先,针对待识别车牌号码的第一图像中的每一像素行绘制像素值图,当像素值图中待选区域的波峰特征点或波谷特征点满足预设条件时,将待选区域对应的第一图像中的像素点连接成线段。其次,根据依据波峰特征点或波谷特征点连接的线段及各个线段之间的距离来获得每个车牌定位块图像,再从每个车牌定位块图像中选择第一图像的车牌号码区域对应的第二图像,然后对第二图像进行字符分割,获得第二图像包含的N个字符图像,最后,根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
也就是说,本申请实施例中,先依据各个国家的车牌都具有的字符与背景的像素值差别较大和车牌区域特征点比较集中的特点,获得车牌定位块图像;并在字符分割后根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符。
可见,本申请实施例利用了各个国家车牌共有的特点,获得了车牌定位块图像,并且根据预先存储的每个国家和地区的字符特征来进行字符识别,因此能够识别各个国家的车牌,与现有技术相比,提高了通用性。
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍。显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为部分国家和地区车牌类型的示例图;
图2为本申请实施例提供的车牌号码识别方法的一种流程示意图;
图2a为待识别车牌号码的图像中像素值图的一个例子;
图3为图2所示实施例的步骤S206的一种流程示意图;
图4为车牌中号码7和4相互嵌入的一个示例图;
图5为图2所示实施例的步骤S206的另一种流程示意图;
图6为本申请实施例提供的车牌号码识别方法的另一种流程示意图;
图7为本申请实施例提供的车牌号码识别装置的一种结构示意图;
图8为图7中第二图像分割模块706的一种结构示意图;
图9为图7中第二图像分割模块706的另一种结构示意图;
图10为本申请实施例提供的车牌号码识别装置的另一种结构示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整的描述。显然,所描述的实施例仅仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。
图1为部分国家和地区车牌类型的示例图。图中,1为中国香港地区的车牌示例,其中,车牌字符数量在3~6之间,车牌颜色为黑字白底;2为中国澳门地区的车牌示例,其中,字符数量为6,车牌颜色为白字黑底和黄字黑底,并且字符中间还包括短连接线;3为印度的车牌示例,其中,字符数量为10,车牌颜色为黑字黄底和黑字白底,并且字符中间以句点隔开;4为菲律宾的车牌示例,其中,字符数量为6,车牌颜色为黑字黄底;5为韩国的车牌示例,其中,字符数量为7,车牌颜色为黑字白底;6为泰国车牌示例,其中,字符
数量为6,车牌颜色为黑字白底。
可见,各国家和地区的车牌在以下方面各有不同:
车牌结构:包括单层车牌和双层车牌;
字符数量:分布区间为[3,10];
颜色:前景即字符颜色有白色、黄色、黑色、绿色等,车牌背景颜色有白色,黑色,黄色,绿色、蓝色等,且字符颜色与背景颜色组合数量较多;
字体种类:不仅不同国家采用的字体大不相同,且同一国家的车牌字体亦不相同,例如印度。
字符种类:包含阿拉伯数字、英文、泰文、韩文、中文和日文等。
现有技术中,一般各个国家或地区针对当地的车牌结构进行车牌识别,例如:依据中国的车牌结构、颜色、字体种类等信息进行中国车牌号码识别,这种识别方法无法识别众多国家和地区的车牌,车牌识别的通用性不强。
因此,本申请实施例提供了一种车牌号码识别方法及装置,能够提高车牌号码识别的通用性。
本申请实施例能够应用于具有处理器的电子设备中,例如台式电脑、平板电脑、笔记本电脑、智能手机等。
图2为本申请实施例提供的车牌号码识别方法的一种流程示意图,所述方法包括如下步骤:
步骤S201:获取待识别车牌号码的第一图像。
其中,待识别车牌号码的第一图像可以是监控视频中的帧图像,也可以是抓拍图像,当然还可以是任意一张待识别车牌号码的图像,本申请对第一图像的来源不做具体限定。该第一图像一般应包含待识别车牌号码车辆的图像,并且由于第一图像常常是电子设备拍摄的图像,因此它还可能包含其他复杂的背景图像,该背景图像可以是树木、人、路面、围栏等。
步骤S202:针对第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值。
图2a为一个像素值图的例子,其中具有波峰波谷形状的曲线就是图中黑线所示像素行的像素值图。
步骤S203:针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段。
其中,预设条件可以为下述条件中的一种或多种:
条件一,针对每个待选区域,识别所述待选区域中包含的波峰特征点数量或波谷特征点数量,判断所述波峰特征点数量或波谷特征点数量是否满足预设特征点数量阈值。
条件二,针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像素值的跳变幅值,判断所述待选区域的所有跳变幅值是否均大于预设跳变幅值阈值。
条件三,针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像素值的跳变幅值,计算每两个跳变幅值之间的幅值差值,判断所述待选区域中的所有幅值差值是否均不大于预设幅值差值阈值。
条件四,针对每个待选区域,识别所述待选区域中相邻波峰特征点与波谷特征点的横坐标的跳变间隔,判断所述待选区域中的所有跳变间隔是否均匀。
与上述条件对应的,可以认为车牌区域的像素值图中波峰特征点和波谷特征点具有以下特点:
特征点跳变较频繁,且跳变次数在一定范围内;
垂直方向特征点的像素值跳变幅值较大;
特征点的跳变幅度基本一致;
特征点之间的水平跳变间隔较均匀。
为了降低计算复杂度,还可以在识别像素值图中的波峰特征点或波谷特征点之前,对像素值图进行缩放和平滑处理。在标记波峰特征点和波谷特征点之后,还可以去除像素值图中波峰波谷曲线的毛刺。
步骤S204:针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性,将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像。
具体的,针对每个线段,确定所述线段下方的相邻线段可以包括:针对每个线段,确定所述线段下方像素行中的相邻线段。
在本步骤中,当判断出第二距离和第三距离中的至少一个距离不小于预设第一距离阈值时,则说明所述线段和相邻线段不具有兄弟属性,继续判断下一个线段和其相邻线段的距离。
其中,预设第一距离阈值可以通过预先对车牌中字符的特点进行离线学习得到。具体的,可以采用预设的机器学习方法,对各个国家和地区车牌的样本进行学习。
在本实施例中,为了使设置的兄弟属性更准确,在对所述线段和相邻线段均设置兄弟属性之前,所述方法还可以包括:
步骤1:确定所述线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述线段的像素跳变特征值;确定所述相邻线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述相邻线段的像素跳变特征值。
步骤2:判断所述线段与所述相邻线段的像素跳变特征值的差值的绝对值是否小于预设第一跳变特征阈值,如果是,则执行对所述线段和相邻线段均设置兄弟属性的步骤。
此时,说明这两条线段具有相似的像素跳变特征值。当判断出该线段与相邻线段的像素跳变特征值的差值的绝对值不小于预设第一跳变特征阈值时,说明这两条线段不具有相似的像素跳变特征值,则不对这两条线段设置兄弟属性。此后,当再次判断出线段与相邻线段的像素跳变特征值的差值的绝对值小于预设第一跳变特征阈值时,对该线段和相邻线段设置另一兄弟属性,该兄弟属性不同于上述兄弟属性。
例如,图像中识别出编号为1~10的十条线段,这十条线段按照编号顺序
上下相邻,当判断出连续的三条线段1、2、3均具有相似的像素跳变特征值时,为这三条线段均设置兄弟属性A;线段3和线段4不具有相似的像素跳变特征值,线段4~10均具有相似的像素跳变特征值,则为线段4~10均设置兄弟属性B。
需要说明的是,由于第一图像通常包含较复杂的图像背景,因此,从第一图像中获得的车牌定位块图像可能不止一个,其中可能包含了非车牌区域,例如车灯区域、车标区域等。
步骤S205:从每个车牌定位块图像中选择第一图像的车牌号码区域对应的第二图像。
需要指出的是,在本实施例中,经过上述步骤的处理,获得的车牌定位块图像可能是比较粗糙的,例如边缘不规则、包含车牌的边框等。为了使得到的第二图像更精准,还可以对第二图像进行细定位处理。也就是说,在从每个车牌定位块图像中选择第二图像之后,还可以对第二图像中的车牌号码区域进行细定位处理,使第二图像的边缘尽可能地卡在车牌内部字符的边缘处。具体的细定位过程可以与步骤S202~S204类似,只是重新设置各个阈值的取值。
上述细定位处理过程也可以在步骤S205之前实施,即对每个车牌定位块图像进行细定位处理,然后从细定位处理后的每个车牌定位块图像中选择第二图像。可以理解的是,细定位处理过程在步骤S205之后实施,比在步骤S205之前实施更能够提高处理速度。这是因为,在步骤S205之后实施时,只需对第二图像进行细定位处理,所处理的图像个数较少,有利于提高处理速度。
根据步骤S204可知,车牌定位块图像中可能包含非车牌区域,例如车头散热区也被定位出来。为了使获得的第二图像更准确,需要从每个车牌定位块图像中选择第二图像。
需要说明的是,从每个车牌定位块图像中选择第二图像可以包括多种实施方式,例如根据每个车牌定位块图像的像素值平均值进行选择,或者根据每个车牌定位块图像的大小进行选择。
在本申请的另一实施例中,为了使选择的第二图像中包含的非车牌区域更少,本实施例中的步骤S205具体可以包括:
根据预先存储的每个国家和地区的车牌特征,对每个车牌定位块图像进行车牌真伪筛选,获得真实车牌定位块图像,将所述真实车牌定位块图像确定为第一图像的车牌号码区域对应的第二图像。其中,预先存储的每个国家和地区的车牌特征可以是车牌的宽高比例、车牌中的字符数量、字符的字体和笔画走势等特征,例如大部分国家或地区的车牌的字符数量在3~10个字符之间。这些车牌特征可以是采用机器学习算法从大量车牌样本中学习到的,其中,车牌样本包括各个国家或地区的车牌。
具体的,根据预先存储的每个国家和地区的车牌特征,当车牌定位块图像的宽高比例符合预设的第一比例阈值范围,并且字符数量在预设范围内时,即可确认该车牌定位块图像为真实车牌定位块图像。
步骤S206:针对每个第二图像,根据垂直投影法,获得第二图像的像素值的垂直投影图,根据所述垂直投影图,对第二图像进行分割,获得第二图像包含的N个字符图像。
其中,获得第二图像的像素值的垂直投影图,可以包括:以横向坐标为横轴,以纵向像素值的和值为纵轴,获得第二图像的像素值的垂直投影图。更具体的,根据垂直投影法获得图像的像素值的垂直投影图的过程不再赘述。垂直投影图中包含多个波峰和波谷,根据每个波峰和波谷的位置,即可以确定第二图像中每个字符的左右边界,获得N个字符图像,N一般在[3,10]之间。
步骤S207:根据预先存储的每个国家和地区的字符特征,识别N个字符图像中的字符,获得第一图像对应的车牌号码。
其中,预先存储的每个国家和地区的字符特征包括阿拉伯数字、英文、中文、韩文、泰文、日文等多种字符的字体特征和笔画走势特征等。这些特征也可以是采用机器学习算法从大量车牌样本中学习到的,其中,车牌样本包括各个国家或地区的车牌。
具体的,在识别N个字符图像中的字符之前,可以根据预先存储的每个国家和地区的字符特征,对N个字符图像进行字符真伪筛选,确定真实字符图像,识别真实字符图像中的字符,将每个字符按照预设顺序组成字符串,将字符串确定为第一图像对应的车牌号码。
在实际应用中,获得的字符串可能会有多个,这时,可以将每个字符串输入字符分类器,获得每个字符串的置信度,将置信度最高的字符串确定为第一图像对应的车牌号码。
由上述内容可知,在本实施例中,先依据各个国家的车牌都具有的字符与背景的像素值差别较大和车牌区域特征点比较集中的特点,获得车牌定位块图像,并在字符分割后根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符。可见,本实施例利用了各个国家车牌共有的特点,获得了车牌定位块图像,并且根据预先存储的每个国家和地区的字符特征来进行字符识别,因此能够识别各个国家的车牌,与现有技术相比,提高了通用性。
在图2所示实施例中,为了克服某些场景中车牌倾斜等因素对后续的分割和识别过程带来的不利影响,可以对选中的第二图像进行相应的预处理,因此可以对图2所示实施例进行改进。具体的,在步骤S206的针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,所述方法还可以包括:
步骤1:将第二图像转换为亮字暗底的灰度图像。
步骤2:对所述灰度图像进行车牌倾斜校正。
其中,车牌倾斜校正是指使车牌中的每个字符的中心点均处于一条水平线上。例如,图1中的印度车牌即存在车牌倾斜的问题,车牌倾斜校正需要对这样的车牌进行校正。
步骤3:对车牌倾斜校正后的图像进行车牌字符畸变校正。
相应的,图2所示实施例中针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图的步骤,可以包括:针对车牌字符畸变校正后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图。
由上述内容可见,本实施例针对第二图像进行灰度处理、倾斜校正和畸变校正,并针对校正后的第二图像进行垂直投影操作,能够提高字符分割和字符识别过程的准确性。
在图2所示实施例的一种具体实施方式中,当第二图像的车牌首末位置
或中间位置存在铆钉,或者车牌上存在污点时,可能会导致获得的N个字符图像的位置不准确。为了提高N个字符图像的位置的准确性,可以对图2所示实施例进行改进。具体的,图2的步骤S206,即根据所述垂直投影图,对第二图像进行分割,获得第二图像包含的N个字符图像,具体可以按照图3所示流程示意图进行,即包括以下步骤:
步骤S301:根据所述垂直投影图,对第二图像进行分割,获得第二图像包含的待修正的N个字符图像。
步骤S302:针对第二图像,根据连通域法,获得第二图像包含的每个连通域以及每个连通域的第一位置,根据所述连通域和第一位置,计算所述连通域的平均宽度,将所述平均宽度确定为第二图像的平均字符宽度。
其中,连通域方法利用了每个字符或字符的一部分构成连通域的特性,把这些连通域切分出来,即切分出来每个字符图像,同时,可以获得每个连通域的第一位置。
步骤S303:根据所述平均字符宽度,判断所述待修正的N个字符图像中是否存在字符图像宽度大于预设第一宽度阈值的第一字符图像,如果存在,则执行步骤S304。
如果不存在,则直接将待修正的N个字符图像作为第二图像包含的N个图像。
步骤S304:根据所述第一位置修正所述第一字符图像,根据修正后的第一字符图像,确定所述第二图像包含的N个字符图像。
具体的,针对不同情况对第一字符图像进行修正的过程也不相同,这些情况包括车牌首末字符与铆钉粘连,或者车牌字符存在相互嵌入情况,在这两种情况下,N个字符图像会存在字符过宽的情况。
为了解决字符过宽的问题,提高分割字符的准确性,在步骤S304的一种具体实施方式中,即根据第一位置修正所述第一字符图像可以包括:
步骤1:根据第一字符图像的位置,从所述连通域中确定与所述第一字符图像的位置对应的目标连通域。
例如,第一字符图像的位置为[20,30],那么从连通域中确定字符位置也在[20,30]的目标连通域,目标连通域可能包括至少两个连通域。也就是说,
第一字符图像实际上是一个铆钉和一个英文字母的合体,而其对应的目标连通域包括一个铆钉连通域和一个英文字母连通域。
步骤2:根据目标连通域及对应的第一位置,对第一字符图像进行分割或者重新确定第一字符图像的位置。
例如,第一字符图像的位置为[20,30],目标连通域的第一位置为[20,25]和[25,30],这种情况属于两个字符发生粘连,或者车牌上存在污点,污点和字符粘连了。那么可以将第一字符图像的位置修正为[20,25]和[25,30],即第一字符图像被分割为两个字符图像。如果目标连通域的第一位置为[20,22]和[21,30],分别为第一目标连通域的位置和第二目标连通域的位置,这种情况属于铆钉和字符粘连。由于可以根据平均字符宽度(假设为10)判断出第一个目标连通域的宽度过小(宽度为2),因此可以将第一个目标连通域舍弃,将第二目标连通域的位置确定为第一字符图像的位置。
又如,第一字符图像的位置为[20,30],目标连通域的第一位置为[20,27]和[23,30],这种情况属于字符相互嵌入。那么,可以将第一字符图像的位置修正为[20,25]和[25,30],即将23和27的平均值25作为两字符图像的分割点。
图4为字符7和4的垂直投影相互嵌入的情况示意图。其中,在根据垂直投影法对这种车牌进行字符分割时,7和4被分割成了一个字符,因此认为7和4相互嵌入了。本实施例可以将这种相互嵌入的字符分割开。
由上述内容可见,在本实施例中,采用连通域方法进一步修正分割后的待修正的N个字符图像,针对实际应用中存在的字符粘连、首末字符位置不够准确和字符嵌入的情况,可以提高字符分割结果的准确性。
在图2所示实施例的一种具体实施方式中,对车牌字符进行分割后还可能存在过窄的字符图像,这种情况可能是车牌字符部分光照不均造成的。例如,字符H中的横线高度反光,导致字符分割过程中将H识别成了两个I,即造成了字符的分裂。因此,为了进一步提高字符分割结果的准确性,可以针对上述问题对图2所示实施例进行改进,其中,步骤S206,即根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像,可以按照图5所示流程示意图进行。图5包括以下步骤:
步骤S501:根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的待修正的N个字符图像。
步骤S502:判断待修正的N个字符图像中是否存在字符图像宽度小于预设第二宽度阈值的第二字符图像,如果存在,则执行步骤S503。
具体的,如果不存在,则说明待修正的N个字符图像中不存在字符分裂现象,此时将待修正的N个字符图像作为第二图像包含的N个字符图像,执行步骤S207,即执行根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码的步骤即可。
步骤S503:将相邻的至少两个第二字符图像确定为待修正字符图像。
步骤S504:获得第二图像的边缘图,根据垂直投影法,对所述边缘图进行字符分割,并从分割后的边缘图中确定与所述待修正字符图像位置对应的目标字符图像。
步骤S505:将所述待修正字符图像和对应的目标字符图像均输入字符分类器,获得每个字符图像的置信度。
其中,所述字符分类器为根据各个国家和地区的字符特征设置的分类器。各个国家和地区的字符特征可以利用机器学习算法从大量包含各个国家和地区的车牌中学习得到。
步骤S506:判断所述待修正字符图像的至少两个置信度是否均小于对应的目标字符图像的置信度,如果是,则执行步骤S507。
具体的,如果否,则说明目标字符图像并不是完全可信的,此时,将待修正的N个字符图像作为第二图像包含的N个字符图像,继续执行步骤S207即可。
步骤S507:根据所述对应的目标字符图像的位置,将所述待修正字符图像包含的至少两个第二字符图像进行合并,获得第二图像包含的N个字符图像。
例如,目标字符图像K的位置为[20,30],待修正字符图像包含的两个第二字符图像A和B的位置分别为[20,23]和[26,30],其中A、B和K的置信度分别为0.2、0.3和0.9,那么可以判断出A和B的置信度均小于K的置信度,这时,将A和B进行合并,获得修正后的字符图像的位置为[20,30]。
由以上内容可见,在本实施例中,待修正的N个字符图像中存在字符图像宽度小于预设第二宽度阈值时,说明待修正的N个字符图像中存在字符分裂的情况。对第二图像的边缘图进行字符分割,根据从边缘图得到的字符图像,对待修正的N个字符图像进行修正。由于对第二图像的边缘图进行字符分割,得到的分割结果,与直接对第二图像进行字符分割得到的分割结果可能是不同的,边缘图受光照不均等外界影响较小,能够更准确地识别出车牌上光照不均匀处的字符。因此,本实施例的方案能够提高字符分割结果的准确性。
图6为本申请实施例提供的车牌号码识别方法的另一种流程示意图,其中,步骤S601~S605分别与图2所示实施例中的步骤S201~S205相同,此处不再赘述。
步骤S606:根据第二图像的宽高比例以及预设比例阈值,判断第二图像是否属于双层车牌,如果是,则执行步骤S607。
如果否,则说明第二图像不属于双层车牌,执行针对每个第二图像,根据垂直投影法,获得第二图像的像素值的垂直投影图,根据所述垂直投影图,对第二图像进行分割,获得第二图像包含的N个字符图像的步骤即可。
在实际应用中,第二图像中可能存在双层车牌,例如,图1中中国香港车牌中的第三个车牌就是双层车牌。
具体的,世界范围内的车牌的宽度一般在50~300像素之间,高度在15~50像素之间,可以根据这些信息确定预设比例阈值。
步骤S607:从第二图像中获得每个第二图像包含的上定位块和下定位块,具体包括:
针对所述第二图像中的每个像素行,确定所述像素行包含的每个像素点与其相邻像素点的像素值的差值的绝对值,并将所述绝对值求和,获得所述像素行的像素跳变特征值;
针对每个像素行,确定所述像素行下方的相邻像素行,并确定所述像素行与相邻像素行的像素跳变特征值的差值的绝对值;判断所述绝对值是否小于预设第二跳变特征阈值,如果是,则将所述像素行和相邻像素行设置兄弟属性;将设置为相同兄弟属性的像素行拼接成块,获得所述第二图像包含的
上定位块和下定位块。
可以理解的是,对于双层车牌,上层字符部分和下层字符部分存在一定的空隙。字符部分的像素跳变特征值明显大于空隙部分的像素跳变特征值,因此,根据预设第二跳变特征阈值,可以将具有相似像素跳变特征值的像素行识别出来,并设置兄弟属性。由于上层字符部分具有与下层字符部分不同的兄弟属性,因此可以根据兄弟属性的值获得第二图像包含的上定位块和下定位块。
步骤S608:根据所述上定位块和下定位块,将第二图像转换成单层车牌图像。
具体的,步骤S608中,根据上定位块和下定位块,将第二图像转换成单层车牌图像,可以包括:将上定位块放置在下定位块左侧,进而将第二图像转换成单层车牌图像;也可以包括:将下定位块放置在上定位块右侧,进而将第二图像转换成单层车牌图像。当然,根据上定位块和下定位块,将第二图像转换成单层车牌图像的具体实施方式还有很多。
步骤S609:针对转换成单层车牌图像后的每个第二图像,根据垂直投影法,获得第二图像的像素值的垂直投影图,根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像。
步骤S610:根据预先存储的每个国家和地区的字符特征,识别N个字符图像中的字符,获得第一图像对应的车牌号码。
其中,步骤S610与图2所示实施例中的步骤S207相同,此处不再赘述。
由上述内容可见,在本实施例中,根据第二图像的宽高比例,可以判断其是否属于双层车牌。当第二图像属于双层车牌时,可以根据双层车牌中的上层和下层之间存在一定的间隔,将双层车牌转换成单层车牌,从而对第二图像的车牌字符进行分割时,可以使分割结果更准确。
图7为本申请实施例提供的车牌号码识别装置的一种结构示意图,所述装置包括:
第一图像获取模块701,用于获取待识别车牌号码的第一图像;
像素值图绘制模块702,用于针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,
纵坐标为像素点的像素值;
像素点连接模块703,用于针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;
定位块获得模块704,用于针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;
第二图像选择模块705,用于从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;
第二图像分割模块706,用于针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;
图像字符识别模块707,用于根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
在图7所示实施例中,所述预设条件可以为下述条件中的一种或多种:
针对每个待选区域,识别所述待选区域中包含的波峰特征点数量或波谷特征点数量,判断所述波峰特征点数量或波谷特征点数量是否满足预设特征点数量阈值;或,
针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像素值的跳变幅值,判断所述待选区域的所有跳变幅值是否均大于预设跳变幅值阈值;或,
针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像
素值的跳变幅值,计算每两个跳变幅值之间的幅值差值,判断所述待选区域中的所有幅值差值是否均不大于预设幅值差值阈值;或,
针对每个待选区域,识别所述待选区域中相邻波峰特征点与波谷特征点的横坐标的跳变间隔,判断所述待选区域中的所有跳变间隔是否均匀。
在图7所示实施例中,定位块获得模块704还可以用于:
在所述对所述线段和相邻线段均设置兄弟属性之前,确定所述线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述线段的像素跳变特征值;确定所述相邻线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述相邻线段的像素跳变特征值;
判断所述线段的像素跳变特征值与所述相邻线段的像素跳变特征值的差值的绝对值是否小于预设第一跳变特征阈值,如果是,则对所述线段和相邻线段均设置兄弟属性。
在图7所示实施例中,第二图像选择模块705具体可以用于:
根据预先存储的每个国家和地区的车牌特征,对每个车牌定位块图像进行车牌真伪筛选,获得真实车牌定位块图像;将真实车牌定位块图像确定为第一图像的车牌号码区域对应的第二图像。
在图7所示实施例中,所述装置还可以包括第二图像校正模块(图中未示出);
其中,第二图像校正模块,用于在针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,将所述第二图像转换为亮字暗底的灰度图像;对所述灰度图像进行车牌倾斜校正;对车牌倾斜校正后的图像进行车牌字符畸变校正;
对应的,第二图像分割模块706,具体可以用于针对车牌字符畸变校正后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像。
在图7所示实施例中,第二图像分割模块706可以包括第一获得子模块801、第一计算子模块802、第一判断子模块803和第一确定子模块804,这
些模块如图8所示,与图3所示方法实施例相对应。
其中,第一获得子模块801,用于根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的待修正的N个字符图像;
第一计算子模块802,用于针对所述第二图像,根据连通域法,获得所述第二图像包含的每个连通域以及每个连通域的第一位置,根据所述连通域和所述第一位置,计算所述连通域的平均宽度,将所述平均宽度确定为所述第二图像的平均字符宽度;
第一判断子模块803,用于根据所述平均字符宽度,判断所述待修正的N个字符图像中是否存在字符图像宽度大于预设第一宽度阈值的第一字符图像;
第一确定子模块804,用于当所述待修正的N个字符图像中存在字符图像宽度大于预设第一宽度阈值的第一字符图像时,根据所述第一位置修正所述第一字符图像,根据修正后的第一字符图像,确定所述第二图像包含的N个字符图像。
具体的,第一确定子模块804可以用于:
根据所述第一字符图像的位置,从所述连通域中确定与所述第一字符图像的位置对应的目标连通域;根据所述目标连通域及对应的第一位置,对所述第一字符图像进行分割或者重新确定第一字符图像的位置。
在图7所示实施例中,第二图像分割模块706可以包括第二获得子模块901、第二判断子模块902、第二确定子模块903、图像分割子模块904、第三获得子模块905、第三判断子模块906和图像合并子模块907,这些模块如图9所示,该实施例与图5所示方法实施例相对应。
其中,第二获得子模块901,用于根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的待修正的N个字符图像;
第二判断子模块902,用于判断所述待修正的N个字符图像中是否存在字符图像宽度小于预设第二宽度阈值的第二字符图像;
第二确定子模块903,用于当所述待修正的N个字符图像中存在字符图像宽度小于预设第二宽度阈值的第二字符图像时,将相邻的至少两个第二字符图像确定为待修正字符图像;
图像分割子模块904,用于获得所述第二图像的边缘图,根据垂直投影法,对所述边缘图进行字符分割,并从分割后的边缘图中确定与所述待修正字符图像位置对应的目标字符图像;
第三获得子模块905,用于将所述待修正字符图像和对应的目标字符图像均输入字符分类器,获得每个字符图像的置信度,所述字符分类器为根据各个国家和地区的字符特征设置的分类器;
第三判断子模块906,用于判断所述待修正字符图像的至少两个置信度是否均小于对应的目标字符图像的置信度;
图像合并子模块907,用于当所述待修正字符图像的至少两个置信度均小于对应的目标字符图像的置信度时,根据所述对应的目标字符图像的位置,将所述待修正字符图像包含的至少两个第二字符图像进行合并,获得所述第二图像包含的N个字符图像。
图10为本申请实施例提供的车牌号码识别装置的另一种结构示意图,与图6所示方法实施例相对应。该装置中的模块1001~1005与图7所示实施例的模块701~705相同,此处不再赘述。
第四判断子模块1006,用于在针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,根据所述第二图像的宽高比例以及预设比例阈值,判断所述第二图像是否属于双层车牌;
特征值获得子模块1007,用于当所述第二图像属于双层车牌时,针对所述第二图像中的每个像素行,确定所述像素行包含的每个像素点与其相邻像素点的像素值的差值的绝对值,并将所述绝对值求和,获得所述像素行的像素跳变特征值;
定位块获得子模块1008,用于针对每个像素行,确定所述像素行下方的相邻像素行,并确定所述像素行与相邻像素行的像素跳变特征值的差值的绝对值;判断所述绝对值是否小于预设第二跳变特征阈值,如果是,则将所述像素行和相邻像素行设置兄弟属性;将设置为相同兄弟属性的像素行拼接成块,获得所述第二图像包含的上定位块和下定位块;
双层图像转换子模块1009,用于根据所述上定位块和下定位块,将所述第二图像转换成单层车牌图像;
第二图像分割模块1010,用于针对转换成单层车牌图像后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像。
图像字符识别模块1011,用于根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
其中,模块1011可以与图7中的模块207完全相同。
在图10所示实施例中,双层图像转换子模块1009具体可以用于:
将所述上定位块放置在所述下定位块左侧,进而将第二图像转换成单层车牌图像。
由于上述装置实施例是基于方法实施例得到的,与该方法具有相同的技术效果,因此装置实施例的技术效果在此不再赘述。
对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。
本申请实施例提供了一种电子设备,适用于车牌号码识别,所述电子设备包括:
壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行以下步骤:
获取待识别车牌号码的第一图像;
针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;
针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;
针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;
从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;
针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;
根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
其中,该电子设备可以以多种形式存在,包括但不限于:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机以及低端手机等。
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。
(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。
(5)其他具有数据交互功能的电子装置。
综上可知,本申请实施例可以依据各个国家的车牌都具有的字符与背景的像素值差别较大和车牌区域特征点比较集中的特点,获得车牌定位块图像;
并在字符分割后根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符。可见,本申请实施例利用了各个国家车牌共有的特点,获得了车牌定位块图像,并且根据预先存储的每个国家和地区的字符特征来进行字符识别,因此能够识别各个国家的车牌,与现有技术相比,提高了通用性。
本申请提供了一种应用程序,所述应用程序用于在运行时执行本申请实施例提供的车牌号码识别方法。其中,该车牌号码识别方法包括:
获取待识别车牌号码的第一图像;
针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;
针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;
针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;
从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;
针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;
根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
综上可知,本申请实施例可以依据各个国家的车牌都具有的字符与背景的像素值差别较大和车牌区域特征点比较集中的特点,获得车牌定位块图像;
并在字符分割后根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符。可见,本申请实施例利用了各个国家车牌共有的特点,获得了车牌定位块图像,并且根据预先存储的每个国家和地区的字符特征来进行字符识别,因此能够识别各个国家的车牌,与现有技术相比,提高了通用性。
本申请提供了一种存储介质,用于存储可执行代码,所述可执行代码在运行时用于执行本申请实施例提供的车牌号码识别方法。其中,该车牌号码识别方法包括:
获取待识别车牌号码的第一图像;
针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;
针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;
针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;
从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;
针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;
根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
综上可知,本申请实施例可以依据各个国家的车牌都具有的字符与背景
的像素值差别较大和车牌区域特征点比较集中的特点,获得车牌定位块图像;并在字符分割后根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符。可见,本申请实施例利用了各个国家车牌共有的特点,获得了车牌定位块图像,并且根据预先存储的每个国家和地区的字符特征来进行字符识别,因此能够识别各个国家的车牌,与现有技术相比,提高了通用性。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本领域普通技术人员可以理解,上述实施方式中的全部或部分步骤是能够通过程序指令相关的硬件来完成的,所述的程序可以存储于计算机可读取存储介质中。这里所称存储介质,是指ROM/RAM、磁碟、光盘等。
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所做的任何修改、等同替换、改进等,均包含在本申请的保护范围内。
Claims (23)
- 一种车牌号码识别方法,其特征在于,所述方法包括:获取待识别车牌号码的第一图像;针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
- 根据权利要求1所述的方法,其特征在于,所述预设条件为下述条件中的一种或多种:针对每个待选区域,识别所述待选区域中包含的波峰特征点数量或波谷特征点数量,判断所述波峰特征点数量或波谷特征点数量是否满足预设特征点数量阈值;或,针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像 素值的跳变幅值,判断所述待选区域的所有跳变幅值是否均大于预设跳变幅值阈值;或,针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像素值的跳变幅值,计算每两个跳变幅值之间的幅值差值,判断所述待选区域中的所有幅值差值是否均不大于预设幅值差值阈值;或,针对每个待选区域,识别所述待选区域中相邻波峰特征点与波谷特征点的横坐标的跳变间隔,判断所述待选区域中的所有跳变间隔是否均匀。
- 根据权利要求1所述的方法,其特征在于,在所述对所述线段和相邻线段均设置兄弟属性之前,所述方法还包括:确定所述线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述线段的像素跳变特征值;确定所述相邻线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述相邻线段的像素跳变特征值;判断所述线段与所述相邻线段的像素跳变特征值的差值的绝对值是否小于预设第一跳变特征阈值,如果是,则执行所述对所述线段和相邻线段均设置兄弟属性的步骤。
- 根据权利要求1所述的方法,其特征在于,所述从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像,包括:根据预先存储的每个国家和地区的车牌特征,对所述每个车牌定位块图像进行车牌真伪筛选,获得真实车牌定位块图像;将所述真实车牌定位块图像确定为所述第一图像的车牌号码区域对应的第二图像。
- 根据权利要求4所述的方法,其特征在于,在针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,所述方法还包括:将所述第二图像转换为亮字暗底的灰度图像;对所述灰度图像进行车牌倾斜校正;对车牌倾斜校正后的图像进行车牌字符畸变校正;所述针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图,包括:针对车牌字符畸变校正后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图。
- 根据权利要求5所述的方法,其特征在于,所述根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像,包括:根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的待修正的N个字符图像;针对所述第二图像,根据连通域法,获得所述第二图像包含的每个连通域以及每个连通域的第一位置,根据所述连通域和所述第一位置,计算所述连通域的平均宽度,将所述平均宽度确定为所述第二图像的平均字符宽度;根据所述平均字符宽度,判断所述待修正的N个字符图像中是否存在字符图像宽度大于预设第一宽度阈值的第一字符图像;如果存在,则根据所述第一位置修正所述第一字符图像,根据修正后的第一字符图像,确定所述第二图像包含的N个字符图像。
- 根据权利要求6所述的方法,其特征在于,所述根据所述第一位置修正所述第一字符图像,包括:根据所述第一字符图像的位置,从所述连通域中确定与所述第一字符图像的位置对应的目标连通域;根据所述目标连通域及对应的第一位置,对所述第一字符图像进行分割或者重新确定第一字符图像的位置。
- 根据权利要求1所述的方法,其特征在于,所述根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像,包括:根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的待修正的N个字符图像;判断所述待修正的N个字符图像中是否存在字符图像宽度小于预设第二宽度阈值的第二字符图像;如果存在,则将相邻的至少两个第二字符图像确定为待修正字符图像;获得所述第二图像的边缘图,根据垂直投影法,对所述边缘图进行字符 分割,并从分割后的边缘图中确定与所述待修正字符图像位置对应的目标字符图像;将所述待修正字符图像和对应的目标字符图像均输入字符分类器,获得每个字符图像的置信度,所述字符分类器为根据各个国家和地区的字符特征设置的分类器;判断所述待修正字符图像的至少两个置信度是否均小于对应的目标字符图像的置信度;如果是,则根据所述对应的目标字符图像的位置,将所述待修正字符图像包含的至少两个第二字符图像进行合并,获得所述第二图像包含的N个字符图像。
- 根据权利要求1所述的方法,其特征在于,在针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,所述方法还包括:根据所述第二图像的宽高比例以及预设比例阈值,判断所述第二图像是否属于双层车牌;如果是,则针对所述第二图像中的每个像素行,确定所述像素行包含的每个像素点与其相邻像素点的像素值的差值的绝对值,并将所述绝对值求和,获得所述像素行的像素跳变特征值;针对每个像素行,确定所述像素行下方的相邻像素行,并确定所述像素行与相邻像素行的像素跳变特征值的差值的绝对值;判断所述绝对值是否小于预设第二跳变特征阈值,如果是,则将所述像素行和相邻像素行设置兄弟属性;将设置为相同兄弟属性的像素行拼接成块,获得所述第二图像包含的上定位块和下定位块;根据所述上定位块和下定位块,将所述第二图像转换成单层车牌图像;所述针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图,包括:针对转换成单层车牌图像后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图。
- 根据权利要求9所述的方法,其特征在于,所述根据所述上定位块和 下定位块,将所述第二图像转换成单层车牌图像,包括:将所述上定位块放置在所述下定位块左侧,进而将所述第二图像转换成单层车牌图像。
- 一种车牌号码识别装置,其特征在于,所述装置包括:第一图像获取模块,用于获取待识别车牌号码的第一图像;像素值图绘制模块,用于针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;像素点连接模块,用于针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;定位块获得模块,用于针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;第二图像选择模块,用于从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;第二图像分割模块,用于针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;图像字符识别模块,用于根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
- 根据权利要求11所述的装置,其特征在于,所述预设条件为下述条件中的一种或多种:针对每个待选区域,识别所述待选区域中包含的波峰特征点数量或波谷 特征点数量,判断所述波峰特征点数量或波谷特征点数量是否满足预设特征点数量阈值;或,针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像素值的跳变幅值,判断所述待选区域的所有跳变幅值是否均大于预设跳变幅值阈值;或,针对每个待选区域,识别所述待选区域中包含的波峰特征点的像素值或波谷特征点的像素值,确定所述待选区域中相邻波峰特征点与波谷特征点像素值的跳变幅值,计算每两个跳变幅值之间的幅值差值,判断所述待选区域中的所有幅值差值是否均不大于预设幅值差值阈值;或,针对每个待选区域,识别所述待选区域中相邻波峰特征点与波谷特征点的横坐标的跳变间隔,判断所述待选区域中的所有跳变间隔是否均匀。
- 根据权利要求11所述的装置,其特征在于,所述定位块获得模块还用于:在所述对所述线段和相邻线段均设置兄弟属性之前,确定所述线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述线段的像素跳变特征值;确定所述相邻线段包含的每个像素点与其相邻像素点像素值的差值的绝对值,并对所述绝对值求和,获得所述相邻线段的像素跳变特征值;判断所述线段的像素跳变特征值与所述相邻线段的像素跳变特征值的差值的绝对值是否小于预设第一跳变特征阈值,如果是,则对所述线段和相邻线段均设置兄弟属性。
- 根据权利要求11所述的装置,其特征在于,所述第二图像选择模块,具体用于:根据预先存储的每个国家和地区的车牌特征,对所述每个车牌定位块图像进行车牌真伪筛选,获得真实车牌定位块图像;将所述真实车牌定位块图像确定为所述第一图像的车牌号码区域对应的第二图像。
- 根据权利要求14所述的装置,其特征在于,所述装置还包括第二图像校正模块;所述第二图像校正模块,用于在针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,将所述第二图像转换为亮字暗底的灰度图像;对所述灰度图像进行车牌倾斜校正;对车牌倾斜校正后的图像进行车牌字符畸变校正;所述第二图像分割模块,具体用于针对车牌字符畸变校正后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像。
- 根据权利要求15所述的装置,其特征在于,所述第二图像分割模块包括:第一获得子模块,用于根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的待修正的N个字符图像;第一计算子模块,用于针对所述第二图像,根据连通域法,获得所述第二图像包含的每个连通域以及每个连通域的第一位置,根据所述连通域和所述第一位置,计算所述连通域的平均宽度,将所述平均宽度确定为所述第二图像的平均字符宽度;第一判断子模块,用于根据所述平均字符宽度,判断所述待修正的N个字符图像中是否存在字符图像宽度大于预设第一宽度阈值的第一字符图像;第一确定子模块,用于当所述待修正的N个字符图像中存在字符图像宽度大于预设第一宽度阈值的第一字符图像时,根据所述第一位置修正所述第一字符图像,根据修正后的第一字符图像,确定所述第二图像包含的N个字符图像。
- 根据权利要求16所述的装置,其特征在于,所述第一确定子模块,具体用于:根据所述第一字符图像的位置,从所述连通域中确定与所述第一字符图像的位置对应的目标连通域;根据所述目标连通域及对应的第一位置,对所述第一字符图像进行分割或者重新确定第一字符图像的位置。
- 根据权利要求11所述的装置,其特征在于,所述第二图像分割模块包括:第二获得子模块,用于根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的待修正的N个字符图像;第二判断子模块,用于判断所述待修正的N个字符图像中是否存在字符图像宽度小于预设第二宽度阈值的第二字符图像;第二确定子模块,用于当所述待修正的N个字符图像中存在字符图像宽度小于预设第二宽度阈值的第二字符图像时,将相邻的至少两个第二字符图像确定为待修正字符图像;图像分割子模块,用于获得所述第二图像的边缘图,根据垂直投影法,对所述边缘图进行字符分割,并从分割后的边缘图中确定与所述待修正字符图像位置对应的目标字符图像;第三获得子模块,用于将所述待修正字符图像和对应的目标字符图像均输入字符分类器,获得每个字符图像的置信度,所述字符分类器为根据各个国家和地区的字符特征设置的分类器;第三判断子模块,用于判断所述待修正字符图像的至少两个置信度是否均小于对应的目标字符图像的置信度;图像合并子模块,用于当所述待修正字符图像的至少两个置信度均小于对应的目标字符图像的置信度时,根据所述对应的目标字符图像的位置,将所述待修正字符图像包含的至少两个第二字符图像进行合并,获得所述第二图像包含的N个字符图像。
- 根据权利要求11所述的装置,其特征在于,所述装置还包括:第四判断子模块,用于在针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图之前,根据所述第二图像的宽高比例以及预设比例阈值,判断所述第二图像是否属于双层车牌;特征值获得子模块,用于当所述第二图像属于双层车牌时,针对所述第二图像中的每个像素行,确定所述像素行包含的每个像素点与其相邻像素点的像素值的差值的绝对值,并将所述绝对值求和,获得所述像素行的像素跳变特征值;定位块获得子模块,用于针对每个像素行,确定所述像素行下方的相邻像素行,并确定所述像素行与相邻像素行的像素跳变特征值的差值的绝对值; 判断所述绝对值是否小于预设第二跳变特征阈值,如果是,则将所述像素行和相邻像素行设置兄弟属性;将设置为相同兄弟属性的像素行拼接成块,获得所述第二图像包含的上定位块和下定位块;双层图像转换子模块,用于根据所述上定位块和下定位块,将所述第二图像转换成单层车牌图像;所述第二图像分割模块,具体用于针对转换成单层车牌图像后的每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像。
- 根据权利要求19所述的装置,其特征在于,所述双层图像转换子模块具体用于:将所述上定位块放置在所述下定位块左侧,进而将所述第二图像转换成单层车牌图像。
- 一种电子设备,其特征在于,适用于车牌号码识别,所述电子设备包括:壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的程序,以用于执行以下步骤:获取待识别车牌号码的第一图像;针对所述第一图像中的每一像素行,绘制所述像素行中每个像素点的像素值图,其中,像素值图的横坐标为像素点坐标,纵坐标为像素点的像素值;针对每个像素值图,识别所述像素值图中的波峰特征点和波谷特征点;按照预设宽度,将所述像素值图分割成第一数量个待选区域,针对每个待选区域,识别所述待选区域中包含的波峰特征点或波谷特征点,判断所述波峰特征点或波谷特征点是否满足预设条件,如果是,则将所述待选区域对应的第一图像中的像素点连接成线段;针对每个线段,确定所述线段下方的相邻线段,并计算所述线段的左端 点与所述相邻线段的左端点之间的第二距离,计算所述线段的右端点与所述相邻线段的右端点之间的第三距离,判断所述第二距离和第三距离是否均小于预设第一距离阈值,如果是,则对所述线段和相邻线段均设置兄弟属性;将设置为相同兄弟属性的线段拼接成块,获得每个车牌定位块图像;从所述每个车牌定位块图像中选择所述第一图像的车牌号码区域对应的第二图像;针对每个第二图像,根据垂直投影法,获得所述第二图像的像素值的垂直投影图;根据所述垂直投影图,对所述第二图像进行分割,获得所述第二图像包含的N个字符图像;根据预先存储的每个国家和地区的字符特征,识别所述N个字符图像中的字符,获得第一图像对应的车牌号码。
- 一种应用程序,其特征在于,所述应用程序用于在运行时执行权利要求1-10任一项所述的车牌号码识别方法。
- 一种存储介质,其特征在于,用于存储可执行代码,所述可执行代码在运行时用于执行权利要求1-10任一项所述的车牌号码识别方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610657870.5 | 2016-08-11 | ||
CN201610657870.5A CN107729899B (zh) | 2016-08-11 | 2016-08-11 | 一种车牌号码识别方法及装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018028306A1 true WO2018028306A1 (zh) | 2018-02-15 |
Family
ID=61162669
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/088709 WO2018028306A1 (zh) | 2016-08-11 | 2017-06-16 | 一种车牌号码识别方法及装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107729899B (zh) |
WO (1) | WO2018028306A1 (zh) |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109447117A (zh) * | 2018-09-25 | 2019-03-08 | 平安科技(深圳)有限公司 | 双层车牌识别方法、装置、计算机设备及存储介质 |
CN109902688A (zh) * | 2019-04-04 | 2019-06-18 | 安徽清新互联信息科技有限公司 | 一种基于车牌模板信息进行字符多维参数最优分割的方法 |
CN110517281A (zh) * | 2019-08-19 | 2019-11-29 | 温州大学 | 一种从高到低扫描一维投影图分割目标的方法 |
CN110533019A (zh) * | 2018-05-23 | 2019-12-03 | 杭州海康威视数字技术股份有限公司 | 车牌定位方法、装置及存储介质 |
CN111223104A (zh) * | 2018-11-23 | 2020-06-02 | 杭州海康威视数字技术股份有限公司 | 一种包裹提取及跟踪方法、装置及电子设备 |
CN111340041A (zh) * | 2020-03-13 | 2020-06-26 | 安阳工学院 | 一种基于深度学习的车牌识别方法及装置 |
CN111754525A (zh) * | 2020-06-23 | 2020-10-09 | 苏州中科全象智能科技有限公司 | 一种基于非精确切分的工业字符检测流程 |
CN111860474A (zh) * | 2019-04-18 | 2020-10-30 | 四川大学 | 一种基于背景散热片消融的车标定位方法 |
CN111914845A (zh) * | 2020-07-02 | 2020-11-10 | 浙江大华技术股份有限公司 | 一种车牌中字符分层方法、装置及电子设备 |
CN112381088A (zh) * | 2020-11-11 | 2021-02-19 | 上善智城(苏州)信息科技有限公司 | 一种油罐车车牌识别方法及系统 |
CN112950540A (zh) * | 2021-02-01 | 2021-06-11 | 联宝(合肥)电子科技有限公司 | 一种条码识别方法及设备 |
CN113095327A (zh) * | 2021-03-16 | 2021-07-09 | 深圳市雄帝科技股份有限公司 | 光学字符识别区域的定位方法、系统及其存储介质 |
CN113345036A (zh) * | 2021-05-24 | 2021-09-03 | 广西电网有限责任公司电力科学研究院 | 基于hsv特征变换的指示灯状态识别方法 |
CN113392839A (zh) * | 2021-05-18 | 2021-09-14 | 浙江大华技术股份有限公司 | 非机动车车牌识别方法、装置、计算机设备和存储介质 |
CN113591855A (zh) * | 2021-08-18 | 2021-11-02 | 易思维(杭州)科技有限公司 | 一种粘连vin码分割方法 |
CN113837991A (zh) * | 2021-06-18 | 2021-12-24 | 腾讯云计算(北京)有限责任公司 | 图像处理方法、装置、设备及存储介质 |
CN116310448A (zh) * | 2023-05-24 | 2023-06-23 | 山东曙岳车辆有限公司 | 基于计算机视觉的集装箱拼装匹配性检测方法 |
CN117558136A (zh) * | 2023-11-18 | 2024-02-13 | 广东有位智能科技有限公司 | 一种地区车牌智能识别系统 |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108876747B (zh) * | 2018-06-29 | 2021-04-02 | 凌云光技术股份有限公司 | 一种oled绘素的提取方法及装置 |
CN109325492B (zh) * | 2018-08-17 | 2023-12-19 | 平安科技(深圳)有限公司 | 字符切割方法、装置、计算机设备及存储介质 |
CN110163199A (zh) * | 2018-09-30 | 2019-08-23 | 腾讯科技(深圳)有限公司 | 车牌识别方法、车牌识别装置、车牌识别设备及介质 |
CN109948620A (zh) * | 2019-03-19 | 2019-06-28 | 厦门商集网络科技有限责任公司 | 一种字符分割方法及终端 |
CN110059695B (zh) * | 2019-04-23 | 2021-08-27 | 厦门商集网络科技有限责任公司 | 一种基于垂直投影的字符分割方法及终端 |
CN111062375B (zh) * | 2019-12-11 | 2023-04-28 | 南京红松信息技术有限公司 | 一种基于上下文关系的题号缺失补全方法 |
CN112666123A (zh) * | 2020-01-16 | 2021-04-16 | 海南信天源科技开发有限公司 | 车载型机动车尾气遥感系统 |
CN113554659B (zh) * | 2020-04-23 | 2023-06-02 | 杭州海康威视数字技术股份有限公司 | 图像处理方法、装置、电子设备、存储介质及显示系统 |
CN111915792B (zh) * | 2020-05-19 | 2022-06-07 | 武汉卓目科技有限公司 | 一种图像斑马线图文的识别方法及装置 |
CN111784499A (zh) * | 2020-06-24 | 2020-10-16 | 平安银行股份有限公司 | 基于云平台的业务集成方法、装置、电子设备及存储介质 |
CN113095325B (zh) * | 2021-05-11 | 2021-11-09 | 浙江华是科技股份有限公司 | 一种船舶识别方法、装置及计算机可读存储介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101877126A (zh) * | 2009-11-19 | 2010-11-03 | 东软集团股份有限公司 | 一种车牌候选区域的分割方法及装置 |
CN102054271A (zh) * | 2009-11-02 | 2011-05-11 | 富士通株式会社 | 文本行检测方法和装置 |
CN102722704A (zh) * | 2012-06-12 | 2012-10-10 | 厦门宸天电子科技有限公司 | 一种融合视频动态跟踪的车牌识别方法和系统 |
CN103679191A (zh) * | 2013-09-04 | 2014-03-26 | 西交利物浦大学 | 基于静态图片的自动套牌车检测方法 |
US20140369566A1 (en) * | 2006-04-04 | 2014-12-18 | Cyclops Technologies, Inc. | Perimeter Image Capture and Recognition System |
CN105184291A (zh) * | 2015-08-26 | 2015-12-23 | 深圳市捷顺科技实业股份有限公司 | 一种多类型车牌检测方法及系统 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9122953B2 (en) * | 2013-04-15 | 2015-09-01 | Xerox Corporation | Methods and systems for character segmentation in automated license plate recognition applications |
-
2016
- 2016-08-11 CN CN201610657870.5A patent/CN107729899B/zh active Active
-
2017
- 2017-06-16 WO PCT/CN2017/088709 patent/WO2018028306A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140369566A1 (en) * | 2006-04-04 | 2014-12-18 | Cyclops Technologies, Inc. | Perimeter Image Capture and Recognition System |
CN102054271A (zh) * | 2009-11-02 | 2011-05-11 | 富士通株式会社 | 文本行检测方法和装置 |
CN101877126A (zh) * | 2009-11-19 | 2010-11-03 | 东软集团股份有限公司 | 一种车牌候选区域的分割方法及装置 |
CN102722704A (zh) * | 2012-06-12 | 2012-10-10 | 厦门宸天电子科技有限公司 | 一种融合视频动态跟踪的车牌识别方法和系统 |
CN103679191A (zh) * | 2013-09-04 | 2014-03-26 | 西交利物浦大学 | 基于静态图片的自动套牌车检测方法 |
CN105184291A (zh) * | 2015-08-26 | 2015-12-23 | 深圳市捷顺科技实业股份有限公司 | 一种多类型车牌检测方法及系统 |
Non-Patent Citations (1)
Title |
---|
HE, LI: "Design and Implementation of License Plate Location and Recognition System", ELECTRONIC TECHNOLOGY & INFORMATION SCIENCE , CHINA MASTER'S THESES FULL-TEXT DATABASE, vol. 5.5.1.2, no. 06, 15 June 2012 (2012-06-15), pages 37, XP031194841 * |
Cited By (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110533019A (zh) * | 2018-05-23 | 2019-12-03 | 杭州海康威视数字技术股份有限公司 | 车牌定位方法、装置及存储介质 |
CN109447117A (zh) * | 2018-09-25 | 2019-03-08 | 平安科技(深圳)有限公司 | 双层车牌识别方法、装置、计算机设备及存储介质 |
CN109447117B (zh) * | 2018-09-25 | 2023-06-30 | 平安科技(深圳)有限公司 | 双层车牌识别方法、装置、计算机设备及存储介质 |
CN111223104A (zh) * | 2018-11-23 | 2020-06-02 | 杭州海康威视数字技术股份有限公司 | 一种包裹提取及跟踪方法、装置及电子设备 |
CN111223104B (zh) * | 2018-11-23 | 2023-10-10 | 杭州海康威视数字技术股份有限公司 | 一种包裹提取及跟踪方法、装置及电子设备 |
CN109902688A (zh) * | 2019-04-04 | 2019-06-18 | 安徽清新互联信息科技有限公司 | 一种基于车牌模板信息进行字符多维参数最优分割的方法 |
CN109902688B (zh) * | 2019-04-04 | 2023-04-18 | 安徽清新互联信息科技有限公司 | 一种基于车牌模板信息进行字符多维参数最优分割的方法 |
CN111860474A (zh) * | 2019-04-18 | 2020-10-30 | 四川大学 | 一种基于背景散热片消融的车标定位方法 |
CN110517281A (zh) * | 2019-08-19 | 2019-11-29 | 温州大学 | 一种从高到低扫描一维投影图分割目标的方法 |
CN111340041B (zh) * | 2020-03-13 | 2023-03-24 | 安阳工学院 | 一种基于深度学习的车牌识别方法及装置 |
CN111340041A (zh) * | 2020-03-13 | 2020-06-26 | 安阳工学院 | 一种基于深度学习的车牌识别方法及装置 |
CN111754525A (zh) * | 2020-06-23 | 2020-10-09 | 苏州中科全象智能科技有限公司 | 一种基于非精确切分的工业字符检测流程 |
CN111914845A (zh) * | 2020-07-02 | 2020-11-10 | 浙江大华技术股份有限公司 | 一种车牌中字符分层方法、装置及电子设备 |
CN112381088A (zh) * | 2020-11-11 | 2021-02-19 | 上善智城(苏州)信息科技有限公司 | 一种油罐车车牌识别方法及系统 |
CN112950540B (zh) * | 2021-02-01 | 2022-04-15 | 联宝(合肥)电子科技有限公司 | 一种条码识别方法及设备 |
CN112950540A (zh) * | 2021-02-01 | 2021-06-11 | 联宝(合肥)电子科技有限公司 | 一种条码识别方法及设备 |
CN113095327A (zh) * | 2021-03-16 | 2021-07-09 | 深圳市雄帝科技股份有限公司 | 光学字符识别区域的定位方法、系统及其存储介质 |
CN113095327B (zh) * | 2021-03-16 | 2022-10-14 | 深圳市雄帝科技股份有限公司 | 光学字符识别区域的定位方法、系统及其存储介质 |
CN113392839A (zh) * | 2021-05-18 | 2021-09-14 | 浙江大华技术股份有限公司 | 非机动车车牌识别方法、装置、计算机设备和存储介质 |
CN113345036A (zh) * | 2021-05-24 | 2021-09-03 | 广西电网有限责任公司电力科学研究院 | 基于hsv特征变换的指示灯状态识别方法 |
CN113837991A (zh) * | 2021-06-18 | 2021-12-24 | 腾讯云计算(北京)有限责任公司 | 图像处理方法、装置、设备及存储介质 |
CN113591855A (zh) * | 2021-08-18 | 2021-11-02 | 易思维(杭州)科技有限公司 | 一种粘连vin码分割方法 |
CN113591855B (zh) * | 2021-08-18 | 2023-07-04 | 易思维(杭州)科技有限公司 | 一种粘连vin码分割方法 |
CN116310448A (zh) * | 2023-05-24 | 2023-06-23 | 山东曙岳车辆有限公司 | 基于计算机视觉的集装箱拼装匹配性检测方法 |
CN117558136A (zh) * | 2023-11-18 | 2024-02-13 | 广东有位智能科技有限公司 | 一种地区车牌智能识别系统 |
Also Published As
Publication number | Publication date |
---|---|
CN107729899A (zh) | 2018-02-23 |
CN107729899B (zh) | 2019-12-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018028306A1 (zh) | 一种车牌号码识别方法及装置 | |
US11410277B2 (en) | Method and device for blurring image background, storage medium and electronic apparatus | |
Yuan et al. | A robust and efficient approach to license plate detection | |
WO2018090771A1 (zh) | 一种车牌识别方法及装置 | |
US9430704B2 (en) | Image processing system with layout analysis and method of operation thereof | |
EP3163504B1 (en) | Method, device and computer-readable medium for region extraction | |
US20190114486A1 (en) | Subtitle extraction method and device, storage medium | |
US9602728B2 (en) | Image capturing parameter adjustment in preview mode | |
US9519838B2 (en) | Character recognition method | |
WO2018121006A1 (zh) | 一种车牌定位方法及装置 | |
CN109919002B (zh) | 黄色禁停线识别方法、装置、计算机设备及存储介质 | |
US10062195B2 (en) | Method and device for processing a picture | |
US10169673B2 (en) | Region-of-interest detection apparatus, region-of-interest detection method, and recording medium | |
JP2008257649A (ja) | 画像認識装置 | |
US20200134784A1 (en) | Method, Electronic Device, and Storage Medium for Obtaining Depth Image | |
US20160140701A1 (en) | Facilitating Text Identification and Editing in Images | |
CN111553302B (zh) | 关键帧选取方法、装置、设备及计算机可读存储介质 | |
US9087272B2 (en) | Optical match character classification | |
KR20120044484A (ko) | 이미지 처리 시스템에서 물체 추적 장치 및 방법 | |
JP6466038B1 (ja) | 画像処理装置および画像処理方法 | |
CN110909568A (zh) | 用于面部识别的图像检测方法、装置、电子设备及介质 | |
CN114898321A (zh) | 道路可行驶区域检测方法、装置、设备、介质及系统 | |
US8681221B2 (en) | Vehicular image processing device and vehicular image processing program | |
TWI660310B (zh) | 比對追蹤物件的方法及電子裝置 | |
WO2018058573A1 (zh) | 对象检测方法、对象检测装置以及电子设备 |
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: 17838437 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: 17838437 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17838437 Country of ref document: EP Kind code of ref document: A1 |