Crack Detection Matlab Coder
Posted : admin On 02.09.2019Matlab crack 64 bit matlab 2015a crack baidu matlab 2014b crack download matlab 2014b linux crack matlab 2014b 32 bit crack matlab 2013 32 bit crack matlab 2015 crack 32 bit crack matlab r2013b 32. Matlab Code For Ultrasonic Crack Detection.pdf To download full version 'Matlab Code For Ultrasonic Crack Detection.pdf' copy this link into your browser. Additionally, bad blood boils. ConsNone for free matlab code for road crack detection given that it is matlab code for road crack detection a simple facility only.
Have you ever wonder that how an ANPR (Automatic Number Plate Recognition) system works? Let me tell you the concept behind it, the camera of the ANPR system captures image of vehicle license plate and then the image is processed through multiple number of algorithms to provide an alpha numeric conversion of the image into a text format. ANPR system is used at many places like Petrol Pumps, Shopping Malls, Airports, highways, toll booths, Hotels, Hospitals, Parking lots, Defense & Military check points etc.
There are many image processing tools available for this Number plate detection, but here in this tutorial we will use MATLAB Image Processing to get the vehicle license plate number into the text format. If you are new with MATLAB or image processing, then check our previous MATLAB projects:
First, let me brief you about the concept we are using for detecting number plates. There are three programs or ‘.m’ files for this project.
![Crack Detection Matlab Coder Crack Detection Matlab Coder](https://www.researchgate.net/profile/Ismail_Danfillo/post/Im_working_on_my_project_involving_detection_of_cracks_on_rail_using_image_processing_algorithms_on_matlab_can_someone_help_with_the_matlab_code/attachment/59d622406cda7b8083a1bce6/AS:273826670153732@1442296773824/download/crackL1.jpg)
- Template Creation (template_creation.m)– This is used to call the saved images of alphanumerics and then save them as a new template in MATLAB memory.
- Letter Detection(Letter_detection.m) – Reads the characters from the input image and find the highest matched corresponding alphanumeric.
- Plate Detection(Plate_detection.m) – Process the image and then call the above two m-files to detect the number.
Now, we will learn about how to code these m-files and what you have to do before start coding. After going through this tutorial, you can find all the code files and working explanation video at the end of this project.
Template Creation
First create a folder for the project (my folder name is Number Plate Detection) to save and store the files. We have stored the binary images of all the alphabets and numbers in the sub-folder named as ‘alpha'.
Now, open the Editor window in the MATLAB, as shown in the below image,
![Coder Coder](https://www.mathworks.com/matlabcentral/answers/uploaded_files/28747/two.jpg)
If you are not familiar with the basic terminology of MATLAB I suggest you to check the linked tutorial.
Now, copy and paste the below code intemplate_creation.m file, and save the file in the project folder (Number Plate Detection). All the files related to this project including image templates files can be downloaded from here. Also check the video given at the end of this project.
Here, in the above code we are saving the images into a variable by using command ‘imread()’. This function is used to call the images from the folder or from any location of the PC into the MATLAB. Let’s take an example from the above code:
![Matlab coder supported functions Matlab coder supported functions](https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/64867/versions/1/screenshot.jpg)
Where A is the variable, and in ‘alpha/A.bmp’, ‘alpha’ is the folder name and ‘A.bmp’ is the file name.
Then create a matrix of ‘letter’ and ‘number’ and save it in variable ‘NewTemplates’ by using command ‘save(filename,variables)’.
Now start coding Letter_detection.m, in a new editor window.
Letter Detection
Here we are creating the second code file namedLetter_detection.m. Now, copy and paste the below code in that file and save the file in the project folder with name Letter_detection. This file can be downloaded from here, this attached zip files also contains other files related to this Number plate detection project.
Here, in the above code we have created a function named letter which gives us the alphanumeric output of the input image from class ‘alpha’ by using command ‘readLetter()’. And then load the saved templates by using command load ‘NewTemplates.
After that, we have resized the input image so it can be compared with the template’s images by using the command ‘imresize(filename,size)’. Then for loop is used to correlates the input image with every image in the template to get the best match.
A matrix ‘rec’ is created to record the value of correlation for each alphanumeric template with the characters template from the input image, as shown in the below code,
Then ‘find()’ command is used to find the index which corresponds to the highest matched character. Then according to that index, corresponding character is printed using‘if-else’ statement.
Now, after completing with this open a new editor window to start code for the main program.
Number Plate Detection
Here is the third and final code file named Plate_detection.m copy and paste the below code in this file and save into the project folder. For quick start you can download all the code files with image templates from here.
Basic commands used in above code are mentioned below:
imread() – This command is used to open the image into the MATLAB from the target folder.
rgb2gray() –This command is used to convert the RGB image into grayscale format.
imbinarize() – This command is used to Binarize 2-D grayscale image or simply we can say it converts the image into black and white format.
edge() – This command is used to detect the edges in the image, by using various methods like Roberts, Sobel, Prewitt and many others.
regionprops() – This command is used to measure properties of image region.
numel() – This command is used to calculate the number of array elements.
imcrop() – This command is used to crop the image in the entered size.
bwareaopen() – This command is used to remove small objects from binary image.
Matlab Coder Tutorial
By using the above commands in the code, we are calling the input image and converting it into the grayscale. Then the grayscale is converted into the binary image, and the edge of the binary images is detected by the Prewitt method.
Then the below code is used to detect the location of the number plate in the entire input image,
After that crop the number plate and remove the small objects from the binary image by using command ‘imcrop()’ and ‘bwareaopen()’ respectively.
Then, the below code is used to process that cropped license plate image and to display the detected number in the image and text format (in the command window).
Working of Vehicle License Plate Number Detection System using MATLAB
In the template_creation.m file we have design the code to save all the binary images of alphanumerics into a directory or file named as ‘NewTemplates’. Then that directory is called in the Letter_detection.m as you can see in the below
Then in the Plate_detection.m code file the Letter_detection.m code file is called when we process the image as shown in image below,
Now, click on the ‘RUN’ button to run the .m file
MATLAB may take few seconds to respond, wait until it shows busy message in the lower left corner as shown below,
As the program start you will get the number plate image popup and the number in the command window. The output for my image will look like the image given below;
Complete working of Vehicle License Number Plate Detection System is demonstrated in the Video below, and all the code files with image templates can be downloaded from here.
Also, check all MATLAB Projects here.