Showing posts with label Image Processing. Show all posts
Showing posts with label Image Processing. Show all posts

Fundamental image processing using MATLAB

This tutorial will show you the very basic method on how to read an image from your computer and put it in the MATLAB workspace that finally display them on MATLAB's figure. This tutorial is aimed for a very beginner people who want to know this. I hope this can help a little bit. Lets get started...
READ MORE - Fundamental image processing using MATLAB

Latest progress of "Special Plate Number Recognition System" with GUI in MATLAB


This is the latest progress as per date posted. There will be more to come soon as this project is ongoing. Do leave your comment if any...thanks
READ MORE - Latest progress of "Special Plate Number Recognition System" with GUI in MATLAB

Special Plate number segmentation code in MATLAB

% --- Executes on button press in loadButton.
function loadButton_Callback(hObject, eventdata, handles)
% hObject handle to loadButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

%**************************************************************************
%% FIRST BLOCK (Read/digitize input image)
%**************************************************************************
skip = 0;
default_path = 'C:\Received Images';
[fname fpath] = uigetfile('*.jpg', 'Choose Car Image', default_path);
if fname ~= 0,

choosen_image = strcat(fpath, fname);
retrieved_image = imread(choosen_image);
axes(handles.axes1);
imshow(retrieved_image);
save('temp.mat','retrieved_image','fname'); % Can be replaced by handles

end

% --- Executes on button press in searchPlateButton.
function searchPlateButton_Callback(hObject, eventdata, handles)
% hObject handle to searchPlateButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
axes(handles.axes1);

debug = guidata(handles.debugBox);
debug_flag = debug.flag;
if debug_flag == 1,
axes(handles.axes1);
set(handles.searchPlateButton,'Enable','off');
set(handles.contButton,'Enable','on');
set(handles.debugBox,'Enable','off');
end

error_flag = 0;
try
Load = load('temp.mat');
catch error
disp('Sorry..You have to load the image');
error_flag = 1;
end

if error_flag == 0,

retrieved_image = Load.retrieved_image;
fname = Load.fname;
%% PREPROCESSING BLOCK
[original_image connected_image] = createObject(retrieved_image, fname);

%% DETECTION/SEGMENTATION BLOCK
%% Pre-ANALYSIS
processed_image = thirtyPercent(connected_image); % remove 30%
detectObjects(processed_image); % Do nothing to the image. Only draw rect box for every objects
if debug_flag == 1, uiwait; else uiresume; end

%% ANALYSIS BASED ON RULEs
% Rule 1 - Crops the image by ignoring boxes with more than 1 object.
[crops] = cropsObject(original_image, processed_image);
if debug_flag == 1, uiwait; else uiresume; end
% Rule 2
[crops] = compactCheck(original_image, crops);
if debug_flag == 1, uiwait; else uiresume; end
% Rule 3
[crops] = angleCheck(original_image, crops);
if debug_flag == 1, uiwait; else uiresume; end
% Rule 4
[crops] = hvCheck(crops);

%Plot the plate
plotImage(retrieved_image, crops);

[ignored count] = size(crops);
for i=1:1:count, % 'count' is the number of images stored in 'crops'
BW = crops(i).obj; % Retrieve every image to be analyzed
%------------------------------------------------------------------
BWthin = bwmorph(BW,'thin',Inf);
subplot(count,1,i,'Parent',handles.myPanel)
imshow(BWthin), title('Image Processed')
%------------------------------------------------------------------
end

set(handles.debugBox,'Enable','on');
set(handles.contButton,'Enable','off');
set(handles.searchPlateButton,'Enable','on');
end
READ MORE - Special Plate number segmentation code in MATLAB

Plate number localization or segmentation

Sample image need to go through segmentation process:


This is the progress of the project right now. In order to start segmentize the plate number, we have to do some deep study and analysis on how the plate number is different from a non-plate number. From the knowledge about the plate number characteristic, it make us easier to start writing the rules or I call it as "Rule Based Function". Before I explain further, need to be cleared by any readers that I am using Matlab proggramming that obviously uses Image Processing Tools in it.
All the program is written in the ".m" file with their suitable names according to their fucntion. Lets now jump to the topic as I don't want to drag further. First of all, we need to convert the color image to grayscale, and from gray scale image to black and white image and eventually start calling rule based function to do the job. There is a few function which I have split them out. It does not means anything to the expert programmer, but for the sake of simplicity and troubleshooting easiness it is suggested so.
The first stage of segmentation:


After the image has been converted to be a black and white image using a global thresholding technique, it is then being processed and the detected object will be boxed as shown in the figure above. On the left hand side, there is a text showing the background process. Don't worry, I am purposely print it out for me to see the process behind it by putting command "disp('your message')" if you are interested to know. Next, it will go through a few rule based function that I called compact check, angle check and HV check.

Compact Check:

This is a function to check the object compactness based on some formula inside it. I has a great posibility to removed unwanted object that is really obvious not a plate number. However this function alone does not enough to eliminate all the non-plate number object. Thus, the next function named "angle check" will be used to help him.

Angle Check:

What angle check does?. It simply measure the angle of every object as well as calculate the distance between them. If it is too far each other, there is a high posibility that the object not belong to a plate number. Bare in mind that angle check is also not good enough to removed all because the angle and the distance is very similar to the plate number's characteristic. Therefore we have to really focus on the character's characteristic to filter that out.

HV Check:

This is the final function so far, in it there is a few more verification being done. The way its work is that, it plot horizontal (H) and vertical (V) of the cropped object and do some analysis on it. H and V implies to the function's name HV check. After this check, we can get the result as shown below:


The green boxed with a dotted line is the detected plate number. Next process would be in the next post. bare with me..hehehe bye.
READ MORE - Plate number localization or segmentation

Special plate recognition for Malaysian vehicles

It starts with the camera that capture the vehicle image, and then will go through a pre-processing stage, plate number detection or segmentation, character extraction and the output eventually feed into a stroke analysis process before the output plate number being displayed.
READ MORE - Special plate recognition for Malaysian vehicles

Object Recognition in MATLAB

There are a few things that we need to consider when dealing with object detection. The first thing is that Image Processing Toolbox in MATLAB. In order to use MATLAB tool in image processing, we have to get use to it. Getting familiar with the usage of every function in the toolbox mentioned ealier will automatically trigger your brain to think out of the box. Many project as well as application can be created using the provided toolbox as long as you are always exploring the function's functionality.

Before any detection is designed, you might first need to know what type of input do you have. Is that a still image? or video image? or etc..

By knowing the type of input, it make your work easier and could be better. Below is the toolbox for image processing as for you who new in MATLAB and never know it.



The picture above shown the help menu in MATLAB. You have to go through every single tap if you are a beginer. Some more info that I want ot share with you is the M-File.
You can get M-File by clicking File -> New -> M-File in the MATLAB windows.

Stop here for now... to be continued
READ MORE - Object Recognition in MATLAB

Real-Time plate number recognition

Searching today give me a few results on a plate number recognition project. It look simple, but it is actually very hard to make it work. One of the usefull web page about this kind of project is as below:

http://visl.technion.ac.il/projects/2003w24/

The brief explaination on how they design and implement the prject is stated in the web. For more reference you can just googling in www.google.com by typing "Plate number recognition" keyword on the google search engine.

There is another document about this topic. Lets take a look on that.

Plate Number Doc in PDF Plate number Recognition Example

Plate number Regognition Journal
READ MORE - Real-Time plate number recognition

Web Cam in MATLAB

Refer to this web page:
http://madan.wordpress.com/2007/03/23/image-capture-using-webcam-in-matlab/ . This web showing how we can use our web cam or any camera installed in our PC to work in MATLAB. I have tried this and found out the frame captured is not sharp enough when it is being display as an image. Need further understanding...

Besides the link given above, in order to know the basic in image processing, MATLAB help as per link http://www.mathworks.com/access/helpdesk/help/toolbox/images/ is also useful as a start.
READ MORE - Web Cam in MATLAB

Some usefull info about face Detection

Face Detection might also be usefull as a start in this project. The link given below is very usefull in the sense that it will give some idea on how the writer write the code of Face Detection.

http://www.codeproject.com/KB/audio-video/face_detection.aspx

From the code, the algorithms used probably can also be use in Human Tracking system.
READ MORE - Some usefull info about face Detection

Matlab vs C++

Which one is simple?.
Basically, both could be used to design the human tracking system. MATLAB sound to be a little bit more familiar than C++ in the field of DSP or detection.
What to be considered before hand?
1) Tools to import the video in Matlab/C++
2) Simplicity of the implementation.
3) Real Time processing, where the detection is on the real time video streaming.
4) to be added :)

The correct software need to be choosen as it will give the best effect and performance of the processing. There is no right or wrong with the chosen software, its only about which one is the most user friendly as well as provide best performance of all.
READ MORE - Matlab vs C++

Human Tracking System

This is the research about human tracking. The basic idea of this research is to track people in a video.
READ MORE - Human Tracking System

Related Posts Plugin for WordPress, Blogger...
 
 
 

Total Pageviews

Advertisements

Cool Text: Logo and Graphics Generator
Home