CN111382736B - License plate image acquisition method and device - Google Patents
License plate image acquisition method and device Download PDFInfo
- Publication number
- CN111382736B CN111382736B CN201811643555.2A CN201811643555A CN111382736B CN 111382736 B CN111382736 B CN 111382736B CN 201811643555 A CN201811643555 A CN 201811643555A CN 111382736 B CN111382736 B CN 111382736B
- Authority
- CN
- China
- Prior art keywords
- license plate
- image
- block
- license
- adhered
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/255—Detecting or recognising potential candidate objects based on visual cues, e.g. shapes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
- G06V10/267—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/56—Extraction of image or video features relating to colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/60—Type of objects
- G06V20/62—Text, e.g. of license plates, overlay texts or captions on TV images
- G06V20/625—License plates
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
- Traffic Control Systems (AREA)
Abstract
The embodiment of the invention provides a license plate image acquisition method and device. The method comprises the steps of obtaining license plate photographing images of vehicles to be identified, determining suspicious candidate areas comprising adhered license plate images to be segmented, segmenting the suspicious candidate areas into a plurality of blocks, and determining target blocks corresponding to boundary positions of two license plates in the adhered license plate images according to the number of pixels of two interesting colors included in each block; and cutting the suspicious candidate region according to the target block. According to the embodiment of the invention, the suspicious candidate areas of the photographed image of the license plate are partitioned, the target blocks serving as the boundary are determined according to the pixel number of two interesting colors included in each block, and the image is cut, so that the problem of positioning and segmentation of a plurality of license plates with different colors, which are hung on a vehicle at the same time, can be solved, the positioning accuracy is higher, a foundation is laid for post-processing of license plate recognition, and the license plate recognition rate is improved.
Description
Technical Field
The embodiment of the invention relates to the technical field of image processing, in particular to a license plate image acquisition method and device.
Background
In recent years, the vehicle conservation amount and the traffic volume in China are continuously increased, and the work task of ground traffic management is becoming heavy. At present, the development of artificial intelligence is rapid, the effect of the intelligent traffic system is remarkable, and the information interaction is realized through digital and visual management, so that a plurality of problems in the traffic field are effectively solved. License plate recognition technology is an important component of an intelligent traffic system and is generally divided into five steps: license plate positioning, correction, preprocessing, type judgment and identification. The license plate positioning is a foundation and a core, and errors in each link are likely to cause deviation of a final recognition result.
License plate information is one of the most critical information of vehicles, and currently, in the intelligent traffic and intelligent community scene, a vehicle is generally hung on one license plate, and the license plate recognition level of the vehicles is higher. However, there are vehicles that need to hang multiple license plates at the same time, for example, as vehicles entering the ground of a bridge of the hong Kong and Shang, there are increasing vehicles that have the particularity that two license plates (called stuck license plates) are hung on the vehicle body at the same time, one license plate is a white-background black-character license plate outside the country, and the other license plate is a black-background white-character Guangdong Z Kong and Shang license plate. For the local government to manage the mud head vehicle in a standardized way, a local special license plate (such as blue license plate in Shenzhen area) is additionally arranged on the mud head vehicle.
The existing license plate positioning algorithm can be influenced by the mounting positions of a plurality of license plates of special vehicles, whether the traditional positioning algorithm based on character textures or the license plate positioning algorithm based on the deep learning frame can detect a plurality of adhered license plates at the same time, the subsequent license plate recognition is not facilitated, no recognition or false recognition is easily caused, and the license plate recognition rate is greatly reduced. Therefore, how to separate adhered license plates is a technical problem to be solved.
Disclosure of Invention
Aiming at the technical problems in the prior art, the embodiment of the invention provides a license plate image acquisition method and device.
In a first aspect, an embodiment of the present invention provides a method for acquiring a license plate image, including:
acquiring a license plate photographing image of a vehicle to be identified, and taking the region as a suspicious candidate region if the region including the adhesion license plate image to be segmented in the license plate photographing image is judged and known according to a preset rule;
dividing the suspicious candidate region into a plurality of blocks, and determining a target block corresponding to the boundary position of two license plates in the adhered license plate image according to the pixel number of two interesting colors included in each block; wherein the two interesting colors are respectively in one-to-one correspondence with the two license plates;
And performing image cutting on the suspicious candidate area according to the target block to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively.
In a second aspect, an embodiment of the present invention provides a license plate image acquiring apparatus, including:
the acquisition module is used for acquiring license plate photographing images of vehicles to be identified, and if the license plate photographing images comprise areas of adhesion license plate images to be segmented according to preset rules, the areas are used as suspicious candidate areas;
the determining module is used for dividing the suspicious candidate area into a plurality of blocks, and determining target blocks corresponding to the boundary positions of two license plates in the adhered license plate image according to the pixel number of two interesting colors included in each block; wherein the two interesting colors are respectively in one-to-one correspondence with the two license plates;
and the cutting module is used for carrying out image cutting on the suspicious candidate areas according to the target block so as to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively.
In a third aspect, an embodiment of the invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method as provided in the first aspect when the program is executed.
In a fourth aspect, embodiments of the present invention provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method as provided by the first aspect.
In a fifth aspect, an embodiment of the present invention provides a license plate image processing system,
the camera is used for acquiring license plate photographing images of the vehicles to be identified;
the first processor is connected with the camera and is used for judging whether the license plate photographed image comprises an area to be segmented, adhered to the license plate image or not according to a preset rule;
the second processor is connected with the first processor and is used for taking the region as a suspicious candidate region after the first processor judges that the region of the adhered license plate image to be segmented is included in the license plate photographed image, dividing the suspicious candidate region into a plurality of blocks, and determining the corresponding target blocks on the boundary positions of the two license plates in the adhered license plate image according to the pixel number of the two interesting colors included in each block; wherein the two interesting colors are respectively in one-to-one correspondence with the two license plates; image cutting is carried out on the suspicious candidate areas according to the target blocks so as to obtain license plate images corresponding to the two license plates in the adhered license plate images respectively;
And the third processor is respectively connected with the first processor and the second processor and is used for judging and knowing that the license plate photographing image does not comprise the area of the adhered license plate image to be segmented, or after the second processor obtains the license plate images respectively corresponding to the two license plates, license plate recognition processing is carried out on the license plate images of the single license plate sent by the first processor or the second processor.
According to the license plate image acquisition method and device, the suspicious candidate areas of the license plate photographed image are partitioned in blocks, the target blocks serving as the boundary are determined according to the pixel number of two interesting colors included in each block, and image cutting is performed, so that the problem of positioning and segmentation of a plurality of license plates with different colors, which are hung on a vehicle at the same time, can be solved, the positioning accuracy is high, a foundation is laid for post-processing of license plate recognition, and the license plate recognition rate is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a license plate image acquisition method according to an embodiment of the present invention;
fig. 2 is a flowchart of a license plate image acquisition method according to another embodiment of the present invention;
fig. 3a, fig. 3b, and fig. 3c are diagrams illustrating an example of license plate image cutting according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for acquiring license plate images according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a license plate image processing system according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
For vehicles hanging a plurality of license plates, for example, two license plates are hung, in the process of positioning the license plates according to the size, color or texture of the license plates in the prior art, when the same candidate area contains a plurality of adhered license plates, the boundaries of the license plates are difficult to define in the texture and color modes, so that the license plates cannot be identified. Aiming at the defects of the prior art, the embodiments of the invention provide a method and a device for acquiring adhered license plate images based on an image processing technology so as to realize the segmentation of adhered license plates. The technical scheme of the invention will be described through various embodiments.
Fig. 1 is a flowchart of a license plate image acquisition method according to an embodiment of the present invention, as shown in fig. 1, where the method includes:
the method embodiment can be executed by a license plate image acquisition device. Firstly, a license plate photographing image of a vehicle to be identified is obtained, wherein the vehicle to be identified can be a vehicle hanging two license plates, such as a mud head vehicle or a harbor and australian vehicle, and the vehicle is provided with adhered license plates, the adhesion mode of the two license plates can be horizontal side by side layout or vertical layout in the up-down direction, and the embodiment of the invention is not limited to the above. It can be understood that the license plate photographing image is an image of the head or tail of the vehicle to be identified with the adhered license plate, and the image can be a photo obtained by photographing with a camera or a frame of image selected from video streams photographed by a camera.
After the license plate photographing image of the vehicle to be identified is obtained, a preset rule can be adopted to preliminarily judge whether the license plate photographing image comprises the area of the adhesion license plate image to be segmented. It can be understood that the license plate photographing image can be divided into a plurality of image areas, if one image area comprises the adhered license plate image, the image area can be used as a suspicious candidate area, and image processing is carried out on the suspicious candidate area, so that the adhered license plate image is segmented, the image processing is not needed to be carried out on the whole license plate photographing image, and the working efficiency of subsequent image processing is improved.
It should be noted that, determining whether a license plate photographed image includes an adhered license plate image may be implemented by using a variety of existing technologies and rules, which are not limited in this embodiment of the present invention. Of course, in the subsequent method embodiments of the present invention, detailed development will be described as to how to determine according to the preset rule. It may be appreciated that if the area, which does not include the adhered license plate image to be segmented, in the license plate photographed image, that is, the image including only one license plate, is determined and known according to the preset rule, then other license plate detection processes, such as correction, preprocessing, type determination and identification processes, may be performed on the image of the single license plate in the prior art, and the embodiment of the present invention is not specifically limited and described for the subsequent processes
after the suspicious candidate region is acquired, subsequent image processing operations of the embodiment of the method are performed on the suspicious candidate region. Specifically, the suspicious candidate region is first divided into a plurality of blocks, and it is understood that the purpose of dividing the blocks is to find a target block adjacent to or even matching with the boundary line of two license plates in the adhered license plate image from among the divided blocks, and divide the block into two license plates as the boundary line. Therefore, it can be understood that the specific manner of dividing the blocks in the embodiment of the present invention should be related to the layout manner of the adhered license plates, and if the adhered license plates are arranged side by side, the division of the blocks may be along the horizontal direction (i.e. by columns); if the adhered license plates are vertically arranged, the partition of the blocks can be along the up-down direction (i.e. by row). Of course, it is not limited thereto, and it is understood that the tiles may be divided in other ways, for example, at a certain inclination angle, as long as the dividing line of two license plates can be found by the divided tiles.
The two interesting colors described in this embodiment are in one-to-one correspondence with the colors of the two license plates to be segmented. For example, for the treatment of a black-and-white adhered license plate of a harbor-Australian vehicle, one of the two interesting colors is black, and the other is white. For example, the treatment of the adhered license plate with blue and yellow license plates of the mud-head vehicle is aimed at, wherein one of the two interesting colors is blue, and the other color is yellow. After the division of the tiles, the number of pixels of the two colors of interest included in each tile is acquired, and the number of pixels of the black color included and the number of pixels of the white color included in each tile are determined, for example, by an image processing technique. After the number of pixels of two colors included in each block is obtained, the positions of the boundary lines of the two license plates in the adhered license plate image can be determined through the number of pixels of the color of interest of each block. It can be understood that, because the two license plates in the adhered license plates have different colors, the pixel color distribution at two sides of the boundary has a certain rule, for example, in the adhered license plates of black license plates and white license plates, one side of the boundary is characterized by the concentration of black pixels, and the other side of the boundary is characterized by the concentration of white pixels, so that the boundary positions of the two license plates in the adhered license plate image can be found according to the rule by dividing the blocks and obtaining the number of pixels of the interested colors included in each block, and the block positioned at the boundary position is determined.
And 102, performing image cutting on the suspicious candidate area according to the target block to obtain license plate images corresponding to the two license plates in the adhered license plate image.
After the target block is found, the suspicious candidate region may be image-cut with the target block as a boundary. Because the target block is positioned on the position of the dividing line, two adhered license plates can be divided according to the cutting of the target block, and license plate images corresponding to the two license plates can be obtained respectively.
It can be understood that the method embodiment is only a solution provided for positioning two license plates in the adhered license plates, after respective license plate images are obtained, other license plate detection processes, such as correction, preprocessing, type judgment and recognition processes, can be performed, and the subsequent processes are not particularly limited and described in the embodiment of the invention.
The embodiment of the method provides a license plate image acquisition method, which can solve the problem of positioning and segmentation of a plurality of license plates with different colors, which are hung on a vehicle at the same time, by dividing suspicious candidate areas of a license plate photographed image into blocks, determining target blocks serving as boundaries according to the number of pixels with two interesting colors, which are included in each block, and cutting the image.
On the basis of the above embodiments of the method, determining, according to the number of pixels of two interested colors included in each tile, a target tile corresponding to a boundary position of two license plates in the adhered license plate image, that is, searching for a license plate boundary may include the following steps:
step a1, counting the pixel numbers of two interesting colors included in each block, and calculating the difference value of the pixel numbers of the two interesting colors corresponding to each block;
for example, the suspicious candidate region may be segmented into n blocks of the same size in rows or columns. It can be understood that if the adhered license plates are arranged side by side, the license plates are cut in columns; if the adhered license plates are vertically distributed, the adhered license plates are divided according to rows, and the sizes of all the blocks are the same. After segmentation of the tiles, the number of pixels of two colors of interest, e.g., i, included in each tile is counted 1 And i 2 Representing the number of pixels of two colors of interest of the ith block, whose corresponding number of pixels differs by d i =i 1 -i 2 . Here, i 1 >i 2 . Step b1, respectively calculating the average value of the difference values of the pixel numbers corresponding to all the blocks on two sides of each block according to the difference values of the pixel numbers of the two interesting colors corresponding to each block;
Calculating the difference d of the pixel numbers of the two interesting colors corresponding to each block i =i 1 -i 2 Then, calculating the average value of the difference of the pixel numbers corresponding to all the blocks on both sides of each block, specifically, taking the jth block (n.gtoreq.1) as an example, the average value of the difference of the pixel numbers corresponding to the (j-1) blocks before the jth block is required to be calculatedAnd the average value +.of the difference value of the corresponding pixel numbers of the (n-j) blocks after the jth block>The +.>And->
For example, if n=10, j=5, the average value of the difference values of the corresponding pixel numbers of the 4 blocks before the 5 th block needs to be calculatedAnd the average value of the difference in the corresponding pixel numbers of the 5 blocks after the 5 th block +.>
And similarly, respectively calculating the average value of the difference values of the pixel numbers corresponding to all the blocks on both sides of each block.
In this embodiment, the suspicious candidate region is segmented into n blocks with the same size, it will be understood that if the suspicious candidate region is segmented into n blocks with different sizes, the suspicious candidate region can be obtained by performing the calculationAnd->The formula of (2) can also be used for setting the weight value, and the value of the weight value is set according to different block sizes.
Step c1, calculating the variance of the pixel number corresponding to each block according to the difference value and the difference value average value;
and calculating the variance of the pixel number corresponding to each block after calculating and obtaining the difference value corresponding to each block and the average value of the difference values.
And d1, determining the target block according to the variance of the pixel number corresponding to each block.
Specifically, the sum of variances D of the numbers of pixels corresponding to all the blocks on both sides of each block is calculated by applying the following formula j And will beAnd determining the block with the smallest sum of the corresponding variances as the target block.
The calculation formula is as follows:find j min Make->And if the sum of all variances is the minimum value, the position corresponding to the jth block is the boundary of the two license plates, the jth block is the target block, and the two license plates with the interesting colors can be obtained by dividing the blocks.
The method embodiment determines the target block based on the variance and the minimum mode, however, other modes capable of reflecting the minimum characteristic of the color variation on two sides of the target block are also possible, and the embodiment of the invention is not limited in detail.
On the basis of the above embodiments of the method, if the area including the adhered license plate image to be segmented in the license plate photographed image is determined and obtained according to a preset rule, the area is used as a suspicious candidate area, the method may include the following steps:
Step a2, screening according to a preset aspect ratio threshold value to obtain a candidate region of at least one license plate photographed image;
the preset aspect ratio threshold can be determined according to the actual size of the adhered license plate to be positioned. The license plate photographed image is processed through a texture method, a plurality of candidate areas with different sizes can be obtained, and the candidate areas are screened through a preset aspect ratio example threshold value, so that one or a plurality of candidate areas with the sizes meeting the expected size are obtained.
It will be appreciated that since during the actual inspection process, other patterns may be detected in addition to the license plate, in order to screen out those patterns that are not license plates, embodiments of the present invention preset an aspect ratio threshold that is considered "likely to be a license plate" only if the aspect ratio of the pattern is within this threshold, otherwise the pattern is screened out.
Empirically, the aspect ratio of a standard license plate is around "5:1", and the threshold setting is relatively relaxed considering that there is a subsequent screening procedure. Generally, the aspect ratio of the pattern is between "2:1" and "7:1", and it is believed that the pattern may include a complete license plate. However, in the case of the embodiment of the present invention, there is license plate adhesion, and considering that the license plate adhesion increases the pattern width, the threshold of aspect ratio embodiment can be relaxed to "2:1 "to" 10: 1'. The data are empirical values, and the specific situation can be modified according to actual scene statistics.
Step b2, obtaining the sum of the pixel numbers of the two interesting colors in each candidate area, and calculating the duty ratio of the interesting colors;
after obtaining one or more candidate regions of a size that meets the expected size, it is necessary to further determine whether it is likely to include a stuck license plate image based on its color ratio. Specifically, the sum of the pixel numbers of the two interested colors in each candidate area is obtained, for example, if the adhered license plate to be positioned is a combination of a black license plate and a white license plate, the pixel number of all black pixels and the pixel number of all white pixels in each candidate area are obtained, and summation processing is performed. The duty cycle of the color of interest corresponding to each candidate region is calculated according to the following formula:
wherein the numerator "number of pixels of interest color" is the sum of the numbers of pixels of two interest colors in each candidate region, and the denominator "candidate region area" is the number of all pixels in the candidate region.
And c2, if judging that the occupancy ratio corresponding to a candidate area is higher than a preset threshold, determining an area including the adhered license plate image to be segmented in the license plate photographed image, and taking the candidate area as a suspicious candidate area.
If the color ratio corresponding to the candidate region is higher than the preset threshold value, determining that the region of the license plate photographed image, which comprises the adhered license plate image to be segmented, is the suspicious candidate region.
Further, in the embodiment of the present invention, it may be determined whether a pixel i is a pixel of a color of interest according to the following formula:
α+β+ig+γ iB > threshold (color 1); wherein iR, iG, iB are RGB values corresponding to pixel i, threshold (color 1) is a threshold corresponding to the color of interest; weights α, β, γ are determined from the color of interest. The color pixel of interest may be determined by RGB/YUV values or gray values of a picture, such as an RGB picture, by adjusting the weights to determine whether a pixel is in the color gamut of interest. It will be appreciated that there are different threshold values for black pixels and Bai Suxiang pixels, respectively, and that the corresponding three weights in the formula will also change. If the calculation result of the formula is greater than the threshold value, the pixel i can be considered to belong to the pixel of the interested color.
On the basis of the above embodiments of the method, the performing image cutting on the suspicious candidate area according to the target block to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively includes:
And cutting the suspicious candidate region according to the target block, and repairing two images obtained by cutting to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively. Specifically, after the boundary line is found and the suspicious candidate region is subjected to image cutting, some information may be lost due to the cutting of the image obtained by cutting, and in order to ensure the accuracy of the subsequent procedure, in this embodiment, the cut image may be appropriately repaired, and specific repairing means are not specifically limited, for example, the image is expanded or filled, so as to obtain the repaired license plate image.
The license plate image acquisition method provided by the embodiment of the invention is used for solving the problem that a plurality of license plates with different colors appear in a candidate area in the license plate positioning process, and can expand the application range to various adhesion license plate conditions, and is mainly divided into three parts: (1) Judging suspicious candidate areas to be processed according to preset aspect ratio and the duty ratio of pixels of the interested colors in the whole candidate areas; (2) Equally dividing the suspicious candidate area into n blocks according to rows or columns, calculating pixel difference values of two interested colors in each block, and traversing the variance of the pixel difference value of the current block in the i-1 areas on the left side and the sum of the variances of the n-i blocks on the right side of the current block from the preset i-th block; (3) And (3) finding out the minimum variance and the block where the minimum variance is located from the ith variance to the n-1 variance as a boundary, and correcting the width and the height of the image according to specific conditions to obtain the cut complete license plate.
The embodiment of the invention provides a method for cutting adhered license plates based on a variance blocking thought, which comprises the steps of carrying out blocking statistics on suspicious candidate areas, carrying out pixel difference of two different colors, traversing variances of each block in different sections to determine cutting positions, carrying out image segmentation on adhered license plates of the suspicious candidate areas, and leading target color identification candidate areas. The embodiment of the invention is simple, high-efficiency and low in cost, supports the side-by-side and up-and-down adhesion placement of a plurality of license plates with different base colors, and can accurately separate the adhered license plates at the positioning module, thereby improving the license plate recognition rate.
Fig. 2 is a flowchart of a license plate image acquisition method according to another embodiment of the present invention, as shown in fig. 2, where the method includes:
in this step, several abnormal aspect ratio regions that do not meet the preset aspect ratio case threshold may be screened out.
step 203, dividing the suspicious candidate region into a plurality of blocks, counting the pixel numbers of two interested colors included in each block, and calculating the difference value of the pixel numbers corresponding to each block;
in this embodiment, after the dividing line is divided according to the dividing line position, the two complete license plates can be obtained by repairing the images of the two license plates obtained by the dividing by using the target block.
Fig. 3a, fig. 3b, and fig. 3c are diagrams illustrating an example of license plate image cutting provided in an embodiment of the present invention, where fig. 3a is an image before cutting, and it can be seen that two license plates distributed side by side are included, one is a white license plate, and the other is a black license plate. After the image is cut, fig. 3b is an individual image of the white license plate obtained after cutting, and fig. 3c is an individual image of the black license plate obtained after cutting, and it can be seen that the images of the two license plates in the figure are effects after the image patch is performed by using the target area as the boundary after cutting.
In the process of the method, there are two situations without cutting, one is that if the target block is judged to be located at the edge position of the suspicious candidate area, the process is ended. And if judging that the ratio of the occupancy rate corresponding to any candidate area is higher than the preset threshold value, determining that the area of the license plate image to be segmented, which is adhered, is not included in the license plate photographed image, and ending the flow. The end of the procedure is understood as the end of the procedure of the license plate positioning link, and other processing links such as correction, preprocessing, type judgment, identification and the like follow, and the embodiment of the method does not specifically limit the follow-up processing links.
It should be noted that, part of the steps in the method embodiment are the same as the processing flows of part of the steps in the method embodiment, and reference may be made to the above method embodiments, which are not described herein.
The license plate image acquisition method provided by the embodiment of the invention has the advantages that the structure is simple and efficient, the adhered license plates can be separated by the candidate region screening module which is connected after coarse positioning/deep learning positioning, the performance cost is low, the method is simple and can be used for different chip platforms, the problem of positioning and dividing a plurality of license plates with different colors which are hung on a vehicle at the same time can be well solved, the foundation is laid for the post-processing of license plate recognition, and the license plate recognition rate is improved.
Fig. 4 is a schematic structural diagram of an acquisition device for license plate images according to an embodiment of the present invention, as shown in fig. 4, the device includes an acquisition module 401, a determination module 402, and a cutting module 403, where:
the obtaining module 401 is configured to obtain a license plate photographed image of a vehicle to be identified, and if it is determined that an area including an adhesion license plate image to be segmented in the license plate photographed image is known according to a preset rule, the area is used as a suspicious candidate area; the determining module 402 is configured to segment the suspicious candidate area into a plurality of blocks, and determine a target block corresponding to a boundary position of two license plates in the adhered license plate image according to the number of pixels of two interesting colors included in each block; wherein the two interesting colors are respectively in one-to-one correspondence with the two license plates; the cutting module 403 is configured to perform image cutting on the suspicious candidate area according to the target block, so as to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively.
Specifically, the acquiring module 401 acquires a license plate photographed image of a vehicle to be identified, where the vehicle to be identified may be a vehicle with two license plates suspended, such as a mud-head vehicle or a harbor-australian vehicle. It can be understood that the license plate photographing image is an image of the head or tail of the vehicle to be identified with the adhered license plate, and the image can be a photo obtained by photographing with a camera or a frame of image selected from video streams photographed by a camera. After acquiring the license plate photographed image of the vehicle to be identified, the acquiring module 401 may use a preset rule to perform preliminary judgment on whether the license plate photographed image includes the area of the adhesion license plate image to be segmented. If one of the image areas comprises the adhered license plate image, the image area can be used as a suspicious candidate area, and image processing is carried out on the suspicious candidate area in the follow-up process, so that the adhered license plate image is segmented, the image processing is not needed to be carried out on the whole license plate photographing image, and the working efficiency of the follow-up image processing is improved. The determining module 402 divides the suspicious candidate area into a plurality of blocks, and obtains the number of pixels of two interested colors included in each block after dividing the suspicious candidate area into a plurality of blocks, for example, determines the number of pixels of black color included in one block and the number of pixels of white color included in one block through an image recognition technology. After the number of pixels of the two colors included in each block is obtained, the positions of the boundary lines of the two license plates in the adhered license plate image can be determined through the number of pixels of the interested colors of each block. After the determining module 402 finds the target tile, the cutting module 403 may perform image cutting on the suspicious candidate region using the target tile as a boundary. Because the target block is positioned on the position of the dividing line, two adhered license plates can be divided according to the cutting of the target block, and license plate images corresponding to the two license plates can be obtained respectively.
The license plate image acquiring device provided by the embodiment of the invention is specifically used for executing the flow steps of the method embodiments, and specific functions of the license plate image acquiring device can participate in the method embodiments, and are not repeated here.
The embodiment of the invention provides a license plate image acquisition device, which can solve the problem of positioning and segmentation of a plurality of license plates with different colors, which are hung on a vehicle at the same time, has higher positioning accuracy, lays a foundation for post-processing of license plate recognition, and improves the license plate recognition rate by dividing a suspicious candidate region of a license plate photographed image and determining a target block serving as a boundary according to the number of pixels of two interesting colors included in each block and performing image cutting.
Fig. 5 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention, where, as shown in fig. 5, the electronic device may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke a computer program stored in memory 530 and executable on processor 510 to perform the transmission methods provided by the above embodiments, including, for example: acquiring a license plate photographing image of a vehicle to be identified, and taking the region as a suspicious candidate region if the region including the adhesion license plate image to be segmented in the license plate photographing image is judged and known according to a preset rule; dividing the suspicious candidate region into a plurality of blocks, and determining a target block corresponding to the boundary position of two license plates in the adhered license plate image according to the pixel number of two interesting colors included in each block; wherein the two interesting colors are respectively in one-to-one correspondence with the two license plates; and performing image cutting on the suspicious candidate area according to the target block to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in essence or a part contributing to the prior art or a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The electronic device provided by the embodiment of the present invention may specifically execute the flow of the license plate image obtaining method provided by the above method embodiments, and specifically reference may be made to the above method embodiments, which are not described herein again.
The embodiments of the present invention also provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the transmission method provided in the above embodiments, for example, including: acquiring a license plate photographing image of a vehicle to be identified, and taking the region as a suspicious candidate region if the region including the adhesion license plate image to be segmented in the license plate photographing image is judged and known according to a preset rule; dividing the suspicious candidate region into a plurality of blocks, and determining a target block corresponding to the boundary position of two license plates in the adhered license plate image according to the pixel number of two interesting colors included in each block; wherein the two interesting colors are respectively in one-to-one correspondence with the two license plates; and performing image cutting on the suspicious candidate area according to the target block to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively.
The computer program in the non-transitory computer readable storage medium provided by the embodiment of the present invention may be called to execute the flow of the license plate image obtaining method provided by each method embodiment, and specifically, reference may be made to each method embodiment described above, which is not repeated herein.
Fig. 6 is a schematic diagram of a license plate image processing system according to an embodiment of the present invention, as shown in fig. 6, the system includes a camera 601, a first processor 602, a second processor 603, and a third processor 604, where:
the camera 601 is used for acquiring license plate photographing images of vehicles to be identified; the first processor 602 is connected with the camera 601, and is configured to determine whether the license plate photographed image includes an area to be segmented, where the area is adhered to the license plate image, according to a preset rule; the second processor 603 is connected to the first processor 602, and is configured to determine, after the first processor 602 determines that an area including an adhered license plate image to be segmented in the license plate photographed image is known, the area as a suspicious candidate area, segment the suspicious candidate area into a plurality of blocks, and determine a target block corresponding to a boundary position of two license plates in the adhered license plate image according to the number of pixels of two interested colors included in each block; wherein the two interesting colors are respectively in one-to-one correspondence with the two license plates; image cutting is carried out on the suspicious candidate areas according to the target blocks so as to obtain license plate images corresponding to the two license plates in the adhered license plate images respectively; the third processor 604 is connected to the first processor 602 and the second processor 603, and is configured to determine that the license plate photographed image does not include the area of the adhered license plate image to be segmented in the license plate photographed image, or perform license plate recognition processing on the license plate image of the single license plate sent by the first processor 602 or the second processor 603 after the second processor 603 obtains the license plate images corresponding to the two license plates respectively.
Further, on the basis of the foregoing embodiment, the system may further include a display, connected to the third processor, for displaying a result of the identification of the license plate image of the single license plate by the third processor. The display may be a touch screen display or a non-touch screen display.
Still further, on the basis of the foregoing embodiment, the system may further include a charging processor connected to the third processor, and configured to perform parking charging on the identification result output by the third processor according to the entry time. After the third processor outputs the license plate image of the single license plate, the charging processor calculates the entering time according to the time when the vehicle suspending the license plate enters the parking lot and the current time, and performs parking calculation according to specific charging rules.
The license plate image processing system provided by the embodiment of the present invention may execute the license plate image acquisition method flow provided by the above method embodiments, and specifically, reference may be made to the above method embodiments, which are not described herein again. The system can identify the vehicles hanging a single license plate and the vehicles hanging two license plates, has wide application scene, is particularly suitable for identifying the vehicles adhered with the license plates and carrying out corresponding charging treatment, and improves the calculation management efficiency of the parking lot on various vehicles.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (17)
1. The license plate image acquisition method is characterized by comprising the following steps of:
acquiring a license plate photographing image of a vehicle to be identified, and taking the region as a suspicious candidate region if the region including the adhesion license plate image to be segmented in the license plate photographing image is judged and known according to a preset rule;
dividing the suspicious candidate area into a plurality of blocks based on the layout mode of the adhered license plates, and determining target blocks corresponding to the boundary positions of two license plates in the adhered license plate image according to the pixel number of two interesting colors included in each block; wherein the two interesting colors are respectively in one-to-one correspondence with the two license plates;
And performing image cutting on the suspicious candidate area according to the target block to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively.
2. The method according to claim 1, wherein the determining the target block corresponding to the boundary position of the two license plates in the adhered license plate image according to the number of pixels of the two interesting colors included in each block includes:
counting the number of pixels of two interesting colors included in each block, and calculating the difference value of the number of pixels of the two interesting colors corresponding to each block;
respectively calculating the average value of the difference values of the pixel numbers corresponding to all the blocks on two sides of each block according to the difference values of the pixel numbers of the two interesting colors corresponding to each block; if the layout mode is a side-by-side layout, the two sides of the block are the two sides of the block after the block is divided according to the column; if the layout mode is vertical layout, the two sides of the block are the two sides of the block after being divided according to the line;
calculating the variance of the pixel number corresponding to each block according to the difference value and the difference value average value;
and determining the target block according to the variance of the pixel quantity corresponding to each block.
3. The method of claim 2, wherein determining the target block based on the variance of the number of pixels corresponding to all blocks on both sides of each block comprises:
calculating the sum of variances of the pixel numbers corresponding to all the blocks on both sides of each block;
and determining the block with the minimum sum of the corresponding variances as the target block.
4. The method of claim 1, wherein determining whether pixel i is a pixel of a color of interest is performed according to the formula:
α+β+ig+γ iB > threshold (color 1); wherein iR, iG, iB are RGB values corresponding to pixel i, threshold (color 1) is a threshold corresponding to the color of interest; weights α, β, γ are determined from the color of interest.
5. The method according to claim 1, wherein the determining, according to a preset rule, that the license plate photographed image includes a region of the adhered license plate image to be segmented, and taking the region as a suspicious candidate region includes:
obtaining the sum of the pixel numbers of the two interesting colors in each candidate area, and calculating the duty ratio of the interesting colors;
if the occupation ratio corresponding to the candidate region is higher than the preset threshold value, determining the region including the adhered license plate image to be segmented in the license plate photographed image, and taking the candidate region as a suspicious candidate region.
6. The method of claim 5, wherein prior to the step of obtaining a sum of the number of pixels for the two colors of interest within each of the candidate regions, the method further comprises:
screening according to a preset aspect ratio threshold value to obtain a candidate region of at least one license plate photographed image.
7. The method of claim 1, wherein the segmenting the suspicious candidate region into a plurality of tiles comprises:
and dividing the suspicious candidate region into a plurality of blocks with the same size according to the rows or the columns.
8. The method according to any one of claims 1 to 7, wherein the performing image cutting on the suspicious candidate region according to the target block to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively includes:
and cutting the suspicious candidate region according to the target block, and repairing two images obtained by cutting to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively.
9. The method of claim 8, wherein the patching of the two images obtained from the cutting comprises:
And repairing the two images obtained by cutting by using the target block.
10. The method according to claim 1, wherein the method further comprises:
if the target block is judged to be located at the edge position of the suspicious candidate area, the process is ended.
11. The method of claim 5, wherein the method further comprises:
if judging that the occupancy ratio corresponding to any candidate area is higher than the preset threshold value, determining that the license plate photographed image does not include the area to be segmented, adhering the license plate image, and ending the flow.
12. An acquisition device of license plate image, characterized by comprising:
the acquisition module is used for acquiring license plate photographing images of vehicles to be identified, and if the license plate photographing images comprise areas of adhesion license plate images to be segmented according to preset rules, the areas are used as suspicious candidate areas;
the determining module is used for dividing the suspicious candidate area into a plurality of blocks based on the layout mode of the adhered license plate, and determining the corresponding target blocks on the boundary positions of the two license plates in the adhered license plate image according to the pixel number of the two interesting colors included in each block; wherein the two interesting colors are respectively in one-to-one correspondence with the two license plates;
And the cutting module is used for carrying out image cutting on the suspicious candidate areas according to the target block so as to obtain license plate images corresponding to the two license plates in the adhered license plate image respectively.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 11 when the program is executed.
14. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 11.
15. A license plate image processing system, comprising:
the camera is used for acquiring license plate photographing images of the vehicles to be identified;
the first processor is connected with the camera and is used for judging whether the license plate photographed image comprises an area to be segmented, adhered to the license plate image or not according to a preset rule;
the second processor is connected with the first processor and is used for taking the region as a suspicious candidate region after the first processor judges that the region of the adhered license plate image to be segmented is included in the license plate photographed image, segmenting the suspicious candidate region into a plurality of blocks based on the layout mode of the adhered license plate, and determining the corresponding target blocks on the boundary positions of the two license plates in the adhered license plate image according to the pixel number of the two interesting colors included in each block; wherein the two interesting colors are respectively in one-to-one correspondence with the two license plates; image cutting is carried out on the suspicious candidate areas according to the target blocks so as to obtain license plate images corresponding to the two license plates in the adhered license plate images respectively;
And the third processor is respectively connected with the first processor and the second processor and is used for judging and knowing that the license plate photographing image does not comprise the area of the adhered license plate image to be segmented, or after the second processor obtains the license plate images respectively corresponding to the two license plates, license plate recognition processing is carried out on the license plate images of the single license plate sent by the first processor or the second processor.
16. The system of claim 15, further comprising:
and the display is connected with the third processor and used for displaying the identification result of the third processor on the license plate image of the single license plate.
17. The system according to claim 15 or 16, further comprising:
and the charging processor is connected with the third processor and is used for carrying out parking charging on the identification result output by the third processor according to the entering time length.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811643555.2A CN111382736B (en) | 2018-12-29 | 2018-12-29 | License plate image acquisition method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811643555.2A CN111382736B (en) | 2018-12-29 | 2018-12-29 | License plate image acquisition method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111382736A CN111382736A (en) | 2020-07-07 |
CN111382736B true CN111382736B (en) | 2023-05-23 |
Family
ID=71219364
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811643555.2A Active CN111382736B (en) | 2018-12-29 | 2018-12-29 | License plate image acquisition method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111382736B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112784821A (en) * | 2021-03-06 | 2021-05-11 | 深圳市安比智慧科技有限公司 | Building site behavior safety detection and identification method and system based on YOLOv5 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10224640A (en) * | 1997-02-05 | 1998-08-21 | Canon Inc | Image processor and its method |
CN101751785A (en) * | 2010-01-12 | 2010-06-23 | 杭州电子科技大学 | Automatic license plate recognition method based on image processing |
CN202243250U (en) * | 2011-10-17 | 2012-05-30 | 郑琳芸 | Frame type three-dimensional license plate sticker |
CN109101945A (en) * | 2018-08-27 | 2018-12-28 | 贵阳学院 | A kind of more detection method of license plate in traffic video monitoring image |
-
2018
- 2018-12-29 CN CN201811643555.2A patent/CN111382736B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10224640A (en) * | 1997-02-05 | 1998-08-21 | Canon Inc | Image processor and its method |
CN101751785A (en) * | 2010-01-12 | 2010-06-23 | 杭州电子科技大学 | Automatic license plate recognition method based on image processing |
CN202243250U (en) * | 2011-10-17 | 2012-05-30 | 郑琳芸 | Frame type three-dimensional license plate sticker |
CN109101945A (en) * | 2018-08-27 | 2018-12-28 | 贵阳学院 | A kind of more detection method of license plate in traffic video monitoring image |
Also Published As
Publication number | Publication date |
---|---|
CN111382736A (en) | 2020-07-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108038883B (en) | Crack detection and identification method applied to highway pavement video image | |
CN107679520B (en) | Lane line visual detection method suitable for complex conditions | |
CN106203398B (en) | A kind of method, apparatus and equipment detecting lane boundary | |
CN108805042B (en) | Detection method for monitoring video sheltered from leaves in road area | |
WO2018040756A1 (en) | Vehicle body colour identification method and device | |
CN108416784B (en) | Method and device for rapidly extracting boundary of urban built-up area and terminal equipment | |
CN103310435B (en) | Combine vertical projection and optimal path the method split characters on license plate | |
CN107392139A (en) | A kind of method for detecting lane lines and terminal device based on Hough transformation | |
CN109948504B (en) | Lane line identification method and device | |
KR101246120B1 (en) | A system for recognizing license plate using both images taken from front and back faces of vehicle | |
CN110088766A (en) | Lane detection method, Lane detection device and non-volatile memory medium | |
CN108010044A (en) | A kind of method of video boundaries detection | |
CN103729828A (en) | Video rain removing method | |
CN109816720B (en) | Road center detection method, airborne equipment and storage medium | |
CN116630321B (en) | Intelligent bridge health monitoring system based on artificial intelligence | |
CN106022268A (en) | Identification method and device of speed limiting sign | |
CN111582100B (en) | Target object detection method and device | |
CN111382736B (en) | License plate image acquisition method and device | |
CN110188640B (en) | Face recognition method, face recognition device, server and computer readable medium | |
CN109766846B (en) | Video-based self-adaptive multi-lane traffic flow detection method and system | |
CN107832732B (en) | Lane line detection method based on treble traversal | |
CN111695374B (en) | Segmentation method, system, medium and device for zebra stripes in monitoring view angles | |
CN110619335A (en) | License plate positioning and character segmentation method | |
CN109934126A (en) | Vehicle tail smoke detection method and system | |
CN115620259A (en) | Lane line detection method based on traffic off-site law enforcement scene |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |