Number Plate Extraction using MATLAB
The algorithm for extracting number plate can be summarized as:-
Contents
Input Image
- Capture image from webcam.
- Store the captured image into an image file for further processing.
Convert Image into Binary
- Identify the intensity of the image.
If image intensity = high Reduce intensity Else if intensity = low Increase intensity Else No change. - Convert image into grayscale.
- Calculate the appropriate threshold value for the image.
- Convert the image into a binary image using the calculated threshold.
Detecting Number plate area
- Fill small holes including numbers of Number plate so that number plate area will be large to isolate from the figure.
- Determine the width and height of the image.
- 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 to the image intensity and plate area. - Use the step no. 3 for both horizontal and vertical direction.
- Check number of possible areas.
- Logically AND with binary image obtained at “Convert image into a binary algorithm.
- Crop the required area.
Segmentation
- Filter the noise level present in the image.
- Clip the plate area in such a way that only numbers of plate area extracted.
- Separate each character from the plate.
Number Identification
- Create the template file from the stored template images.
- Resize image obtained from segmentation to the size of the template.
- Compare each character with the templates.
- Store the best-matched character.
Save to file in the given format
- Open a text file in write mode (append mode in case of the multiple records).
- Store the character obtained from the number identification process to text file in given format.
- Close the file
Some of the snapshots for the number plate extractions:-
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.
will it work for any no plate i am indian weather it will work for indian no plate
will it work for indian number plate
Ya 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.
plz post codes for number plate extraction.
Tnx in advance.
I have given the link at the bottom of the post. Anyways you can download from the link below.
http://dl.dropbox.com/u/24930699/Projects/My%20Projects/Others/Number%20Plate%20Extraction%20using%20MATLAB.zip
nothing there to download could u please check again
i open the dropbox project is not there.
can u send me at the email [email protected]
Please try out now. I have updated the code link.
need ur help sir
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.
Plz reply and post codes for run-length smearing algorithm.(hsmearing and vsmearing) as soon as possible.
I 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.
Thk U.
hi..will it works for black background with white characters?
thnx..^^
This algorithm works for the number plate with white background and black text. You need to invert the color of image captured to process.
is it because the template which is used in black and white background?
what 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
Image Processing India
how to locate the number plate area and crope it from the whole vehicle photo….any idea…?
Hi. can you sharing with me the code from the beginning process till end.I need to learn this for my Final year project.
my emel: [email protected]
do u mind sending the code to [email protected]
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
This 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.
i am getting some error can u send me proper code?
is this the whole code/ you have implemented all the steps which you mentioned above from input image to number identification?
hi.. i really lyk dis proj..
but 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
iwant the code please help me
what 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
helo…im doing project on anpr using ocr(optical character recognition)…i want code to extract the number plate without noise…pls favour me…
helo..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..
Dude which algorithm did u use to segment the number plates and using which algorithm do u isolate the number plate from the image????
Hi there i cannot download your project could you please mail it to me on [email protected]
Excellent work.I am trying to download your project but can’t could you please mail it to me on [email protected]
Hi dear,
I’m new on Mathlab developer and i wonder to be a good MathLab programmer.
I’ve developed an OCR project on C# language and using a DTKANPR Libs.
I capture de image and store on SQL Server database, but my project has missing most the time on taking the plate.
Can you help me, how to integrate MathLab on C#, i mean manager all MathLab function on C#, and here um your code, there a line an instaance of img with “image.jpg”.
How can i take the image from camera “real time” and passing it to MathLab?
PS: I am sorry about my english
Best wishes
AOA
How to load multi images stored in a folder
can you share your project, please help sir
please mail it to me [email protected]
I am getting error like
Error using fprintf
Invalid file identifier. Use fopen to generate a valid file
identifier.
Error in main (line 55)
fprintf(fid,’Number Plate:-%s\nDate:-%s\n’,’word’,’date’);%Write
‘word’ in text file (upper)
in lines 55 56 in main.
Can u help me out in this?
Getting error in simulation
Can you please post working code?
Hey…tanx for sharing. I am an undergraute at the University of Swaziland..I am doing a similar project for my final year…i have implemented license plate extraction and segmentation. I am stuck in recognition…if I can have a look at ur code it would help but I am not able to download the code. Please email it here: [email protected].
Thanking you in advance
Sir,
could you please send all the zip fles,templates and the complete matlab code
Sir,
could you please send all the zip fles,templates and the complete matlab code to my email
Email: [email protected]
Valuable ideas ! I loved the facts , Does anyone know if I would be able to grab a sample CG 20 37 example to use ?
Dear ashokji. Please post extraction code and details for no plate extraction system and help many students to understand MATLAB fully . It will be a great help to our kids..,.Sunil Gupta Indian Railways
Hello. I tried to use your code on a 7 digit plate and it keeps giving me as a result a wrong number plate ,sometimes completely different than the real one. What kind of changes should I make in order to produce the right result?
Well done!
I am trying to download your project but can’t.
Could you please mail it to me?
Dear Sir,
Please send number plate extraction code and details.
Help many students to understand MATLAB fully.
I have updated the link. Pleas try out now.
please update it again. it doesn’t take
I request you to mail the matlab code of this project to [email protected]
hai can u send me the link to your code
hello plz send me all things in mail.i need this .
email -id [email protected]
Hi. can you sharing with me the code at [email protected]
Sir,
could you please send all the zip fles,templates and the complete matlab code to my email
Email: [email protected]
sir plz send me code at [email protected]
hello do you mind sharing the code, in desperate need of some help. Thank you
[email protected]
can you please email me the code for license plate detection, in desperate need of some help,
thank you
[email protected]
Excellent work.I am trying to download your project but can’t could you please mail it to me on [email protected]