File Exchange

image thumbnail


version (9.17 KB) by vishal rana
live data is acquired and analyzed to calculate any motion and latest image is storded.


Updated 11 Apr 2012

View License

The system architecture is going to function in following way:
1. Capturing the live video feed through a web cam : To detect motion we first have to capture live video frames of the area to be monitored and kept under surveillance this is done by using a web cam which continuously provides a sequence of video frames in a particular speed of FPS (frames per second).

2. Comparing the current frames captured with previous frames to detect motion: For checking whether any motion is present in the live video feed, we compare the live video frames being provided by the web cam with each other so that we can detect changes in these frames and hence predict the occurrence of some motion.

3. Storing the frames on the memory if motion is detected. If motion is being detected, we would require storing such motion so that the user can view it in the near future. This also helps the user in providing a legal proof of some inappropriate activity since a video coverage can be used as a proof in the court of law.

Comments and Ratings (13)

i am using logitech usb webcam but it is not work for this motion example

Taiem Hasan

how to use with ip camera vice webcam

Manoj kiran

Its really nice and it works well., it would be better if add function for bounding box and centroid calculation of moving object.

please explain how we did this


can we process active contour(snakes) in live video streaming...please may i have some more suggestions in this concept..??

thank you

maha fnj


HI.. Vishal .. Does this will Work on R2010b... Im Getting error in GUI Callback


I would like to ask you about could you help me ? I'm interesting in active contur by using snak and I have problem in the program.

The program concerns the analysis of motion in image sequences using techniques Snakes. It is a movie horse jumping over an obstacle. Highlight the contours using active contour snake. Then select the most important features such as the horse, the distance from the obstacle the horse feet from the ground, etc., With the program will compare the films of other jumping horses with our model, and mark whether it is better or worse. This is a general problem to be solved.I hope you can help me if you will agree I will send you the details.

Yours sincerely



hi,When i was running the code it is working fine and i clicked on stop video button it is giving me an error
Error is

??? Error using ==> imaqdevice.trigger at 51
OBJ must be running before TRIGGER is used.

Error in ==> MOTION>pushbutton1_Callback at 125

Error in ==> gui_mainfcn at 96

Error in ==> MOTION at 42
gui_mainfcn(gui_State, varargin{:});

Error in ==>

??? Error while evaluating uicontrol Callback

can any help me with this


thanks Its so benefit :)


Now with added gui...

MATLAB Release Compatibility
Created with R2011a
Compatible with any release
Platform Compatibility
Windows macOS Linux