CN116129415A - Night license plate detection method, system and storage medium - Google Patents

Night license plate detection method, system and storage medium Download PDF

Info

Publication number
CN116129415A
CN116129415A CN202211725023.XA CN202211725023A CN116129415A CN 116129415 A CN116129415 A CN 116129415A CN 202211725023 A CN202211725023 A CN 202211725023A CN 116129415 A CN116129415 A CN 116129415A
Authority
CN
China
Prior art keywords
license plate
image
night
data
gray
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211725023.XA
Other languages
Chinese (zh)
Inventor
许旻昱
陆音
陈子阳
郁建峰
徐兵荣
蔡奕杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi IoT Technology Co Ltd
Original Assignee
Tianyi IoT Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi IoT Technology Co Ltd filed Critical Tianyi IoT Technology Co Ltd
Priority to CN202211725023.XA priority Critical patent/CN116129415A/en
Publication of CN116129415A publication Critical patent/CN116129415A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/625License plates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/10Machine learning using kernel methods, e.g. support vector machines [SVM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground 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/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/50Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
    • 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/56Extraction of image or video features relating to colour
    • 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
    • G06V10/765Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects using rules for classification or partitioning the feature space
    • 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/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/778Active pattern-learning, e.g. online learning of image or video features
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a night license plate detection method, a system and a storage medium, which are applied to the technical field of artificial intelligence, and can realize night license plate detection and effectively improve the accuracy of night license plate detection. The method comprises the following steps: preprocessing an original image of a vehicle at night to obtain a gray level image of the vehicle at night; calculating a gray level map of the vehicle at night through a preset edge algorithm to obtain a first binary image; converting the original image of the night vehicle into HSV color model data to obtain an HSV color model image; performing preset binarization processing according to the HSV color model image to obtain a second binary image; combining the first binary image and the second binary image to obtain a combined image; morphological operation is carried out on the combined image to obtain license plate region data; extracting candidate license plate region images from original images of vehicles at night according to license plate region data; and predicting through a preset machine learning model according to the candidate license plate region image to obtain a night license plate detection result.

Description

Night license plate detection method, system and storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a night license plate detection method, a night license plate detection system and a storage medium.
Background
Intelligent traffic systems are widely used in cities to solve traffic problems. Wherein, license plate discernment plays an important role. The license plate detection task is to detect and extract a license plate region from an acquired vehicle image, and mainly comprises license plate positioning and license plate judgment. The license plate positioning needs to position a candidate license plate region image from the license plate image, and the license plate judgment extracts a real license plate region from the candidate license plate region image. With the continuous development of computer technology and machine vision technology, license plate detection technology is mature, and is widely applied to urban traffic management. However, license plate detection still faces challenges due to special weather, light, and the like. In the related art, the road surface illumination light source is limited at night, and the overall brightness of the image is low, so that the acquired vehicle image is often not clear enough, and the license plate detection accuracy is low.
Disclosure of Invention
In order to solve at least one of the technical problems, the invention provides a night license plate detection method, a system and a storage medium, which can realize night license plate detection and effectively improve the accuracy of night license plate detection.
In one aspect, the embodiment of the invention provides a night license plate detection method, which comprises the following steps:
preprocessing an original image of a vehicle at night to obtain a gray level image of the vehicle at night;
calculating the gray level map of the night vehicle through a preset edge algorithm to obtain a first binary image;
converting the night vehicle original image into HSV color model data to obtain an HSV color model image;
performing preset binarization processing according to the HSV color model image to obtain a second binary image;
combining the first binary image and the second binary image to obtain a combined image;
morphological operation is carried out on the combined image, and license plate region data are obtained;
extracting candidate license plate region images from the original images of the night vehicles according to the license plate region data;
and predicting through a preset machine learning model according to the candidate license plate region image to obtain a night license plate detection result.
The night license plate detection method provided by the embodiment of the invention has at least the following beneficial effects: in the embodiment, an original image of a night vehicle is preprocessed to obtain a gray level image of the night vehicle, so that the original image of the night vehicle is enhanced. Then, the embodiment calculates a gray level map of the night vehicle through a preset edge algorithm to obtain a first binary image. Meanwhile, the method converts the night vehicle original image into HSV color model data to obtain a corresponding HSV color model image, and performs preset binarization processing on the HSV color model image to obtain a second binary image. Then, the embodiment combines the first binary image and the second binary image to obtain a combined image by combining the edge feature and the color feature, so that license plate region data can be obtained more accurately through morphological operation. Then, the embodiment extracts a candidate license plate region image from the original image of the night vehicle according to the license plate region data, predicts the candidate license plate region image through a preset machine learning model, and judges whether the candidate license plate region image is a license plate region, so that a night license plate detection result is obtained, night license plate detection is realized, and the accuracy of night license plate detection is effectively improved.
According to some embodiments of the invention, the night vehicle original image is a gray scale image;
preprocessing an original image of a night vehicle to obtain a gray level image of the night vehicle, wherein the preprocessing comprises the following steps:
counting the number of pixel points corresponding to all gray values in the original image of the night vehicle to obtain first gray level data;
counting gray scales with the number of all pixels smaller than the preset number of pixels in the original image of the night vehicle according to the first gray scale data to obtain second gray scale data;
setting the gray value of the pixel point corresponding to each gray level in the second gray level data to be zero to obtain an intermediate image;
calculating a demarcation point threshold value of a license plate region and other regions according to the intermediate image;
counting the number of gray levels with the number of all pixels equal to zero in the license plate region according to the intermediate image to obtain license plate region gray data;
counting the number of gray scales with the number of all pixels equal to zero in the other areas according to the intermediate image to obtain gray data of the other areas;
constructing a target demarcation threshold according to the demarcation point threshold, the license plate region gray data and the other region gray data;
and carrying out local histogram equalization on the intermediate image according to the target demarcation threshold value to obtain the night vehicle gray scale map.
According to some embodiments of the invention, the computing the night vehicle gray scale map by a preset edge algorithm to obtain a first binary image includes:
and calculating the gray level map of the night vehicle through a Sobel edge algorithm to obtain the first binary image.
According to some embodiments of the invention, the HSV color model image includes hue channel data, saturation channel data, and brightness channel data;
the performing preset binarization processing according to the HSV color model image comprises the following steps:
constructing a preset license plate tone value range, a preset license plate color saturation value range and a preset license plate color brightness value range; the preset license plate tone value range comprises a blue license plate tone value range, a yellow license plate tone value range and a green license plate tone value range;
traversing all pixel points of the HSV color model image, setting 255 gray values corresponding to a first pixel point, in which the tone channel data meet the preset license plate tone value range, the saturation channel data meet the preset license plate color saturation value range, and the brightness channel data meet the preset license plate color brightness value range, and otherwise setting 0.
According to some embodiments of the invention, the combining the first binary image and the second binary image to obtain a combined image includes:
traversing the first binary image and the second binary image, setting the gray value of a fourth pixel point corresponding to the second pixel point in the combined image to 255 when the gray value of the second pixel point in the first binary image is 255 and the number of the pixel points with gray values not being 0 in a preset area in the second binary image is more than 0, otherwise setting the gray value of the fourth pixel point corresponding to the second pixel point in the combined image to 0; the preset area is an eight-connected area of a third pixel point corresponding to the second pixel point in the second binary image.
According to some embodiments of the present invention, the predicting, according to the candidate license plate region image, by a preset machine learning model, obtains a night license plate detection result, including:
performing binarization processing on the candidate license plate region image to obtain a license plate region binary image;
counting the number of pixel points with the pixel value of 1 in each row of pixel data in the license plate region binary image to obtain row data;
counting the number of pixel points with the pixel value of 1 in each column of pixel data in the license plate region binary image to obtain column data;
and predicting the row data and the column data as input features of the preset machine learning model to obtain the night license plate detection result.
According to some embodiments of the invention, the predicting the line data and the column data as input features of the preset machine learning model to obtain the night license plate detection result includes:
and inputting the row data and the column data into a support vector machine model for prediction to obtain the night license plate detection result.
On the other hand, the embodiment of the invention also provides a night license plate detection system, which comprises:
the preprocessing module is used for preprocessing the original image of the night vehicle to obtain a gray level image of the night vehicle;
the edge algorithm module is used for calculating the night vehicle gray level map through a preset edge algorithm to obtain a first binary image;
the conversion module is used for converting the night vehicle original image into HSV color model data to obtain an HSV color model image;
the binarization module is used for carrying out preset binarization processing according to the HSV color model image to obtain a second binary image;
the merging module is used for merging the first binary image and the second binary image to obtain a merged image;
the morphological operation module is used for performing morphological operation on the combined image to obtain license plate region data;
the extraction module is used for extracting candidate license plate region images from the original images of the night vehicles according to the license plate region data;
and the prediction module is used for predicting through a preset machine learning model according to the candidate license plate region image to obtain a night license plate detection result.
On the other hand, the embodiment of the invention also provides a night license plate detection system, which comprises:
at least one processor;
at least one memory for storing at least one program;
the at least one program, when executed by the at least one processor, causes the at least one processor to implement the night license plate detection method as described in the above embodiments.
In another aspect, an embodiment of the present invention further provides a computer storage medium, in which a program executable by a processor is stored, where the program executable by the processor is used to implement the method for detecting a license plate at night according to the above embodiment.
Drawings
FIG. 1 is a flowchart of a method for detecting a license plate at night according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of a night license plate detection system according to an embodiment of the present invention.
Detailed Description
The embodiments described in the present application should not be construed as limitations on the present application, but rather as many other embodiments as possible without inventive faculty to those skilled in the art, are intended to be within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
Before describing embodiments of the present application, related terms referred to in the present application will be first described.
HSV (Hue, saturation, value) color model: is a color space created from the visual properties of the colors, also known as a hexagonal pyramid model. The parameters of the colors in the model are hue (H), saturation (S) and brightness (V), respectively. The color is measured by an angle, the value range is 0-360 degrees, the color is calculated from red in a counterclockwise direction, the color is 0 degrees, the color is 120 degrees, and the color is 240 degrees. Saturation indicates how close a color is to a spectral color. One color can be seen as the result of a certain spectral color being mixed with white. The larger the proportion of the spectral color is, the higher the degree of the color approaching the spectral color is, and the higher the saturation of the color is. The saturation is high, and the color is deep and bright. The white light component of the spectral color is 0, and the saturation reaches the highest. The value range is usually 0% to 100%, and the larger the value is, the more saturated the color is. Brightness means the degree to which a color is bright, and for a light source color, the brightness value is related to the luminance of the illuminant. For the color of the object, this value is related to the transmittance or reflectance of the object. Typically the values range from 0% (black) to 100% (white).
Intelligent traffic systems are widely used and solve traffic problems in cities. Wherein, license plate discernment plays an important role. The license plate detection task is to detect and extract a license plate region from the acquired license plate image. The method comprises the steps of firstly locating a candidate license plate region from a license plate image, and extracting a real license plate region from the candidate license plate region. With the continuous development of computer technology and machine vision technology, license plate detection technology is mature, and is widely applied to urban traffic management. License plate detection is still challenging due to special weather, light, etc. For example, at night, the road surface illumination light source is limited, and the overall brightness of the image is low. Therefore, the acquired vehicle image tends to be insufficiently clear, which tends to cause the license plate detection accuracy to become low. In the related art, how to improve the accuracy of license plate detection at night becomes a problem to be solved.
Based on the above, an embodiment of the invention provides a night license plate detection method, which can realize night license plate detection and effectively improve the accuracy of night license plate detection. Referring to fig. 1, the method of the embodiment of the present invention includes, but is not limited to, step S110, step S120, step S130, step S140, step S150, step S160, step S170, and step S180.
Specifically, the method application process of the embodiment of the invention includes, but is not limited to, the following steps:
s110: preprocessing an original image of the vehicle at night to obtain a gray level image of the vehicle at night.
S120: and calculating the gray level map of the vehicle at night through a preset edge algorithm to obtain a first binary image.
S130: and converting the original image of the night vehicle into HSV color model data to obtain an HSV color model image.
S140: and carrying out preset binarization processing according to the HSV color model image to obtain a second binary image.
S150: and combining the first binary image and the second binary image to obtain a combined image.
S160: morphological operation is carried out on the combined image, and license plate region data are obtained.
S170: and extracting candidate license plate region images from the original images of the night vehicles according to the license plate region data.
S180: and predicting through a preset machine learning model according to the candidate license plate region image to obtain a night license plate detection result.
In the working process of the specific embodiment, the embodiment firstly preprocesses the acquired original image of the night vehicle to obtain a gray level image of the night vehicle. According to the embodiment, the original image of the night vehicle is preprocessed, so that the contrast of the original image of the night vehicle obtained in the night environment is enhanced. Then, the embodiment calculates the night gray level map through a preset edge algorithm to obtain a first binary image. Specifically, in this embodiment, by performing edge detection on the grayscale image of the vehicle at night, some irrelevant messages in the image are removed, and important structural attributes, that is, edge features, in the image are retained, so as to obtain a first binary image. Meanwhile, the embodiment converts the night vehicle original image into HSV color model data to obtain an HSV color model image. Then, the embodiment performs preset binarization processing on the HSV color image to obtain a second binary image. Specifically, the night vehicle original image acquired in the embodiment is an RGB color model image, and the embodiment extracts color features of the night vehicle original image by converting the night vehicle original image into an HSV color model and performing preset binarization processing on the obtained HSV color model image to obtain a second binary image. Further, in this embodiment, the first binary image and the second binary image are combined to obtain a combined image, and morphological operation is performed on the combined image to obtain license plate region data. Specifically, in this embodiment, by combining the edge feature and the color feature, the first binary image and the second binary image are combined, so that the obvious non-license plate region is removed from the combined image through morphological operation, and license plate region data is extracted. Then, the embodiment extracts corresponding candidate license plate region images from the original images of the night vehicles according to the extracted license plate region data. Further, the embodiment predicts the candidate license plate region image through a preset machine learning model, and judges whether the candidate license plate region is a license plate region, so that a night license plate detection result is obtained, night license plate detection is realized, and the accuracy of night license plate detection is effectively improved. According to the embodiment, the license plate region positioning is performed by combining the edge features and the color features, so that the accuracy of license plate positioning is effectively improved. Meanwhile, the extracted candidate license plate region images are analyzed and predicted through a preset machine learning model after training is finished, so that the accuracy and reliability of night license plate detection are effectively improved.
In some embodiments of the invention, the original image of the night vehicle is a gray scale image. Accordingly, preprocessing the original image of the night vehicle to obtain a gray scale image of the night vehicle, including but not limited to:
and counting the number of pixel points corresponding to all gray values in the original image of the night vehicle to obtain first gray level data.
And counting gray scales of which the number of all pixel points in the original image of the night vehicle is smaller than the preset number of pixels according to the first gray scale data to obtain second gray scale data.
And setting the gray value of the pixel point corresponding to each gray level in the second gray level data to be zero to obtain an intermediate image.
And calculating the demarcation point threshold value of the license plate region and other regions according to the intermediate image.
And counting the number of gray levels with the number of all pixels equal to zero in the license plate region according to the intermediate image to obtain the gray data of the license plate region.
And counting the number of gray levels with the number of all pixels equal to zero in other areas according to the intermediate image to obtain gray data of other areas.
And constructing a target demarcation threshold according to the demarcation point threshold, the license plate region gray data and other region gray data.
And carrying out local histogram equalization on the intermediate image according to the target demarcation threshold value to obtain a night vehicle gray scale image.
In this embodiment, the original image of the night vehicle is obtained as a gray scale image, for example, in the form of an 8-bit gray scale image. In the preprocessing process of the original image of the night vehicle, the embodiment firstly counts the number of pixel points corresponding to all gray values in the original image of the night vehicle to obtain first gray level data. For example, for a gray scale map of format 8 bits, the gray scale value range is [0,255], i.e., there are 256 gray scale values dividing the gray scale into corresponding 256 gray scale levels. The method includes the steps of firstly counting the number of pixel points corresponding to each gray value in an original image of a night vehicle to obtain first gray level data. Then, the embodiment calculates gray levels with the number of all pixels smaller than the preset number of pixels in the original image of the night vehicle according to the first gray level data to obtain second gray level data. Specifically, in this embodiment, gray levels, corresponding to gray levels, of pixel points in an original image of a night vehicle are counted according to the first gray level data, wherein the number of gray levels is smaller than a preset number of pixels, so as to obtain second gray level data. Illustratively, in this embodiment, gray levels with all pixel points less than 7 in the original image of the night vehicle are counted to obtain the second gray level data. When only 5 pixels corresponding to a certain gray level in the original image of the night vehicle are provided, the gray level is counted into the second gray level data. Further, in this embodiment, the gray value of the pixel point corresponding to each gray level in the second gray level data is set to zero, so as to obtain an intermediate image. For example, in this embodiment, the gray value of the pixel corresponding to the gray level with the number of all pixels smaller than 7 in the original image of the night vehicle is set to 0, so as to obtain the intermediate image. Then, the embodiment calculates the demarcation point threshold value of the license plate region and other regions according to the intermediate image. Specifically, in this embodiment, the calculation formula of the demarcation point threshold value t is shown in the following formula (1):
Figure BDA0004029363050000071
wherein t is a demarcation point threshold value, N is the total number of pixels with gray values not 0 in the intermediate image, t i Is the pixel gray value of the i-th point. This gives two segments: other segments are [1, t]The target segment is [ t+1,255]。
Further, in this embodiment, the number of gray levels of all pixels with the number equal to zero in the license plate region is counted according to the intermediate image to obtain the license plate region gray data, and meanwhile, the number of gray levels of all pixels with the number equal to zero in other regions is counted according to the intermediate image to obtain the other region gray data. Then, the embodiment constructs the target demarcation threshold according to the demarcation point threshold, the license plate region gray data and other region gray data. In an exemplary embodiment, first, the number of gray levels of which the number of all pixel points is equal to 0 in the license plate part and other parts, i.e., the license plate region and other regions, of the intermediate image are counted respectively, and the number of gray levels is recorded as a and B, i.e., the license plate region gray data and other region gray data respectively. These gray levels are then proportioned to license plate areas and other areas. In this embodiment, the allocation is performed according to the ratio of the whole gray level of the license plate region to the whole gray level of the other region stations, and the allocation formulas are shown in the following formulas (2) and (3):
Figure BDA0004029363050000072
Figure BDA0004029363050000073
wherein Q is in the formula 1 Number of gray levels allocated to other segments, Q 2 The number of gray levels assigned to the target segment.
After the allocation, a target demarcation threshold u is constructed as shown in the following formula (4):
u=t-A+Q 1 (4)
further, in this embodiment, local histogram equalization is performed on the intermediate image according to the target demarcation threshold value, so as to obtain a night vehicle gray scale map. Specifically, the present embodiment repartitions the gray scale intervals of the target end and other segments according to the target demarcation threshold value u, the other segments are extended to [1, u ], and the target segments are extended to [ u+1,255]. Next, in this embodiment, local histogram equalization is performed on two segments of [1, t ], [ t+1,255], as shown in the following formula (5):
Figure BDA0004029363050000074
wherein i is the original gray level, t i For the gray level after the equalization,
Figure BDA0004029363050000075
representing the cumulative distribution function of the ith gray level. n is n k ,n j Is the gray level s k At [1, t],[t+1,255]Total number of pixels in a region, n a ,n b The total number of pixels in the two sections having a frequency number greater than 0 gray scale.
In some embodiments of the present invention, the night vehicle gray scale map is calculated by a preset edge algorithm to obtain a first binary image, including but not limited to:
and calculating the gray level map of the vehicle at night by a Sobel edge algorithm to obtain a first binary image.
In this embodiment, the first binary image is obtained by calculating the gray level map of the night vehicle through the sobel edge algorithm. In particularIn this embodiment, sobel (Sobel) operation is performed on a preprocessed gray image, i.e., a night vehicle gray image, to obtain a binary image G x =(g 1 ,g 2 ,…g N ) The first binary image is used for extracting edge features in the night gray level image through the Sobel edge algorithm, so that the edge blurring degree is reduced, and the accuracy of license plate region positioning is improved.
In some embodiments of the invention, the HSV color model image includes hue channel data, saturation channel data, and brightness channel data. Accordingly, preset binarization processing is performed according to the HSV color model image, including but not limited to:
and constructing a preset license plate tone value range, a preset license plate color saturation value range and a preset license plate color brightness value range. The preset license plate tone value range comprises a blue license plate tone value range, a yellow license plate tone value range and a green license plate tone value range.
Traversing all pixel points of the HSV color model image, setting 255 to the gray value corresponding to the first pixel point of which the tone channel data meets the preset license plate tone value range and the saturation channel data meets the preset license plate color saturation value range, and setting 0 to the gray value corresponding to the first pixel point of which the brightness channel data meets the preset license plate color brightness value range.
In this particular embodiment, the HSV color model image includes hue channel data, saturation channel data, and brightness channel data. The method comprises the steps of firstly constructing a preset license plate tone value range, a preset license plate color saturation value range and a preset license plate color brightness value range, then traversing all pixel points of an HSV color model image, judging whether the corresponding preset range is met or not, and setting a corresponding gray value. Specifically, the preset license plate tone value range includes a blue license plate tone value range, a yellow license plate tone value range, and a green license plate tone value range. According to the embodiment, all pixel points in the HSV color model image are traversed, tone channel data in all pixel points meet the preset license plate tone value range, saturation channel data meet the preset license plate color saturation range, and brightness channel data are fullThe gray value corresponding to the first pixel point of the preset license plate brightness value range is set to 255. Meanwhile, the gradation value corresponding to the pixel point that does not satisfy the above condition is set to 0. Illustratively, the present embodiment converts a night vehicle raw image into an HSV color model image I HSV Then, the tone channel data h are respectively read i Saturation channel data s i Luminance channel data v i Where i=1, 2 … N. If h i E B or h i E G or h i E Y and S e S x ,v∈V x Let the gray value k corresponding to the pixel point i =255, otherwise 0, resulting in a binary image K c =(k 1 ,k 2 ,…k N ) I.e. a second binary image. Wherein B is the tone value range of the blue license plate, Y is the tone value range of the yellow license plate, G is the tone value range of the green license plate, S x For the color saturation range of license plate, V x And the color brightness value range of the license plate. In this embodiment, the license plate color saturation range and the license plate color brightness value range are set in a manner of obtaining an empirical value through multiple tests.
In some embodiments of the present invention, the first binary image and the second binary image are combined to obtain a combined image, including but not limited to:
traversing the first binary image and the second binary image, when the gray value of the second pixel point in the first binary image is 255 and the number of the pixels with gray values which are not 0 in the preset area in the second binary image is more than 0, setting the gray value of the fourth pixel point corresponding to the second pixel point in the combined image to 255, otherwise, setting to 0. The preset area is an eight-connected area of a third pixel point corresponding to the second pixel point in the second binary image.
In this embodiment, the present embodiment sets the corresponding gray values according to the relationship between the gray values of the corresponding pixels in the first binary image and the second binary image by traversing the first binary image and the second binary image, so as to construct the combined image. Specifically, the present embodiment first traverses the first binary image and the second binary image, when a pixel point in the first binary image is the secondAnd the gray value of the pixel point is 255, and meanwhile, in the eight-connected region of the third pixel point corresponding to the second pixel point in the second binary image, if the number of the pixel points with gray values not equal to 0 is larger than 0, the gray value of the fourth pixel point corresponding to the second pixel point in the combined image is set to 255, otherwise, the gray value of the fourth pixel point corresponding to the second pixel point in the combined image is set to 0, so that the combination of the first binary image and the second binary image is realized, the edge characteristics and the color characteristics of the images are combined, and the license plate positioning accuracy is improved. Illustratively, the first binary image in this embodiment is G x =(g 1 ,g 2 ,…g N ) The second binary image is K c =(k 1 ,k 2 ,…k N ) Combining the images into L B =(l 1 ,l 2 ,…l N ). If g i =255, and k i The number of pixels having a gray value other than 0 in the eight-connected region is not 0, l i =255, otherwise l i =0。
In some embodiments of the present invention, the night license plate detection node is obtained by predicting the candidate license plate region image through a preset machine learning model, including but not limited to:
and carrying out binarization processing on the candidate license plate region image to obtain a license plate region binary image.
And counting the number of pixel points with the pixel value of 1 in each line of pixel data in the binary image of the license plate region to obtain line data.
And counting the number of pixel points with the pixel value of 1 in each column of pixel data in the binary image of the license plate region to obtain column data.
And predicting the line data and the column data as input features of a preset machine learning model to obtain a night license plate detection result.
In this embodiment, the candidate license plate area image is binarized to obtain a license plate area binary image, and then the number of pixel points with a pixel value of 1 in each row of pixel data and each column of pixel data in the license plate area binary image is counted to obtain corresponding row data and column data. And then, predicting the row data and the column data as input features of a preset machine learning model to obtain a night license plate detection result. Specifically, in this embodiment, after a candidate license plate region image is extracted from an original image of a night vehicle according to license plate region data, binarization processing is performed on the candidate license plate region image. And then, respectively counting the number of 1 pixel values in each row and each column in the binary image of the license plate region to obtain corresponding row data and column data. Further, in this embodiment, a statistical histogram corresponding to the row data and the column data is used as an input feature of a preset machine learning model to predict, and whether the candidate license plate region is a license plate region is determined. According to the embodiment, the statistical histogram of the binary image of the license plate region in the horizontal and vertical directions is used as the input characteristic of the machine learning model, so that the accuracy of license plate recognition at night is effectively improved.
In some embodiments of the present invention, the row data and the column data are used as input features of a preset machine learning model to predict, so as to obtain a night license plate detection result, including but not limited to:
and inputting the row data and the column data into a support vector machine model for prediction to obtain a night license plate detection result.
In this embodiment, the license plate region prediction is performed by the support vector machine model. Specifically, in this embodiment, data and column data obtained through statistics are input into an SVM (support vector machine) model for prediction, so as to obtain a night license plate detection result. The SVM model is obtained through pre-training in the embodiment. In the embodiment, whether the candidate license plate area is the license plate area is judged through the support vector machine model, so that the accuracy of night license plate detection is improved.
One embodiment of the present invention also provides a night license plate detection system, including:
the preprocessing module is used for preprocessing the original image of the night vehicle to obtain a gray level image of the night vehicle.
The edge algorithm module is used for calculating the gray level map of the night vehicle through a preset edge algorithm to obtain a first binary image.
The conversion module is used for converting the original image of the night vehicle into HSV color model data to obtain an HSV color model image.
And the binarization module is used for carrying out preset binarization processing according to the HSV color model image to obtain a second binary image.
And the merging module is used for merging the first binary image and the second binary image to obtain a merged image.
And the morphological operation module is used for performing morphological operation on the combined image to obtain license plate region data.
And the extraction module is used for extracting candidate license plate region images from the original images of the night vehicles according to the license plate region data.
The prediction module is used for predicting through a preset machine learning model according to the candidate license plate region image to obtain a night license plate detection result.
Referring to fig. 2, an embodiment of the present invention further provides a night license plate detection system, including:
at least one processor 210.
At least one memory 220 for storing at least one program.
The at least one program, when executed by the at least one processor 210, causes the at least one processor 210 to implement the night license plate detection method as described in the above embodiments.
An embodiment of the present invention also provides a computer-readable storage medium storing computer-executable instructions for execution by one or more control processors, e.g., to perform the steps described in the above embodiments.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
While the preferred embodiment of the present invention has been described in detail, the present invention is not limited to the above embodiment, and various equivalent modifications and substitutions can be made by those skilled in the art without departing from the spirit of the present invention, and these equivalent modifications and substitutions are intended to be included in the scope of the present invention as defined in the appended claims.

Claims (10)

1. The night license plate detection method is characterized by comprising the following steps of:
preprocessing an original image of a vehicle at night to obtain a gray level image of the vehicle at night;
calculating the gray level map of the night vehicle through a preset edge algorithm to obtain a first binary image;
converting the night vehicle original image into HSV color model data to obtain an HSV color model image;
performing preset binarization processing according to the HSV color model image to obtain a second binary image;
combining the first binary image and the second binary image to obtain a combined image;
morphological operation is carried out on the combined image, and license plate region data are obtained;
extracting candidate license plate region images from the original images of the night vehicles according to the license plate region data;
and predicting through a preset machine learning model according to the candidate license plate region image to obtain a night license plate detection result.
2. The night license plate detection method according to claim 1, wherein the original image of the night vehicle is a gray scale image;
preprocessing an original image of a night vehicle to obtain a gray level image of the night vehicle, wherein the preprocessing comprises the following steps:
counting the number of pixel points corresponding to all gray values in the original image of the night vehicle to obtain first gray level data;
counting gray scales with the number of all pixels smaller than the preset number of pixels in the original image of the night vehicle according to the first gray scale data to obtain second gray scale data;
setting the gray value of the pixel point corresponding to each gray level in the second gray level data to be zero to obtain an intermediate image;
calculating a demarcation point threshold value of a license plate region and other regions according to the intermediate image;
counting the number of gray levels with the number of all pixels equal to zero in the license plate region according to the intermediate image to obtain license plate region gray data;
counting the number of gray scales with the number of all pixels equal to zero in the other areas according to the intermediate image to obtain gray data of the other areas;
constructing a target demarcation threshold according to the demarcation point threshold, the license plate region gray data and the other region gray data;
and carrying out local histogram equalization on the intermediate image according to the target demarcation threshold value to obtain the night vehicle gray scale map.
3. The night license plate detection method according to claim 1, wherein the calculating the grayscale image of the night vehicle by the preset edge algorithm to obtain a first binary image includes:
and calculating the gray level map of the night vehicle through a Sobel edge algorithm to obtain the first binary image.
4. The night license plate detection method of claim 1, wherein the HSV color model image includes hue channel data, saturation channel data, and brightness channel data;
the performing preset binarization processing according to the HSV color model image comprises the following steps:
constructing a preset license plate tone value range, a preset license plate color saturation value range and a preset license plate color brightness value range; the preset license plate tone value range comprises a blue license plate tone value range, a yellow license plate tone value range and a green license plate tone value range;
traversing all pixel points of the HSV color model image, setting 255 gray values corresponding to a first pixel point, in which the tone channel data meet the preset license plate tone value range, the saturation channel data meet the preset license plate color saturation value range, and the brightness channel data meet the preset license plate color brightness value range, and otherwise setting 0.
5. The night license plate detection method according to claim 1, wherein the combining the first binary image and the second binary image to obtain a combined image includes:
traversing the first binary image and the second binary image, setting the gray value of a fourth pixel point corresponding to the second pixel point in the combined image to 255 when the gray value of the second pixel point in the first binary image is 255 and the number of the pixel points with gray values not being 0 in a preset area in the second binary image is more than 0, otherwise setting the gray value of the fourth pixel point corresponding to the second pixel point in the combined image to 0; the preset area is an eight-connected area of a third pixel point corresponding to the second pixel point in the second binary image.
6. The night license plate detection method according to claim 1, wherein the predicting according to the candidate license plate region image through a preset machine learning model to obtain a night license plate detection result comprises:
performing binarization processing on the candidate license plate region image to obtain a license plate region binary image;
counting the number of pixel points with the pixel value of 1 in each row of pixel data in the license plate region binary image to obtain row data;
counting the number of pixel points with the pixel value of 1 in each column of pixel data in the license plate region binary image to obtain column data;
and predicting the row data and the column data as input features of the preset machine learning model to obtain the night license plate detection result.
7. The method for detecting a night license plate according to claim 6, wherein predicting the line data and the column data as input features of the preset machine learning model to obtain the night license plate detection result comprises:
and inputting the row data and the column data into a support vector machine model for prediction to obtain the night license plate detection result.
8. A night license plate detection system, comprising:
the preprocessing module is used for preprocessing the original image of the night vehicle to obtain a gray level image of the night vehicle;
the edge algorithm module is used for calculating the night vehicle gray level map through a preset edge algorithm to obtain a first binary image;
the conversion module is used for converting the night vehicle original image into HSV color model data to obtain an HSV color model image;
the binarization module is used for carrying out preset binarization processing according to the HSV color model image to obtain a second binary image;
the merging module is used for merging the first binary image and the second binary image to obtain a merged image;
the morphological operation module is used for performing morphological operation on the combined image to obtain license plate region data;
the extraction module is used for extracting candidate license plate region images from the original images of the night vehicles according to the license plate region data;
and the prediction module is used for predicting through a preset machine learning model according to the candidate license plate region image to obtain a night license plate detection result.
9. A night license plate detection system, comprising:
at least one processor;
at least one memory for storing at least one program;
the at least one program, when executed by the at least one processor, causes the at least one processor to implement the night license plate detection method of any one of claims 1 to 7.
10. A computer storage medium in which a processor-executable program is stored, wherein the processor-executable program, when executed by the processor, is for implementing the night license plate detection method of any one of claims 1 to 7.
CN202211725023.XA 2022-12-30 2022-12-30 Night license plate detection method, system and storage medium Pending CN116129415A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211725023.XA CN116129415A (en) 2022-12-30 2022-12-30 Night license plate detection method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211725023.XA CN116129415A (en) 2022-12-30 2022-12-30 Night license plate detection method, system and storage medium

Publications (1)

Publication Number Publication Date
CN116129415A true CN116129415A (en) 2023-05-16

Family

ID=86307458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211725023.XA Pending CN116129415A (en) 2022-12-30 2022-12-30 Night license plate detection method, system and storage medium

Country Status (1)

Country Link
CN (1) CN116129415A (en)

Similar Documents

Publication Publication Date Title
CN106599792B (en) Method for detecting hand driving violation behavior
Alvarez et al. Road detection based on illuminant invariance
CN102364496B (en) Method and system for identifying automobile license plates automatically based on image analysis
CN103824081B (en) Method for detecting rapid robustness traffic signs on outdoor bad illumination condition
CN101334836A (en) License plate positioning method incorporating color, size and texture characteristic
Le et al. Real time traffic sign detection using color and shape-based features
CN109948504B (en) Lane line identification method and device
CN110598560A (en) Night monitoring and identifying method and system based on neural network enhancement
CN107705254B (en) City environment assessment method based on street view
CN107844761B (en) Traffic sign detection method and device
US20170178341A1 (en) Single Parameter Segmentation of Images
CN113537037A (en) Pavement disease identification method, system, electronic device and storage medium
CN110782409A (en) Method for removing shadow of multi-motion object
CN112115800A (en) Vehicle combination recognition system and method based on deep learning target detection
CN111666811A (en) Method and system for extracting traffic sign area in traffic scene image
CN111723805A (en) Signal lamp foreground area identification method and related device
CN104156727A (en) Lamplight inverted image detection method based on monocular vision
CN111178359A (en) License plate number recognition method, device and equipment and computer storage medium
CN107066929B (en) Hierarchical recognition method for parking events of expressway tunnel integrating multiple characteristics
CN114821078B (en) License plate recognition method and device, electronic equipment and storage medium
CN109726708B (en) Lane line identification method and device
CN110633705A (en) Low-illumination imaging license plate recognition method and device
CN116863458A (en) License plate recognition method, device, system and storage medium
CN111241911A (en) Self-adaptive lane line detection method
CN110853000A (en) Detection method of track

Legal Events

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