Moving Object Detection Through MATLAB
Moving Object Detection Through MATLAB
M. Anila 07241A0560
N. Sindhu 07241A05A2
D. Srivalli 07241A05A8
GOKARAJU RANGARAJU
INSTITUTE OF
BACHUPALLY
(2010)
CERTIFICATE
Internal Guide:
K. Praveen Kumar Verma.
TECHNOLOGY
BACHUPALLY, HYDERABAD.
ACKNOWLEDGEMENT
Sincere thanks to our guide K. Praveen Kumar Verma who have helped us all
the way from the concept of the project to the code of the same.
I thank one and all of the team for the cheerful encouragement and unstinted
support rendered to me by their professional knowledge for the successful
completion of Project.
I will be failing in duty if I do not acknowledge with grateful thanks to the authors
of the references and other literatures referred to in this Project.
ABSTRACT
Moving object detection is a fundamental task required for many image and video
processing applications like video surveillance, medical imaging, satellite imaging,
biometrics identification, automated inspection in industry products etc. Basically
this involves segmentation of moving object in the scene.
Segmentation subdivides an image into its constituent regions or objects. The level
to which the segmentation is carried depends on the problem being solved.
Segmentation uses different techniques like morphing, point, line and edge
detection.Problems with illumination like shadows on the background,difference
in the intensities of the objects in the image may arise in segmentation.
We aim to implement a robust moving object detection algorithm that can detect
object in variety of challenging real world scenarios.We organize the video into
frames in which the background is stationary.We use image processing tool box for
obtaining the object by subtracting the frames.The moment of the object is
described using edge detection techniques. We will collect experiment datasets for
these scenarios for testing our algorithm performance.
CONTENTS
CHAPTER 1:
INTRODUCTION
CHAPTER 2:
CHAPTER 3:
SYSTEM DESIGN
CHAPTER 4:
4.3 Screenshots
CHAPTER 5:
5.1: Applications
CHAPTER 6:
CHAPTER 7:
7.1: Conclusion
7.2: References
1:INTRODUCTION
1.3 OBJECTIVE
We aim to implement a robust moving object detection algorithm that can detect
objects in variety of challenging real world scenarios.
2: SYSTEM ANALYSIS AND DESIGN
MATLAB
256MB RAM
3:SYSTEM DESIGN
imfill(): It is used to fill the small holes in the object which have a
closed outline.
plot(): This function is used plot lines on the frame. We use it here to
draw a bounding box around the object.
addframe(): This adds the specified frames into an avi object created.
This avi object is later presented as a video.
3.3. PROBLEMS ENCOUNTERED
The different color intensities of the image may give noise at further
stages.
3.4. DESIRED OUTPUT: The desired output of the task is to show the
movement of the object alone.
The frames obtained in the yester stages are unified into a single object. The
output is shown as a video. Abounding box is plotted around the object to
show the area in which object is present.
4: CODING AND SAMPLE OUTPUT
4.1 CODE
aviobj=avifile('sp','COMPRESSION','NONE','fps',3);
for i=2:50
string1=strcat('E:\MATLAB\work\cind\',int2str(1),'.jpg');
im1=rgb2gray(imread(string1));
s %figure,imshow(im1);
string2=strcat('E:\MATLAB\work\cind\',int2str(i),'.jpg');
im2=rgb2gray(imread(string2));
%figure,imshow(im2);
im=imsubtract(im1,im2);
%figure,imshow(im);
f=im2uint16(im);
t=graythresh(f);
b=im2bw(f,t);
%figure,imshow(b)
m = imclose(b,se3);
%figure,imshow(m);
n=imfill(m,'holes');
n=imdilate(n,se5);
n=imfill(n,'holes');
%figure,imshow(n);
se4=strel('disk',6);
%n=imopen(n,se4);
%figure, imshow(n);
n=imerode(n,se4);
n=bwareaopen(n,50);
[L,num]=bwlabel(n,8);
k=1;
figure,imshow(n);
hold on
if k==1
[r,c]=find(L==k)
ymin=min(r)
xmin=min(c)
ymax=max(r);
xmax=max(c);
end
x=xmin:xmax;
y=ymin;
plot(x,y,'-r','LineWidth',5);
x=xmin:xmax;
y=ymax;
plot(x,y,'-r','LineWidth',5);
x=xmin;
y=ymin:ymax;
plot(x,y,'-r','LineWidth',5);
x=xmax;
y=ymin:ymax;
plot(x,y,'-r','LineWidth',5);
hold off
hfig = imgcf;
F(i) = getframe(hfig);
aviobj=addframe(aviobj,F(i));
end
aviobj=close(aviobj);
4.2: SAMPLE OUTPUT
5: APPLICATIONS
Moving object detection is a fundamental task required for many image and video
processing applications like:
video surveillance
medical imaging
satellite imaging
biometrics identification
A moving object can also be detected when the background is not stationery.
7.1. CONCLUSION
www.google.co.in/.com
www.mathworks.com