Carry out the method for binary conversion treatment for the label with local shadow region
Technical field
The present invention relates to image processing field, relate in particular to the binary conversion treatment field of image, specifically refer to a kind of method of carrying out binary conversion treatment for the label with local shadow region.
Background technology
Along with the continuous increase of China's automobile quantity and the develop rapidly of highway construction, the task of traffic administration is increasingly heavy, utilize computing machine and the information processing technology realize the robotization of traffic system and intelligent management particularly important.Wherein, license plate recognition technology is one of research topic in the intelligent transportation system field, and it also has wide market outlook and economic worth simultaneously for providing the wisdom urban construction that important technical support is provided.
The related research direction of license plate recognition technology is more, mainly contains Digital Image Processing, computer vision, pattern-recognition etc.The task of car plate identification is to process, analyze in the video flowing of picked-up with the image of information of vehicles, successively passes through the digital picture pre-service, locates and be partitioned into license plate area, automatically identifies the character on vehicle license.
From early 1990s, external researchist has just started the research to license plate identification.The See/Car System series of Israel Hi-Tech company, the VLPRS series of Singapore Optasia company is all the product of comparative maturity, wherein the VLPRS product mainly is fit to the car plate of Singapore, and the See/Car System of Hi-Tech company has the product of various deformation to adapt to respectively the car plate of some countries.The domestic research that has also started car plate identification in the nineties: the product of comparative maturity has " Han Wang Eye numberplate recognizing system " of Chinese princes and dukes department of automation research institute of the Chinese Academy of Sciences at present, also there is the product of oneself in Asia vision Science and Technology Ltd., Shenzhen Electronics Co., Ltd. of Jitong, the subordinate's of China's Ministry of Information Industry middle intelligence Jiaotong Electronics Co., Ltd etc., and the image of Xi'an Communications University is processed in addition and the Department of Automation of the computer science of Study of recognition chamber, Shanghai Communications University and engineering department, artificial intelligence National Key Laboratory of Tsing-Hua University, Zhejiang University etc. also done similarly and studied.Vehicle License Plate Recognition System has under lab obtained gratifying effect, but be difficult to be applied in Practical Project, this is because the environment in laboratory is in perfect condition, and in physical environment, due to the impact that is subject to the factors such as weather, discrimination is difficult to reach requirement, wherein because licence plate by stained or while being subject to outside shadow interference, OTSU license plate binary method commonly used has run into very large challenge.
When the car plate regional area during with shade, use traditional OTSU algorithm to process, the non-constant of binaryzation effect, because with the impact due to shade of the car plate of shadow region, after making the license plate image gray processing, the brightness of character is inconsistent, generally can not carry out binary conversion treatment based on a threshold value.
The license plate area binaryzation is directly connected to Character segmentation and the identification in car plate identification, therefore,, in order to improve the recognition efficiency of whole car plate identification, designs a kind of binarization method for car plate partial-band shade most important.
Summary of the invention
The objective of the invention is to overcome the shortcoming of above-mentioned prior art, provide a kind of can realize for the car plate with local shadow region carry out binary conversion treatment, improve the car plate recognition efficiency, easy to implement, have a broader applications scope carry out the method for binary conversion treatment for the label with local shadow region.
To achieve these goals, method of for the label with local shadow region, carrying out binary conversion treatment of the present invention has following formation:
Should carry out the method for binary conversion treatment for the label with local shadow region, its principal feature is that described method comprises the following steps:
(1) described label image is carried out gray processing and process, obtain gray level image;
(2) described gray level image is carried out rectangle and cut apart, obtain the rectangular area set;
(3) calculate luminance threshold and the bianry image of each rectangular area based on the edge statistics information of each rectangular area in the set of described rectangular area;
(4) calculate the bianry image of described gray level image based on temporal voting strategy.
Preferably, described step (1) is before, and is further comprising the steps of:
(0) described label detected and cuts apart, obtaining only comprising the label image of the rectangular shape of pending information.
Preferably, describedly described label image carried out gray processing process, obtain gray level image, comprise the following steps:
(11) judge whether described label image is coloured image, if so, continues step (12), if not, continues step (2);
(12) based on following formula, described label image is carried out gray processing and processes, obtain gray level image:
ImgGray=(R×299+G×587+B×114+500)/1000;
Wherein, ImgGray is the gray-scale value of the gray level image after processing, and R is the red color channel value of the label image before processing, and G is the green channel value of the label image before processing, and B is the blue channel value of the label image before processing.
Preferably, describedly described gray level image carried out rectangle cut apart, obtain the rectangular area set, comprise the following steps:
(21) suitable according to the quality Dynamic Selection of the described gray level image rectangle of cutting apart;
(22) use respectively four angle points of described gray level image and central point as initial point, described gray level image is carried out rectangle cut apart and obtain the rectangular area set.
Preferably, between described step (2) and step (3), further comprising the steps of:
(23) regular smoothing processing is carried out in each rectangular area in the rectangular area set of described gray level image.
Preferably, described edge statistics information based on each rectangular area in the set of described rectangular area is calculated luminance threshold and the bianry image of each rectangular area, comprises the following steps:
(31) brightness value of the both sides of edges of each rectangular area in statistics described rectangular area set;
(32) calculate the luminance threshold of each rectangular area in the set of described rectangular area;
(33) calculate the bianry image of each rectangular area in the combination of described rectangular area.
Preferably, the described bianry image that calculates described gray level image based on temporal voting strategy comprises the following steps:
(41) judge the brightness value of each location point of described gray level image based on temporal voting strategy;
(42) calculate the bianry image of described gray level image by combination.
Adopted and carried out the method for binary conversion treatment for the label with local shadow region in this invention, had following beneficial effect:
1, the present invention is a kind of digital image processing method, relates to an important integral link in license plate recognition technology.Use the method can significantly improve the binaryzation effect of band portion shadow region car plate, thereby make license plate image obtain more reasonably cutting apart, improve the accuracy rate of car plate identification under complex environment.
2, the range of application of binary processing method of the present invention not only is confined to car plate, and can comprise all has the label of shade or contamination by dust, has range of application widely.
Description of drawings
Fig. 1 is the process flow diagram that carries out the method for binary conversion treatment for the label with local shadow region of the present invention.
Fig. 2 is that method of for the label with local shadow region, carrying out binary conversion treatment of the present invention is applied to the process flow diagram that car plate is processed.
Fig. 3 is with the gray level image of the car plate of local shadow region in embodiments of the invention.
Fig. 4 is that in embodiments of the invention, the rectangle with the car plate of local shadow region is cut apart image.
Fig. 5 is with the bianry image of the car plate of local shadow region in embodiments of the invention.
Embodiment
, in order more clearly to describe technology contents of the present invention, below in conjunction with specific embodiment, conduct further description.
The objective of the invention is to propose a kind of for the binary processing method of car plate regional area with the shade situation.The new method that the present invention proposes comprises the partition strategy that car plate is carried out 5 directions, based on edge statistics information, calculates the threshold alpha i in binaryzation and calculates bianry image based on temporal voting strategy finally.
Method of the present invention is applied to have following steps with the method for the processing of the car plate of local shadow region:
Be illustrated in figure 1 as the process flow diagram that carries out the method for binary conversion treatment for the label with local shadow region of the present invention.
Be illustrated in figure 2 as method of for the label with local shadow region, carrying out binary conversion treatment of the present invention and be applied to the process flow diagram that car plate is processed.
In order to express easily, the image that uses the method to process is the rectangular area image I mgSource that only comprises car plate through car plate detects and partitioning algorithm splits from image.Namely before binary conversion treatment, need to proceed as follows car plate:
(0) described car plate detected and cuts apart, obtaining only comprising the license plate image ImgSource of the rectangular shape of pending information.
(1) calculate the gray level image ImgGray of described license plate image ImgSource.
Be illustrated in figure 3 as in embodiments of the invention the gray level image with the car plate of local shadow region.
If described license plate image ImgSource is coloured image, use following formula to carry out gray processing to this license plate image and process, obtain gray level image ImgGray:
ImgGray=(R×299+G×587+B×114+500)/1000;
Wherein, ImgGray is the gray-scale value of the gray level image after processing, R is the green channel value of the license plate image ImgSource before described processing for the red color channel value of the license plate image ImgSource before processing, G, and B is the blue channel value of the license plate image ImgSource before processing.
(2) described gray level image ImgGray is carried out rectangle and cut apart, obtain the rectangular area set.
Be illustrated in figure 4 as in embodiments of the invention with the rectangle of the car plate of local shadow region and cut apart image.
(21) according to the suitable rectangle Rect of quality Dynamic Selection of described gray level image ImgGray, it is wide is w, and height is h;
(22), respectively take four angle points of described gray level image ImgGray and central point as initial point, described gray level image ImgGray is carried out Rect cut apart and obtain a rectangular area S set;
(23) all rectangular areas in the S set of the described rectangular area of traversal, carrying out normalization process for each rectangular area Recti can be enough level and smooth.
(3) calculate luminance threshold and the bianry image of each rectangular area Recti based on the edge statistics information of each rectangular area Recti in the set of described rectangular area.
(31) use the Canny operator to calculate the brightness value at the edge of each rectangular area Recti in the set of described rectangular area;
(32), according to the brightness value of the both sides of edges of adding up, calculate the luminance threshold α i of each rectangular area Recti in the set of described rectangular area;
(33) calculate the bianry image Imgi of each rectangular area Recti in the set of described rectangular area.
(4), for each position (i, j) of image, according to temporal voting strategy, judge its brightness value, bianry image ImgBW is calculated in combination finally.
Be illustrated in figure 5 as in embodiments of the invention the bianry image with the car plate of local shadow region.
(41) judge the brightness value of each location point (i, j) of described gray level image based on temporal voting strategy;
(42) calculate the bianry image ImgBW of described gray level image by combination.
Adopted and carried out the method for binary conversion treatment for the label with local shadow region in this invention, had following beneficial effect:
1, the present invention is a kind of digital image processing method, relates to an important integral link in license plate recognition technology.Use the method can significantly improve the binaryzation effect of band portion shadow region car plate, thereby make license plate image obtain more reasonably cutting apart, improve the accuracy rate of car plate identification under complex environment.
2, the range of application of binary processing method of the present invention not only is confined to car plate, and can comprise all has the label of shade or contamination by dust, has range of application widely.
In this instructions, the present invention is described with reference to its specific embodiment.But, still can make various modifications and conversion obviously and not deviate from the spirit and scope of the present invention.Therefore, instructions and accompanying drawing are regarded in an illustrative, rather than a restrictive.