This code reads the car license plate using a simple User Interface (UI). You only need to select the car image and the code does the rest of recognition. The interface looks as in the following image:
If you are testing some other number plate images (than that we inserted for you) make sure that the image is not blurred, no reflection of light from any character, number plate should be dominant, prominent, and distinct in the image. If the number plate is from other (Karachi) city or country then please modify the code as mentioned in the comments of .m files accordingly. In the used plates, there are ‘6’ characters on every number plate. If you are running for other than ‘6’ please modify accordingly in ‘controlling.m’ and ‘guessthesix.m’ files.
If the character is touching the boundary of plate or each other, extraction will not be successful as with the image “pic7”. Plate should not be fancy i.e the characters should all along a single line. Furthermore, the characters should be conventional ones. For example in the image “carplate1” character ‘2’ is not conventional so it prints ‘Z’ instead of ‘2’.
The characters of “pic5” are not evident so program is unable to extract the characters.
PROCEDURE TO RUN:
- I have tested the algorithm on the MATLAB Version (R2019b).
- Copy all the files (.m files and image files) from the folder ‘Number_Plate_Extraction’ in the current directory of MATLAB or where MATLAB can locate in its path.
- Ten(10) images are supplied for the testing of the algorithm.
- Run the file named ‘numberPlateExtraction’ on the command prompt.
- I have set the image ‘car3.jpg’ in “imread” function. If the other nine images are to be tested modify the “imread” command in the “numberPlateExtraction” file as follows:
f=imread(‘carplate2.jpg’); and so on
The function “readLetter” is modified from the function supplied with the OCR algorithm found in MATHWORK Toolbox.
SEE HOW THE CODE WORKS:
CHECK THE FOLLOWING CODES:
- MATLAB Code For Face Recognition Based on Histogram of Oriented Gradients (HOG)