License plate recognition method, device, system and storage medium

By performing region extraction and feature parameter analysis on vehicle images, removing vehicle borders, and then segmenting and matching license plate characters, the problems of slow speed and low accuracy in existing license plate recognition technologies are solved, achieving more efficient license plate recognition.

CN116863458BActive Publication Date: 2026-02-24SHENZHEN JULONG CHUANGSHI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310875024.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-17
Publication Date
2026-02-24
Estimated Expiration
2043-07-17

AI Technical Summary

Technical Problem

Current license plate recognition technology is slow and inaccurate, and is easily affected by other factors in the image.

Method used

By extracting regions and analyzing feature parameters from vehicle images, the license plate area is determined. After removing the vehicle border, the license plate characters are segmented, and individual characters are identified through template matching to achieve license plate number recognition.

Benefits of technology

It improves the accuracy and speed of license plate recognition, reduces interference from vehicle borders, lowers the recognition difficulty, and quickly extracts license plate images through template matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116863458B_ABST
    Figure CN116863458B_ABST
Patent Text Reader

Abstract

The application relates to a license plate recognition method, device and system and a storage medium. The method is applied to a client and comprises the following steps: acquiring a front view image of a vehicle to be recognized, and performing grayscale processing on the front view image of the vehicle to be recognized; performing region extraction on the vehicle front view image after the grayscale processing, obtaining vehicle image regions and region characteristic parameters, and determining a license plate image region; performing binaryzation processing on the license plate image region, performing projection on the license plate image region after the binaryzation processing, removing a license plate frame, and performing segmentation on the license plate image region to obtain various license plate character images; performing normalization on the various license plate character images to obtain various normalized license plate character images; performing template matching on the various normalized license plate character images to output matching characters of various license plate characters; and sorting the matching characters of the various license plate characters according to corresponding license plate characters to obtain a recognized license plate number.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image recognition technology, and in particular to a license plate recognition method, device, system and storage medium. Background Technology

[0002] With the increasing number of motor vehicles and the growing traffic pressure, license plate recognition technology, as an important way to improve vehicle management efficiency, is widely used in automated supervision such as parking lot charging, traffic flow control, vehicle positioning, and highway speeding detection. It is an important component of modern intelligent transportation.

[0003] In existing technologies, the license plate area in a vehicle image is generally identified based on machine learning algorithms to obtain a license plate area image. The license plate area image is then input into a pre-trained machine learning model to perform character recognition on the license plate area and obtain the character content of the license plate.

[0004] However, using machine learning to recognize characters in license plate area images is slow and easily affected by other factors in the image, which reduces the accuracy of the recognition. Summary of the Invention

[0005] This application provides a license plate recognition method, device, system, storage medium, and computer program product to overcome the problems of slow recognition speed and low recognition accuracy in the prior art during license plate recognition.

[0006] Firstly, this application provides a license plate recognition method, including:

[0007] Obtain the front view image of the vehicle to be identified, and perform grayscale processing on the front view image of the vehicle to be identified to obtain the grayscale processed front view image of the vehicle.

[0008] Region extraction is performed on the grayscale vehicle front view image to obtain the image regions and region feature parameters of each vehicle, and the license plate image region is determined based on the region feature parameters of each vehicle region.

[0009] The license plate image region is binarized to obtain the binarized license plate image region;

[0010] Project the binarized license plate image region to remove the license plate border, and then segment the license plate image region to obtain individual license plate character images;

[0011] Normalize each license plate character image to obtain a normalized license plate character image;

[0012] Template matching is performed on each normalized license plate character image to output the matching character for each license plate character;

[0013] The matching characters of each license plate character are sorted according to their corresponding license plate characters to obtain the identified license plate number.

[0014] Optionally, region extraction is performed on the grayscale vehicle front view image to obtain each vehicle image region and its feature parameters. The license plate image region is determined based on the feature parameters of each vehicle region. This includes: performing opening and closing operations on the grayscale vehicle front view image to obtain the vehicle front view image after the opening and closing operations; extracting closed regions from the vehicle front view image after the opening and closing operations to obtain each vehicle image region; filtering rectangular regions from each vehicle image region and calculating the feature parameters of each rectangular region; comparing them with preset values, and determining the rectangular regions whose feature parameters are within the error range as the license plate image region.

[0015] Optionally, the binarized license plate image region is projected to remove the license plate border, and the license plate image region is segmented to obtain individual license plate character images. This includes: horizontally projecting the binarized license plate image region, counting the pixel values ​​in the vertical direction, and removing the vertical border based on the vertical pixel values ​​to obtain a binarized license plate image region without a vertical border; vertically projecting the binarized license plate image region without a vertical border, counting the pixel values ​​in the horizontal direction, and removing the horizontal border based on the horizontal pixel values ​​to obtain a borderless binarized license plate image region; horizontally projecting the borderless binarized license plate image region, counting the pixel values ​​in the vertical direction, and performing image segmentation based on the vertical pixel values ​​to obtain individual license plate character images.

[0016] Optionally, the license plate character images are normalized to obtain normalized license plate character images, including: dividing each license plate character image into a preset number of sub-regions; counting the total number of character points and the number of black character points in each sub-region, and determining the proportion of black character points based on the total number of character points and the number of black character points; for each sub-region, if the proportion of black character points in the sub-region exceeds a preset threshold, then the sub-region is converted into black pixels; otherwise, the sub-region is converted into a white pixel, thus obtaining a normalized license plate character image of a fixed pixel size.

[0017] Optionally, template matching is performed on each normalized license plate character image to output the matching character for each license plate character. This includes: extracting the feature values ​​of each normalized license plate character image and the feature values ​​of each template character; calculating the cross-correlation between the feature values ​​of each normalized license plate character image and the feature values ​​of each template character for each normalized license plate character image; taking the template character corresponding to the largest cross-correlation value as the character matching result of the normalized license plate character image, and outputting the matching character for the license plate character.

[0018] Optionally, the license plate image region is binarized to obtain a binarized license plate image region, including: obtaining the gray value of each pixel in the license plate image region, averaging the gray values ​​of all pixels to obtain the average gray value of the license plate image region; using the average gray value as the binarization threshold of the license plate image region, and binarizing the license plate image region to obtain a binarized license plate image region.

[0019] Optionally, obtaining a front view image of the vehicle to be identified includes: obtaining a video stream of the vehicle to be identified uploaded by a camera; obtaining the vehicle target in the video stream of the vehicle to be identified; and extracting image frames containing the front view image based on changes in the vehicle target to obtain a front view image of the vehicle to be identified.

[0020] Secondly, this application provides a license plate recognition device, including:

[0021] The acquisition module is used to extract the front view image of the vehicle to be identified and perform grayscale processing on the front view image of the vehicle to be identified to obtain the grayscale processed front view image of the vehicle.

[0022] The extraction module is used to extract regions from the grayscale vehicle front view image, obtain the image regions of each vehicle and their feature parameters, and determine the license plate image region based on the feature parameters of each vehicle region.

[0023] The binarization module is used to extract the license plate image region and perform binarization processing to obtain the binarized license plate image region;

[0024] The projection module is used to extract the region of the license plate image after binarization, project it, remove the license plate border, and segment the license plate image region to obtain the individual license plate character images.

[0025] The normalization module is used to extract and normalize each license plate character image to obtain each normalized license plate character image;

[0026] The matching module is used to extract templates from each normalized license plate character image and output the matching characters for each license plate character.

[0027] The sorting module is used to extract the matching characters of each license plate character and sort them according to the corresponding license plate characters to obtain the recognized license plate number.

[0028] Thirdly, this application provides a license plate recognition system, including: a camera and a server;

[0029] The camera is used to capture images of the vehicle to be identified;

[0030] The server is used to identify the license plate of the vehicle to be identified, and includes: at least one processor and memory;

[0031] The memory stores the instructions that the computer executes;

[0032] At least one processor executes computer execution instructions stored in memory, causing at least one processor to perform a license plate recognition method as described in any of the first aspects.

[0033] Fourthly, a computer storage medium storing computer execution instructions, which, when executed by a processor, implement the license plate recognition method as described in any of the first aspects.

[0034] Fifthly, this application provides a computer program product, comprising: a computer program; when the computer program is executed by a processor, it implements the license plate recognition method as described in any of the first aspects.

[0035] This application provides a license plate recognition method. It obtains a license plate region image by extracting a region from a vehicle image and analyzing its regional feature parameters. The method then segments the characters within the license plate region image, removing the vehicle border to obtain individual characters. These individual characters are then recognized one by one using template matching to obtain all the content of the license plate. Removing the vehicle border reduces interference and improves recognition accuracy. Recognizing individual license plate characters through template matching reduces the difficulty and increases the recognition speed. Furthermore, the rapid extraction of the license plate image using regional feature parameter analysis further enhances the speed of license plate recognition. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0037] Figure 1 This is a schematic diagram illustrating an application scenario provided in one embodiment of this application;

[0038] Figure 2 A flowchart illustrating a license plate recognition method provided in one embodiment of this application;

[0039] Figure 3 A flowchart illustrating the overall process of license plate recognition provided in one embodiment of this application;

[0040] Figure 4 A grayscale image and a binarized image of a license plate provided in one embodiment of this application;

[0041] Figure 5 This is a segmented image of a license plate binarization image provided in one embodiment of this application;

[0042] Figure 6 A normalized license plate character image provided in one embodiment of this application;

[0043] Figure 7 This is a schematic diagram of the structure of a license plate recognition device provided in one embodiment of this application;

[0044] Figure 8 This is a schematic diagram of the structure of a server provided in one embodiment of this application. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0046] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.

[0047] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.

[0048] In existing technologies, the vehicle image is first input into a pre-trained machine learning model for recognizing license plate regions to obtain the license plate region image. Then, the license plate region image is input into a pre-trained machine learning model for recognizing license plate characters to perform character recognition on the license plate region and obtain the character content of the license plate. However, the license plate recognition method in the existing technology requires two machine learning recognition operations on the vehicle image to obtain the character content of the license plate, which is slow. Furthermore, the use of machine learning to recognize characters in the license plate region image is easily affected by other factors in the image, resulting in low recognition accuracy.

[0049] To address the problems in the existing technology, this application provides a license plate recognition method, which involves extracting regions from a vehicle image to determine the license plate image region, segmenting the license plate image region to obtain license plate characters, and finally performing template matching on each segmented character to obtain the license plate recognition result.

[0050] refer to Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario provided in this application. For example... Figure 1 As shown, the system includes a camera 101 and a server 102. The camera 101 acquires a video stream of vehicle images and sends the video stream to the server 102 for license plate recognition. The server 102 extracts and analyzes the video stream acquired by the camera 101 to identify the vehicle's license plate. Specific implementation details can be found in the following embodiments.

[0051] refer to Figure 2 , Figure 2 This is a schematic flowchart of a license plate recognition method provided in one embodiment of this application. The execution subject of this embodiment can be... Figure 1 The server in the illustrated embodiment is not specifically limited in this embodiment. Figure 2 As shown, the method includes:

[0052] S201: Obtain the front view image of the vehicle to be identified, and perform grayscale processing on the front view image of the vehicle to be identified to obtain the grayscale processed front view image of the vehicle.

[0053] The front view image of the vehicle to be identified includes a front view and a rear view; grayscale conversion is an image processing technique that converts a color image into a grayscale image.

[0054] Specifically, the process involves acquiring the video stream of the vehicle to be identified uploaded by the camera; acquiring the vehicle target in the video stream of the vehicle to be identified; extracting image frames containing the front view image based on changes in the vehicle target to obtain the front view image of the vehicle to be identified; and combining the values ​​of the red, green, and blue channels of each pixel in the front view image of the vehicle to be identified in a certain proportion to make the front view image of the vehicle to be identified black and white or grayscale.

[0055] Furthermore, the video stream of the vehicle to be identified uploaded by the camera is acquired; the changes of a preset number of image frames in the video stream are compared to obtain the maximum dynamic target in the video stream, and the maximum dynamic target is determined to be the vehicle to be identified; the area of ​​the maximum dynamic target is calculated, and when the area of ​​the maximum dynamic target reaches its minimum, the current frame is determined to be the front view image frame of the vehicle to be identified, and the image frame is cropped to obtain the front view image of the vehicle to be identified; for each pixel, the values ​​of the red, green and blue channels of each pixel are weighted and averaged according to a preset ratio to obtain the grayscale value of each pixel and the grayscale vehicle image.

[0056] S202: Extract regions from the grayscale vehicle front view image to obtain the image regions and region feature parameters of each vehicle, and determine the license plate image region based on the region feature parameters of each vehicle region.

[0057] Among them, the vehicle image region consists of multiple closed image regions obtained during the region extraction process of the grayscale vehicle front view image; the region feature parameters include various features, such as the area, perimeter, width, height, aspect ratio, etc.

[0058] Specifically, the preset function in the preset software is used to extract regions from the grayscale vehicle front view image to obtain multiple closed vehicle image regions. Then, the regional feature parameters of the multiple closed vehicle image regions are calculated and compared with preset values. The rectangular regions whose regional feature parameters are within the error range are determined as the license plate region image.

[0059] For example, the regionprops function can be used to extract regions from a grayscale vehicle front view image.

[0060] S203: Perform binarization processing on the license plate image region to obtain the binarized license plate image region.

[0061] Binarization is the process of converting the grayscale value of each pixel in an image into either black or white.

[0062] Specifically, the grayscale value of each pixel in the license plate image area is obtained, and the grayscale value of each pixel is converted into a black or white pixel based on a preset binarization threshold.

[0063] S204: Project the binarized license plate image region, remove the license plate border, and segment the license plate image region to obtain individual license plate character images.

[0064] Projection is the process of summing the pixel values ​​of an image in a certain direction, thereby making the two-dimensional image one-dimensional.

[0065] Specifically, the pixel values ​​of the license plate image region after binarization are counted in the horizontal and vertical directions, and the horizontal border, vertical license plate border, and non-license plate character image region in the license plate image region are obtained based on the statistical results.

[0066] S205: Normalize each license plate character image to obtain normalized license plate character images.

[0067] Normalization involves adjusting the license plate character image to a fixed pixel size.

[0068] Specifically, each license plate character image is segmented to obtain a fixed number of sub-regions. Based on the proportion of black character points in each sub-region and a preset threshold, all character points in the sub-region are converted into black and white pixels to obtain a normalized license plate character image.

[0069] S206: Perform template matching on each normalized license plate character image and output the matching character for each license plate character.

[0070] Template matching is a pixel-level image processing algorithm that is typically used to find known patterns or features in an input image.

[0071] Specifically, for each normalized license plate character image, all template characters in the preset template are compared with each pixel of the normalized license plate character image, and the similarity between the template characters and the license plate character image is calculated. The template character corresponding to the maximum similarity is the matching character of the license plate character.

[0072] S207: Sort the matching characters of each license plate character according to the corresponding license plate character to obtain the recognized license plate number.

[0073] Specifically, the matching characters of each license plate character are sorted according to their preceding and following positions to obtain the recognized license plate number.

[0074] The solution proposed in this application achieves the following technical effects: By extracting regions from vehicle images and analyzing their feature parameters, a license plate region image is obtained. The characters in the license plate region image are then segmented, vehicle borders are removed, and individual characters are obtained. These individual characters are then recognized one by one using template matching, thus obtaining all the content of the license plate. Removing the vehicle border reduces interference and improves recognition accuracy. Recognizing individual license plate characters through template matching reduces recognition difficulty and increases recognition speed. Furthermore, the rapid extraction of the license plate image using region feature parameter analysis further improves the speed of license plate recognition.

[0075] In some embodiments, an opening and closing operation is performed on the grayscale vehicle front view image to obtain the vehicle front view image after the opening and closing operation; closed regions are extracted from the vehicle front view image after the opening and closing operation to obtain each vehicle image region; rectangular regions are selected from each vehicle image region, and the regional feature parameters of each rectangular region are calculated; compared with preset values, and the rectangular regions whose regional feature parameters are within the error range are determined as license plate region images.

[0076] Erosion and dilation are the basis of opening and closing operations. Erosion followed by dilation is the opening operation, and dilation followed by erosion is the closing operation. The preset values ​​are pre-defined regional feature parameters.

[0077] Specifically, the grayscale vehicle front view image is subjected to erosion and dilation processing to reduce noise. Preset functions in the software are used to extract closed regions from the eroded and dilated vehicle front view image, and each extracted vehicle image region is marked. Rectangular regions within each vehicle image region are selected, and the width and height of each rectangular region are calculated to obtain the aspect ratio. This aspect ratio is then compared with a preset aspect ratio; rectangular regions within the preset aspect ratio error range are identified as license plate region images.

[0078] The solution proposed in this application can achieve the following technical effects: erosion and dilation processing are performed on the grayscale vehicle front view image to obtain a clearer vehicle image, increasing the accuracy of license plate image region recognition and further enhancing the accuracy of license plate recognition. By analyzing the regional feature parameters of each vehicle image region, the license plate region image is determined without the need for feature extraction using machine learning algorithms, which greatly improves the recognition speed of license plate region images.

[0079] In some embodiments, the binarized license plate image region can be horizontally projected, the vertical pixel values ​​can be counted, and the vertical border can be removed based on the vertical pixel values ​​to obtain a binarized license plate image region without vertical borders; the binarized license plate image region without vertical borders can be vertically projected, the horizontal pixel values ​​can be counted, and the horizontal border can be removed based on the horizontal pixel values ​​to obtain a borderless binarized license plate image region; the borderless binarized license plate image region can be horizontally projected, the vertical pixel values ​​can be counted, and the image can be segmented based on the vertical pixel values ​​to obtain individual license plate character images.

[0080] Horizontal projection involves scanning the image from top to bottom, counting the pixel values ​​in the vertical direction, and obtaining the change of pixel values ​​in the horizontal direction. Vertical projection involves scanning the image from left to right, counting the pixel values ​​in the horizontal direction, and obtaining the change of pixel values ​​in the vertical direction. The pixel value is the number of white pixels.

[0081] Specifically, the binarized license plate image region is horizontally projected, and the number of white pixels in the vertical direction is counted. The position with the largest number of white pixels in the horizontal direction is obtained, and the same position in the horizontal direction is compared with the same position in the binarized license plate image region to obtain the vertical border region of the license plate. The vertical border region is then removed to obtain the binarized license plate image region without a vertical border. The binarized license plate image region without a vertical border is then vertically projected, and the number of white pixels in the horizontal direction is counted. The position with the largest number of white pixels in the vertical direction is obtained, and the same position in the horizontal direction is compared with the position without a vertical border. The same position in the vertical direction of the binarized license plate image region is horizontally divided to obtain the horizontal border region of the license plate. The horizontal border region is then removed to obtain the borderless binarized license plate image region. The borderless binarized license plate image region is then horizontally projected again to count the number of white pixels in the vertical direction. The positions where the number of white pixels in the horizontal direction is 0 or lower than a preset threshold are obtained. The same position in the horizontal direction of the borderless license plate image region is then vertically divided to obtain the non-license plate character region. The non-license plate character region is then removed to obtain the individual license plate character images.

[0082] The solution proposed in this application can achieve the following technical effects: by projection and statistical analysis of pixel values ​​in the horizontal and vertical directions, the license plate border and non-license plate character areas in the binarized license plate image area can be quickly identified, the binarized license plate image area can be segmented, and the license plate character area can be accurately obtained, thereby improving the speed and accuracy of license plate recognition.

[0083] In some embodiments, each license plate character image can be divided into a preset number of sub-regions; the total number of character points and the number of black character points in each sub-region are counted, and the proportion of black character points is determined based on the total number of character points and the number of black character points; for each sub-region, if the proportion of black character points in the sub-region exceeds a preset threshold, the sub-region is converted into black pixels; otherwise, the sub-region is converted into a white pixel, thus obtaining a normalized license plate character image with a fixed pixel size.

[0084] Among them, the character dot is the smallest unit of measurement for the size of the license plate character image.

[0085] Specifically, when the number of character points in the license plate character image is less than the number of sub-regions, such as when there are 2*2=4 character points, the top left and bottom right character points are black, and the number of pixels in the sub-region is 4*4=16, the pixels in the sub-region corresponding to the top left and bottom right character points in the license plate character image are black.

[0086] The solution proposed in this application can achieve the following technical effects: by normalizing the license plate character image, a character image with the same pixel value as the template character is obtained, which facilitates subsequent matching with the template character.

[0087] In some embodiments, feature values ​​of each normalized license plate character image and feature values ​​of each template character can be extracted; for each normalized license plate character image feature value, the cross-correlation between the feature value of the normalized license plate character image and the feature value of each template character can be calculated; the template character corresponding to the largest cross-correlation value is taken as the character matching result of the normalized license plate character image, and the matching character of the license plate character is output.

[0088] Among them, the feature quantity is the pixel of the character image; the template character is a pre-defined binarized character image; and the cross-correlation quantity is a measure of the correlation between two characters.

[0089] Specifically, pixel values ​​are extracted from each normalized license plate character image and each template character, and the pixel values ​​are converted into a two-dimensional matrix according to a preset order. For the two-dimensional matrix of pixel values ​​of each normalized license plate character image, the covariance between it and the two-dimensional matrix of pixel values ​​of each template character is calculated to obtain the cross-correlation between the pixels of the normalized license plate character image and each preset template character. The template character corresponding to the largest cross-correlation is taken as the character matching result of the normalized license plate character image, and the matching character of the license plate character is output.

[0090] The solution proposed in this application can achieve the following technical effects: by using template matching to identify normalized license plate character images one by one, the difficulty of identifying license plate character images is reduced, while the recognition speed is improved.

[0091] In some embodiments, the grayscale value of each pixel in the license plate image region can be obtained, and the average grayscale value of the license plate image region can be obtained by averaging the grayscale values ​​of all pixels. The average grayscale value is used as the binarization threshold of the license plate image region to perform binarization processing on the license plate image region, thereby obtaining the binarized license plate image region.

[0092] Specifically, an image processing library can be used to read the grayscale value of each pixel in the license plate image region and store it in a grayscale image of the same size as the license plate image region. In the grayscale image, the grayscale values ​​of all pixels are summed and divided by the total number of pixels to obtain the average grayscale value of the license plate image region. This average grayscale value is then used as a binarization threshold; pixels less than or equal to this threshold are set to 0 (black), and pixels greater than this threshold are set to 255 (white). Based on the selected threshold, the grayscale value of each pixel in the license plate image region is converted to either black or white, resulting in the binarized license plate image region.

[0093] The solution proposed in this application can achieve the following technical effects: the average gray value of the license plate image region is used as the binarization threshold to perform binarization processing on the license plate image region, resulting in a more accurate binarized image, which further enhances the accuracy of license plate recognition.

[0094] In some embodiments, a front view or rear view (frontal view) of the vehicle is captured by a camera. The vehicle license plate is located and extracted from the captured vehicle image. The characters in the license plate are segmented based on license plate features. The features of Chinese characters and other characters are extracted from the segmented license plate and recognized. The overall flowchart of license plate recognition is as follows: Figure 3 As shown.

[0095] step:

[0096] 1) Acquire images (front view images of the vehicle to be identified) using a camera device. Preprocess the input images, mainly performing grayscale conversion, grayscale correction, and image denoising. Grayscale conversion uses a weighted average method f(x,y)=0.30R(i,j)+0.59G(i,j)+0.11B(i,j), which calculates a weighted average of the RGB components.

[0097] 2) The license plate only occupies a small part of the image, so it is necessary to identify the license plate area. First, the image after opening and closing operations is processed to extract the region and calculate the region feature parameters. Based on the prior knowledge of the license plate (preset values), the region feature parameters are compared to extract the license plate area (license plate image area). The license plate width and height range and proportional relationship are used to initially locate the license plate.

[0098] The regionprops function is used to extract the license plate region. Each region in the image is labeled, then the feature parameters of each region are calculated, and finally the minimum rectangle width and height of the contained region are calculated. This gives the approximate location of the license plate.

[0099] 3) After locating the license plate image, license plate character segmentation can be performed, and the license plate can be binarized to highlight the characters. The grayscale mean of the entire license plate area is used as the binarization threshold. Then, the interference of the license plate border on character extraction is removed by removing the border through horizontal and vertical projection. Finally, the vertical grayscale projection method of the license plate area is used to achieve character region recognition and segmentation. The grayscale image and binary image of the license plate are shown below. Figure 4 As shown, after segmentation as Figure 5 As shown

[0100] 4) Due to the varying sizes of license plates, normalization of the segmented character images is necessary. The segmented characters are standardized into a fixed-pixel matrix. The fixed matrix size is set to 10×20 pixels. The conversion algorithm is as follows:

[0101] ① Divide the segmented characters into 10×20 sub-regions and calculate the number of pixels S in each region.

[0102] ② For each region, count the number of black dots (character dots) Ai, i=1,2,...,N, where N is the number of regions. Then Mi=Ai / S, i=1,2,...,N. If Mi>T, then Pi=1, otherwise Pi=0. The threshold T is set to 0.5.

[0103] ③ If Pi=1, the corresponding pixels in the conversion result area are black; otherwise, they are white. The result is as follows: Figure 6 As shown

[0104] 5) Use template matching algorithm to recognize characters after normalization. Extract several features from the image or image region f(i,j) to be recognized and compare them one by one with the corresponding features of the template T(i,j). Calculate the cross-correlation between them. The largest cross-correlation indicates the highest similarity. The image can be classified into the corresponding class. Finally, output the corresponding result.

[0105] Figure 7 This is a schematic diagram of the structure of a license plate recognition device provided in one embodiment of this application, as shown below. Figure 7 As shown, the license plate recognition device 700 of this embodiment includes: an acquisition module 701, an extraction module 702, a binarization module 703, a projection module 704, a normalization module 705, a matching module 706, and a sorting module 707.

[0106] The acquisition module 701 is used to extract the front view image of the vehicle to be identified and perform grayscale processing on the front view image of the vehicle to be identified to obtain the grayscale processed front view image of the vehicle.

[0107] The extraction module 702 is used to extract regions from the grayscale vehicle front view image to obtain each vehicle image region and region feature parameters, and to determine the license plate image region based on the region feature parameters of each vehicle region.

[0108] The binarization module 703 is used to extract the license plate image region and perform binarization processing to obtain the binarized license plate image region;

[0109] The projection module 704 is used to extract the region of the license plate image after binarization, project it, remove the license plate border, and segment the license plate image region to obtain the individual license plate character images.

[0110] The normalization module 705 is used to extract and normalize each license plate character image to obtain each normalized license plate character image;

[0111] The matching module 706 is used to extract template matching for each normalized license plate character image and output the matching character for each license plate character;

[0112] The sorting module 707 is used to extract the matching characters of each license plate character and sort them according to the corresponding license plate characters to obtain the recognized license plate number.

[0113] In one possible implementation, the extraction module 702 is specifically used to: perform opening and closing operations on the grayscale vehicle front view image to obtain the vehicle front view image after opening and closing operations; extract closed regions from the vehicle front view image after opening and closing operations to obtain each vehicle image region; filter rectangular regions in each vehicle image region and calculate the regional feature parameters of each rectangular region; compare with preset values, and determine the rectangular regions whose regional feature parameters are within the error range as license plate region images.

[0114] In one possible implementation, the projection module 704 is specifically used to: project the binarized license plate image region horizontally, count the pixel values ​​in the vertical direction, and remove the vertical border based on the vertical pixel values ​​to obtain a binarized license plate image region without vertical borders; project the binarized license plate image region without vertical borders vertically, count the pixel values ​​in the horizontal direction, and remove the horizontal border based on the horizontal pixel values ​​to obtain a borderless binarized license plate image region; project the borderless binarized license plate image region horizontally, count the pixel values ​​in the vertical direction, and perform image segmentation based on the vertical pixel values ​​to obtain images of each license plate character.

[0115] In one possible implementation, the normalization module 705 is specifically used to divide each license plate character image into a preset number of sub-regions; count the total number of character points and the number of black character points in each sub-region, and determine the proportion of black character points based on the total number of character points and the number of black character points; for each sub-region, if the proportion of black character points in the sub-region exceeds a preset threshold, the sub-region is converted into black pixels; otherwise, the sub-region is converted into a white pixel, thus obtaining a normalized license plate character image of a fixed pixel size.

[0116] In one possible implementation, the matching module 706 is specifically used to: extract the feature values ​​of each normalized license plate character image and the feature values ​​of each template character; calculate the cross-correlation between the feature values ​​of each normalized license plate character image and the feature values ​​of each template character for each normalized license plate character image; take the template character corresponding to the largest cross-correlation value as the character matching result of the normalized license plate character image, and output the matching character of the license plate character.

[0117] In one possible implementation, the binarization module 703 is specifically used to: obtain the gray value of each pixel in the license plate image region; average the gray values ​​of all pixels to obtain the average gray value of the license plate image region; use the average gray value as the binarization threshold of the license plate image region to perform binarization processing on the license plate image region to obtain the binarized license plate image region.

[0118] In one possible implementation, the acquisition module 701 is specifically used to: acquire the video stream of the vehicle to be identified uploaded by the camera; acquire the vehicle target in the video stream of the vehicle to be identified; and extract image frames containing the front view image based on the changes in the vehicle target to obtain the front view image of the vehicle to be identified.

[0119] The apparatus of this embodiment can be used to execute the method of any of the above embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0120] The license plate recognition system of this application includes a camera 101 and a server 102;

[0121] Camera 101 is used to capture images of the vehicle to be identified;

[0122] Server 102 is used to identify the license plate of the vehicle to be identified, wherein Figure 8 This is a schematic diagram of the structure of a server provided in one embodiment of this application, as shown below. Figure 8 As shown, the server 800 in this embodiment may include a memory 801 and a processor 802.

[0123] The memory 801 stores a computer program that can be loaded by the processor 802 and execute the methods described in the above embodiments.

[0124] The processor 802 and the memory 801 are connected, for example, via a bus.

[0125] Optionally, server 800 may also include a transceiver. It should be noted that in practical applications, the transceiver is not limited to one, and the structure of server 800 does not constitute a limitation on the embodiments of this application.

[0126] Processor 802 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 802 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0127] A bus can include a pathway for transmitting information between the aforementioned components. The bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only one thick line is used in the diagram, but this does not imply that there is only one bus or one type of bus.

[0128] The memory 801 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0129] The memory 801 stores application code that executes the scheme of this application, and its execution is controlled by the processor 802. The processor 802 executes the application code stored in the memory 801 to implement the content shown in the foregoing method embodiments.

[0130] Servers include, but are not limited to, servers for mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as servers for fixed terminals such as digital TVs and desktop computers. Figure 8 The server shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0131] The system in this embodiment can be used to execute the methods of any of the above embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0132] This application also provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute the methods described in the above embodiments.

[0133] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

Claims

1. A license plate recognition method, characterized in that, include: Obtain the front view image of the vehicle to be identified, and perform grayscale processing on the front view image of the vehicle to be identified to obtain the grayscale processed front view image of the vehicle. Region extraction is performed on the grayscale processed vehicle front view image to obtain each vehicle image region and region feature parameters, and the license plate image region is determined based on the region feature parameters of each vehicle region. The license plate image region is binarized to obtain a binarized license plate image region; The binarized license plate image region is projected to remove the license plate border, and the license plate image region is segmented to obtain individual license plate character images. The license plate character images are normalized to obtain normalized license plate character images; Template matching is performed on each of the normalized license plate character images to output the matching characters for each license plate character; The matching characters of each license plate character are sorted according to the corresponding license plate character to obtain the recognized license plate number; The process of extracting regions from the grayscale-processed vehicle front view image to obtain each vehicle image region and its feature parameters, and determining the license plate image region based on the region feature parameters of each vehicle region, includes: An opening and closing operation is performed on the grayscale vehicle front view image to obtain the vehicle front view image after the opening and closing operation. The closed regions are extracted from the front view image of the vehicle after the opening and closing operation is processed to obtain the image regions of each vehicle. Filter out rectangular regions from each of the vehicle image regions, and calculate the regional feature parameters of each rectangular region; The image is compared with preset values, and the rectangular area whose regional feature parameters are within the error range is determined as the license plate area image.

2. The method according to claim 1, characterized in that, The process of projecting the binarized license plate image region, removing the license plate border, and segmenting the license plate image region to obtain individual license plate character images includes: The binarized license plate image region is horizontally projected, and the pixel values ​​in the vertical direction are counted. The vertical border is removed based on the vertical pixel values ​​to obtain a binarized license plate image region without a vertical border. The license plate image region after binarization without vertical borders is vertically projected, the pixel values ​​in the horizontal direction are counted, and the horizontal borders are removed based on the pixel values ​​in the horizontal direction to obtain the license plate image region after binarization without borders. The borderless, binarized license plate image region is horizontally projected, and the pixel values ​​in the vertical direction are counted. Based on the pixel values ​​in the vertical direction, the image is segmented to obtain the images of each license plate character.

3. The method according to claim 1, characterized in that, The normalization of each license plate character image to obtain normalized license plate character images includes: Each of the license plate character images is divided into a predetermined number of sub-regions; Count the total number of character points and the number of black character points in each sub-region, and determine the proportion of black character points based on the total number of character points and the number of black character points; For each sub-region, if the proportion of black character points in the sub-region exceeds a preset threshold, the sub-region is converted into black pixels; otherwise, the sub-region is converted into a white pixel, resulting in a normalized license plate character image with a fixed pixel size.

4. The method according to claim 1, characterized in that, The step of performing template matching on each of the normalized license plate character images and outputting the matching characters for each license plate character includes: Extract the feature values ​​of each normalized license plate character image and the feature values ​​of each template character; For each normalized license plate character image, calculate the cross-correlation between the feature values ​​of the normalized license plate character image and the feature values ​​of each template character; The template character corresponding to the largest cross-correlation is taken as the character matching result of the normalized license plate character image, and the matching character of the license plate character is output.

5. The method according to claim 1, characterized in that, The step of binarizing the license plate image region to obtain the binarized license plate image region includes: The grayscale value of each pixel in the license plate image region is obtained, and the average grayscale value of the license plate image region is obtained by averaging the grayscale values ​​of all pixels. The average gray value is used as the binarization threshold of the license plate image region to perform binarization processing on the license plate image region, resulting in the binarized license plate image region.

6. The method according to claim 1, characterized in that, The process of obtaining a front view image of the vehicle to be identified includes: Acquire the video stream of the vehicle to be identified uploaded by the camera; Obtain the vehicle target in the video stream of the vehicle to be identified; Based on the changes in the vehicle target, image frames containing front view images are extracted to obtain the front view image of the vehicle to be identified.

7. A license plate recognition device, characterized in that, include: The acquisition module is used to extract the front view image of the vehicle to be identified and to perform grayscale processing on the front view image of the vehicle to be identified to obtain the grayscale processed front view image of the vehicle. The extraction module is used to extract regions from the grayscale processed vehicle front view image to obtain each vehicle image region and region feature parameters, and to determine the license plate image region based on the region feature parameters of each vehicle region. The binarization module is used to extract the license plate image region and perform binarization processing to obtain the binarized license plate image region; The projection module is used to extract the region of the binary license plate image, project it, remove the license plate border, and segment the license plate image region to obtain individual license plate character images. The normalization module is used to extract and normalize each license plate character image to obtain each normalized license plate character image; The matching module is used to extract template matching for each of the normalized license plate character images and output the matching characters for each license plate character; The sorting module is used to extract the matching characters of each license plate character and sort them according to the corresponding license plate characters to obtain the recognized license plate number; The process of extracting regions from the grayscale-processed vehicle front view image to obtain each vehicle image region and its feature parameters, and determining the license plate image region based on the region feature parameters of each vehicle region, includes: An opening and closing operation is performed on the grayscale vehicle front view image to obtain the vehicle front view image after the opening and closing operation. The closed regions are extracted from the front view image of the vehicle after the opening and closing operation is processed to obtain the image regions of each vehicle. Filter out rectangular regions from each of the vehicle image regions, and calculate the regional feature parameters of each rectangular region; The image is compared with preset values, and the rectangular area whose regional feature parameters are within the error range is determined as the license plate area image.

8. A license plate recognition system, characterized in that, include: Cameras and servers; The camera is used to capture images of the vehicle to be identified; The server is used to identify the license plate of the vehicle to be identified and includes at least one memory and processor; The memory is used to store program instructions; The processor is configured to call and execute program instructions in the memory to perform the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program; when the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Vehicle analysis system and analysis method based on video file

    CN107122777A