The number plate extraction in MATLAB can be accomplished using Image Proccessing Tools available in MATLAB. The functions provided by the Image Processing ToolBox makes it easy to process any images to extract the data from it.
The algorithm for extracting number plate can be summarized as:-
Input Image
Pic 1:- Number plate that is to be extracted.
Open the main.m file in MATLAB.
Now run the main.m file in the MATLAB. It may prompt you to change the default directory. You can either change folder or Add to Path. Better change the directory.
You will get a messagebox showing the extracted number plate. Message box like this:-
The log file ( log.txt ) is maintained to keep track of the saved number plates ( which can be used in application level ). The log file content contains the number plate with the date saved.
In main.m there are certain lines which when commented can be used to see the step by step characters extraction.
Feel free to ask any queries if any problem occurred. I am using MATLAB 7.12.0 (R20011a) but it should work in all version.
Download the whole project here.
The project involving the number plate extraction :- ANPR(Automatic Number Plate Recognition) Using ALR(Automatic Line Tracking Robot).
The algorithm for extracting number plate can be summarized as:-
Input Image
- 1.Capture image from webcam.
- 2.Store the captured image into a image file for further processing.
- 1.Identify the intensity of the image.
If image intensity = high Reduce intensity Else if intensity = low Increase intensity Else No change.2.Convert image into grayscale.
- 3.Calculate appropriate threshold value for the image.
- 4.Convert the image into binary image using the calculated threshold.
- 1.Fill small holes including numbers of Number plate so that number plate area will be large to isolate from figure. 2.Determine width and height of the image. 3.Scan each pixel of line counting number of white pixels in the following system,
If number of ‘white’ pixels < x; pixels become ‘black’ Else; no change If number of ‘white’ pixels > y; pixels become ‘black’ Else; no change The value of x and y may be changed according the image intensity and plate area.4. Use the step no. 3 for both horizontal and vertical direction.
- 5.Check number of possible areas.
- 6. Logically AND with binary image obtained at “Convert image into binary algorithm.
- 7.Crop the required area.
- 1.Filter the noise level present in the image.
- 2.Clip the plate area in such a way that only numbers of plate area extracted.
- 3.Separate each character from the plate.
- 1.Create the template file from the stored template images.
- 2.Resize image obtained from segmentation to the size of template.
- 3.Compare each character with the templates.
- 4.Store the best matched character.
- 1.Open a text file in write mode (append mode in case of the multiple records).
- 2.Store the character obtained from the number identification process to text file in given format.
- 3.Close the file
Pic 1:- Number plate that is to be extracted.
Open the main.m file in MATLAB.
Now run the main.m file in the MATLAB. It may prompt you to change the default directory. You can either change folder or Add to Path. Better change the directory.
You will get a messagebox showing the extracted number plate. Message box like this:-
The log file ( log.txt ) is maintained to keep track of the saved number plates ( which can be used in application level ). The log file content contains the number plate with the date saved.
In main.m there are certain lines which when commented can be used to see the step by step characters extraction.
Feel free to ask any queries if any problem occurred. I am using MATLAB 7.12.0 (R20011a) but it should work in all version.
Download the whole project here.
The project involving the number plate extraction :- ANPR(Automatic Number Plate Recognition) Using ALR(Automatic Line Tracking Robot).
Great post on number plate extraction and OCR in MATLAB.
ReplyDeletewill it work for any no plate i am indian weather it will work for indian no plate
ReplyDeletewill it work for indian number plate
ReplyDeleteYa it works for the Number plate of any kind ( Number 0-9 and alphabets A-Z). You can make it work for any language you want but you should have the template file for them.
Deleteplz post codes for number plate extraction.
ReplyDeleteTnx in advance.
I have given the link at the bottom of the post. Anyways you can download from the link below.
Deletehttp://dl.dropbox.com/u/24930699/Projects/My%20Projects/Others/Number%20Plate%20Extraction%20using%20MATLAB.zip
You have posted codes for character segmentation but not for plate extraction which uses smearing algorithm. So i request u to post codes for extracting license plate.(hsmearing and vsmearing functions). By the way thax for reply and hope u soon post codes for plate extraction.
ReplyDeletePlz reply and post codes for run-length smearing algorithm.(hsmearing and vsmearing) as soon as possible.
ReplyDeleteI m final year student project similer to ur's. i need help for license plate recognition. so request you to post source codes for that.
ReplyDeleteThk U.
hi..will it works for black background with white characters?
ReplyDeletethnx..^^
This algorithm works for the number plate with white background and black text. You need to invert the color of image captured to process.
Deleteis it because the template which is used in black and white background?
Deletewhat if the picture entered is the whole car, not just the plate
thx
interesting blog. It would be great if you can provide more details about it. Thanks you
ReplyDeleteImage Processing India
how to locate the number plate area and crope it from the whole vehicle photo....any idea...?
ReplyDeleteHi. can you sharing with me the code from the beginning process till end.I need to learn this for my Final year project.
ReplyDeletemy emel: sasuke.cold@yahoo.com
i am a student of mtech final year,i work on recognition of blurred license plates ,can u help me by providing the code for recognition of blurred license plates
ReplyDeleteThis is useful blog, contains rich content about Create a Number Plate.All kinds of show plates and numberplates is excelled, we make sure the work according to your demand and choice and timely delivery is ensured.
ReplyDeletei am getting some error can u send me proper code?
ReplyDeleteis this the whole code/ you have implemented all the steps which you mentioned above from input image to number identification?
ReplyDeletehi.. i really lyk dis proj..
ReplyDeletebut d problem is dat.. this proj. is not extracting particular no. plate from whole vehicle image ..(car image)
here ,only number plate is needed..
can u help to solve dis prob..???
so , it also extracts from whole vehicle img..
thanks..
can you write the codes for those please
ReplyDeleteiwant the code please help me
Deletewhat to do if after median filtering,some of the characters gets partitioned.it detects all this partition as seperate character.how to overcome this.please reply
ReplyDeletehelo...im doing project on anpr using ocr(optical character recognition)...i want code to extract the number plate without noise...pls favour me...
ReplyDeletehelo..im doing proj on automatic number plate recognition system using OCR algorithm...i want source code to extract the exact number plate region irrespective of its position..pls favour me..
ReplyDeleteDude which algorithm did u use to segment the number plates and using which algorithm do u isolate the number plate from the image????
ReplyDeleteHi there i cannot download your project could you please mail it to me on mvaishak.1291@gmail.com
ReplyDeleteExcellent work.I am trying to download your project but can't could you please mail it to me on robotics.rajkot@gmail.com
ReplyDelete