CLICK HERE FOR FREE BLOGGER TEMPLATES, LINK BUTTONS AND MORE! »

Tuesday, May 15, 2012

Week 14 ( 26. April. 2012 )

Assalamualaikum

Title of Activities :
- Presentation of FYP.

Objectives :
- To meet the task of final year student.

Content / Procedure :
- Register at Gemilang Hall at 12 pm.
- Each student will be given a table for presentation and a board for posting the project`s poster.
- Two accessors will be coming to student to access about knowledgeable student for her / his own project.

Result / Analysis :


- Poster of FYP Presentation -


Week 13 ( 17. April. 2012 )

Assalamualaikum

Title of Activity :
- Preparation of the FYP Semester 2 Presentation

Objective :
- To ensure all arrangements for presentation run smoothly.

Content / Procedure :
- Prepare script and video.
- Read the article from web and books.
- Understanding the process and check the error.


Result / Analysis : 




- This is a video for Final Year Project. The video must be uploaded to RPS .

Week 12 ( 9 April 2012 )

Assalamualaikum


Title of Activities :
- Build a GUI layout and system.


Objectives :
- To present the developed tracking algorithm in a visual and graphical form that will ease users to interact better with the system.
- To detect and recognizing license plates and develop a system that can extract the license plate number from complex scene images with no assumption of image quality


Content / Procedures :
- Concentrate on using the application rather than on the mechanics involved in doing thing.
- Use by providing them with a consistent appearance and with intuitive controls like push-buttons, list boxes, sliders, menus, and so forth.
Every box inside the GUI have own function that have been set to make the system look interactive.




Result / Analysis :
Besides that, another major work accomplished was designing and developing the GUI (graphical user interfaces) for the tracking system. It is accomplished using GUIDE, the MATLAB GUI development environment that provides a set of tools for creating GUI.



Monday, April 30, 2012

Week 11 ( 2. April. 2012 )

Assalamualaikum

Title of Activity :
- Study for experimental result.

Objective :
- To tested the proposed systems whether the systems is going fine or not.

Content / Procedure
- Test and simulate all the car plates taken and the percentage of successful experiments in the systems.
- Study of factors that makes the systems does not function properly.
- A set of 50 images were taken from :

a) Complex scene, in which several objects with complex textures are presented.
b) Various environment ( street, roadside and parking lot ).
c) Different inclined angles and distances relative to camera.

 - Different angles -


- Distance from the camera - 

- Car plate size - 

- A shiny surface -

- The fracture surface -

Result / Analysis :
- Performance for individual system subsection were as follows : 92.1 % of plates were located successfully, 85% characters were segmented correctly, 50 % of characters manually extracted plates and 93.2 % of these characters were correctly classified.
- The major factors of errors was mainly due to bad quality of input image during the acquisition stage.

Week 9 - 10 ( 22. March. 2012 )

Assalamualaikum...

Title of Activity :
- Recognizing license plate characters.

Objective :
- To identified and to finalize the results are ASCII character and numbers of the plate.
- To get a similar result like a segmentation process.
- To ensure which the architecture of a neural network want to be used.

Content / Procedure :
- Used a Multi Layer Perceptron Network trained with the back propagation algorithm.
- During learning process, characters of the constituted database are successively presented at the input layer of Multi Layer Perceptron Network and their corresponding outputs are compared to the desire output.
- Implementing Multi Layer Perceptron Network with two hidden layers of 35 and 10 neurons as neural network.
- I use 30 data on the pictures. 20 of them were used for training and last 12 were used for simulating and testing.
- The training data will get from Image Processing for the neural network is based on input training.bmp image which has exactly 36 characters ( 25 alphabets 10 numbers ). Every type of character is train automatically once we simulate the program.

Result / Analysis :

 ~ Neural Network Training Tool ~

- There are some problems when using fan beam transforms method, the systems cannot recognize the plate numbers.

- Fan beam transform method -

- Change from Fan beam transform method to other character recognition method. The result will get same, but must to train the alphabet and number more frequently.
- The most challenging part is about need to change the source code to suitable method many times. 


Tuesday, March 27, 2012

Week 8 ( 12.March.2012 )

Assalamualaikum.

Title of Activity :
- Character Segmentation.


Objective :
To get a more accurate binarization results, this process uses several local threshold values since the illumination of the plates.


Content / Procedure
- Adding some code to ease the process of identifying the characters.
- Divide the extracted plate into different images, each containing one isolated character.

TotalArea = 0;
            idx = [];
            for cnt = 1:size(stats,1)
                HWratio = (stats(cnt).BoundingBox(4)/stats(cnt).BoundingBox(3));
                density = stats(cnt).Area / (stats(cnt).BoundingBox(3)*stats(cnt).BoundingBox(4));
                area = stats(cnt).Area;
                
                x1 = ceil(stats(cnt).BoundingBox(1));
                y1 = ceil(stats(cnt).BoundingBox(2));
                x2 = ceil(stats(cnt).BoundingBox(1) + stats(cnt).BoundingBox(3));
                y2 = ceil(stats(cnt).BoundingBox(2) + stats(cnt).BoundingBox(4));
                
                if x1 > size(BW3,2)
                    x1 = size(BW3,2);
                end


                if x2 > size(BW3,2)
                    x2 = size(BW3,2);
                end
                
                if y1 > size(BW3,1)
                    y1 = size(BW3,1);
                end


                if y2 > size(BW3,1)
                    y2 = size(BW3,1);
                end
                
                GradientMagnitude = size(find(edge(BW3(y1:y2, x1:x2),'log') == 1),1);
                
                if(density > LLimit_Density) && (density < HLimit_Density) ...
                        && (area > LLimit_Area) && (area < HLimit_Area) ...
                        && (HWratio > LLimit_HWratio) && (HWratio < HLimit_HWratio) ...
                        && (GradientMagnitude > LLimit_GradientMagnitude) && (GradientMagnitude < HLimit_GradientMagnitude)
                    
                    idx = [idx cnt];
                    TotalArea = TotalArea + area;
                end
                
                
            end
             
            BW4 = ismember(labelmatrix(cc), idx);            
            cc = bwconncomp(BW4);
            
            if (TotalArea > LLimit_TotalArea) && (TotalArea < HLimit_TotalArea) ...
                    && (cc.NumObjects >= LLimit_NumOfCharacter) && (cc.NumObjects <= HLimit_NumOfCharacter)
                
                % Find the distance between each character
                stats = regionprops(BW4, 'Centroid', 'BoundingBox');
                CenterOfCharacter = [];
                for cnt = 1:size(stats,1)
                    CenterOfCharacter(cnt,:) = stats(cnt).Centroid;                    
                end
                [B, ind] = sort(CenterOfCharacter(:,1), 1);
                SortedCharacter = CenterOfCharacter(ind,:);
                dist = [];
                for cnt = 1:size(SortedCharacter,1)-1
                    dist(cnt,:) = norm(SortedCharacter(cnt,:)-SortedCharacter(cnt+1,:));                    
                end
                                
                for cnt = 1:size(dist,1)-5
                    space_between_character = dist(cnt+2);
                    dist_segment = [dist(cnt:cnt+1); dist(cnt+3:cnt+5)];
                    avg_dist = mean(dist_segment); std_dist = std(dist_segment);


                    if((space_between_character / avg_dist) > RatioBetweenSpaceDistAndAvrDist) ...
                            && (std_dist < MaxStdOfCharDist)
                        
                        BW5 = ismember(labelmatrix(cc), [cnt:cnt+6]);
                        cc = bwconncomp(BW5);
                                                                      
                        for seg_cnt = cnt:cnt+6
                            BW6 = imcrop(BW5, stats(seg_cnt).BoundingBox);
                            ImgSegment{AllowedSegmentCnt} = imresize(BW6, [20 10]);
                            AllowedSegmentCnt = AllowedSegmentCnt + 1; 
                                                   
                        end % for seg_cnt = cnt:cnt+6
                        
                    end % if((space_between_character / avg_dist) > 1.5) && (std_dist < 3)
                       
                end % for cnt = 1:size(dist,1)-5
                                
            end


        end % for j=1:size(VProSegment{i}.Profile,1)
    end 
end


% Show image of each character
if (isempty(ImgSegment) == 0)


    for cnt = 1:size(ImgSegment,2)    
        figure; imshow(ImgSegment{cnt});
    end
    
end


Result / Analysis
- Stretch the contrast of the image to extend over the entire range of grey levels available.
- Resize each character to the standard height and width in order to be used in the following recognition process.




Week 7 ( 5. March. 2012 )

Assalamualaikum

Title of Activity :
- Extracting the image of license plate

Objective :
- To locate the vehicle license`s plate.

Content / Procedure :
- Adding some source code to eliminating the noise.

Result / Analysis :
- The process contains each phase performs a segmentation process on the grey image to eliminate the redundant pixels that don`t belong to a plate region.

clear all; close all; clc;

% Threshold
LLimit_Density = 0.20;
HLimit_Density = 1.50;

LLimit_Area = 30;
HLimit_Area = 2000;

LLimit_HWratio = 0.3;
HLimit_HWratio = 9.5;

LLimit_TotalArea = 400;
HLimit_TotalArea = 3000;


% Display result
DisplayGrayImage = 1;
DisplayMedianFiltering = 1;
DisplayHorizontalProfile = 1;
DisplayVerticalProfile = 1;

% Get a list of all the images name in folder images
InputImg = imread('images\499.JPG');
InputImg = im2double( InputImg );

% Convert To Grayscale Using the NTSC standard
red = immultiply( InputImg(:,:,1), 299 );
green = immultiply(  InputImg(:,:,2), 587 );
blue = immultiply( InputImg(:,:,3), 114 );

ProcessImg = red + green + blue;
ProcessImg = imdivide( ProcessImg, 1000 );
if DisplayGrayImage == 1
    figure; hold on; imshow( ProcessImg );
end

% Perform median filtering to remove noise
ProcessImg = medfilt2(ProcessImg, [5 5]);
if DisplayMedianFiltering == 1
    figure; hold on; imshow( ProcessImg );
end

I = ProcessImg;
if ~(isa(I,'double') || isa(I,'single')); I = im2single(I); end
gh = imfilter(I,fspecial('sobel') ,'replicate');
gv = imfilter(I,fspecial('sobel')','replicate');
EdgeImg = abs(gh) + abs(gv);  
%figure, imshow(EdgeImg);

% Create horizontal profile
HProfile = sum(EdgeImg,2);
H_thres = mean(HProfile);  

[ Filtered_HProSegment ] = ProfileSegmentation( HProfile, H_thres*0.75, 15);

if DisplayHorizontalProfile == 1

    clear rgb_img;
    rgb_img(:,:,1) = uint8(EdgeImg * 255);
    rgb_img(:,:,2) = uint8(EdgeImg * 255);
    rgb_img(:,:,3) = uint8(EdgeImg * 255);

    for i=1:size(Filtered_HProSegment,1)
        for j=1:size(rgb_img,2)
            rgb_img(Filtered_HProSegment(i,1),j,1) = 255;
            rgb_img(Filtered_HProSegment(i,1),j,2) = 0;
            rgb_img(Filtered_HProSegment(i,1),j,3) = 0;

            rgb_img(Filtered_HProSegment(i,2),j,1) = 255;
            rgb_img(Filtered_HProSegment(i,2),j,2) = 0;
            rgb_img(Filtered_HProSegment(i,2),j,3) = 0;          
        end
    end

    figure; imshow(rgb_img);

end

% Find the Horizontal Density Vector
HDV = zeros(size(Filtered_HProSegment,1), size(EdgeImg,2));
M = 150;

for k=1:size(Filtered_HProSegment,1)
    SlidingWindowsArea = (Filtered_HProSegment(k,2) - Filtered_HProSegment(k,1)) * M;
    for width_cnt = 1:size(EdgeImg,2)          

        min_w = width_cnt - M;
        max_w = width_cnt + M;

        if min_w < 1
            min_w = 1;
        end

        if max_w > size(EdgeImg,2)
           max_w = size(EdgeImg,2);
        end

        %SlidingWindowsArea = (max_w - min_w )* M;
        SumG = sum(sum(EdgeImg(Filtered_HProSegment(k,1):Filtered_HProSegment(k,2), min_w:max_w)));
        HDV(k,width_cnt) = SumG/SlidingWindowsArea;

    end

    V_thres = mean(HDV(k,:));  
    FoundProfile = ProfileSegmentation( HDV(k,:)', V_thres, 100);
    VProSegment{k}.Profile = [];
    if size(FoundProfile,1) > 0
        VProSegment{k}.Profile = FoundProfile;
    end
end

if DisplayVerticalProfile == 1
    clear rgb_img;
    rgb_img(:,:,1) = uint8(EdgeImg * 255);
    rgb_img(:,:,2) = uint8(EdgeImg * 255);
    rgb_img(:,:,3) = uint8(EdgeImg * 255);

    figure; imshow(rgb_img); hold on;  
    for i=1:size(Filtered_HProSegment,1)
        if isempty(VProSegment{i}.Profile) == 0
            for j=1:size(VProSegment{i}.Profile,1)
                x = VProSegment{i}.Profile(j,1);
                y = Filtered_HProSegment(i,1);          
                w = VProSegment{i}.Profile(j,2) - VProSegment{i}.Profile(j,1);
                h = Filtered_HProSegment(i,2) - Filtered_HProSegment(i,1);          
                rectangle('Position',[x,y,w,h], 'EdgeColor', 'Red', 'LineWidth',2)          
            end
        end
    end
end

% Auto-skew correction
level = graythresh(InputImg);
BW_ProcessImg = im2bw(InputImg,level);

for i=1:size(Filtered_HProSegment,1)
    if isempty(VProSegment{i}.Profile) == 0
        for j=1:size(VProSegment{i}.Profile,1)

            x1 = VProSegment{i}.Profile(j,1);
            y1 = Filtered_HProSegment(i,1);
            x2 = VProSegment{i}.Profile(j,2);
            y2 = Filtered_HProSegment(i,2);

            ProcessImgSegment = BW_ProcessImg(y1:y2, x1:x2);
            EdgeSegment = EdgeImg(y1:y2, x1:x2);                                

            level = graythresh(EdgeSegment);
            BW = im2bw(EdgeSegment,level*0.2);

            BW1 = imfill(BW,'holes');

            cc = bwconncomp(BW1);
            stats = regionprops(BW1, 'Area', 'FilledImage');
            SumBW = 0;
            for cnt =1:size(stats,1)
                SumBW = SumBW + stats(cnt).Area;
            end
            MeanBW = SumBW/size(stats,1);
            idx = find([stats.Area] > MeanBW*0.2);
            BW2 = ismember(labelmatrix(cc), idx);
            se = strel('disk',5);
            BW2 = imclose(BW2,se);
            %figure; imshow(BW2);


            % Find the skew angle by using hough transform
            %BW22 = edge(BW2,'canny');
            [H,T,R] = hough(BW2);
            P  = houghpeaks(H,5,'threshold',ceil(0.3*max(H(:))));
            lines = houghlines(BW2,T,R,P,'FillGap',5,'MinLength',7);

            DetectedSkew = 0;
            if isempty(fieldnames(lines)) == 0
                max_len = 0;
                max_ind = 0;
                for cnt =1:size(lines,2)                  
                    len = norm(lines(cnt).point1 - lines(cnt).point2);
                    if ( len > max_len)
                      max_len = len;
                      max_ind = cnt;
                   end
                end
                DetectedSkew = lines(max_ind).theta;
            end

            % Deskew the car plate image
            if DetectedSkew == 0
               tf = [1 0 0; 0 1 0; 0 0 1];                  
            else
               tf = [1 tand(90 - DetectedSkew) 0; 0 1 0; 0 0 1];                  
            end
            tform = maketform('affine', tf);
            BW3 = imtransform(BW2 & ProcessImgSegment, tform);            
            se = strel('disk',1);      
            BW3 = imerode(BW3,se);
            %figure; imshow(BW3);
         
            cc = bwconncomp(BW3);
            stats = regionprops(BW3, 'ConvexHull', 'Area', 'BoundingBox');

         
            % Check the properties
            fig_BW_disp = figure;
            for cnt = 1:size(stats,1)
                BW_disp = BW3;
                clf(fig_BW_disp);
                figure(fig_BW_disp); imshow(BW_disp); hold on;
                rectangle('Position',stats(cnt).BoundingBox,'EdgeColor','red','LineWidth',2);

                HWratio = (stats(cnt).BoundingBox(4)/stats(cnt).BoundingBox(3))
                density = stats(cnt).Area / (stats(cnt).BoundingBox(3)*stats(cnt).BoundingBox(4))
                area = stats(cnt).Area
                pause
            end
       
            % Condition: Check the density
            TotalArea = 0;
            idx = [];
            for cnt = 1:size(stats,1)
                HWratio = (stats(cnt).BoundingBox(4)/stats(cnt).BoundingBox(3));
                density = stats(cnt).Area / (stats(cnt).BoundingBox(3)*stats(cnt).BoundingBox(4));
                area = stats(cnt).Area;
                if(density > LLimit_Density) && (density < HLimit_Density) ...
                        && (area > LLimit_Area) && (area < HLimit_Area) ...
                        && (HWratio > LLimit_HWratio) && (HWratio < HLimit_HWratio)
                    idx = [idx cnt];
                    TotalArea = TotalArea + area;
                end
            end        
         
            BW4 = ismember(labelmatrix(cc), idx);          
            cc = bwconncomp(BW4);
         
            if (TotalArea > LLimit_TotalArea) && (TotalArea < HLimit_TotalArea) ...
                    %&& (cc.NumObjects >= LLimit_NumOfCharacter) && (cc.NumObjects <= HLimit_NumOfCharacter)
                figure; imshow(BW4);
            end


        end
    end
end

- Get the illustrates an edge detection process.


Conclusion.
- Through this process, I can detect few factors contribute to this process failed which is :

a) Shining of surface plate.
b) A dirty plate surface.
c) Damaged of surface plate.




- Need more magic image to get successful result.