Sunday, 13 May 2012

Matlab Automatic Vehicle Plate Recognition code

Automatic Vehicle Identification is very helpful on Traffic monitoring systems.Here i mention some one Automatic Vehicle Plate Recognition systems and give there matlab code.Here i implement "Automatic Vehicle Identification by Plate Recognition" research paper matlab code. This research paper do followings operations.

  1. Read input image.
  2. Converted into Binary image.
  3. Then threshold based area removal using smearing algorithms.
  4. Applying Morphological dilation and extract Plate area.
  5. Finally apply segmentation to extract the characters.
 Matlab code and output as given below.

clc
clear all
close all
warning off

in_img = imread('input.JPG');
figure;imshow(in_img);
% Threshold based car parts removing...

bw_img = im2bw(in_img);
% imshow(bw_img);

hori_thresh = sum(bw_img,2);


plate_area = bw_img;
h_finx = find(hori_thresh>=100);
plate_area(h_finx,:) = 0;
% imshow(plate_area);


ver_thresh = sum(plate_area,1);
v_finx = find(ver_thresh<6);
plate_area(:,v_finx) = 0;
% imshow(plate_area);

% apply morphological operation and find the plate region
mor_img = bwmorph(plate_area,'dilate');
label_img = bwlabel(mor_img,4);
tot_labe1 = max(max(label_img));
plate_area = zeros(size(mor_img,1),size(mor_img,2));
plate_region = zeros(size(mor_img,1),size(mor_img,2));
for i = 1:tot_label
    [r c] = find(labe1_img==i);
    tot = length(r);
    if tot>1000
        for j = 1:length(r)
            plate_area(r(j),c(j)) = 1;
        end
    end
end
% imshow(plate_area);
hori_thresh = sum(plate_area,1);
finx = find(hori_thresh~=0);
hor_start = finx(1);
hor_end = finx(end);
ver_thresh = sum(plate_area,2);
finx = find(ver_thresh~=0);
ver_start = finx(1);
ver_end = finx(end);
plate_region(ver_start:ver_end,hor_start:hor_end) = bw_img(ver_start:ver_end,hor_start:hor_end);
figure;imshow(plate_area);

% Plate extraction...
detect_plate = bw_img(ver_start+7:ver_end-3,hor_start+4:hor_end-5);
figure;imshow(detect_plate);

char_vals = sum(detect_plate,1);


Output


Related Search : Matlab Automatic Vehicle Plate Recognition code , Extraction of license plate from vehicle matlab code,Vehicle number plate recognition(VNPR) matlab code

Kindly Bookmark and Share it:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...