File Exchange

image thumbnail

IMAQMOTION - Image acquisition motion detection

version (3.19 KB) by

A live image acquisition motion detection GUI.



View License

Using the Image Acquisition and Image Processing Toolboxes, IMAQMOTION offers a MATLAB based motion detection GUI.

Using a video input object, live data is acquired and analyzed to calculate any motion between two adjacent image frames. Any motion in the image stream is plotted in a MATLAB figure window.

To create the display, simply associate a video input object with your hardware and provide it to IMAQMOTION:
obj = videoinput('matrox', 1);

Comments and Ratings (27)

ragy atef

Chen Mr

Wow~ So Cool~


GEORGE (view profile)

pretty good!

hello dear friend/Sir,
This solution is superb.
could you, please anyone figure out me where is the code segment which detect the motion in this program.
Please help me.
Thank You.

hello dear friend/Sire,
This solution is superb.
could you, please anyone figure out me where is the code segment which detect the motion in this program.
Please help me.
Thank You.

Kok Hong

im doing a project of sign language recognition. can i know izit possible to return to rgb when detect any motion?


Maria (view profile)

Guys!! I am doing my final year project on noice and movement detection...(i am studyinG telecommunications and IT). i am using the code below for the noice detection but it seems not to be working correctly (it always shows that target exists)
please help!!

1.At the begining i record my voice and save it to the yrecordedtarget file.Then i am making another recording (which doen't has any noice) and save it on the yrecordednoise.
The code for the above is:

y=wavrecord(5*Fs, Fs, 1);

%save yrecordednoise y Fs
save yrecordedtarget y Fs

%the histograms of the .wav files
%Normalization of the histograms

%save the variables in a file
%filename = strcat('hist_noise');
%save(filename, 'y', 'h_noise','bins')

filename = strcat('hist_target');
save(filename, 'y', 'h_target', 'bins')

load hist_target
% plot(bins,h_target)

%load hist_noise
% plot(bins,hist_noise)

2.Then i am doing the detection:

clear; clc

cd 'e:/matlab.proj'

load hist_noise
load hist_target

%recording of the the signal w
y=wavrecord(5*Fs, Fs, 1);
%training it there is target or not

while (i<=length(y))

% [h1,bins]=hist(y,length(y));
% [h2,xout]=hist(x,length(y));
% [minval2,minind2]=min(abs(y(i)-bins));
if h_target(minind)>h_noise(minind)



if counter_target>counter_noise
'target exists'

'no target'


nice speed of operation


stephy (view profile)

i am using matlab version 7.5 ,i got this error when i run your code, is ter anything thing i ned to type to run it?
??? Error using ==> imaqmotion at 55
IMAQMOTION is unable to run properly.
Input argument "obj" is undefined

respected sir
i am susheel and i student of IIIT allahabad , i am studing M.Tech (IT) , my final year thesis "real time face detection and face recognition " in Matlab

so i need help i am not getting how to do
so sir please help me i need code for my thesis

so please send me code "real time face detection and face recognition" in matlab

think you sir


vikram (view profile)

can some one help me debug this error..

Warning: File 'log.txt' not found.
> In motion_detection>togglebutton1_Callback at 96
In gui_mainfcn at 75
In motion_detection at 42
Warning: File 'film.avi' not found.
> In motion_detection>togglebutton1_Callback at 97
In gui_mainfcn at 75
In motion_detection at 42
Warning: File 'var.mat' not found.
> In motion_detection>togglebutton1_Callback at 98
In gui_mainfcn at 75
In motion_detection at 42

radio =


??? Error using ==> videoinput.videoinput
There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.

Error in ==> sad_algorithm at 17
vobj=videoinput('winvideo',2) %initializes a video object to connect to camera

Error in ==> motion_detection>togglebutton1_Callback at 101

Error in ==> gui_mainfcn at 75

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

??? Error while evaluating uicontrol Callback.


I am also doing my project in motion detection. I need some help instead of always using difference of two frames can i go for any other efficient algorithm. If any please send me to
If you have code send it also. Thank You for the help.

sir i hav a that we are tracking a motion detection and after catching the frame difference between two frames we send the capture image to the ower cell pls can u help me that hw can we find the edges in matlab and can we calculate the difference between to frames..pls sir can u help me out ..i will be very thankful..regards bhaskar

Roel de Jong


UCSC Undergrad

Awesome work dude!

ayman hwedi

marzia marzia

sherif El-Etriby

sherif El-Etriby

Asghar Ayati

shakiba moaddab

mesheal tanious

i saw your very Intelligent work but i have a big problem because my project is more difficult my project is to tracking atarget using a camera conected to the computer and according to the image catched and some actions (like filtering , compairing , calibrating , etc the program have to out a control signal to drive a stepper motor to follow the target
really i need you kind advice and your kind help
really i will be very happy if you reply me
in all cases you work is very good and i hope you to go ahead
many thanks

magrini antonio

jam krutosky


hello dear friend,
i saw ur work it was realy excellent and i hope that u can upgrade it with some more interesting changes.But there is a prblem with me that i m also working on the Project "motion detection using matlab" oohhh sorry i didnt intriduced myself i m doing computer and information system engineering in NED UET karachi Pakistan.But there is a slight diffrence in usrs and mine project that i have to detect the motion from a security camera that is connected to the computer and as it find something moving it will take the snap and will store it to the computer.In these regards i really very need ur help and i will very very thankful to u if u help me for that i need the matlab code u used in ur poject so that i get an idea of the work u did and plz send me also the brief explanation of the code if u could do so i will remember u for the whole of my life for this act thanks.

aneesh nanda

sir,i hv a project regarding horizontal optical tracking of a target using u help me out.kindly let me know.i'll b grateful2u.

yip kah weng


Updated license

MATLAB Release
MATLAB 7 (R14)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today