The disclosure relates to a computer implemented method for recognizing license plate image, and related computer product, computer-readable recording medium, and image recognizing apparatus using the same.
In many cities, video camcorder systems monitor traffic movements and potential criminal activities. As a result, violations of traffic rules and illegal behaviors no longer go undetected. However, such systems are expensive to run, the resolution of most video camcorders mounted in road intersections or on buildings in key locations is very low. Moreover, as the video clips are recorded outdoors, weather conditions may have a serious effect on the quality of the images, so they are often blurred. Under these circumstances, recognizing the characters in a blurred license plate image becomes a very important issue in investigations of a crime scene.
In order to recognize the characters in license plate images, some pattern recognition-based approaches have been proposed. In these approaches, a license plate recognition procedure can be divided into three steps: (1) license plate detection, (2) character segmentation, and (3) character recognition. The accuracy of pattern recognition-based approaches depends to a large extent on the result of character segmentation. However, it is well known that appropriate segmentation of the characters in a license plate image is a very difficult task because they are usually blurred and slanted if they are captured by a video camcorder.
In recent years, super-resolution-based image reconstruction has been proposed as an alternative way to tackle the license plate recognition problem. Unlike conventional pattern recognition approaches that perform recognition directly on a grabbed image frame, a super-resolution-based approach first tries to improve the quality of the grabbed frame. In super-resolution-based approaches, the current trend is to super-resolve multiple low-resolution images to a high-resolution image. However, a license plate is usually captured when the vehicle is moving. Hence, images captured in different time instances may provide different perspectives because they were captured in different angles in the field of view. This makes the registration task even more difficult.
Accordingly, the present disclosure is directed to a computer implemented method for recognizing license plate image, and related computer product, computer-readable recording medium, and image recognizing apparatus using the same, which can effectively recognize license plate numbers in a license plate image.
According to an embodiment of the present disclosure, a computer implemented method of recognizing a license plate image is provided. The method includes collecting a plurality of character template images and respectively homogenizing the character template images to generate a plurality of simulated character template images based on the license plate image. The method also includes respectively generating a plurality of similarity degrees corresponding to the simulated character template images by comparing the simulated character template images with the license plate image. The method further includes estimating at least one candidate character corresponding to the license plate image and at least one candidate character position corresponding to the at least one candidate character according to the similarity degrees corresponding to the simulated character template images.
According to an embodiment of the present disclosure, an image recognizing apparatus for recognizing a license plate image is provided. The image recognizing apparatus includes a database, an image extracting unit, a template simulating unit and an operation processing unit. The database is configured for storing a plurality of character template images. The image extracting unit is configured for extracting the license plate image. The template simulating unit is configured for respectively homogenizing the character template images to generate a plurality of simulated character template images based on the license plate image. The operation processing unit is configured for comparing the simulated character template images with the license plate image to respectively generate a plurality of similarity degrees corresponding to the simulated character template images and estimating at least one candidate character corresponding to the license plate image and at least one candidate character position corresponding to the at least one candidate character according to the similarity degrees corresponding to the simulated character template images.
According to an exemplary embodiment of the present disclosure, a computer program product is provided. The computer program product includes a plurality of program instructions, and the program instructions are suitable for being loaded into a computer system to execute the aforementioned method of recognizing a license plate image.
According to an exemplary embodiment of the present disclosure, a computer-readable recording medium for recording a program is provided, wherein the program executes the aforementioned method of recognizing a license plate image when the program is loaded into a computer system and executed by the same.
In order to make the aforementioned and other features of the present disclosure more comprehensible, several embodiments accompanied with figures are described in detail below.
The accompanying drawings are included to provide further understanding, and are incorporated in and constitute a part of this specification. The drawings illustrate exemplary embodiments and, together with the description, serve to explain the principles of the disclosure.
Referring to
The micro processing unit 102 is configured for controlling a whole operation of the image processing system 100. For example, the micro processing unit 102 may give instructions to the image recognizing apparatus 106 for recognizing a license plate image.
The buffer memory 104 is coupled to the micro processing unit 102 and is configured for temporarily storing data. In the present exemplary embodiment, the buffer memory 104 is a static random-access memory (SRAM), though the disclosure is not limited thereto, and in another exemplary embodiment, the buffer memory 104 can also be a dynamic random access memory or other memories.
The image recognizing apparatus 106 is coupled to the micro processing unit 102 and is configured for recognizing a license plate image. To be specific, the image recognizing apparatus 106 may recognize a license plate image, which is blurred or has a low-resolution, and output possible license plate numbers corresponding to the license plate image.
The image recognizing apparatus 106 includes a control unit 200, a database 202, an input interface unit 203, an image extracting unit 204, a template simulating unit 206, an operation processing unit 208 and an output unit 210.
The control unit 200 is configured for controlling a whole operation of the image recognizing apparatus 106.
The database 202 is coupled to the control unit 200 and configured for storing a plurality of character template images. To be specific, license plate numbers of license plates are composed of a plurality of characters. For example, in Taiwan, these characters include the letters (from A to Z) and the digits (from 0 to 9). Herein, these character template images are images of these characters. For example, these character template images are extracted and collected from a plurality of high-resolution license plate images.
The image extracting unit 204 is coupled to the control unit 200 and configured for extracting a license plate image to be recognized (hereinafter referred to as “a target license plate image”) in an image. To be specific, a license plate to be recognized is usually shown in an image captured by a video camcorder. Therefore, before recognizing a license plate shown in an image, it requires extracting a license plate image from the image. For example, in the exemplary embodiment, the image recognizing apparatus 106 includes an input interface unit 203 for selecting four corners (as points A˜D shown in
The template simulating unit 206 is coupled to the control unit 200 and configured for respectively homogenizing the character template images stored in the database 202 to generate a plurality of simulated character template images based on a target license plate image extracted by the image extracting unit 204. To be specific, in the present exemplary embodiment, the template simulating unit 206 may transform the character template images stored in the database 202 into a plurality of simulated character template images having the same characteristic as the target license plate image.
In the present exemplary embodiment, the template simulating unit 206 normalizes the size of each of the character template images. In particular, the template simulating unit 206 generates an inverse coordinate transformation matrix based on the target license plate image and normalizes the size of each of the character template images according to the inverse coordinate transformation matrix.
For example, in the present exemplary embodiment, the template simulating unit 206 identifies a plurality of symmetrical parts on a vehicle image in the image and rectifies the image to generate a rectified image. Then, the template simulating unit 206 uses original positions of the symmetrical parts in the image and new positions of the symmetrical parts in the rectified image to calculate a coordinate transformation matrix from the image to the rectified image, and thereby calculates the inverse coordinate transformation matrix according to the coordinate transformation matrix.
Referring to
In the rectifying algorithm, first, we let ln be the nth line segment drawn on the distorted image plane P, and Pnl, Pnr and Pnm be its left end point, right end point, and mid-point, respectively, as indicated in
where P(x, y) is a point on the distorted image plane P and P′(x′, y′) is the transformed point on the rectified plane P′. Then, we can find the directional transformation matrix Mp by solving the following over-determined system:
where (xn, yn) and (x′n, y′n) denote the positions of the nth corresponding control points. This system can be solved by minimizing the error:
E(m)=(Am−b)2 (3)
by
where AT denotes the transpose of A. By calculating each element of m, we can find the directional transformation matrix Mp to rectify the distorted image from the distorted image plane P to the rectified plane P′.
The directional transformation matrix Mp can be also obtained from a camera calibration unit 108 in
In another exemplary embodiment, the directional transformation matrix can be obtained from a 3D scene model reconstruction unit 110 in
Besides calculating the directional transformation matrix Mp, in the rectifying algorithm, a scaling transformation matrix Ms is calculated for normalize the size of the target license plate image. Herein, the scaling transformation matrix Ms may be computed by a formula (5):
where w and h are the width and height of the character region on the rectified plane P′, and wn and hn are the normalized width and height. Herein, the two transformation matrices can be combined into the coordinate transformation matrix M from the distorted image plane P to the rectified plane P′ as a formula (6):
M=Ms*Mp (6)
Accordingly, the template simulating unit 206 may generate the inverse coordinate transformation matrix M−1 according to the coordinate transformation matrix M.
Besides normalizing the size of each of the character template images, in the present exemplary embodiment, the template simulating unit 206 further normalizes the image quality of each of the character template images, such that each of the generated simulated character template images has the same image quality as the target license plate image.
For example, in the present exemplary embodiment, the template simulating unit 206 identifies a mean and a standard deviation of a gray level of the target license plate image and normalizes a gray level of each of the character template images based on a formula (7):
where Tc is the normalized character template images, C is the set of all character template images; It is the target license plate image; μIt and δIt are respectively the mean and standard deviation of all pixel intensities in the target license plate image; μIc and δIc are respectively the mean and standard deviation of all pixel intensities in each of the character template images.
Referring
Consequently, according to the inverse coordinate transformation matrix M−1 and the formula (7), the template simulating unit 206 may transform the character template images stored in the database 202 into the simulated character template images having the same size and gray level as the target license plate image.
Referring to
For example, in the present exemplary embodiment, the operation processing unit 208 figures out the similarity degrees by sliding each of the simulated character template images on the target license plate image. The left bottom, left top, right bottom, right top, or middle of the simulated character template image can be served as the reference point of the sliding. For example, in the present exemplary embodiment, the reference point is at left bottom. Therefore, the simulated character template image is moved along the x-axis of the target license plate image one pixel to the right each time. The distances of all the pixels between simulated character template image and the corresponding target license plate image are averaged. The inverse of the average distance is recorded as the similarity degree Sc at each start position, which is the corresponding position of the reference point, of the target license plate image. The similarity curve of each simulated character template image is thus formed by connecting all the similarity degrees in the start positions. The similarity degree between the simulated character template image and the target license plate image during the sliding process can be measured by the inverse of L1-distance or L2-distance.
Referring
where the size of each of the simulated character template images is M*N, and xp represents the start position on the x-axis of a sub-image in the target license plate image.
After generating similarity curves corresponding to all of the simulated character template images, the operation processing unit 208 obtains the maximum similarity curve by choosing the maximum similarity degree among the similarity degrees in all xp positions by a formula (9):
The bottom of
Referring to
X
cand
={x
cand
|S
max(x)≦Smax(xcand), where|xcand−x|<M/2} (10)
where M denotes the width of a simulated character template image.
Additionally, the operation processing unit 208 identifies corresponding candidate characters with the maximum similarity degree for each candidate character position Xcand. In the exemplary embodiment, the operation processing unit 208 takes the closest several characters according to a cutoff threshold for screening out qualified candidate characters with lower similarity degrees. For example, the operation processing unit 208 calculates the average of all the obtained similarity degrees and uses it as the cutoff threshold. However, it should be noted that the present disclosure is not limited thereof, and in another exemplary embodiment, the cutoff threshold can be predetermined as a fixed value. For example, the cutoff threshold may be set as 0.5.
In the present exemplary embodiment, the operation processing unit 208 further uses multiple-character template images based on the estimated candidate characters and the estimated corresponding candidate character positions to recognize a target license plate image and thereby estimates possible characters and possible character positions corresponding to the possible characters.
To be specific, the operation processing unit 208 combines the character template images to generate a plurality of multiple-character template images based on the estimated candidate characters and the corresponding candidate character positions. Then, the template simulating unit 206 homogenizes the multiple-character template images to generate a plurality of simulated multiple-character template images based on the license plate image. After that, the operation processing unit 208 respectively generates a plurality of similarity degrees corresponding to the simulated multiple-character template images by comparing the simulated multiple-character template images with the target license plate image and estimates a plurality of possible characters and a plurality of possible character positions corresponding to the possible characters according to the similarity degrees corresponding to the simulated multiple-character template images.
Herein, the homogenizing of the multiple-character template images, the generating of the similarity degrees corresponding to multiple-character template images and the estimating of possible characters and possible character positions are similar to that of the character template images, as shown in
It should be mentioned that, a specific symbol (e.g., a hyphen) is usually used in a license plate. Therefore, when using multiple-character template images to recognize a target license plate image, the specific symbol must be considered. For example, in a Taiwanese license plate, the hyphen may be on the right-hand side between the second and third characters or between the forth and fifth characters. For example, in the present exemplary embodiment, the input interface unit 203 which is capable of providing a user for selecting a type of a target license plate image, thereby recognizing a position of the specific symbol. Or, in another exemplary embodiment, it is hypothesized that a specific symbol may be located on the right-hand side between the second and third characters or between the forth and fifth characters, and the actual position can be recognized by sorting the similarity degrees. Moreover, in another exemplary embodiment, a character template image corresponding to the specific symbol is used for performing the foregoing homogenizing and comparing, thereby recognizing a specific symbol on the target license plate image.
Referring to
Referring to
The template simulating unit 206 identifies the position of the hyphen on the target license plate image according to the methods described above and accordingly generates simulated two-character template images corresponding to the two-character template images.
The operation processing unit 208 compares the simulated two-character template images corresponding to the 1st and 2nd positions with the sub-images corresponding to the 1st and 2nd positions of the target license plate image, and calculates a similarity degree between each of these simulated two-character template images and the sub-images corresponding to the 1st and 2nd positions of the target license plate image, thereby generating the similarity degrees corresponding to these simulated multiple-character template images and estimating candidate characters corresponding to the 1st and 2nd positions. The operation processing unit 208 then compares the simulated two-character template images corresponding to the 2nd and 3rd positions with the sub-images corresponding to the 2nd and 3rd positions of the target license plate image, and calculates a similarity degree between each of these simulated two-character template images and the sub-images corresponding to the 2nd and 3rd positions of the target license plate image, thereby generating the similarity degrees corresponding to these simulated multiple-character template images and estimating candidate characters corresponding to the 2nd and 3rd positions according to the generated similarity degrees. Similarly, the operation processing unit 208 computes the average of those similarity degrees and uses it as the cutoff threshold to screen out the character templates with lower similarity degrees as the candidate characters.
With the same manner, the operation processing unit 208 extends the single-character templates at the 3rd and 6th position to the second level. Accordingly, the operation processing unit 208 may use three-character template images, four-character template images, five-character template images and six-character template images to find out possible characters corresponding to all the positions of the target license plate image.
Referring to
Referring to
In step S1203, the character template images are respectively homogenized to generate a plurality of simulated character template images based on the target license plate image. For example, as shown in
Then, in step S1205, a plurality of similarity degrees corresponding to the simulated character template images are generated respectively by comparing the simulated character template images with the target license plate image. Furthermore, in step S1207, candidate characters corresponding to the target license plate image and candidate character positions corresponding to the candidate characters are estimated according to the similarity degrees corresponding to the simulated character template images. The generating of the similarity degrees and the estimating of the candidate characters and corresponding candidate character positions have been described with
Then, in step S1209, the character template images are combined to generate a plurality of multiple-character template images based on the estimated candidate characters and corresponding candidate character positions. And, in step S1211, the multiple-character template images are respectively homogenized to generate a plurality of simulated multiple-character template images based on the target license plate image.
After that, in step S1213, a plurality of similarity degrees corresponding to the simulated multiple-character template images are generated respectively by comparing the simulated multiple-character template images with the license plate image. And, in step S1215, a plurality of possible characters and a plurality of possible character positions corresponding to the possible characters are estimated according to the similarity degrees corresponding to the simulated multiple-character template images. The detail steps for estimating possible characters and corresponding possible character positions by using multiple-character template images have been described with
Finally, in step S1217, possible license plate numbers corresponding to the target license plate image are output based on the possible characters and the possible character positions corresponding to the possible characters.
The present disclosure further provides a computer program product composed of a plurality of program instructions. The program instructions are suitable for being loaded into a computer system and executed by the same so as to perform the method of recognizing a license plate image described above and allow the computer system to have functions of the image recognizing apparatus described above.
In addition, the computer program product is stored in a computer-readable recording medium and subsequently read by a computer system, wherein the computer-readable recording medium may be any data storage medium. The computer-readable recording medium may be a read-only memory (ROM), a random-access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, or an optical data storage device.
In light of the foregoing, the method recognizing a license plate image and the image recognizing apparatus according to the present disclosure identify the positions of the characters on a license plate image and use simulated character template images to derive their corresponding character lists. Additionally, the method recognizing a license plate image and the image recognizing apparatus according to the present disclosure further identify the location of any special symbol, such as a hyphen. Furthermore, the method recognizing a license plate image and the image recognizing apparatus according to the present disclosure expand the character template images to multiple-character templates images to refine the recognition results. Accordingly, the method recognizing a license plate image and the image recognizing apparatus according to the present disclosure can effectively recognize characters in blurred license plate images without segmenting the characters.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present disclosure without departing from the scope or spirit of the disclosure. In view of the foregoing, it is intended that the present disclosure cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.