image grabbing
Message-ID:<ff3078d5-a019-483a-bc8b-2184c45e8844@i24g2000prf.googlegroups.com>
Subject:
image grabbing
Date:Thu, 5 Feb 2009 18:13:39 +0100
hi
I'm interested in doing real time image processing project.so I tried
to interface a usb 2.0 webcam to matlab using following commands--
vid = videoinput('winvideo',1);
set(vid,'FramesPerTrigger',1);
while (1)
start(vid)
data = getdata(vid);
end
but the function "start(vid)" takes 3 seconds and it is too much.i
dont know how i can decrease this time to less than 1 second.
who can help me to decrease the time of image grabbing?Is it better to
use simulink blocks? Can MATLAB do tow things simultaneouly or should
I use another software such as Labview?
Message-ID:<C9GdnZDj8Zoh3DfUnZ2dnUVZ_gSWnZ2d@giganews.com>
Subject:
Re: image grabbing
Date:Sun, 1 Mar 2009 09:05:16 +0100
On Thu, 05 Feb 2009 09:13:39 -0800, sinasi20 wrote:
> hi
> I'm interested in doing real time image processing project.so I tried to
> interface a usb 2.0 webcam to matlab using following commands-- vid =
> videoinput('winvideo',1);
>
> set(vid,'FramesPerTrigger',1);
> while (1)
> start(vid)
>
>
> data = getdata(vid);
> end
>
> but the function "start(vid)" takes 3 seconds and it is too much.i dont
> know how i can decrease this time to less than 1 second.
>
> who can help me to decrease the time of image grabbing?Is it better to
> use simulink blocks? Can MATLAB do tow things simultaneouly or should I
> use another software such as Labview?
I found the following code via google. I'm curious whether grabbing
multiple images might avoid the high latency of grabbing one image at a
time.
Randy
% Create video input object.
vid = videoinput('winvideo')
% Set video input object properties for this application.
% Note that example uses both SET method and dot notation method.
set(vid,'TriggerRepeat',Inf);
vid.FrameGrabInterval = 5;
% Set value of a video source object property.
vid_src = getselectedsource(vid);
set(vid_src,'Tag','motion detection setup');
% Create a figure window.
figure;
% Start acquiring frames.
start(vid)
% Calculate difference image and display it.
while(vid.FramesAcquired<=100) % Stop after 100 frames
data = getdata(vid,2);
diff_im = imadd(data(:,:,:,1),-data(:,:,:,2));
imshow(diff_im);
end
stop(vid)
http://www.edaboard.com/ftopic325427.html
Message-ID:<ff3078d5-a019-483a-bc8b-2184c45e8844@i24g2000prf.googlegroups.com>
Subject:
image grabbing
Date:Thu, 5 Feb 2009 18:13:39 +0100
hi
I'm interested in doing real time image processing project.so I tried
to interface a usb 2.0 webcam to matlab using following commands--
vid = videoinput('winvideo',1);
set(vid,'FramesPerTrigger',1);
while (1)
start(vid)
data = getdata(vid);
end
but the function "start(vid)" takes 3 seconds and it is too much.i
dont know how i can decrease this time to less than 1 second.
who can help me to decrease the time of image grabbing?Is it better to
use simulink blocks? Can MATLAB do tow things simultaneouly or should
I use another software such as Labview?
Message-ID:<C9GdnZDj8Zoh3DfUnZ2dnUVZ_gSWnZ2d@giganews.com>
Subject:
Re: image grabbing
Date:Sun, 1 Mar 2009 09:05:16 +0100
On Thu, 05 Feb 2009 09:13:39 -0800, sinasi20 wrote:
> hi
> I'm interested in doing real time image processing project.so I tried to
> interface a usb 2.0 webcam to matlab using following commands-- vid =
> videoinput('winvideo',1);
>
> set(vid,'FramesPerTrigger',1);
> while (1)
> start(vid)
>
>
> data = getdata(vid);
> end
>
> but the function "start(vid)" takes 3 seconds and it is too much.i dont
> know how i can decrease this time to less than 1 second.
>
> who can help me to decrease the time of image grabbing?Is it better to
> use simulink blocks? Can MATLAB do tow things simultaneouly or should I
> use another software such as Labview?
I found the following code via google. I'm curious whether grabbing
multiple images might avoid the high latency of grabbing one image at a
time.
Randy
% Create video input object.
vid = videoinput('winvideo')
% Set video input object properties for this application.
% Note that example uses both SET method and dot notation method.
set(vid,'TriggerRepeat',Inf);
vid.FrameGrabInterval = 5;
% Set value of a video source object property.
vid_src = getselectedsource(vid);
set(vid_src,'Tag','motion detection setup');
% Create a figure window.
figure;
% Start acquiring frames.
start(vid)
% Calculate difference image and display it.
while(vid.FramesAcquired<=100) % Stop after 100 frames
data = getdata(vid,2);
diff_im = imadd(data(:,:,:,1),-data(:,:,:,2));
imshow(diff_im);
end
stop(vid)
http://www.edaboard.com/ftopic325427.html



RSS News Feed