Vehicle Number Plate Detection and Character Recognition using MATLAB

Before understanding the concept behind image reading and recognition, you should understand “Fourier Transform” and basic matrix operations in Matlab.

1) Let’s consider we have captured below the picture of the vehicle, in which number plate and its font is clear with the surrounding contrast.

Vehicle number plate detection using MATLAB
Vehicle number plate detection using MATLAB

2) To locate the car license plate and identify the characters, we use the Matlab platform to provide some image processing functions to Fourier transform the character template and the image to be processed as the core idea. The basic method is as follows:

  1. Read the image to be processed and convert it to a binary image. After converting, using the threshold of 0.2 near the license plate characters most clearly, the least points (as shown below)
    I = imread('car.jpg');
    I2 = rgb2gray(I);
    I4 = im2bw(I2, 0.2);
  2. Remove the area where the image is too small to be sure of the license plate.
    bw = bwareaopen(I4, 500);
  3. To locate the license plate, inflate the white area, corrode to unrelated small objects, including the license plate characters.
    se = strel('disk',15);
    bw = imclose(bw,se);

  4. At this point the number plate where the white connectivity domain is clearly visible, but outside the black area, there is a larger white connectivity domain and the license plate where the domain surrounded by. It is necessary to fill it.
    bw = imfill(bw,[1 1]);
  5. Now, let’s find the connectivity domain boundary. While retaining this graphic for later to mark it on it.
    [B,L] = bwboundaries(bw,4);
    imshow(label2rgb(L, @jet, [.5 .5 .5]))
    hold on
  6. Finding the one that is most likely to be the number plate in all connected domains. The standard of judgment is that the aspect ratio of the license plate is about 4.5: 1, and its area is related to the circumference:(4.5 × L × L) / (2 × (4.5 + 1) × L) 2 ≈ 1/27 ,Which is characterized by,metric = 27 * area / perimeter ^ 2as the matching degree of the connected domain, the closer it is to 1, the more likely that the corresponding connected domain is 4.5: 1.

    MATLAB Program

    stats = regionprops(L,'Area','Centroid');
    for k = 1:length(B)
      boundary = B{k};
      delta_sq = diff(boundary).^2;   
      perimeter = sum(sqrt(sum(delta_sq,2)));
      area = stats(k).Area;
      metric = 27*area/perimeter^2;
      metric_string = sprintf('%2.2f',metric);
    if metric >= 0.9 && metric <= 1.1
        centroid = stats(k).Centroid;
        plot(centroid(1),centroid(2),'ko');
        goalboundary = boundary;
        s = min(goalboundary, [], 1);
        e = max(goalboundary, [], 1);
       goal = imcrop(I4,[s(2) s(1) e(2)-s(2) e(1)-s(1)]);
    end
      text(boundary(1,2)-35,boundary(1,1)+13,...
      metric_string,'Color','g',...
    'FontSize',14,'FontWeight','bold');
    end
    for k = 1:length(B)
     boundary = B{k};
     plot(boundary(:,2),boundary(:,1),'w','LineWidth',2)
    end

    The rectangular matching degree is 0.99, which is the most probable area. Below is the license plate area in the binary image determined by it:

  7. The license plate image is highlighted and expanded to a square of 256 × 256 (left as shown below) so that the matrix rotation operation is performed in the following “Fourier transform”.
    goal = ~goal;
    goal(256,256) = 0;
    figure;
    imshow(goal);
  8. Read a character template from the file (with “P” as an example, the template image is taken directly from the above binary image). Calculate the Fourier descriptor for the image and calculate the descriptor with a predefined decision function. In the transformed image, the level of brightness indicates the degree to which the corresponding region matches the template (as shown in the figure below).
    w = imread('P.bmp');
    w = ~w;
    C= real(ifft2(fft2(goal).*fft2(rot90(w,2),256,256)));
  9. By checking the maximum value of C, the test determines a suitable threshold (where 240 is appropriate), showing the point where the brightness is greater than the threshold, that is, the highest degree of matching to the template (see below).
    thresh = 240;
    figure;
    imshow(C > thresh);

    In contrast to the left and right graphs, it can be shown that the character “P” is recognized and positioned. The same way that you can identify and locate other characters.

3) This method is generally easier to understand, Matlab function hides the Fourier transform and other complex calculations. Disadvantages: In the positioning of the license plate, the program specifically according to the characteristics of the given image design, there is no universality. In character recognition, only characters that are substantially consistent with a given template are recognized. License plate size, angle, light, integrity, clarity changes, it can not be identified. At the same time for “8” and “B” similar characters, recognition is often confused.

Download

Click here to download MATLAB program and related files.

If you like this article, please share it with your friends and like or facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!

Temperature Controller Project using LabVIEW and Arduino

Hi friends, here we are going to build a small engineering project based on LabVIEW and Arduino. In this project, we are making Temperature controller using Arduino and LabVIEW. We will operate a cooling fan when the temperature goes above set point.

Before you start this project make sure that you have installed LabVIEW Interface For Arduino (LIFA) on your system. If not follow this article for installing LIFA: How to Interface Arduino with LabVIEW

Components required:

  • Arduino Uno (or Freeduino)
  • 10K ohm resistor
  • Thermistor
  • RGB LED (or separate LEDS can also be used)
  • DC fan (5V)

Theory:

In this temperature controller project, we will use thermistor for measuring the temperature of a liquid or any other material. We are using three LEDs to indicate temperature range. Red LED is used to indicate the temperature is the above set point. Blue LED will indicate temperature lies between upper and lower set point. Green LED will indicate temperature below set point.

Front Panel of Temperature Controller
Front Panel of Temperature Controller

When the RED LED glows the cooling fan will turn on. Due to cool air (or you can also use a cooler water pump with relay circuitry), your object (liquid) will get cooled. When the temperature falls down DC cooling fan will get turned off.

Construction of Temperature Controller Project:

Interfacing thermistor with Arduino
Interfacing thermistor with Arduino

Temperature controller using LabVIEW and Arduino
Fig 2: Temperature controller using LabVIEW and Arduino
  • Connect thermistor and Resistor with the analog port of Arduino as shown in the first image.
  • Now connect three LEDs with positive terminals of each led to pin number 8,9 and 10. Connect negative terminal of LED with common (ground of Arduino).
  • Now depends on your application i.e. if you are using the small 5V dc fan you can connect it directly to the Arduino (pin number 3 and ground) using motor driver IC L293D (In the figure we have connected the motor directly but it should be not so. You should use a motor driver IC). If you are using 230V AC appliance you need a relay circuit. You can buy it from here.

Download LabVIEW Program: Click Here

You may like these articles

If you like this article, please share it with your friends and like or facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!

How to Interface Arduino with LabVIEW

Hi friends, here we will see how to interface arduino (or freeduino) with LabVIEW. In this post a step by step tutorial is given on LabVIEW Interface For Arduino (i.e. LIFA). Follow the steps in given order and configure your LabVIEW to make it comaptible with Arduino or Freeduino.

LabVIEW Interface For Arduino:

Step 1: Download LabVIEW Interface For Arduino (LIFA) 

Step 2: Don’t install LIFA directly. If you install LIFA directly you will get an error like

“VIPM could not continue. Please fix the error and try again. VIPM could not connect to Labview 2013. VIPM requires LabVIEW access as a part of the current task execution in progress. please verify the VI SERVER : Exported VIs and Machine access settings in LabVIEW 2013…… “

Complete the following steps to enable VI server access

Step 3: Open LabVIEW go to Tools > Options > VI Server

LabVIEW Settings for Arduino 005

 

Configuring VI Servers in LabVIEW 006

 

Step 4: After clicking on VI Server scroll down to check Machine Access. Here you have to add machine access list manually. So make sure that you have added “10.211.55.13”, “localhost”, “*” in the Machine access list as shown in above image. Then click on OK.

Step 5: Now open downloaded VI Package Manager.

Step 6: Search for LabVIEW Interface For Arduino and double click on it to install it.

LabVIEW Interface For Arduino LIFA

LabVIEW Interface for Arduino 002

 

Step 7: Click on continue and after installation complete click on finish.

LabVIEW Interface for Arduino 003

LabVIEW Interface for Arduino 004

 

Now you are ready to connect arduino with LabVIEW. In the next post we will see how to connect Arduino with LabVIEW practically and we will do a simple project using Arduino and LabVIEW.

For more details you may refer: Configuring VI Server 

See also:  How to save LabVIEW Program in Image format

I hope you have successfully installed LabVIEW Interface for Arduino and ready to do some stuff with Arduino. If you have any doubt feel free to ask. Share this article with your friends and like our facebook page for future updates.

How to save LabVIEW Program in Image format

In this short tutorial I am going to show how to export Labview Block Diagram in image format. Using these steps you can save LabVIEW block Diagram in different image formats like PNG, JPG or GIF. Do following steps one by one.

Export Labview Block Diagram in image format:

Step 1: Click on File > Print

Step 2: Select VI (already selected) click on next

Step 3: Select icon, description, panel and diagram and then click on next.

Export Labview Block Diagram in image format.

Step 4: Now select destination as HTML file and click on next.

Exporting LabVIEW file in image format

Step 5: At this stage you have to choose desired image format. I will recommend to use PNG format of image. Because it is loss less image and also has small size.

Saving Labview program in image format

Step 6: Finally click on save and choose the destination where you want to save the image.

In this way you can easily convert Labview Block Diagram in image format for your project work, journals or other things.

See also: LabVIEW Program for celsius to fahrenheit conversion

If you like this article, please share it with your friends and like or facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!

LabVIEW Program for Degree Celsius to Fahrenheit Conversion

Hi friends, today we are going to learn a simple program using LabVIEW. This might be your first program using LabVIEW. Here we are going to convert temperature readings from degree Celsius into degree Fahrenheit. Without wasting too much time let us start programming with LabVIEW for our first program.

LabVIEW Program for degree Celsius to Fahrenheit Conversion

Step 1: Open the LabVIEW and click on Blank VI

Open new VI project

Step 2: Now you will see two windows on your computer screen. One is ‘front panel’ and other is ‘block diagram’. To properly adjust both of them on your screen press “Ctrl+t” from your keyboard.

Step 3: Now you will see both the windows are adjusted on a single screen. Move your cursor on block diagram window and right click on empty space. The available function will appear. Click on structures and then click on while loop. Now draw the while loop (box) by dragging your mouse on block diagram window.

Creating while loop in labview

 

Step 4: In this first LabVIEW program we are converting temperature readings from degree Celsius to degree Fahrenheit. So, in short, we are implementing the formula to convert C>F as shown below.

Celsius to Fahrenheit conversion formula

 

Step 5: First of all we have to take a slider to vary the Celsius readings. To bring a slider, right click on the front panel. Available controls will appear. Move cursor on “Numeric” and click on “vertical fill slide”. You can give a name to the slider. Here we are using this slider for degree Celsius readings, therefore, I have named as “Deg C”. In this way, we have completed “C”. Now we have to multiply this “C” with “9/5” as shown in the formula.

Taking slider in labview

 

Step 6: To multiply “C” with “9/5”, we will first multiply it with 9 and then divide it by 5. To multiply “C” with 9 we have to take “multiplier”. Right-click on block diagram > numeric > multiply. Same steps will be needed for taking divider and for addition with 32 as from formula.

numeric operations in labview

 

Step 7: for taking “9” i.e. constant right click on block diagram > numeric > numeric constant.

numeric constant in labview

Step 8: Similarly take divider and divide by 5. Take addition and add 32. Now your block diagram will look like this:

celsius to fahrenheit

Step 9: Now we have shown this converted temperature readings (which are now in Fahrenheit) on the numeric indicator. Right click on front panel > numeric > numeric indicator. I have given the name as “Deg F” to this numeric indicator.

numeric indicator in labview

Step 10: Finally we have to create a control for the while loop to stop the program at any time. To create a control right click on red button i.e. “loop condition” and select “create control”.

creating control in labview

Step 11:  Save the program by pressing “Ctrl+S”.

Step 12: Click on run button available in the block diagram window.

Run

Step 13: Now vary the slider you will see a corresponding change in degree Fahrenheit output.

Output

Labview_program_for_degree_to_fahrenheit_conversionp

If you are having any problems while doing your first LabVIEW program feel free to ask in comments. I am also providing a LabVIEW program file for converting Celsius to Fahrenheit which you can download here.

Download

Click here to download the LabVIEW program.

If you like this article, please share it with your friends and like our facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!

How to Make 10V DC Power Supply (PCB included)

Hi friends, in this short tutorial we are going to learn how to make 10V DC power supply using LM350 IC. You can use this circuit as your first or second year engineering electronics mini project. This circuit is capable of producing 10V DC output at a current rating of maximum 3A. It uses LM350, a three terminal positive voltage regulator. It can produce an output voltage ranging from 1.2V to 33V for the input voltage of 14V to 24 V obtained from the AC mains through a step-down transformer. The capacitor C2 ensures the stability of the output from the regulator. To get different levels of the output voltage, the values of R2 and C3 can be varied accordingly.

Components required

  • C1 = 0.1uF
  • C2 = 1uF
  • C3 = 10uF
  • D1,D2,D3,D4 = IN5001
  • F1 = 3A
  • J1,J2 are screw terminals
  • R1 = 240O
  • R2 = 1.65K
  • U1 = LM350

Circuit diagram

10V DC Power Supply
10V DC Power Supply

Download

You can download PCB Scematics here: 10V DC power supply

Features of 10V DC Power Supply

Input(V): 14VAC to 24VAC
Output(V): 10 VDC
Output load: 3A
PCB:68mmX35mm

Note: Use a ccl with 2oz Cu thickness for PCB fabrication.

This article is written by Heknath B Vicky. You can also submit your article and can earn 1$ per article. For more details click here.

I hope you liked this short tutorial on 10V DC Power Supply. Please share this article with your friends and like our facebook page. Subscribe to our newsletter for future updates. If you have any queries feel free to ask in the comment section below. Have a nice day!

Interfacing 433MHz RF Modules with 8051 Microcontroller

Hello Friends Today I am going to show you how to use a 433MHz RF module in your 8051 Projects. The 433MHz RF module is one of the cheapest ways of wireless communication other than IR that you can use in your 8051 projects.There is receiving and Transmitting module that we will needed. You can easily find them online for3-4$(150-200 Indian Rs).

Components required

  • Microcontroller (P89V51RD2) (2)
  • Resistor 10K (1)
  • Capacitor 33pF (2)
  • Capacitor 10uF (1)
  • 11.0592MHz Crystal (1)
  • 433MHz RF Transmitter (1)
  • 433MHz RF Receiver (1)
  • Buzzer(optional) (1)

Circuit Diagram and Description

RF Transmitter-receiver

Receiving circuit
Receiving circuit

Transmitting Circuit
Transmitting Circuit

Connections of the Transmitter Module

The smaller module of the two with a crystal on it is the Transmitter module. The Pin connections for the module are as below

Pin on Module            Connection

GND               GND on 8051 Board

DATA             P3.1 on 8051 Board

Vcc                  Vcc on 8051 Board

ANT                Connected to 17.25cm long wire

Connections for the Receiver Module

The Larger module of the two is the Receiver module.The Module has multiple GND and Vcc pins which need to be connected externally. The Pin connections for the module are as below

Pin on Module            Connection

GND              GND on 8051 Board

DATA            P3.0 on 8051 Board

Vcc                 Vcc on 8051 Board

ANT               Connected to 17.25cm long wire

About the Program

In this particular program, we are using UART to transmit 8-bit data over the RF module. The data pin of the transmit module is connected to the transmit pin of the 8051. When the Switch 4 is pressed on the 8051 Board then the ASCII value of character t is sent over the RFmodule.If this is received at the receiving 8051 then the Buzzer will turn on for 5 Seconds.

Download

Click here to download the C, Assembly and Hex file.

This article is written by Aditya Wani.

If you like this article, please share it with your friends and like or facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!

How to Make 1 Amp Power Supply – Electronics Mini Project

Hi friends, today we are going to build a 1A power supply, which will power your projects and save money on batteries. It is suitable as an adjustable power supply for your projects. you can use this current supply for driving DC motors, low voltage bulbs, etc. So let’s start.

Specifications of 1A power supply:

We are going to build a 1A power supply such that it will have maximum benefits and specifications to the user. Our 1A power supply circuit will have following specifications:

  1. Preset voltage range: 1.5V to 35V
  2. Maximum input voltage: 28V AC or 40V DC
  3. Maximum dissipation: 15W
  4. Short circuit protection
  5. Thermal and overload protection

For different output voltage, we need to choose a specific transformer. Following table shows how to select right transformer.

Choose right transformer
Choose right transformer

Components required:

  1. Diodes: D1, D2, D3, D4 = 1N4007
  2. Resistor: R1=120O
  3. Potentiometer: RV1=4.7KO
  4. Capacitors: C1=0.1µF (104)
  5. Electrolytic capacitors: C2=1µF, C3=10µF, C4=2200µF
  6. Voltage regulator: VR1= LM317
  7. SK1 and SK2 are terminal box.

Circuit Diagram:

1A Power Supply Circuit Diagram
1A Power Supply Circuit Diagram

Description:

Build the circuit as shown in circuit diagram. Connect the AC signal of the transformer (output of transformer) at SK1. Set the desired output voltage by the use of RV1 potentiometer. Mount voltage regulator LM317 along with heat sink if you are using high power application.

If you like this article, please share it with your friends and like or facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!

How to Make Metal Detector – Final Year Project

Hi friends, today we are going to build a very useful circuit which is Metal Detector. We all know about Metal Detector equipment which is widely used at security points. Same kind of Metal Detector we are going to build today. Our circuit is more powerful which can detect the presence of metal inside walls. If you want to drill a hole in walls, we can use this Metal Detector to check if there is any metal pipe like gas pipeline or water pipes, etc.

Features of Metal Detector

  1. Detection Range: 8 cm (3″ approx.)
  2. Power supply: 9V Battery
  3. Power consumption: 30mA max.
  4. Output form: LED or/and Buzzer

Components required

  1. Coils: It consists of two windings around the ferrite core. Winding L1 has 120 turns and winding L2 has 43 turns. We are using copper wire having 0.3mm thickness.

    Metal detector coil
    Metal detector coil
  2. Diode (D1): 1N4148
  3. Zener diode (ZD1): 3V9
  4. Resistors: R1=330O, R2=R3=470O, R4=2.7KO, R5=10KO
  5. Capacitors: C1=1200pF or 3300pF, C2=47nF
  6. Transistors: T1=T2=T3=BC547B
  7. LED (LD1): 5mm red
  8. Trim potentiometers: RV1= 2.5KO, RV2=100O
  9. Push button SW1

Circuit Diagram of Metal Detector:

Metal detector circuit diagram
Metal detector circuit diagram

Test and Adjustments:

  1. Connect a 9V battery to the circuit.
  2. Keep the circuit where there is no metal in the vicinity.
  3. Turn preset RV1 fully clockwise.
  4. Turn RV2 fully anti-clockwise.
  5. Depress the push button and hold it during the final adjustments.
  6. Now turn RV1 anti-clockwise till red LED goes out.
  7. Now turn RV2 clockwise until the red LED weakly lit.
  8. Now when metal comes in the vicinity of circuit red LED will be more brightly lit.

You can observe that we have one buzzer in the circuit. This buzzer is optional. If you want the output of the circuit in the form of a buzzer, you can connect the buzzer as shown in the diagram.

If you like this article, please share it with your friends and like or facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!.

Sound Activated LED Kit – Electronics Mini Project

Hi friends, today we are going to build another interesting electronic circuit which is sound activated LED kit. We can use this circuit for sound indicator applications or sound to the light unit in the music application. This project is also useful for hearing-impaired people. By use of this circuit, doorbell sound or phone ring sound produces light indications and thus hearing-impaired people can also perform a particular action.

Sound Activated LEDs

This circuit requires simple electronic components which you can easily find in any electronic components shop. There are no any expensive components in its circuitry, hence it’s a low-cost mini project. You can build this project for your second or third year engineering submissions. Let us build sound activated LED circuit step by step.

Components:

  1. Resistors:
    10KO: (R1)
    330KO: (R2)
    100KO: (R3, R4, R5)
    47O: (R6, R7, R8, R9)
    1.5MO: (R10, R11, R12)
    47KO: (R13, R14)
  2. LED: 5mm (LD1, LD2, LD3, LD4)
  3. Transistors: BC547 (T1, T2, T3) and BC557 (T4)
  4. Capacitor: 100nF (C1, C2, C3) and 100µF (C4)
  5. Potentiometer: 220K (RV1)
  6. MIC1

Circuit Diagram

Sound Activated LED
Sound Activated LED

Description

As shown in the circuit diagram of sound activated LEDs, we have used a 220K potentiometer. The sensitivity of this circuit can be varied by using this potentiometer. We have used a built-in microphone (M300) for sensing the sound waves.

Power consumption for this circuit is near around 0.5mA min./12mA max. It requires a 8 to 15V DC power supply. You can also use a 9V DC battery.

Features of Sound activated LED kit

  1. Intermediate level
  2. Power consumption: 0.5mA min./12mA max.
  3. It has adjustable sensitivity
  4. Require small area for installation
  5. low cast and effective circuitry

I hope you liked this sound activated LED Kit. Try to build your own and let me know if you found any difficulties in it. Please share your comments below. Like our facebook page and subscribe to our newsletter for future updates. Have a nice day!