WO2017162023A1 - 一种车牌检测方法及装置 - Google Patents

一种车牌检测方法及装置 Download PDF

Info

Publication number
WO2017162023A1
WO2017162023A1 PCT/CN2017/075941 CN2017075941W WO2017162023A1 WO 2017162023 A1 WO2017162023 A1 WO 2017162023A1 CN 2017075941 W CN2017075941 W CN 2017075941W WO 2017162023 A1 WO2017162023 A1 WO 2017162023A1
Authority
WO
WIPO (PCT)
Prior art keywords
license plate
pixel
area
preset
candidate
Prior art date
Application number
PCT/CN2017/075941
Other languages
English (en)
French (fr)
Inventor
浦世亮
钮毅
潘作舟
罗兵华
Original Assignee
杭州海康威视数字技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Priority to US16/086,789 priority Critical patent/US10769476B2/en
Priority to EP17769300.9A priority patent/EP3435279A4/en
Publication of WO2017162023A1 publication Critical patent/WO2017162023A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/63Scene text, e.g. street names
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • G06F18/2155Generating training patterns; Bootstrap methods, e.g. bagging or boosting characterised by the incorporation of unlabelled data, e.g. multiple instance learning [MIL], semi-supervised techniques using expectation-maximisation [EM] or naïve labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/42Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
    • G06V10/421Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation by analysing segments intersecting the pattern
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • G06V10/449Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters
    • G06V10/451Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters with interaction between the filter responses, e.g. cortical complex cells
    • G06V10/454Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/60Extraction of image or video features relating to illumination properties, e.g. using a reflectance or lighting model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/625License plates

Definitions

  • the present application relates to the field of intelligent transportation, and in particular to a method and device for detecting a license plate.
  • the application of license plate detection technology has expanded from the scenes of the original toll booths and security card bays to the general monitoring scenes such as electronic police and entrances and exits.
  • the background of the traffic monitoring pictures obtained in these scenes is ever-changing, there are complex textures and noises near the license plate area in the picture, and when the non-license plate area in the picture has a texture very similar to the license plate area (such as windows, lights) , radiator grille, leaves, grass, fences, pavement signs), will greatly increase the error rate of the license plate area, and bring the problem that the real license plate area contains part of the background and the real license plate area boundary accuracy is reduced, and then easy The license plate detection result is wrong, and the license plate detection accuracy rate is low.
  • the embodiment of the present application discloses a license plate detecting method and device to improve the correct rate of license plate detection.
  • the embodiment of the present application discloses a license plate detecting method, and the method includes the following steps:
  • the plate candidate region M 1 redefine the candidate region M 2 plate, wherein the plate candidate region from the aspect ratio of M 2 is not greater than the first The area of the preset threshold;
  • the first preset classification model Determining, according to the first preset classification model, whether the license plate candidate area M 2 is a license plate area, wherein the first preset classification model is a classification model obtained by learning a sample license plate area by a machine learning algorithm;
  • the license plate candidate area M 2 is a license plate area, and a detection result is generated according to the license plate candidate area M 2 .
  • the obtaining the license plate candidate area M 1 of the to-be-detected picture according to the pixel value of the pixel in the picture to be detected includes:
  • the obtaining, by the preset scanning sequence, the effective pixel segments of each pixel row of the to-be-detected image including:
  • the obtaining the license plate candidate area M 1 of the to-be-detected picture according to the valid pixel segment after the combining process includes:
  • a license plate candidate area M 1 is obtained based on the determined boundary.
  • the re-determining the license plate candidate region M 2 from the license plate candidate region M 1 according to a preset machine learning-based regression algorithm includes:
  • a license plate candidate area M 2 is obtained based on the redefined boundary.
  • the first preset classification model is obtained by:
  • the first preset classification model is obtained according to a preset machine learning algorithm and the positive sample.
  • the method before the obtaining the first preset classification model according to the preset machine learning algorithm and the positive sample, the method further includes:
  • Obtaining the first preset classification model according to the preset machine learning algorithm and the positive sample including:
  • the first preset classification model is obtained according to a preset machine learning algorithm, the positive sample, and the negative samples of the plurality of categories.
  • the method further includes:
  • the license plate candidate area M 2 is not a license plate area, it is determined whether the brightness of the license plate candidate area M 2 is within a preset brightness range;
  • the second preset classification model Determining, according to the second preset classification model, whether the license plate candidate region M 2 after the grayscale equalization processing is a license plate region, wherein the second preset classification model is equalizing the grayscale by a machine learning algorithm a classification model obtained by learning the processed license plate area;
  • the step of determining that the license plate candidate area M 2 is a license plate area and generating a detection result according to the license plate candidate area M 2 is performed.
  • an embodiment of the present application further discloses a license plate detecting apparatus, where the apparatus includes: a candidate area obtaining module, a aspect ratio determining module, a candidate area determining module, a first license plate area determining module, and a detection result generating module. ;
  • the candidate area obtaining module is configured to obtain the license plate candidate area M 1 of the to-be-detected picture according to the pixel value of the pixel in the picture to be detected;
  • the aspect ratio determination value module configured to calculate the value of the license plate of the candidate area M 1 aspect ratio, the aspect ratio and determining whether the value is greater than a first predetermined threshold value, if YES, the candidate region determination module is triggered ;
  • the candidate region determining module is configured to re-determine the license plate candidate region M 2 from the license plate candidate region M 1 according to a preset machine learning-based regression algorithm, wherein the license plate candidate region M 2 is an aspect ratio An area not larger than the first preset threshold;
  • the first license plate area determining module is configured to determine, according to the first preset classification model, whether the license plate candidate area M 2 is a license plate area, wherein the first preset classification model is a sample by using a machine learning algorithm a classification model obtained by learning the license plate area, and if yes, triggering the detection result generation module;
  • the detection result generating module is configured to determine that the license plate candidate area M 2 is a license plate area, and generate a detection result according to the license plate candidate area M 2 .
  • the candidate region obtaining module includes: an effective pixel segment obtaining submodule, a similarity degree calculating submodule, a pixel segment combining submodule, and a candidate region obtaining submodule;
  • the effective pixel segment obtaining sub-module is configured to obtain valid pixel segments of each pixel row of the to-be-detected image according to a preset scanning sequence, where the effective pixel segment is: according to a gray level in a pixel row a pixel segment determined by a pixel point whose hop value is greater than a second preset threshold;
  • the similarity calculation sub-module is configured to calculate a vertical adjacent effective pixel according to a pixel value of a pixel point at both ends of each valid pixel segment and a pixel value of a pixel point at two ends of the effective pixel segment vertically adjacent to the effective pixel segment The degree of similarity of the boundaries of the segments;
  • the pixel segment merging sub-module is configured to perform merging processing on adjacent valid pixel segments whose boundary similarity is greater than a third preset threshold
  • the candidate region obtaining submodule is configured to obtain the license plate candidate region M 1 of the to-be-detected picture according to the valid pixel segment after the merge processing.
  • the valid pixel segment obtains a sub-module, specifically for:
  • the effective pixel segment obtaining submodule includes: a grayscale hopping value calculating unit, a pixel point selecting unit, a candidate pixel segment obtaining unit, a grayscale hopping determining unit, and an effective pixel segment determining unit;
  • the grayscale hopping value calculation unit is configured to calculate a grayscale hopping value of each pixel in the pixel row X, wherein the pixel row X is any pixel row in the image to be detected;
  • the pixel point selection unit is configured to select a pixel point whose grayscale hopping value is greater than a second preset threshold value
  • the candidate pixel segment obtaining unit is configured to obtain candidate pixel segments on the pixel row X according to pixel points with the largest and smallest horizontal coordinates among the selected pixel points;
  • the grayscale hopping determining unit is configured to determine whether a grayscale hopping value of each pixel in the candidate pixel segment matches a preset grayscale hopping rule, and if yes, trigger the effective pixel Paragraph Determining unit;
  • the effective pixel segment determining unit is configured to determine that the candidate pixel segment is a valid pixel segment.
  • the candidate region obtaining submodule includes: a suspect string region determining unit, a color information obtaining unit, a boundary determining unit, and a candidate region obtaining unit;
  • the suspected string area determining unit is configured to determine a suspected character string area in the effective pixel segment after the merge processing
  • the color information obtaining unit is configured to obtain string color information according to pixel values of pixel points in the suspected character string region, and according to pixels in the valid pixel segment that are not in the suspected character string region after the merge processing Pixel value, obtaining background color information;
  • the boundary determining unit is configured to determine a boundary of the license plate candidate region according to the string color information and the background color information;
  • the candidate region obtaining unit is configured to obtain the license plate candidate region M 1 according to the determined boundary.
  • the candidate region determining module includes: a location determining submodule, a boundary determining submodule, and a candidate region determining submodule;
  • the location determining sub-module for determining the position of a candidate region suspected of M 1 in said string of plates
  • the boundary determining sub-module is configured to re-determine a boundary of the license plate candidate area according to the determined position according to a preset machine learning-based regression algorithm
  • the candidate region determining submodule is configured to obtain the license plate candidate region M 2 according to the redefined boundary.
  • the device further includes: a first sample region obtaining module and a classification model obtaining module;
  • the first sample region obtaining module is configured to obtain a sample license plate region whose boundary accuracy is greater than a preset accuracy threshold and/or a sample license plate region whose aspect ratio value is smaller than the first preset threshold value, and The obtained sample license plate area is taken as a positive sample;
  • the classification model obtaining module is configured to obtain the first preset classification model according to a preset machine learning algorithm and the positive sample.
  • the device further includes: a second sample region obtaining module and a sample region classification module;
  • the second sample area obtaining module is configured to obtain a sample area that is a non-license card area
  • the sample region classification module is configured to classify the obtained sample regions according to the content of the obtained sample regions, and obtain negative samples of multiple categories;
  • the classification model obtains a module, specifically for:
  • the first preset classification model is obtained according to a preset machine learning algorithm, the positive sample, and the negative samples of the plurality of categories.
  • the device further includes: a brightness determining module, a gray leveling processing module, and a second license plate area determining module;
  • the brightness determining module is configured to determine whether the brightness of the license plate candidate area M 2 is within a preset brightness range if it is determined that the license plate candidate area M 2 is not a license plate area, and if not, Then triggering the grayscale equalization processing module;
  • the second license plate area determining module is configured to determine, according to the second preset classification model, whether the license plate candidate area M 2 after the gray level equalization processing is a license plate area, and if the license plate area is, triggering the detection result generation
  • the module, wherein the second preset classification model is a classification model obtained by learning a grayscale equalization processed sample license plate region by a machine learning algorithm.
  • an embodiment of the present application further discloses a terminal, the terminal comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed in the housing Inside the space, the processor and the memory are disposed on the circuit board; the power circuit is configured to supply power to each circuit or device of the terminal; the memory is configured to store executable program code; The processor executes the above-described license plate detecting method by executing executable program code stored in the memory.
  • an embodiment of the present application further discloses an executable program code for executing the above-described license plate detecting method at runtime.
  • the embodiment of the present application further discloses a storage medium, and the storage medium For storing executable program code, the executable program code is executed to execute the license plate detecting method described above.
  • the detection terminal after receiving the to be detected image, the pixel values to be detected picture pixel, is obtained to be detected image plate candidate region M 1, width and height of the plate candidate region M 1 of the present application ratio is greater than a case where a first predetermined threshold value, according to a first predetermined classification model based on machine learning, to redefine the candidate region from the license plate candidate region M 1 M 2, in a first predetermined classification model based on machine learning in accordance with It is determined whether the license plate candidate area M 2 is a license plate area, and if so, the license plate candidate area M 2 is determined as the license plate area, and the detection result is generated based on the license plate candidate area M 2 .
  • the area containing the real license plate is a non-license plate area because the aspect ratio of the license plate candidate area is too large, and the correct rate of the license plate detection is improved.
  • the first predetermined classification model based on machine learning is used to collect the license plate candidate. The characteristics of the area, classify the license plate candidate area, and determine whether the license plate candidate area is the license plate area, instead of setting the classification model by the user manually setting the feature, thereby further improving the correct rate of the license plate detection.
  • FIG. 1 is a schematic flow chart of a method for detecting a license plate according to an embodiment of the present application
  • FIG. 2 is a schematic flow chart of another method for detecting a license plate according to an embodiment of the present application
  • FIG. 3 is a schematic flowchart diagram of another method for detecting a license plate according to an embodiment of the present application
  • FIG. 4 is a schematic flowchart diagram of another method for detecting a license plate according to an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of a license plate detecting apparatus according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of another license plate detecting apparatus according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of another license plate detecting apparatus according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of another license plate detecting apparatus according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of a method for detecting a license plate according to an embodiment of the present disclosure, where the method may include the following steps:
  • the detecting terminal may determine, according to the pixel value of each pixel in the picture to be detected, an area of the picture that may include the license plate content, that is, the license plate candidate area M 1 . For example, obtaining a pixel point in which the grayscale hopping value in each pixel row is greater than a preset threshold, and determining that the pixel segment between two pixel points satisfying the preset grayscale hopping rule is a valid pixel segment, and merging adjacent one another And the effective pixel segment whose boundary similarity is greater than another preset threshold, obtain the license plate candidate region M 1 .
  • step S102 calculation of aspect ratio plate candidate region M value of 1, and judges whether the aspect ratio is greater than a first predetermined threshold value, if YES, proceed to step S103;
  • the first preset threshold may be determined according to the aspect ratio of the real license plate in the actual application.
  • the width and height of the real license plate are: 440 mm*140 mm
  • the first preset threshold may be: 440/140 ⁇ 3.14.
  • the license plate candidate area M 1 In the actual traffic scene picture, there may be more background areas similar to the real license plate area around the real license plate area. Therefore, if the aspect ratio of the license plate candidate area M 1 is too large when the license plate detection is performed, the license plate candidate is indicated.
  • the area M 1 includes too many areas that do not belong to the license plate, and when judging whether the candidate license plate area M 1 is a license plate area, it is easy to refer to the characteristics of the non-licence plate area, and it is easy to determine that the license plate candidate area M 1 is a non-license plate. In the area, if the license plate candidate area M 1 contains the real license plate area, this causes a misjudgment.
  • the determination is obtained in a case where the aspect ratio is not greater than a first predetermined threshold value, the license plate may be plate candidate region as a candidate region M 1 M 2, proceed to step S104.
  • the license plate candidate area M 2 is an area in which the aspect ratio value is not greater than the first predetermined threshold.
  • the above machine learning based regression algorithm is a boundary regression algorithm constructed by learning the characteristics of the sample region.
  • the above machine learning-based regression algorithm may be: a boundary regression algorithm for learning the object's features in the sample from the sample region by model training, and then determining the boundary of the object according to the learned object features. .
  • the characteristics of the learned object are more comprehensive than the features of the object manually set by the user, and the determined boundary is more accurate, which can effectively reduce the interference of the background texture on the license plate detection. .
  • step S104 determining, according to the first preset classification model, whether the license plate candidate area M 2 is a license plate area, and if so, executing step S105;
  • the first preset classification model is a classification model obtained by learning a sample license plate area by a machine learning algorithm.
  • a large number of sample license plate areas can be found in advance, and then the sample license plate area is learned by a machine learning algorithm to obtain a classification model, and the classification model can be used to easily divide an area into a license plate area.
  • the first preset classification model may be: a classification model based on a random forest, a support vector machine, a deep neural network, or a convolutional neural network.
  • Classification model based on convolutional neural network for example, using a model of the convolutional neural network classification can be obtained wherein the convolution plate candidate region M 2, and then the plate candidate region M 2 are classified according to the convolution characteristics obtained Determine if it is a license plate area.
  • the machine learning-based classification model is adopted, and the user does not need to manually set the feature, but learns the feature of the object that is favorable for classification from the sample license plate area, and improves the generalization ability and detection of the machine learning algorithm. The correct rate of the license plate.
  • the foregoing first preset classification model may be obtained by:
  • the boundary accuracy may be the distance between the boundary of the sample license plate area and the boundary of the real license plate, or may be the consistency of the boundary of the real license plate, which is not limited in this application.
  • a sample license plate area with a boundary accuracy greater than a preset accuracy threshold and a sample license plate area with an aspect ratio smaller than a first preset threshold are used as two types of positive samples, and the first preset classification model is trained by a machine learning algorithm. In this way, clearly distinguishing the types of the sample license plate area can effectively improve the anti-interference ability of the first preset classification model to the background noise.
  • the method may further include:
  • the non-license plate area may include an area including a lane road surface, a green belt, an isolation fence, a door and a window, a front radiator grille, a lamp, a car logo, and a body advertisement text.
  • the above-mentioned area including the roadway, the green belt, and the isolation fence can be used as a sample area of the road surface, and the area including the door window, the front grille, and the headlight can be used as a sample area of the vehicle body, including the logo of the vehicle body and the body.
  • the area can be used as a sample area of the body text pattern, and of course, there are other types of sample areas, which will not be described here.
  • step S12 may include:
  • the first preset classification model is obtained according to a preset machine learning algorithm, a positive sample, and a negative sample of a plurality of categories.
  • S105 Determine the license plate candidate area M 2 as the license plate area, and generate a detection result according to the license plate candidate area M 2 .
  • the detection result may be stored in the detection terminal. After the number of detection results reaches a certain number, all the detection results are sent to the preset terminal, thereby avoiding the pre-prevention.
  • the set terminal always receives the detection result, which affects the user's use of the terminal.
  • the detection result may be directly sent to the preset terminal, so as to timely notify the user of the detection result of the license plate.
  • the detecting terminal after receiving the image to be detected, obtains the license plate candidate region M 1 of the image to be detected according to the pixel value of the pixel in the image to be detected, and the aspect ratio of the license plate candidate region M 1 is greater than a case where a first predetermined threshold value, according to a first predetermined classification model based on machine learning, re-determining plate candidate region M 2, according to the first predetermined classification model based on machine learning, determined from the candidate region M 1 plate Whether the license plate candidate area M 2 is the license plate area, and if so, the license plate candidate area M 2 is determined as the license plate area, and the detection result is generated based on the license plate candidate area M 2 .
  • the area containing the real license plate is a non-license plate area because the aspect ratio of the license plate candidate area is too large, and the correct rate of the license plate detection is improved.
  • the first predetermined classification model based on machine learning is used to collect the license plate candidate. The characteristics of the area, classify the license plate candidate area, and determine whether the license plate candidate area is the license plate area, instead of setting the classification model by the user manually setting the feature, thereby further improving the correct rate of the license plate detection.
  • FIG. 2 is a schematic flowchart of another method for detecting a license plate according to an embodiment of the present disclosure.
  • step S101 may include the following steps:
  • S1011 Obtain an effective pixel segment of each pixel row of the to-be-detected image according to a preset scanning sequence.
  • the effective pixel segment is: a pixel segment determined according to a pixel point in which a grayscale hopping value in the pixel row is greater than a second preset threshold.
  • the preset scanning sequence may be a horizontal progressive scan, a horizontal cross-row scan, or other scan sequences, which is not limited in this application.
  • step S1011 may include:
  • the effective pixel segment of each pixel row of the image to be detected is obtained by the following steps:
  • the pixel row X is any pixel row in the image to be detected.
  • the grayscale hopping value of each pixel is the difference between the pixel value of the pixel and the pixel value of the previous scanning point.
  • the color of the license plate is specified, such as: white on a blue background, black on a yellow background, white on a black background, black on a white background, etc., so the pixel points of the background area and the license plate string in the license plate area.
  • the grayscale jump value between pixels is traceable, and the second preset threshold can be determined according to the grayscale jump value between "bottom (plate background)" and "word (plate license foreground)" in the real license plate.
  • the second preset threshold may be determined to be 10; in addition, taking into account factors such as environmental factors and resolution of the image capture device, The second preset threshold may be set to a certain multiple of the grayscale jump value between the "bottom” and the "word” of the real license plate, for example, the second preset threshold may be set as the "bottom” of the license plate and The value of the grayscale jump between "words" is 0.8 times.
  • step S24 determining whether the grayscale hopping value of each pixel in the candidate pixel segment matches the preset grayscale hopping rule, and if yes, executing step S25;
  • the type and order of the characters on the license plate are specified, that is: Chinese characters, letters, " ⁇ ", five characters (including letters, numbers, and/or Chinese characters), therefore, each in the license plate area
  • the change of the grayscale hopping value of the pixel in the pixel row is regular, and the grayscale hopping rule may be set according to the variation rule. If the candidate pixel segment in one pixel row of the license plate candidate region satisfies the grayscale hopping rule, The candidate pixel segment can be determined to be a valid pixel segment.
  • the candidate pixel segment that may be determined is too long, and when matching with a preset grayscale hopping rule, a part of the candidate pixel segment satisfies a grayscale hopping rule. While the other part does not satisfy the gray-scale hopping rule, a part that satisfies the gray-scale hopping rule can be intercepted and used as the candidate pixel segment.
  • S1012 Calculate a boundary similarity degree of the vertically adjacent effective pixel segments according to a pixel value of a pixel point at each end of each effective pixel segment and a pixel value of a pixel point at both ends of the effective pixel segment vertically adjacent to the effective pixel segment;
  • the degree of similarity of the boundary may be: a difference between pixel values of pixel points of the opposite side/external side of the two adjacent effective two pixel segments, or may be the same side of the two adjacent effective pixel segments
  • the ratio between the pixel values of the pixel points at the opposite ends of the opposite side is not limited in this application.
  • X1 and X2 the left end of X1 is A, the right end of X1 is B, the left end of X2 is C, and the right end of X2 is D.
  • X1 and The boundary similarity of X2 can be the difference between A and B (or C and D), the ratio of A to B (or C to D), or the difference between A and C (or B and D). It can also be the ratio of A to C (or B to D).
  • S1013 Perform merging processing on adjacent valid pixel segments whose boundary similarity is greater than a third preset threshold
  • the license plate occupies a certain area instead of one pixel row, so it is necessary to merge the adjacent effective pixel segments whose boundary similarity is greater than the third preset threshold.
  • S1014 Obtain a license plate candidate area M 1 of the picture to be detected according to the effective pixel segment after the merge processing.
  • the effective pixel segment after the merge processing may be used as the license plate candidate region M 1 of the image to be detected, but the boundary of the effective pixel segment after the merge processing is not necessarily a straight line or an approximate straight line, but an irregular curve.
  • the boundary of the license plate candidate area M 1 needs to be further determined. Therefore, the above step S1014 may include:
  • the color of the "bottom (plate background)” and “word (vehicle foreground)” of the license plate is specified, and the contrast between the color of the "bottom” of the license plate and the color of the "word” is certain, so The color information of the "bottom” of the license plate and the color information of the "word” are used to determine the boundary of the license plate candidate area.
  • the character string color information determined above is white, and the determined background color information is black, and the region in which the color adjacent to the suspected character string region is black is determined as the background region, and the boundary of the background region is the boundary of the license plate candidate region.
  • the string color information may be an average pixel value A 1 of all pixels in the suspect string region
  • the background color information may be an average pixel value A 2 of all pixels in the non-suspect string region, according to A 1 and A
  • the ratio of 2 determines a fourth preset threshold. If the ratio of the average pixel values A 3 and A 1 of all the pixels in the region adjacent to the suspected string region matches the fourth preset threshold, the neighbor may be determined.
  • the area is the background area, and the boundary of the background area is the boundary of the license plate candidate area.
  • a license plate detection method based on a license plate edge feature or a genetic algorithm may be used to determine a license plate candidate region
  • an Adaboost license plate detector based on a Harr feature may be used to determine a license plate candidate region, which is not claimed in this application. limited.
  • these methods for determining the license plate candidate area are more complicated and generally less generalized than the above-described method of determining the license plate candidate area.
  • the detecting terminal obtains effective pixel segments of each pixel row of the image to be detected according to a preset scanning order, and according to the pixel values of the pixel points at both ends of each effective pixel segment and perpendicular to the effective pixel segment
  • the pixel value of the pixel points at the opposite ends of the effective pixel segment is calculated, and the boundary similarity degree of the vertically adjacent effective pixel segment is calculated, and the adjacent effective pixel segments whose boundary similarity is greater than the third preset threshold are combined, according to the merge processing
  • the effective pixel segment obtains the license plate candidate region M 1 of the picture to be detected, and the method for obtaining the license plate candidate region is simple and easy to implement, thereby improving the versatility and generalization of the license plate detecting method.
  • FIG. 3 is a schematic flowchart diagram of another method for detecting a license plate according to an embodiment of the present application.
  • step S103 may include the following steps:
  • the aspect ratio of the license plate candidate area M 1 is greater than the first preset threshold, it indicates that the license plate candidate area M 1 contains too many picture background areas, and the excessive picture background area generates background noise for the license plate area.
  • the detection causes interference and reduces the correct rate of license plate detection. Therefore, for the license plate candidate area M 1 whose aspect ratio is larger than the first preset threshold, it is necessary to newly determine the license plate candidate area.
  • the license plate area must contain a string, and therefore, when re-determining plate candidate region, determining the position of the first plate candidate region suspected strings M 1, and then re-determined based on the position of the plate candidate region.
  • S1032 Re-determine the boundary of the license plate candidate area according to the determined position according to a preset machine learning-based regression algorithm
  • the characteristics of the learned object are not manually set by the user, but the characteristics of the obtained object are more comprehensive through machine learning.
  • the determined boundaries are more accurate and can effectively reduce the interference of the background texture on the license plate detection.
  • the area within the boundary is the license plate candidate area M 2 .
  • the terminal in the case where the license plate candidate region M 1 aspect ratio greater than a first predetermined threshold value, the terminal first determines the position of the detection plate candidate region M 1 suspected character string, and then according to preset based The machine learning regression algorithm re-determines the boundary of the license plate candidate area according to the determined position, and obtains the license plate candidate area M 2 according to the redefined boundary, so that the feature in the machine learning based regression algorithm is not manually set by the user, so The regression algorithm determines the license plate candidate area M 2 , which effectively reduces the interference of the background texture on the license plate detection, thereby improving the correct rate of the license plate detection.
  • FIG. 4 is a schematic flowchart diagram of another method for detecting a license plate according to an embodiment of the present disclosure. The method may further include the following steps:
  • a plate candidate region M may be the mean luminance of the luminance of the plate candidate region M of all pixels, it is possible for all of the pixels 2 in a partial area of the plate candidate region M
  • the average value of the brightness may also be the average value of the brightness of the preset number of pixels randomly selected in the license plate candidate area M 2 , which is not limited in this application.
  • the license plate candidate area M 2 if it is determined that the license plate candidate area M 2 is not the license plate area, it is determined whether the brightness of the license plate candidate area M 2 is within a preset brightness range, and if the brightness of the license plate candidate area M 2 is Within the preset brightness range, it can be determined that the license plate candidate area M 2 is a non-license card area, and the secondary license plate detection process ends.
  • license plate is determined candidate area M 2 gray balance processing whether the license plate, the license plate if it is performed step S105, generates a detection result.
  • the second preset classification model is a classification model obtained by learning a sample license plate region after the grayscale equalization processing by a machine learning algorithm.
  • the determination is obtained in the case where the plate candidate area M 2 gray balance processing is not the license plate, the license plate can be determined that the candidate region M 2 non license plate, the license plate detection times The process ends.
  • the foregoing second preset classification model may be the same as the method for obtaining the first preset classification model, and details are not described herein again.
  • the positive and negative samples of the model training are the sample license plate regions after the grayscale equalization processing.
  • the detecting terminal determines whether the brightness of the license plate candidate area M 2 is within a preset brightness range, if the brightness is not preset. In the range, the license plate candidate area M 2 is further subjected to gray level equalization processing, and according to the second preset classification model, it is determined whether the license plate candidate area M 2 after the gray level equalization processing is the license plate area, and if it is the license plate area, the license plate is determined.
  • the candidate region M 2 is a license plate region, and generates a detection result according to the license plate candidate region M 2 , thereby avoiding the license plate candidate region M 2 being too light or too dark, and erroneously judging the license plate candidate region M 2 including the real license plate as a non-license plate.
  • the area improves the correct rate of license plate detection.
  • FIG. 5 is a schematic structural diagram of a license plate detecting apparatus according to an embodiment of the present disclosure.
  • the apparatus may include: a candidate area obtaining module 501, a aspect ratio determining module 502, a candidate area determining module 503, and a first license plate area. a determination module 504 and a detection result generation module 505;
  • the candidate area obtaining module 501 is configured to obtain a license plate candidate area M 1 of the picture to be detected according to the pixel value of the pixel in the picture to be detected;
  • Aspect ratio value determination module 502 for calculating the value of the license plate candidate region M 1 aspect ratio, the aspect ratio and determines whether the value is greater than a first predetermined threshold value, if yes, the candidate region determining module 503 is triggered;
  • the candidate area determining module 503 is configured to re-determine the license plate candidate area M 2 from the license plate candidate area M 1 according to a preset machine learning-based regression algorithm, wherein the license plate candidate area M 2 has an aspect ratio not greater than the first pre-predetermined The area where the threshold is set;
  • the first license plate area determining module 504 is configured to determine, according to the first preset classification model, whether the license plate candidate area M 2 is a license plate area, wherein the first preset classification model is to learn the sample license plate area by using a machine learning algorithm. a classification model, if yes, trigger detection result generation module 505;
  • the detection result generation module 505 is configured to determine the license plate candidate area M 2 as the license plate area, and generate a detection result according to the license plate candidate area M 2 .
  • the license plate detecting device may further include: a first sample region obtaining module and a classification model obtaining module (not shown in FIG. 5);
  • the first sample area obtaining module is configured to obtain a sample license plate area with a boundary accuracy greater than a preset accuracy threshold and/or a sample license plate area whose aspect ratio is smaller than a first preset threshold, and obtain the obtained sample license plate The area is used as a positive sample;
  • a classification model obtaining module is configured to obtain a first preset classification model according to a preset machine learning algorithm and a positive sample.
  • the license plate detecting device may further include: a second sample region obtaining module and a sample region sorting module (not shown in FIG. 5);
  • the second sample area obtaining module is configured to obtain a sample area that is a non-license card area
  • a sample area classification module configured to classify the obtained sample areas according to the content of the obtained sample area, and obtain negative samples of multiple categories
  • the classification model obtains the module, specifically for:
  • the first preset classification model is obtained according to a preset machine learning algorithm, a positive sample, and a negative sample of a plurality of categories.
  • the detection terminal after receiving the image to be detected, according to the pixel values of pixels in the image to be detected, and the obtained image plate to be detected candidate region M 1, M in the plate candidate region is greater than a value of the aspect ratio a case where a first predetermined threshold value, according to a first predetermined classification model based on machine learning, re-determining plate candidate region M 2, according to the first predetermined classification model based on machine learning, determined from the candidate region M 1 plate Whether the license plate candidate area M 2 is the license plate area, and if so, the license plate candidate area M 2 is determined as the license plate area, and the detection result is generated based on the license plate candidate area M 2 .
  • the area containing the real license plate is a non-license plate area because the aspect ratio of the license plate candidate area is too large, and the correct rate of the license plate detection is improved.
  • the first predetermined classification model based on machine learning is used to collect the license plate candidate. The characteristics of the area, classify the license plate candidate area, and determine whether the license plate candidate area is the license plate area, instead of setting the classification model by the user manually setting the feature, thereby further improving the correct rate of the license plate detection.
  • FIG. 6 is a schematic structural diagram of another license plate detecting apparatus according to an embodiment of the present application.
  • the candidate area obtaining module 501 may include: an effective pixel segment obtaining submodule 5011 and a similarity calculating submodule 5012. a pixel segment merging sub-module 5013 and a candidate region obtaining sub-module 5014;
  • the effective pixel segment obtaining sub-module 5011 is configured to obtain valid pixel segments of each pixel row of the to-be-detected image according to a preset scanning sequence, wherein the effective pixel segment is: according to the gray-scale hopping value in the pixel row is greater than a pixel segment determined by pixels of a preset threshold;
  • the similarity calculation sub-module 5012 is configured to calculate a vertically adjacent effective pixel segment according to a pixel value of a pixel point at both ends of each valid pixel segment and a pixel value of a pixel point at both ends of the effective pixel segment vertically adjacent to the effective pixel segment. Degree of similarity of the boundary;
  • a pixel segment merging sub-module 5013 configured to contiguously have a boundary similarity greater than a third predetermined threshold The effective pixel segments are merged;
  • the candidate region obtaining sub-module 5014 is configured to obtain the license plate candidate region M 1 of the to-be-detected picture according to the valid pixel segment after the merge processing.
  • the effective pixel segment obtaining submodule 5011 is specifically configured to:
  • the effective pixel segment obtaining sub-module 5011 may include: a grayscale hopping value calculating unit, a pixel point selecting unit, a candidate pixel segment obtaining unit, a grayscale hopping determining unit, and an effective pixel segment determining unit (FIG. 6). Not shown);
  • the grayscale hopping value calculation unit is configured to calculate a grayscale hopping value of each pixel in the pixel row X, wherein the pixel row X is any pixel row in the image to be detected;
  • a pixel selection unit configured to select a pixel point whose grayscale hop value is greater than a second preset threshold
  • a candidate pixel segment obtaining unit configured to obtain a candidate pixel segment on the pixel row X according to the pixel point with the largest and smallest horizontal coordinates in the selected pixel point;
  • the grayscale jump determination unit is configured to determine whether the grayscale jump value of each pixel in the candidate pixel segment matches the preset grayscale jump rule, and if yes, trigger the effective pixel segment determining unit;
  • An effective pixel segment determining unit is configured to determine that the candidate pixel segment is a valid pixel segment.
  • the candidate region obtaining submodule 5014 may include: a suspect string region determining unit, a color information obtaining unit, a boundary determining unit, and a candidate region obtaining unit (not shown in FIG. 6);
  • the suspect string area determining unit is configured to determine a suspect string area in the effective pixel segment after the merge processing
  • a color information obtaining unit configured to obtain string color information according to pixel values of pixel points in the suspected character string region, and obtain a background color according to pixel values of pixel points in the non-suspect string region in the effective pixel segment after the merge processing information;
  • a boundary determining unit configured to determine a boundary of the license plate candidate area according to the string color information and the background color information
  • a candidate region obtaining unit for obtaining a license plate candidate region M 1 according to the determined boundary.
  • the detecting terminal obtains valid pixel segments of each pixel row of the image to be detected according to a preset scanning order, and the pixel values of the pixel points at both ends of each effective pixel segment are perpendicular to the effective pixel segment.
  • the pixel value of the pixel points at the opposite ends of the effective pixel segment is calculated, and the boundary similarity degree of the vertically adjacent effective pixel segment is calculated, and the adjacent effective pixel segments whose boundary similarity is greater than the third preset threshold are combined, according to the merge processing
  • the effective pixel segment obtains the license plate candidate region M 1 of the picture to be detected, and the method for obtaining the license plate candidate region is simple and easy to implement, thereby improving the versatility and generalization of the license plate detecting method.
  • FIG. 7 is a schematic structural diagram of another license plate detecting apparatus according to an embodiment of the present application.
  • a candidate area determining module 503 includes: a position determining sub-module 5031, a boundary determining sub-module 5032, and a candidate area determining. Submodule 5033;
  • the location determining sub-module 5031 for determining a position of the plate candidate region suspected of strings M 1;
  • a boundary determining sub-module 5032 configured to re-determine a boundary of the license plate candidate area according to the determined position according to a preset machine learning-based regression algorithm
  • the candidate region determining sub-module 5033 is configured to obtain the license plate candidate region M 2 according to the re-determined boundary.
  • the detecting terminal first determines the position of the suspected character string in the license plate candidate area M 1 , and then according to the preset basis.
  • the machine learning regression algorithm re-determines the boundary of the license plate candidate area according to the determined position, and obtains the license plate candidate area M 2 according to the redefined boundary, so that the feature in the machine learning based regression algorithm is not manually set by the user, so
  • the regression algorithm determines the license plate candidate area M 2 , which effectively reduces the interference of the background texture on the license plate detection, thereby improving the correct rate of the license plate detection.
  • FIG. 8 is a schematic structural diagram of another license plate detecting apparatus according to an embodiment of the present disclosure.
  • the apparatus may further include: a brightness determining module 506, a gray leveling processing module 507, and a second license plate area determining module 508;
  • the brightness determining module 506 is configured to determine whether the brightness of the license plate candidate area M 2 is within a preset brightness range if it is determined that the license plate candidate area M 2 is not the license plate area, and if not, trigger the gray level equalization. Processing module 507;
  • Gray balance process block 507 the candidate for the license plate area M 2 gradation equalization process
  • the second license plate area determining module 508 is configured to determine, according to the second preset classification model, whether the license plate candidate area M 2 after the gray level equalization processing is the license plate area, and if it is the license plate area, trigger the detection result generating module 505, wherein
  • the second preset classification model is a classification model obtained by learning a sample license plate region after the grayscale equalization processing by a machine learning algorithm.
  • the detecting terminal determines whether the brightness of the license plate candidate area M 2 is within a preset brightness range, if the brightness is not preset. In the range, the license plate candidate area M 2 is further subjected to gray level equalization processing, and according to the second preset classification model, it is determined whether the license plate candidate area M 2 after the gray level equalization processing is the license plate area, and if it is the license plate area, the license plate is determined.
  • the candidate area M 2 is a license plate area, and generates a detection result according to the license plate candidate area M 2 , thereby avoiding the license plate candidate area M 2 being too light or too dark, and erroneously judging the license plate candidate area M 2 including the real license plate as a non-license plate.
  • the area improves the correct rate of license plate detection.
  • FIG. 9 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure.
  • the terminal includes: a housing 901 , a processor 902 , a memory 903 , a circuit board 904 , and a power circuit 905 .
  • the processor 902 and the memory 903 are disposed on the circuit board 1004; the power circuit 905 is configured to supply power to each circuit or device of the terminal.
  • the memory 903 is configured to store executable program code; the processor 902 executes the following steps by running executable program code stored in the memory 903:
  • the plate candidate region M 1 redefine the candidate region M 2 plate, wherein the plate candidate region from the aspect ratio of M 2 is not greater than the first The area of the preset threshold;
  • the first preset classification model Determining, according to the first preset classification model, whether the license plate candidate area M 2 is a license plate area, wherein the first preset classification model is a classification model obtained by learning a sample license plate area by a machine learning algorithm;
  • the license plate candidate area M 2 is a license plate area, and a detection result is generated according to the license plate candidate area M 2 .
  • the detecting terminal after receiving the to-be-detected picture, obtains the license plate candidate area M 1 of the picture to be detected according to the pixel value of the pixel to be detected, and the width and height of the license plate candidate area M 1 ratio is greater than a case where a first predetermined threshold value, according to a first predetermined classification model based on machine learning, to redefine the candidate region from the license plate candidate region M 1 M 2, in a first predetermined classification model based on machine learning in accordance with It is determined whether the license plate candidate area M 2 is a license plate area, and if so, the license plate candidate area M 2 is determined as the license plate area, and the detection result is generated based on the license plate candidate area M 2 .
  • the area containing the real license plate is a non-license plate area because the aspect ratio of the license plate candidate area is too large, and the correct rate of the license plate detection is improved.
  • the first predetermined classification model based on machine learning is used to collect the license plate candidate. The characteristics of the area, classify the license plate candidate area, and determine whether the license plate candidate area is the license plate area, instead of setting the classification model by the user manually setting the feature, thereby further improving the correct rate of the license plate detection.
  • the terminal exists in many 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 provides an executable program code, which is used to execute the license plate detection method provided by the embodiment of the present application at runtime, wherein the license plate detection method includes:
  • the plate candidate region M 1 redefine the candidate region M 2 plate, wherein the plate candidate region from the aspect ratio of M 2 is not greater than the first The area of the preset threshold;
  • the first preset classification model Determining, according to the first preset classification model, whether the license plate candidate area M 2 is a license plate area, wherein the first preset classification model is a classification model obtained by learning a sample license plate area by a machine learning algorithm;
  • the license plate candidate area M 2 is a license plate area, and a detection result is generated according to the license plate candidate area M 2 .
  • the detecting terminal after receiving the to-be-detected picture, obtains the license plate candidate area M 1 of the picture to be detected according to the pixel value of the pixel in the picture to be detected, and the aspect ratio of the license plate candidate area M 1 is greater than the first a case where a preset threshold value, according to a first predetermined classification model based on machine learning, re-determining plate candidate region M 2, according to the first predetermined classification model based on machine learning, determined from the candidate license plate candidate region M 1 Whether the area M 2 is the license plate area, and if so, the license plate candidate area M 2 is determined as the license plate area, and the detection result is generated based on the license plate candidate area M 2 .
  • the area containing the real license plate is a non-license plate area because the aspect ratio of the license plate candidate area is too large, and the correct rate of the license plate detection is improved.
  • the first predetermined classification model based on machine learning is used to collect the license plate candidate. The characteristics of the area, classify the license plate candidate area, and determine whether the license plate candidate area is the license plate area, instead of setting the classification model by the user manually setting the feature, thereby further improving the correct rate of the license plate detection.
  • the embodiment of the present application provides a storage medium for storing executable program code, and the executable program code is executed to execute the license plate detecting method provided by the embodiment of the present application, wherein the license plate detecting method includes:
  • the plate candidate region M 1 redefine the candidate region M 2 plate, wherein the plate candidate region from the aspect ratio of M 2 is not greater than the first The area of the preset threshold;
  • the first preset classification model Determining, according to the first preset classification model, whether the license plate candidate area M 2 is a license plate area, wherein the first preset classification model is a classification model obtained by learning a sample license plate area by a machine learning algorithm;
  • the license plate candidate area M 2 is a license plate area, and a detection result is generated according to the license plate candidate area M 2 .
  • the detecting terminal after receiving the to-be-detected picture, obtains the license plate candidate area M 1 of the picture to be detected according to the pixel value of the pixel in the picture to be detected, and the aspect ratio of the license plate candidate area M 1 is greater than the first a case where a preset threshold value, according to a first predetermined classification model based on machine learning, re-determining plate candidate region M 2, according to the first predetermined classification model based on machine learning, determined from the candidate license plate candidate region M 1 Whether the area M 2 is the license plate area, and if so, the license plate candidate area M 2 is determined as the license plate area, and the detection result is generated based on the license plate candidate area M 2 .
  • the area containing the real license plate is a non-license plate area because the aspect ratio of the license plate candidate area is too large, and the correct rate of the license plate detection is improved.
  • the first predetermined classification model based on machine learning is used to collect the license plate candidate. The characteristics of the area, classify the license plate candidate area, and determine whether the license plate candidate area is the license plate area, instead of setting the classification model by the user manually setting the feature, thereby further improving the correct rate of the license plate detection.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Image Analysis (AREA)

Abstract

一种车牌检测方法及装置,该方法包括:根据待检测图片中像素点的像素值,获得待检测图片的车牌候选区域M 1(S101),计算车牌候选区域M 1的宽高比值,并判断宽高比值是否大于第一预设阈值(S102),若为是,则根据预设的基于机器学习的回归算法,从车牌候选区域M 1中重新确定车牌候选区域M 2(S103),按照第一预设分类模型,判断车牌候选区域M 2是否为车牌区域(S104),若为是,则确定车牌候选区域M 2为车牌区域,并根据车牌候选区域M 2,生成检测结果(S105)。应用该技术方案,提高了检测车牌的正确率。

Description

一种车牌检测方法及装置
本申请要求于2016年3月21日提交中国专利局、申请号为201610160790.9发明名称为“一种车牌检测方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及智能交通领域,特别涉及一种车牌检测方法及装置。
背景技术
随着智能交通技术的发展,车牌检测技术的应用已从原有的收费站、治安卡口等背景变化不大的场景扩展到了电子警察、出入口等普通监控场景。然而,在这些场景中获得的交通监测图片的背景千变万化,图片中车牌区域附近有复杂的纹理和噪声,并且当图片中的非车牌区域有跟车牌区域非常相似的纹理(比如车窗、车灯、散热格栅、树叶、草丛、栅栏、路面标志)时,会极大地增加确定车牌区域的错误率,同时带来真实车牌区域包含部分背景和真实车牌区域的边界精准度下降的问题,进而易造成车牌检测结果错误,车牌检测正确率低。
发明内容
本申请实施例公开了一种车牌检测方法及装置,以提高车牌检测的正确率。
为达到上述目的,本申请实施例公开了一种车牌检测方法,所述方法包括步骤:
根据待检测图片中像素点的像素值,获得所述待检测图片的车牌候选区域M1
计算所述车牌候选区域M1的宽高比值,并判断所述宽高比值是否大于第一预设阈值;
若为是,则根据预设的基于机器学习的回归算法,从所述车牌候选区域M1中重新确定车牌候选区域M2,其中,所述车牌候选区域M2为宽高比值不大于第一预设阈值的区域;
按照第一预设分类模型,判断所述车牌候选区域M2是否为车牌区域,其中,所述第一预设分类模型,为通过机器学习算法对样本车牌区域进行学习获得的分类模型;
若为是,则确定所述车牌候选区域M2为车牌区域,并根据所述车牌候选区域M2,生成检测结果。
可选的,所述根据待检测图片中像素点的像素值,获得所述待检测图片的车牌候选区域M1,包括:
按照预设的扫描顺序,获得所述待检测图片的各个像素行的有效像素段,其中,所述有效像素段为:根据像素行中灰度跳变值大于第二预设阈值的像素点确定的像素段;
根据各个有效像素段两端像素点的像素值和与该有效像素段垂直相邻的有效像素段两端像素点的像素值,计算垂直相邻的有效像素段的边界相似程度;
对边界相似程度大于第三预设阈值的相邻有效像素段进行合并处理;
根据合并处理后的有效像素段,获得所述待检测图片的车牌候选区域M1
可选的,所述按照预设的扫描顺序,获得所述待检测图片的各个像素行的有效像素段,包括:
按照预设的扫描顺序,通过以下步骤获得所述待检测图片的每一像素行的有效像素段:
计算像素行X中每一像素点的灰度跳变值,其中,所述像素行X为所述待检测图片中的任一像素行;
选择灰度跳变值大于第二预设阈值的像素点;
根据所选择的像素点中水平坐标最大和最小的像素点,获得所述像素行X上的候选像素段;
判断所述候选像素段内各个像素点的灰度跳变值是否与预设的灰度跳变规则相匹配;
若为是,则确定所述候选像素段为有效像素段。
可选的,所述根据合并处理后的有效像素段,获得所述待检测图片的车牌候选区域M1,包括:
确定合并处理后的有效像素段中的疑似字符串区域;
根据所述疑似字符串区域中像素点的像素值,获得字符串颜色信息,并根据合并处理后的有效像素段中非所述疑似字符串区域中像素点的像素值,获得背景颜色信息;
根据所述字符串颜色信息和所述背景颜色信息,确定车牌候选区域的边界;
根据所确定的边界获得车牌候选区域M1
可选的,所述根据预设的基于机器学习的回归算法,从所述车牌候选区域M1中重新确定车牌候选区域M2,包括:
确定所述车牌候选区域M1中疑似字符串的位置;
按照预设的基于机器学习的回归算法,根据所确定的位置,重新确定车牌候选区域的边界;
根据所重新确定的边界获得车牌候选区域M2
可选的,所述第一预设分类模型通过以下方式获得:
获得边界精确度大于预设精确度阈值的样本车牌区域和/或宽高比值小于所述第一预设阈值的样本车牌区域,并将所获得的样本车牌区域作为正样本;
根据预设的机器学习算法和所述正样本,获得所述第一预设分类模型。
可选的,在所述根据预设的机器学习算法和所述正样本,获得所述第一预设分类模型之前,还包括:
获得为非车牌区域的样本区域;
按照所获得的样本区域的内容,对所获得的样本区域进行分类,得到多个类别的负样本;
所述根据预设的机器学习算法和所述正样本,获得所述第一预设分类模型,包括:
根据预设的机器学习算法、所述正样本和所述多个类别的负样本,获得所述第一预设分类模型。
可选的,所述方法还包括:
在判断得到所述车牌候选区域M2不是车牌区域的情况下,判断所述车牌候选区域M2的亮度是否在预设的亮度范围内;
若为否,则对所述车牌候选区域M2进行灰度均衡化处理;
按照第二预设分类模型,判断灰度均衡化处理后的所述车牌候选区域M2是否为车牌区域,其中,所述第二预设分类模型,为通过机器学习算法对经灰度均衡化处理后的样本车牌区域进行学习获得的分类模型;
若是车牌区域,则执行所述确定所述车牌候选区域M2为车牌区域,并根据所述车牌候选区域M2,生成检测结果的步骤。
为达到上述目的,本申请实施例还公开了一种车牌检测装置,所述装置包括:候选区域获得模块、宽高比值判断模块、候选区域确定模块、第一车牌区域判断模块和检测结果生成模块;
其中,所述候选区域获得模块,用于根据待检测图片中像素点的像素值,获得所述待检测图片的车牌候选区域M1
所述宽高比值判断模块,用于计算所述车牌候选区域M1的宽高比值,并判断所述宽高比值是否大于第一预设阈值,若为是,则触发所述候选区域确定模块;
所述候选区域确定模块,用于根据预设的基于机器学习的回归算法,从所述车牌候选区域M1中重新确定车牌候选区域M2,其中,所述车牌候选区域M2为宽高比值不大于第一预设阈值的区域;
所述第一车牌区域判断模块,用于按照第一预设分类模型,判断所述车牌候选区域M2是否为车牌区域,其中,所述第一预设分类模型,为通过机器学习算法对样本车牌区域进行学习获得的分类模型,若为是,则触发所述检 测结果生成模块;
所述检测结果生成模块,用于确定所述车牌候选区域M2为车牌区域,并根据所述车牌候选区域M2,生成检测结果。
可选的,所述候选区域获得模块,包括:有效像素段获得子模块、相似程度计算子模块、像素段合并子模块和候选区域获得子模块;
其中,所述有效像素段获得子模块,用于按照预设的扫描顺序,获得所述待检测图片的各个像素行的有效像素段,其中,所述有效像素段为:根据像素行中灰度跳变值大于第二预设阈值的像素点确定的像素段;
所述相似程度计算子模块,用于根据各个有效像素段两端像素点的像素值和与该有效像素段垂直相邻的有效像素段两端像素点的像素值,计算垂直相邻的有效像素段的边界相似程度;
所述像素段合并子模块,用于对边界相似程度大于第三预设阈值的相邻有效像素段进行合并处理;
所述候选区域获得子模块,用于根据合并处理后的有效像素段,获得所述待检测图片的车牌候选区域M1
可选的,所述有效像素段获得子模块,具体用于:
按照预设的扫描顺序,获得所述待检测图片的每一像素行的有效像素段;
所述有效像素段获得子模块,包括:灰度跳变值计算单元、像素点选择单元、候选像素段获得单元、灰度跳变判断单元和有效像素段确定单元;
其中,所述灰度跳变值计算单元,用于计算像素行X中每一像素点的灰度跳变值,其中,所述像素行X为所述待检测图片中的任一像素行;
所述像素点选择单元,用于选择灰度跳变值大于第二预设阈值的像素点;
所述候选像素段获得单元,用于根据所选择的像素点中水平坐标最大和最小的像素点,获得所述像素行X上的候选像素段;
所述灰度跳变判断单元,用于判断所述候选像素段内各个像素点的灰度跳变值是否与预设的灰度跳变规则相匹配,若为是,则触发所述有效像素段 确定单元;
所述有效像素段确定单元,用于确定所述候选像素段为有效像素段。
可选的,所述候选区域获得子模块,包括:疑似字符串区域确定单元、颜色信息获得单元、边界确定单元和候选区域获得单元;
其中,所述疑似字符串区域确定单元,用于确定合并处理后的有效像素段中的疑似字符串区域;
所述颜色信息获得单元,用于根据所述疑似字符串区域中像素点的像素值,获得字符串颜色信息,并根据合并处理后的有效像素段中非所述疑似字符串区域中像素点的像素值,获得背景颜色信息;
所述边界确定单元,用于根据所述字符串颜色信息和所述背景颜色信息,确定车牌候选区域的边界;
所述候选区域获得单元,用于根据所确定的边界获得车牌候选区域M1
可选的,所述候选区域确定模块,包括:位置确定子模块、边界确定子模块和候选区域确定子模块;
其中,所述位置确定子模块,用于确定所述车牌候选区域M1中疑似字符串的位置;
所述边界确定子模块,用于按照预设的基于机器学习的回归算法,根据所确定的位置,重新确定车牌候选区域的边界;
所述候选区域确定子模块,用于根据所重新确定的边界获得车牌候选区域M2
可选的,所述装置还包括:第一样本区域获得模块和分类模型获得模块;
其中,所述第一样本区域获得模块,用于获得边界精确度大于预设精确度阈值的样本车牌区域和/或宽高比值小于所述第一预设阈值的样本车牌区域,并将所获得的样本车牌区域作为正样本;
所述分类模型获得模块,用于根据预设的机器学习算法和所述正样本,获得所述第一预设分类模型。
可选的,所述装置还包括:第二样本区域获得模块和样本区域分类模块;
其中,所述第二样本区域获得模块,用于获得为非车牌区域的样本区域;
所述样本区域分类模块,用于按照所获得的样本区域的内容,对所获得的样本区域进行分类,得到多个类别的负样本;
所述分类模型获得模块,具体用于:
根据预设的机器学习算法、所述正样本和所述多个类别的负样本,获得所述第一预设分类模型。
可选的,所述装置还包括:亮度判断模块、灰度均衡化处理模块和第二车牌区域判断模块;
其中,所述亮度判断模块,用于在判断得到所述车牌候选区域M2不是车牌区域的情况下,判断所述车牌候选区域M2的亮度是否在预设的亮度范围内,若为否,则触发所述灰度均衡化处理模块;
所述灰度均衡化处理模块,用于对所述车牌候选区域M2进行灰度均衡化处理;
所述第二车牌区域判断模块,用于按照第二预设分类模型,判断灰度均衡化处理后的所述车牌候选区域M2是否为车牌区域,若是车牌区域,则触发所述检测结果生成模块,其中,所述第二预设分类模型,为通过机器学习算法对经灰度均衡化处理后的样本车牌区域进行学习获得的分类模型。
为达到上述目的,本申请实施例还公开了一种终端,所述终端包括:壳体、处理器、存储器、电路板和电源电路,其中,所述电路板安置在所述壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上;所述电源电路,用于为所述终端的各个电路或器件供电;所述存储器用于存储可执行程序代码;所述处理器通过运行所述存储器中存储的可执行程序代码,以执行上述的车牌检测方法。
为达到上述目的,本申请实施例还公开了一种可执行程序代码,所述可执行程序代码用于在运行时执行上述的车牌检测方法。
为达到上述目的,本申请实施例还公开了一种存储介质,所述存储介质 用于存储可执行程序代码,所述可执行程序代码被运行以执行上述的车牌检测方法。
由上可知,本申请实施例中,检测终端接收到待检测图片后,根据待检测图片中像素点的像素值,获得待检测图片的车牌候选区域M1,在车牌候选区域M1的宽高比值大于第一预设阈值的情况下,根据基于机器学习的第一预设分类模型,从车牌候选区域M1中重新确定车牌候选区域M2,在根据基于机器学习的第一预设分类模型,判断车牌候选区域M2是否为车牌区域,若为是,则确定车牌候选区域M2为车牌区域,并根据车牌候选区域M2,生成检测结果。这样,避免了因为车牌候选区域的宽高比值过大误判包含真实车牌的区域为非车牌区域,提高了车牌检测的正确率,另外,采用基于机器学习的第一预设分类模型采集车牌候选区域的特征,对车牌候选区域进行分类,判断车牌候选区域是否为车牌区域,而不是通过用户手动设置特征来建立分类模型,进一步提高了车牌检测的正确率。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种车牌检测方法的流程示意图;
图2为本申请实施例提供的另一种车牌检测方法的流程示意图;
图3为本申请实施例提供的另一种车牌检测方法的流程示意图;
图4为本申请实施例提供的另一种车牌检测方法的流程示意图;
图5为本申请实施例提供的一种车牌检测装置的结构示意图;
图6为本申请实施例提供的另一种车牌检测装置的结构示意图;
图7为本申请实施例提供的另一种车牌检测装置的结构示意图;
图8为本申请实施例提供的另一种车牌检测装置的结构示意图;
图9为本申请实施例提供的一种终端的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
下面通过具体实施例,对本申请进行详细说明。
参考图1,图1为本申请实施例提供的一种车牌检测方法的流程示意图,该方法可以包括如下步骤:
S101:根据待检测图片中像素点的像素值,获得该待检测图片的车牌候选区域M1
一般地,检测终端接收到待检测图片后,可以根据待检测图片中各个像素点的像素值,确定该图片中可能包含车牌内容的区域,即车牌候选区域M1。例如:获得每一像素行中灰度跳变值大于预设阈值的像素点,并确定满足预设的灰度跳变规则的两个像素点间的像素段为有效像素段,合并上下相邻且边界相似程度大于另一预设阈值的有效像素段,获得车牌候选区域M1
S102:计算车牌候选区域M1的宽高比值,并判断宽高比值是否大于第一预设阈值,若为是,则执行步骤S103;
其中,第一预设阈值可以根据实际应用中真实车牌的宽高比值确定,如:真实车牌的宽和高为:440mm*140mm,则第一预设阈值可以为:440/140≈3.14。
实际交通场景图片中,真实车牌区域的周围可能会存在较多的与真实车牌区域相似的背景区域,这样,进行车牌检测时,若车牌候选区域M1的宽高比值过大,说明该车牌候选区域M1中包含有过多不属于车牌的区域,进而在判断候选车牌区域M1是否为车牌区域时,很容易参考到非车牌区域的特征,进而易判定该车牌候选区域M1为非车牌区域,若车牌候选区域M1中包含真实车牌区域,这样就造成了误判。因此,需要判断车牌候选区域M1的宽高比值是否大于第一预设阈值,并对宽高比值大于第一预设阈值的车牌候选区域M1的宽高比进行调整,得到合适的车牌候选区域。
在本申请的一种实现方式中,在判断得到宽高比值不大于第一预设阈值 的情况下,可以将车牌候选区域M1作为车牌候选区域M2,继续执行步骤S104。
S103:根据预设的基于机器学习的回归算法,从车牌候选区域M1中重新确定车牌候选区域M2
这里,车牌候选区域M2为宽高比值不大于第一预设阈值的区域。
另外,上述基于机器学习的回归算法是通过学习样本区域的特征来构建的一种边界回归算法。一般地,上述基于机器学习的回归算法可以是:通过模型训练,从样本区域中学习出该样本中的对象的特征,然后根据学习到的对象的特征来确定对象的边界的一种边界回归算法。
需要说明的是,通过基于机器学习的回归算法,学习到的对象的特征比用户手动设置的对象的特征更为全面,进而确定的边界更为准确,可以有效的减少背景纹理对车牌检测的干扰。
S104:按照第一预设分类模型,判断车牌候选区域M2是否为车牌区域,若为是,则执行步骤S105;
其中,第一预设分类模型,为通过机器学习算法对样本车牌区域进行学习获得的分类模型。在构建第一预设分类模型时,可以预先找到大量样本车牌区域,然后,采用机器学习算法对这些样本车牌区域进行学习,得到分类模型,通过该分类模型可以简单的把一个区域分为车牌区域和非车牌区域两大类。
本领域内的技术人员可以理解的是,在构建第一预设分类模型时,所选择的样本车牌区域数量越大、车牌区域的种类越多,构建的分类模型分类效果越好。
在本申请的一种实现方式中,上述第一预设分类模型,可以为:基于随机森林、支持向量机、深度神经网络或卷积神经网络等的分类模型。以基于卷积神经网络的分类模型为例,利用该卷积神经网络的分类模型,可以获得车牌候选区域M2的卷积特征,再根据获得的卷积特征对车牌候选区域M2进行分类,判断其是否为车牌区域。在本申请实施例中,采用基于机器学习的分类模型,不需要用户手动设置特征,而是从样本车牌区域中学习有利于分类的对象的特征,提高了该机器学习算法的泛化能力和检测车牌的正确率。
在本申请的一种实现方式中,上述第一预设分类模型可以通过以下方式获得:
S11、获得边界精确度大于预设精确度阈值的样本车牌区域和/或宽高比值小于第一预设阈值的样本车牌区域,将所获得的样本车牌区域作为正样本;
其中,边界精确度可以为样本车牌区域的边界与真实车牌的边界间的距离,也可以为真实车牌的边界的连贯度,本申请对此不进行限定。
S12、根据预设的机器学习算法和正样本,获得第一预设分类模型。
一般地,将边界精确度大于预设精确度阈值的样本车牌区域、宽高比值小于第一预设阈值的样本车牌区域作为两类正样本,通过机器学习算法来训练获得第一预设分类模型,这样,明确区分样本车牌区域的种类,能够有效地提高第一预设分类模型对背景噪声的抗干扰能力。
实际应用中,在对模型进行训练获得第一预设分类模型时,为了提高车牌检测的正确率,还需要采集负样本来对模型进行训练。鉴于此,在本申请的一种实现方式中,在步骤S12之前,还可以包括:
S13、获得为非车牌区域的样本区域;
这里,非车牌区域可以为包含车道路面、绿化带、隔离栅栏、车门窗、车头散热格栅、车灯、车标、车身广告文字等区域。
S14、按照所获得的样本区域的内容,对所获得的样本区域进行分类,得到多个类别的负样本。
如上述的包含车道路面、绿化带、隔离栅栏的区域可以作为路面类的样本区域,包含车门窗、车头散热格栅、车灯的区域可以作为车身类的样本区域,包含车标、车身广告文字的区域可以作为车身文字图案类的样本区域,当然还可以有其他类别的样本区域,此处不再一一赘述。
这种情况下,步骤S12可以包括:
根据预设的机器学习算法、正样本和多个类别的负样本,获得第一预设分类模型。
这样对样本进行类型的细分,有利于模型的收敛,有效地提高了车牌检测的正确率。
S105:确定车牌候选区域M2为车牌区域,并根据车牌候选区域M2,生成检测结果。
在本申请的一种实现方式中,生成检测结果后,可以将检测结果存储在检测终端中,在检测结果的数量达到一定数量后,再将所有的检测结果发送给预设的终端,避免预设的终端总是收到检测结果,影响用户对终端的使用;另外,生成检测结果后,也可以将该检测结果直接发送给预设的终端,以便及时通知用户车牌的检测结果。
应用图1所示实施例,检测终端接收到待检测图片后,根据待检测图片中像素点的像素值,获得待检测图片的车牌候选区域M1,在车牌候选区域M1的宽高比值大于第一预设阈值的情况下,根据基于机器学习的第一预设分类模型,从车牌候选区域M1中重新确定车牌候选区域M2,在根据基于机器学习的第一预设分类模型,判断车牌候选区域M2是否为车牌区域,若为是,则确定车牌候选区域M2为车牌区域,并根据车牌候选区域M2,生成检测结果。这样,避免了因为车牌候选区域的宽高比值过大误判包含真实车牌的区域为非车牌区域,提高了车牌检测的正确率,另外,采用基于机器学习的第一预设分类模型采集车牌候选区域的特征,对车牌候选区域进行分类,判断车牌候选区域是否为车牌区域,而不是通过用户手动设置特征来建立分类模型,进一步提高了车牌检测的正确率。
参考图2,图2为本申请实施例提供的另一种车牌检测方法的流程示意图,该方法中,步骤S101可以包括如下步骤:
S1011:按照预设的扫描顺序,获得待检测图片的各个像素行的有效像素段;
其中,有效像素段为:根据像素行中灰度跳变值大于第二预设阈值的像素点确定的像素段。
在本申请的一种实现方式中,上述预设的扫描顺序可以为横向逐行扫描,也可以为横向跨行扫描,还可以是其他扫描顺序,本申请对此不进行限定。
在本申请的一种实现方式中,上述步骤S1011,可以包括:
按照预设的扫描顺序,通过以下步骤获得待检测图片的每一像素行的有效像素段:
S21、计算像素行X中每一像素点的灰度跳变值;
其中,像素行X为待检测图片中的任一像素行。
需要说明的是,每一像素点的灰度跳变值为该像素点的像素值与上一扫描点的像素值的差值。
S22、选择灰度跳变值大于第二预设阈值的像素点;
实际应用中,车牌的颜色是有规定的,如:、蓝底白字、黄底黑字、黑底白字和白底黑字等,因此在车牌区域中的背景区域的像素点和车牌字符串的像素点间的灰度跳变值是有迹可寻的,可以根据真实车牌中“底(车牌背景)”和“字(车牌前景)”间的灰度跳变值来确定第二预设阈值,假设,真实的车牌的“底”和“字”间的灰度跳变值为10,则可以确定第二预设阈值为10;另外,考虑到环境因素和图片采集设备分辨率等因素的影响,可以将第二预设阈值设置为真实的车牌的“底”和“字”间的灰度跳变值的一定倍数,如:可将第二预设阈值设置为车牌的“底”和“字”间的灰度跳变值的0.8倍。
S23、根据所选择的像素点中水平坐标最大和最小的像素点,确定像素行X上的候选像素段;
S24、判断候选像素段内各个像素点的灰度跳变值是否与预设的灰度跳变规则相匹配,若为是,则执行步骤S25;
实际应用中,车牌上字符的类型以及排列顺序是有规定的,也就是:汉字、字母、“·”、五个字符(包括字母、数字和/或汉字),因此,在车牌区域的每个像素行中像素点的灰度跳变值的变化是有规律的,可以根据该变化规律设置灰度跳变规则,若车牌候选区域的一个像素行中候选像素段满足灰度跳变规则,则可以确定该候选像素段为有效像素段。
在本申请的一种实现方法中,可能确定的候选像素段过长,其在与预设的灰度跳变规则进行匹配时,该候选像素段中的一部分满足灰度跳变规则, 而另一部分不满足灰度跳变规则,则可以截取满足灰度跳变规则的一部分,并将该部分作为候选像素段。
S25、确定候选像素段为有效像素段。
S1012:根据各个有效像素段两端像素点的像素值和与该有效像素段垂直相邻的有效像素段两端像素点的像素值,计算垂直相邻的有效像素段的边界相似程度;
这里,边界相似程度可以为:垂直相邻的两个有效像素段同侧/异侧的两端点像素点的像素值之间的差值,也可以为垂直相邻的两个有效像素段同侧/异侧的两端点像素点的像素值之间的比值,本申请对此不进行限定。
假设,垂直相邻的两个有效像素段分别为X1和X2,X1左侧端点为A,X1右侧端点为B,X2左侧端点为C,X2右侧端点为D,此时,X1和X2的边界相似程度可以为A与B(或C与D)的差值,也可以为A与B(或C与D)的比值,也可以为A与C(或B与D)的差值,还可以为A与C(或B与D)的比值。
S1013:对边界相似程度大于第三预设阈值的相邻有效像素段进行合并处理;
实际应用中,在待检测图片中,车牌是占有一定区域的,而非是一个像素行,因此需要对边界相似程度大于第三预设阈值的相邻有效像素段进行合并处理。
S1014:根据合并处理后的有效像素段,获得待检测图片的车牌候选区域M1
一般地,可以将合并处理后的有效像素段作为待检测图片的车牌候选区域M1,但是合并处理后的有效像素段的边界并不一定是一条直线或近似直线,而是一条不规则的曲线,这种情况下需要进一步确定车牌候选区域M1的边界,因此上述步骤S1014,可以包括:
S26、确定合并处理后的有效像素段中的疑似字符串区域;
S27、根据疑似字符串区域中像素点的像素值,获得字符串颜色信息,并根据合并处理后的有效像素段中非疑似字符串区域中像素点的像素值,获得 背景颜色信息;
实际应用中,车牌的“底(车牌背景)”和“字(车牌前景)”的颜色是有规定,车牌的“底”的颜色和“字”的颜色之间的对比是一定,因此可以获得车牌的“底”的颜色信息和“字”的颜色信息,来确定车牌候选区域的边界。
S28、根据字符串颜色信息和背景颜色信息,确定车牌候选区域的边界;
假设,上述确定的字符串颜色信息为白色,上述确定的背景颜色信息为黑色,则确定疑似字符串区域相邻的颜色为黑色的区域为背景区域,该背景区域的边界为车牌候选区域的边界。
另外,上述字符串颜色信息可以为疑似字符串区域中所有像素点的平均像素值A1,背景颜色信息可以为非疑似字符串区域中所有像素点的平均像素值A2,根据A1和A2的比值,确定第四预设阈值,若与疑似字符串区域相邻的区域中所有像素点的平均像素值A3与A1的比值与第四预设阈值匹配,则可以确定该相邻的区域为背景区域,该背景区域的边界为车牌候选区域的边界。
S29、根据所确定的边界获得车牌候选区域M1
另外,在本申请中还可以采用基于车牌边缘特征或遗传算法的车牌检测方法来确定车牌候选区域,也可以采用基于Harr等特征的Adaboost车牌检测器来确定车牌候选区域,本申请对此不进行限定。但是,这几种确定车牌候选区域的方法与上述确定的车牌候选区域的方法相比,较为复杂且泛化能力较差。
应用图2所示实施例,检测终端按照预设的扫描顺序,获得待检测图片的各个像素行的有效像素段,根据各个有效像素段两端像素点的像素值和与该有效像素段垂直相邻的有效像素段两端像素点的像素值,计算垂直相邻的有效像素段的边界相似程度,对边界相似程度大于第三预设阈值的相邻有效像素段进行合并处理,根据合并处理后的有效像素段,获得待检测图片的车牌候选区域M1,这种获得车牌候选区域的方法简单、容易实现,因此提高了车牌检测方法的通用性和泛化性。
参考图3,图3为本申请实施例提供的另一种车牌检测方法的流程示意图, 该方法中,步骤S103可以包括如下步骤:
S1031:确定车牌候选区域M1中疑似字符串的位置;
在车牌候选区域M1的宽高比大于第一预设阈值的情况下,表明该车牌候选区域M1中包含有过多图片背景区域,而过多图片背景区域会产生背景噪声,对车牌区域的检测造成干扰,降低了车牌检测的正确率。因此,对于宽高比大于第一预设阈值的车牌候选区域M1,需要重新确定车牌候选区域。而在车牌区域中必定包含车牌字符串,因此,在重新确定车牌候选区域时,首先确定车牌候选区域M1中疑似字符串的位置,再根据该位置来重新确定车牌候选区域。
S1032:按照预设的基于机器学习的回归算法,根据所确定的位置,重新确定车牌候选区域的边界;
在本申请的一种实现方式中,通过上述基于机器学习的回归算法,学习到的对象的特征不是用户手动设置的,而是通过基于机器学习到的,获得的对象的特征更为全面,进而确定的边界更为准确,可以有效的减少背景纹理对车牌检测的干扰。
S1033:根据所重新确定的边界获得车牌候选区域M2
在边界确定后,边界内的区域就是车牌候选区域M2
应用图3所示实施例,在车牌候选区域M1的宽高比大于第一预设阈值的情况下,检测终端首先确定车牌候选区域M1中疑似字符串的位置,再按照预设的基于机器学习的回归算法,根据所确定的位置,重新确定车牌候选区域的边界,根据所重新确定的边界获得车牌候选区域M2,这样基于机器学习的回归算法中的特征不用用户手动设置,因此根据该回归算法来确定车牌候选区域M2,有效地减少了背景纹理对车牌检测的干扰,进而提高车牌检测的正确率。
参考图4,图4为本申请实施例提供的另一种车牌检测方法的流程示意图,该方法中还可以包括如下步骤:
S106:判断车牌候选区域M2的亮度是否在预设的亮度范围内,若为否, 则执行步骤S107;
在本申请的一种实现方式中,车牌候选区域M2的亮度可以为车牌候选区域M2中所有像素点的亮度的均值,也可以为车牌候选区域M2中某一部分区域中所有像素点的亮度的均值,还可以为车牌候选区域M2中随机选择的预设数量的像素点的亮度的均值,本申请对此不进行限定。
在本申请的一种实现方式中,在判断得到车牌候选区域M2不是车牌区域的情况下,判断车牌候选区域M2的亮度是否在预设的亮度范围内,若车牌候选区域M2的亮度在预设的亮度范围内,则可以判定该车牌候选区域M2为非车牌区域,该次车牌检测过程结束。
S107:对车牌候选区域M2进行灰度均衡化处理;
其中,灰度均衡化处理的方法为现有技术,此处不再赘述。
S108:按照第二预设分类模型,判断灰度均衡化处理后的车牌候选区域M2是否为车牌区域,若是车牌区域,则执行步骤S105,生成检测结果。
其中,第二预设分类模型,为通过机器学习算法对经灰度均衡化处理后的样本车牌区域进行学习获得的分类模型。
在本申请的一种实现方式中,在判断得到灰度均衡化处理后的车牌候选区域M2不是车牌区域的情况下,则可以判定该车牌候选区域M2为非车牌区域,该次车牌检测过程结束。
另外,在本申请的一种实现方式中,上述第二预设分类模型可以与第一预设分类模型的获得方法相同,此处不再赘述。
需要说明的是,在获得第二预设分类模型时,进行模型训练的正样本和负样本都是经灰度均衡化处理后的样本车牌区域。
应用图4所示实施例,在判断得到车牌候选区域M2不是车牌区域的情况下,检测终端会判断车牌候选区域M2的亮度是否在预设的亮度范围内,若不在预设的该亮度范围内,再对车牌候选区域M2进行灰度均衡化处理,按照第二预设分类模型,判断灰度均衡化处理后的车牌候选区域M2是否为车牌区域,若是车牌区域,则确定车牌候选区域M2为车牌区域,并根据车牌候选区域M2, 生成检测结果,这样避免了因车牌候选区域M2过亮或过暗,而误判包含真实车牌的车牌候选区域M2为非车牌区域,提高了车牌检测的正确率。
参考图5,图5为本申请实施例提供的一种车牌检测装置的结构示意图,该装置可以包括:候选区域获得模块501、宽高比值判断模块502、候选区域确定模块503、第一车牌区域判断模块504和检测结果生成模块505;
其中,候选区域获得模块501,用于根据待检测图片中像素点的像素值,获得待检测图片的车牌候选区域M1
宽高比值判断模块502,用于计算车牌候选区域M1的宽高比值,并判断宽高比值是否大于第一预设阈值,若为是,则触发候选区域确定模块503;
候选区域确定模块503,用于根据预设的基于机器学习的回归算法,从车牌候选区域M1中重新确定车牌候选区域M2,其中,车牌候选区域M2为宽高比值不大于第一预设阈值的区域;
第一车牌区域判断模块504,用于按照第一预设分类模型,判断车牌候选区域M2是否为车牌区域,其中,第一预设分类模型,为通过机器学习算法对样本车牌区域进行学习获得的分类模型,若为是,则触发检测结果生成模块505;
检测结果生成模块505,用于确定车牌候选区域M2为车牌区域,并根据车牌候选区域M2,生成检测结果。
在本申请的一种实现方式中,上述车牌检测装置还可以包括:第一样本区域获得模块和分类模型获得模块(图5中未示出);
其中,第一样本区域获得模块,用于获得边界精确度大于预设精确度阈值的样本车牌区域和/或宽高比值小于第一预设阈值的样本车牌区域,并将所获得的样本车牌区域作为正样本;
分类模型获得模块,用于根据预设的机器学习算法和正样本,获得第一预设分类模型。
在本申请的一种实现方式中,上述车牌检测装置还可以包括:第二样本区域获得模块和样本区域分类模块(图5中未示出);
其中,第二样本区域获得模块,用于获得为非车牌区域的样本区域;
样本区域分类模块,用于按照所获得的样本区域的内容,对所获得的样本区域进行分类,得到多个类别的负样本;
这种情况下,分类模型获得模块,具体用于:
根据预设的机器学习算法、正样本和多个类别的负样本,获得第一预设分类模型。
应用图5所示实施例,检测终端接收到待检测图片后,根据待检测图片中像素点的像素值,获得待检测图片的车牌候选区域M1,在车牌候选区域M1的宽高比值大于第一预设阈值的情况下,根据基于机器学习的第一预设分类模型,从车牌候选区域M1中重新确定车牌候选区域M2,在根据基于机器学习的第一预设分类模型,判断车牌候选区域M2是否为车牌区域,若为是,则确定车牌候选区域M2为车牌区域,并根据车牌候选区域M2,生成检测结果。这样,避免了因为车牌候选区域的宽高比值过大误判包含真实车牌的区域为非车牌区域,提高了车牌检测的正确率,另外,采用基于机器学习的第一预设分类模型采集车牌候选区域的特征,对车牌候选区域进行分类,判断车牌候选区域是否为车牌区域,而不是通过用户手动设置特征来建立分类模型,进一步提高了车牌检测的正确率。
参考图6,图6为本申请实施例提供的另一种车牌检测装置的结构示意图,该装置中,候选区域获得模块501,可以包括:有效像素段获得子模块5011、相似程度计算子模块5012、像素段合并子模块5013和候选区域获得子模块5014;
其中,有效像素段获得子模块5011,用于按照预设的扫描顺序,获得待检测图片的各个像素行的有效像素段,其中,有效像素段为:根据像素行中灰度跳变值大于第二预设阈值的像素点确定的像素段;
相似程度计算子模块5012,用于根据各个有效像素段两端像素点的像素值和与该有效像素段垂直相邻的有效像素段两端像素点的像素值,计算垂直相邻的有效像素段的边界相似程度;
像素段合并子模块5013,用于对边界相似程度大于第三预设阈值的相邻 有效像素段进行合并处理;
候选区域获得子模块5014,用于根据合并处理后的有效像素段,获得待检测图片的车牌候选区域M1
在本申请的一种实现方式中,有效像素段获得子模块5011,具体用于:
按照预设的扫描顺序,获得所述待检测图片的每一像素行的有效像素段;
这种情况下,有效像素段获得子模块5011,可以包括:灰度跳变值计算单元、像素点选择单元、候选像素段获得单元、灰度跳变判断单元和有效像素段确定单元(图6中未示出);
其中,灰度跳变值计算单元,用于计算像素行X中每一像素点的灰度跳变值,其中,像素行X为所述待检测图片中的任一像素行;
像素点选择单元,用于选择灰度跳变值大于第二预设阈值的像素点;
候选像素段获得单元,用于根据所选择的像素点中水平坐标最大和最小的像素点,获得像素行X上的候选像素段;
灰度跳变判断单元,用于判断候选像素段内各个像素点的灰度跳变值是否与预设的灰度跳变规则相匹配,若为是,则触发有效像素段确定单元;
有效像素段确定单元,用于确定候选像素段为有效像素段。
在本申请的一种实现方式中,候选区域获得子模块5014,可以包括:疑似字符串区域确定单元、颜色信息获得单元、边界确定单元和候选区域获得单元(图6中未示出);
其中,疑似字符串区域确定单元,用于确定合并处理后的有效像素段中的疑似字符串区域;
颜色信息获得单元,用于根据疑似字符串区域中像素点的像素值,获得字符串颜色信息,并根据合并处理后的有效像素段中非疑似字符串区域中像素点的像素值,获得背景颜色信息;
边界确定单元,用于根据字符串颜色信息和背景颜色信息,确定车牌候选区域的边界;
候选区域获得单元,用于根据所确定的边界获得车牌候选区域M1
应用图6所示实施例,检测终端按照预设的扫描顺序,获得待检测图片的各个像素行的有效像素段,根据各个有效像素段两端像素点的像素值和与该有效像素段垂直相邻的有效像素段两端像素点的像素值,计算垂直相邻的有效像素段的边界相似程度,对边界相似程度大于第三预设阈值的相邻有效像素段进行合并处理,根据合并处理后的有效像素段,获得待检测图片的车牌候选区域M1,这种获得车牌候选区域的方法简单、容易实现,因此提高了车牌检测方法的通用性和泛化性。
参考图7,图7为本申请实施例提供的另一种车牌检测装置的结构示意图,该装置中,候选区域确定模块503,包括:位置确定子模块5031、边界确定子模块5032和候选区域确定子模块5033;
其中,位置确定子模块5031,用于确定车牌候选区域M1中疑似字符串的位置;
边界确定子模块5032,用于按照预设的基于机器学习的回归算法,根据所确定的位置,重新确定车牌候选区域的边界;
候选区域确定子模块5033,用于根据所重新确定的边界获得车牌候选区域M2
应用图7所示实施例,在车牌候选区域M1的宽高比大于第一预设阈值的情况下,检测终端首先确定车牌候选区域M1中疑似字符串的位置,再按照预设的基于机器学习的回归算法,根据所确定的位置,重新确定车牌候选区域的边界,根据所重新确定的边界获得车牌候选区域M2,这样基于机器学习的回归算法中的特征不用用户手动设置,因此根据该回归算法来确定车牌候选区域M2,有效地减少了背景纹理对车牌检测的干扰,进而提高车牌检测的正确率。
参考图8,图8为本申请实施例提供的另一种车牌检测装置的结构示意图,该装置还可以包括:亮度判断模块506、灰度均衡化处理模块507和第二车牌区域判断模块508;
其中,亮度判断模块506,用于在判断得到车牌候选区域M2不是车牌区域 的情况下,判断车牌候选区域M2的亮度是否在预设的亮度范围内,若为否,则触发灰度均衡化处理模块507;
灰度均衡化处理模块507,用于对车牌候选区域M2进行灰度均衡化处理;
第二车牌区域判断模块508,用于按照第二预设分类模型,判断灰度均衡化处理后的车牌候选区域M2是否为车牌区域,若是车牌区域,则触发检测结果生成模块505,其中,第二预设分类模型,为通过机器学习算法对经灰度均衡化处理后的样本车牌区域进行学习获得的分类模型。
应用图8所示实施例,在判断得到车牌候选区域M2不是车牌区域的情况下,检测终端会判断车牌候选区域M2的亮度是否在预设的亮度范围内,若不在预设的该亮度范围内,再对车牌候选区域M2进行灰度均衡化处理,按照第二预设分类模型,判断灰度均衡化处理后的车牌候选区域M2是否为车牌区域,若是车牌区域,则确定车牌候选区域M2为车牌区域,并根据车牌候选区域M2,生成检测结果,这样避免了因车牌候选区域M2过亮或过暗,而误判包含真实车牌的车牌候选区域M2为非车牌区域,提高了车牌检测的正确率。
参考图9,图9为本申请实施例提供的一种终端的结构示意图,该终端包括:壳体901、处理器902、存储器903、电路板904和电源电路905,其中,所述电路板904安置在所述壳体901围成的空间内部,所述处理器902和所述存储器903设置在所述电路板1004上;所述电源电路905,用于为所述终端的各个电路或器件供电;所述存储器903用于存储可执行程序代码;所述处理器902通过运行所述存储器903中存储的可执行程序代码,以执行以下步骤:
根据待检测图片中像素点的像素值,获得所述待检测图片的车牌候选区域M1
计算所述车牌候选区域M1的宽高比值,并判断所述宽高比值是否大于第一预设阈值;
若为是,则根据预设的基于机器学习的回归算法,从所述车牌候选区域M1中重新确定车牌候选区域M2,其中,所述车牌候选区域M2为宽高比值不大于第一预设阈值的区域;
按照第一预设分类模型,判断所述车牌候选区域M2是否为车牌区域,其 中,所述第一预设分类模型,为通过机器学习算法对样本车牌区域进行学习获得的分类模型;
若为是,则确定所述车牌候选区域M2为车牌区域,并根据所述车牌候选区域M2,生成检测结果。
处理器902对上述步骤的具体执行过程以及处理器902通过运行可执行程序代码来进一步执行的步骤,可以参见本申请图1-8所示实施例的描述,在此不再赘述。
由上可见,本申请实施例中,检测终端接收到待检测图片后,根据待检测图片中像素点的像素值,获得待检测图片的车牌候选区域M1,在车牌候选区域M1的宽高比值大于第一预设阈值的情况下,根据基于机器学习的第一预设分类模型,从车牌候选区域M1中重新确定车牌候选区域M2,在根据基于机器学习的第一预设分类模型,判断车牌候选区域M2是否为车牌区域,若为是,则确定车牌候选区域M2为车牌区域,并根据车牌候选区域M2,生成检测结果。这样,避免了因为车牌候选区域的宽高比值过大误判包含真实车牌的区域为非车牌区域,提高了车牌检测的正确率,另外,采用基于机器学习的第一预设分类模型采集车牌候选区域的特征,对车牌候选区域进行分类,判断车牌候选区域是否为车牌区域,而不是通过用户手动设置特征来建立分类模型,进一步提高了车牌检测的正确率。
该终端以多种形式存在,包括但不限于:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。
(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。
(5)其他具有数据交互功能的电子装置。
本申请实施例提供了一种可执行程序代码,该可执行程序代码用于在运行时执行本申请实施例提供的车牌检测方法,其中,车牌检测方法,包括:
根据待检测图片中像素点的像素值,获得所述待检测图片的车牌候选区域M1
计算所述车牌候选区域M1的宽高比值,并判断所述宽高比值是否大于第一预设阈值;
若为是,则根据预设的基于机器学习的回归算法,从所述车牌候选区域M1中重新确定车牌候选区域M2,其中,所述车牌候选区域M2为宽高比值不大于第一预设阈值的区域;
按照第一预设分类模型,判断所述车牌候选区域M2是否为车牌区域,其中,所述第一预设分类模型,为通过机器学习算法对样本车牌区域进行学习获得的分类模型;
若为是,则确定所述车牌候选区域M2为车牌区域,并根据所述车牌候选区域M2,生成检测结果。
本申请实施例中,检测终端接收到待检测图片后,根据待检测图片中像素点的像素值,获得待检测图片的车牌候选区域M1,在车牌候选区域M1的宽高比值大于第一预设阈值的情况下,根据基于机器学习的第一预设分类模型,从车牌候选区域M1中重新确定车牌候选区域M2,在根据基于机器学习的第一预设分类模型,判断车牌候选区域M2是否为车牌区域,若为是,则确定车牌候选区域M2为车牌区域,并根据车牌候选区域M2,生成检测结果。这样,避免了因为车牌候选区域的宽高比值过大误判包含真实车牌的区域为非车牌区域,提高了车牌检测的正确率,另外,采用基于机器学习的第一预设分类模型采集车牌候选区域的特征,对车牌候选区域进行分类,判断车牌候选区域 是否为车牌区域,而不是通过用户手动设置特征来建立分类模型,进一步提高了车牌检测的正确率。
本申请实施例提供了一种存储介质,用于存储可执行程序代码,该可执行程序代码被运行以执行本申请实施例提供的车牌检测方法,其中,车牌检测方法,包括:
根据待检测图片中像素点的像素值,获得所述待检测图片的车牌候选区域M1
计算所述车牌候选区域M1的宽高比值,并判断所述宽高比值是否大于第一预设阈值;
若为是,则根据预设的基于机器学习的回归算法,从所述车牌候选区域M1中重新确定车牌候选区域M2,其中,所述车牌候选区域M2为宽高比值不大于第一预设阈值的区域;
按照第一预设分类模型,判断所述车牌候选区域M2是否为车牌区域,其中,所述第一预设分类模型,为通过机器学习算法对样本车牌区域进行学习获得的分类模型;
若为是,则确定所述车牌候选区域M2为车牌区域,并根据所述车牌候选区域M2,生成检测结果。
本申请实施例中,检测终端接收到待检测图片后,根据待检测图片中像素点的像素值,获得待检测图片的车牌候选区域M1,在车牌候选区域M1的宽高比值大于第一预设阈值的情况下,根据基于机器学习的第一预设分类模型,从车牌候选区域M1中重新确定车牌候选区域M2,在根据基于机器学习的第一预设分类模型,判断车牌候选区域M2是否为车牌区域,若为是,则确定车牌候选区域M2为车牌区域,并根据车牌候选区域M2,生成检测结果。这样,避免了因为车牌候选区域的宽高比值过大误判包含真实车牌的区域为非车牌区域,提高了车牌检测的正确率,另外,采用基于机器学习的第一预设分类模型采集车牌候选区域的特征,对车牌候选区域进行分类,判断车牌候选区域是否为车牌区域,而不是通过用户手动设置特征来建立分类模型,进一步提高了车牌检测的正确率。
对于装置、终端、可执行程序代码、存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本领域普通技术人员可以理解实现上述方法实施方式中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于计算机可读取存储介质中,这里所称得的存储介质,如:ROM/RAM、磁碟、光盘等。
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。

Claims (19)

  1. 一种车牌检测方法,其特征在于,所述方法包括:
    根据待检测图片中像素点的像素值,获得所述待检测图片的车牌候选区域M1
    计算所述车牌候选区域M1的宽高比值,并判断所述宽高比值是否大于第一预设阈值;
    若为是,则根据预设的基于机器学习的回归算法,从所述车牌候选区域M1中重新确定车牌候选区域M2,其中,所述车牌候选区域M2为宽高比值不大于第一预设阈值的区域;
    按照第一预设分类模型,判断所述车牌候选区域M2是否为车牌区域,其中,所述第一预设分类模型,为通过机器学习算法对样本车牌区域进行学习获得的分类模型;
    若为是,则确定所述车牌候选区域M2为车牌区域,并根据所述车牌候选区域M2,生成检测结果。
  2. 根据权利要求1所述方法,其特征在于,所述根据待检测图片中像素点的像素值,获得所述待检测图片的车牌候选区域M1,包括:
    按照预设的扫描顺序,获得所述待检测图片的各个像素行的有效像素段,其中,所述有效像素段为:根据像素行中灰度跳变值大于第二预设阈值的像素点确定的像素段;
    根据各个有效像素段两端像素点的像素值和与该有效像素段垂直相邻的有效像素段两端像素点的像素值,计算垂直相邻的有效像素段的边界相似程度;
    对边界相似程度大于第三预设阈值的相邻有效像素段进行合并处理;
    根据合并处理后的有效像素段,获得所述待检测图片的车牌候选区域M1
  3. 根据权利要求2所述的方法,其特征在于,所述按照预设的扫描顺序,获得所述待检测图片的各个像素行的有效像素段,包括:
    按照预设的扫描顺序,通过以下步骤获得所述待检测图片的每一像素行的有效像素段:
    计算像素行X中每一像素点的灰度跳变值,其中,所述像素行X为所述待检测图片中的任一像素行;
    选择灰度跳变值大于第二预设阈值的像素点;
    根据所选择的像素点中水平坐标最大和最小的像素点,获得所述像素行X上的候选像素段;
    判断所述候选像素段内各个像素点的灰度跳变值是否与预设的灰度跳变规则相匹配;
    若为是,则确定所述候选像素段为有效像素段。
  4. 根据权利要求2所述的方法,其特征在于,所述根据合并处理后的有效像素段,获得所述待检测图片的车牌候选区域M1,包括:
    确定合并处理后的有效像素段中的疑似字符串区域;
    根据所述疑似字符串区域中像素点的像素值,获得字符串颜色信息,并根据合并处理后的有效像素段中非所述疑似字符串区域中像素点的像素值,获得背景颜色信息;
    根据所述字符串颜色信息和所述背景颜色信息,确定车牌候选区域的边界;
    根据所确定的边界获得车牌候选区域M1
  5. 根据权利要求1所述方法,其特征在于,所述根据预设的基于机器学习的回归算法,从所述车牌候选区域M1中重新确定车牌候选区域M2,包括:
    确定所述车牌候选区域M1中疑似字符串的位置;
    按照预设的基于机器学习的回归算法,根据所确定的位置,重新确定车牌候选区域的边界;
    根据所重新确定的边界获得车牌候选区域M2
  6. 根据权利要求1所述方法,其特征在于,所述第一预设分类模型通过以下方式获得:
    获得边界精确度大于预设精确度阈值的样本车牌区域和/或宽高比值小于所述第一预设阈值的样本车牌区域,并将所获得的样本车牌区域作为正样本;
    根据预设的机器学习算法和所述正样本,获得所述第一预设分类模型。
  7. 根据权利要求6所述方法,其特征在于,在所述根据预设的机器学习算法和所述正样本,获得所述第一预设分类模型之前,还包括:
    获得为非车牌区域的样本区域;
    按照所获得的样本区域的内容,对所获得的样本区域进行分类,得到多个类别的负样本;
    所述根据预设的机器学习算法和所述正样本,获得所述第一预设分类模型,包括:
    根据预设的机器学习算法、所述正样本和所述多个类别的负样本,获得所述第一预设分类模型。
  8. 根据权利要求1所述方法,其特征在于,所述方法还包括:
    在判断得到所述车牌候选区域M2不是车牌区域的情况下,判断所述车牌候选区域M2的亮度是否在预设的亮度范围内;
    若为否,则对所述车牌候选区域M2进行灰度均衡化处理;
    按照第二预设分类模型,判断灰度均衡化处理后的所述车牌候选区域M2是否为车牌区域,其中,所述第二预设分类模型,为通过机器学习算法对经灰度均衡化处理后的样本车牌区域进行学习获得的分类模型;
    若是车牌区域,则执行所述确定所述车牌候选区域M2为车牌区域,并根据所述车牌候选区域M2,生成检测结果的步骤。
  9. 一种车牌检测装置,其特征在于,所述装置包括:候选区域获得模块、宽高比值判断模块、候选区域确定模块、第一车牌区域判断模块和检测结果生成模块;
    其中,所述候选区域获得模块,用于根据待检测图片中像素点的像素值,获得所述待检测图片的车牌候选区域M1
    所述宽高比值判断模块,用于计算所述车牌候选区域M1的宽高比值,并判断所述宽高比值是否大于第一预设阈值,若为是,则触发所述候选区域确定模块;
    所述候选区域确定模块,用于根据预设的基于机器学习的回归算法,从所述车牌候选区域M1中重新确定车牌候选区域M2,其中,所述车牌候选区域M2为宽高比值不大于第一预设阈值的区域;
    所述第一车牌区域判断模块,用于按照第一预设分类模型,判断所述车牌候选区域M2是否为车牌区域,其中,所述第一预设分类模型,为通过机器学习算法对样本车牌区域进行学习获得的分类模型,若为是,则触发所述检测结果生成模块;
    所述检测结果生成模块,用于确定所述车牌候选区域M2为车牌区域,并根据所述车牌候选区域M2,生成检测结果。
  10. 根据权利要求9所述装置,其特征在于,所述候选区域获得模块,包括:有效像素段获得子模块、相似程度计算子模块、像素段合并子模块和候选区域获得子模块;
    其中,所述有效像素段获得子模块,用于按照预设的扫描顺序,获得所述待检测图片的各个像素行的有效像素段,其中,所述有效像素段为:根据像素行中灰度跳变值大于第二预设阈值的像素点确定的像素段;
    所述相似程度计算子模块,用于根据各个有效像素段两端像素点的像素值和与该有效像素段垂直相邻的有效像素段两端像素点的像素值,计算垂直相邻的有效像素段的边界相似程度;
    所述像素段合并子模块,用于对边界相似程度大于第三预设阈值的相邻有效像素段进行合并处理;
    所述候选区域获得子模块,用于根据合并处理后的有效像素段,获得所述待检测图片的车牌候选区域M1
  11. 根据权利要求10所述的装置,其特征在于,所述有效像素段获得子模块,具体用于:
    按照预设的扫描顺序,获得所述待检测图片的每一像素行的有效像素段;
    所述有效像素段获得子模块,包括:灰度跳变值计算单元、像素点选择单元、候选像素段获得单元、灰度跳变判断单元和有效像素段确定单元;
    其中,所述灰度跳变值计算单元,用于计算像素行X中每一像素点的灰度跳变值,其中,所述像素行X为所述待检测图片中的任一像素行;
    所述像素点选择单元,用于选择灰度跳变值大于第二预设阈值的像素点;
    所述候选像素段获得单元,用于根据所选择的像素点中水平坐标最大和最小的像素点,获得所述像素行X上的候选像素段;
    所述灰度跳变判断单元,用于判断所述候选像素段内各个像素点的灰度跳变值是否与预设的灰度跳变规则相匹配,若为是,则触发所述有效像素段确定单元;
    所述有效像素段确定单元,用于确定所述候选像素段为有效像素段。
  12. 根据权利要求10所述的装置,其特征在于,所述候选区域获得子模块,包括:疑似字符串区域确定单元、颜色信息获得单元、边界确定单元和候选区域获得单元;
    其中,所述疑似字符串区域确定单元,用于确定合并处理后的有效像素段中的疑似字符串区域;
    所述颜色信息获得单元,用于根据所述疑似字符串区域中像素点的像素值,获得字符串颜色信息,并根据合并处理后的有效像素段中非所述疑似字符串区域中像素点的像素值,获得背景颜色信息;
    所述边界确定单元,用于根据所述字符串颜色信息和所述背景颜色信息,确定车牌候选区域的边界;
    所述候选区域获得单元,用于根据所确定的边界获得车牌候选区域M1
  13. 根据权利要求9所述装置,其特征在于,所述候选区域确定模块,包 括:位置确定子模块、边界确定子模块和候选区域确定子模块;
    其中,所述位置确定子模块,用于确定所述车牌候选区域M1中疑似字符串的位置;
    所述边界确定子模块,用于按照预设的基于机器学习的回归算法,根据所确定的位置,重新确定车牌候选区域的边界;
    所述候选区域确定子模块,用于根据所重新确定的边界获得车牌候选区域M2
  14. 根据权利要求9所述装置,其特征在于,所述装置还包括:第一样本区域获得模块和分类模型获得模块;
    其中,所述第一样本区域获得模块,用于获得边界精确度大于预设精确度阈值的样本车牌区域和/或宽高比值小于所述第一预设阈值的样本车牌区域,并将所获得的样本车牌区域作为正样本;
    所述分类模型获得模块,用于根据预设的机器学习算法和所述正样本,获得所述第一预设分类模型。
  15. 根据权利要求14所述装置,其特征在于,所述装置还包括:第二样本区域获得模块和样本区域分类模块;
    其中,所述第二样本区域获得模块,用于获得为非车牌区域的样本区域;
    所述样本区域分类模块,用于按照所获得的样本区域的内容,对所获得的样本区域进行分类,得到多个类别的负样本;
    所述分类模型获得模块,具体用于:
    根据预设的机器学习算法、所述正样本和所述多个类别的负样本,获得所述第一预设分类模型。
  16. 根据权利要求9所述装置,其特征在于,所述装置还包括:亮度判断模块、灰度均衡化处理模块和第二车牌区域判断模块;
    其中,所述亮度判断模块,用于在判断得到所述车牌候选区域M2不是车牌区域的情况下,判断所述车牌候选区域M2的亮度是否在预设的亮度范围内, 若为否,则触发所述灰度均衡化处理模块;
    所述灰度均衡化处理模块,用于对所述车牌候选区域M2进行灰度均衡化处理;
    所述第二车牌区域判断模块,用于按照第二预设分类模型,判断灰度均衡化处理后的所述车牌候选区域M2是否为车牌区域,若是车牌区域,则触发所述检测结果生成模块,其中,所述第二预设分类模型,为通过机器学习算法对经灰度均衡化处理后的样本车牌区域进行学习获得的分类模型。
  17. 一种终端,其特征在于,所述终端包括:包括:壳体、处理器、存储器、电路板和电源电路,其中,所述电路板安置在所述壳体围成的空间内部,所述处理器和所述存储器设置在所述电路板上;所述电源电路,用于为所述终端的各个电路或器件供电;所述存储器用于存储可执行程序代码;所述处理器通过运行所述存储器中存储的可执行程序代码,以执行权利要求1-8任一项所述的车牌检测方法。
  18. 一种可执行程序代码,其特征在于,所述可执行程序代码用于在运行时执行权利要求1-8任一项所述的车牌检测方法。
  19. 一种存储介质,其特征在于,所述存储介质用于存储可执行程序代码,所述可执行程序代码被运行以执行权利要求1-8任一项所述的车牌检测方法。
PCT/CN2017/075941 2016-03-21 2017-03-08 一种车牌检测方法及装置 WO2017162023A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/086,789 US10769476B2 (en) 2016-03-21 2017-03-08 License plate detection method and device
EP17769300.9A EP3435279A4 (en) 2016-03-21 2017-03-08 METHOD AND DEVICE FOR DETECTION OF LICENSE PLATE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610160790.9A CN107220579B (zh) 2016-03-21 2016-03-21 一种车牌检测方法及装置
CN201610160790.9 2016-03-21

Publications (1)

Publication Number Publication Date
WO2017162023A1 true WO2017162023A1 (zh) 2017-09-28

Family

ID=59899361

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/075941 WO2017162023A1 (zh) 2016-03-21 2017-03-08 一种车牌检测方法及装置

Country Status (4)

Country Link
US (1) US10769476B2 (zh)
EP (1) EP3435279A4 (zh)
CN (1) CN107220579B (zh)
WO (1) WO2017162023A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110781887A (zh) * 2019-10-25 2020-02-11 上海眼控科技股份有限公司 车牌螺丝检测方法、装置和计算机设备
CN111027544A (zh) * 2019-11-29 2020-04-17 武汉虹信技术服务有限责任公司 一种基于视觉显著性检测的mser车牌定位方法及系统
CN111797694A (zh) * 2020-06-09 2020-10-20 浙江大华技术股份有限公司 一种车牌检测方法及装置

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108121984B (zh) * 2016-11-30 2021-09-21 杭州海康威视数字技术股份有限公司 一种字符识别方法及装置
CN110245544A (zh) * 2018-09-26 2019-09-17 浙江大华技术股份有限公司 一种确定停车状态的方法及装置
CN109948612A (zh) * 2019-03-19 2019-06-28 苏州怡林城信息科技有限公司 基于卷积网络的车牌检测方法、存储介质和检测设备
CN110807459B (zh) * 2019-10-31 2022-06-17 深圳市捷顺科技实业股份有限公司 车牌矫正方法、装置以及可读存储介质
CN111027560B (zh) * 2019-11-07 2023-09-29 浙江大华技术股份有限公司 文本检测方法以及相关装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4878248A (en) * 1988-04-18 1989-10-31 Industrial Technology Research Institute Method and apparatus for automatically recognizing license plate characters
CN101183425A (zh) * 2007-12-20 2008-05-21 四川川大智胜软件股份有限公司 粤港两地车牌定位方法
CN102375982A (zh) * 2011-10-18 2012-03-14 华中科技大学 一种融合多字符特征的车牌定位方法
CN103049742A (zh) * 2012-12-26 2013-04-17 四川九洲电器集团有限责任公司 一种车牌定位的方法
CN105205489A (zh) * 2015-08-27 2015-12-30 华南理工大学 基于颜色纹理分析器与机器学习的车牌检测方法

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI409718B (zh) * 2009-12-04 2013-09-21 Huper Lab Co Ltd 移動中車輛之車牌定位方法
TWI431559B (zh) * 2010-10-29 2014-03-21 Univ Nat Chiao Tung 車牌偵測辨識方法及其系統
US9104939B2 (en) * 2011-08-16 2015-08-11 Xerox Corporation Emergency rescue vehicle video based violation enforcement method and system
US9760789B2 (en) * 2012-04-17 2017-09-12 Conduent Business Services, Llc Robust cropping of license plate images
CN102999753B (zh) * 2012-05-07 2016-09-14 深圳市腾讯计算机系统有限公司 车牌定位方法
US8606011B1 (en) 2012-06-07 2013-12-10 Amazon Technologies, Inc. Adaptive thresholding for image recognition
US8698895B2 (en) * 2012-08-06 2014-04-15 Cloudparc, Inc. Controlling use of parking spaces using multiple cameras
CN103870803A (zh) * 2013-10-21 2014-06-18 北京邮电大学 一种基于粗定位与精定位融合的车牌识别方法和系统
US9569681B2 (en) * 2014-04-10 2017-02-14 Xerox Corporation Methods and systems for efficient image cropping and analysis
US10311731B1 (en) * 2014-09-16 2019-06-04 Knightscope, Inc. Autonomous parking monitor
US20160232410A1 (en) * 2015-02-06 2016-08-11 Michael F. Kelly Vehicle speed detection
US10706330B2 (en) * 2015-10-01 2020-07-07 Intellivision Technologies Corp Methods and systems for accurately recognizing vehicle license plates
CN105354570B (zh) * 2015-10-15 2019-04-09 深圳市捷顺科技实业股份有限公司 一种车牌左右边界精确定位的方法及系统
US9911055B2 (en) * 2016-03-08 2018-03-06 Conduent Business Services, Llc Method and system for detection and classification of license plates

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4878248A (en) * 1988-04-18 1989-10-31 Industrial Technology Research Institute Method and apparatus for automatically recognizing license plate characters
CN101183425A (zh) * 2007-12-20 2008-05-21 四川川大智胜软件股份有限公司 粤港两地车牌定位方法
CN102375982A (zh) * 2011-10-18 2012-03-14 华中科技大学 一种融合多字符特征的车牌定位方法
CN103049742A (zh) * 2012-12-26 2013-04-17 四川九洲电器集团有限责任公司 一种车牌定位的方法
CN105205489A (zh) * 2015-08-27 2015-12-30 华南理工大学 基于颜色纹理分析器与机器学习的车牌检测方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3435279A4 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110781887A (zh) * 2019-10-25 2020-02-11 上海眼控科技股份有限公司 车牌螺丝检测方法、装置和计算机设备
CN111027544A (zh) * 2019-11-29 2020-04-17 武汉虹信技术服务有限责任公司 一种基于视觉显著性检测的mser车牌定位方法及系统
CN111027544B (zh) * 2019-11-29 2023-09-29 武汉虹信技术服务有限责任公司 一种基于视觉显著性检测的mser车牌定位方法及系统
CN111797694A (zh) * 2020-06-09 2020-10-20 浙江大华技术股份有限公司 一种车牌检测方法及装置
CN111797694B (zh) * 2020-06-09 2024-05-28 浙江大华技术股份有限公司 一种车牌检测方法及装置

Also Published As

Publication number Publication date
CN107220579A (zh) 2017-09-29
EP3435279A1 (en) 2019-01-30
US10769476B2 (en) 2020-09-08
US20190073551A1 (en) 2019-03-07
CN107220579B (zh) 2020-02-04
EP3435279A4 (en) 2019-04-17

Similar Documents

Publication Publication Date Title
WO2017162023A1 (zh) 一种车牌检测方法及装置
CN108121986B (zh) 目标检测方法及装置、计算机装置和计算机可读存储介质
US20190188528A1 (en) Text detection method and apparatus, and storage medium
US8867828B2 (en) Text region detection system and method
CN110738125B (zh) 利用Mask R-CNN选择检测框的方法、装置及存储介质
US9430766B1 (en) Gift card recognition using a camera
WO2021026805A1 (zh) 对抗样本检测方法、装置、计算设备及计算机存储介质
US9436883B2 (en) Collaborative text detection and recognition
US8733650B1 (en) Decoding barcodes from images with varying degrees of focus
WO2018090771A1 (zh) 一种车牌识别方法及装置
WO2018121006A1 (zh) 一种车牌定位方法及装置
US10657651B2 (en) Systems and methods for detection of significant and attractive components in digital images
CN109784290B (zh) 一种目标检测方法、装置、设备及可读存储介质
CA2745730C (en) Method, apparatus and computer program product for providing an orientation independent face detector
CN111414888A (zh) 低分辨率人脸识别方法、系统、装置及存储介质
CN107977658B (zh) 图像文字区域的识别方法、电视机和可读存储介质
US20210390667A1 (en) Model generation
CN112215190A (zh) 基于yolov4模型的违章建筑检测方法
CN108268641A (zh) 发票信息识别方法及发票信息识别装置、设备和存储介质
CN105184294B (zh) 一种基于像素追踪的倾斜文字判断识别方法
CN105590112B (zh) 一种图像识别中倾斜文字判断方法
CN103810488A (zh) 图像特征提取方法、图像搜索方法、服务器、终端及系统
CN112949649B (zh) 一种文本图像的识别方法、装置及计算设备
CN112926471A (zh) 业务单据影像内容识别方法及装置
CN112990009A (zh) 基于端到端的车道线检测方法、装置、设备及存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2017769300

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2017769300

Country of ref document: EP

Effective date: 20181022

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

Ref document number: 17769300

Country of ref document: EP

Kind code of ref document: A1