Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Real Time image capture

Subject: Real Time image capture

From: Srikanth

Date: 2 Jun, 2005 20:38:44

Message: 1 of 9

Hi

I need to use a webcam for some real time tracking application. Could
anyone tell me how to capture images in real time? I can't use any of
the standard windows functions - when i try to use the real time
workshop, it gives errors with c code having calls to windows
functions. An external dll call doesn't seem to work in real time
either. Since i need it to run in real time, all my s functions are c
code based and i can't use any of the matlab function calls..

Is there any image capture block for simulink or something like that,
which will work with real time?

The rate i need is not that high, say 10 fps. The camera is a USB based
webcam. Can i grab data directly from the usb port in real time? If so,
is there any standard by which i can retrieve the picture from the data
or does it depend on the camera manufacturer?

Any suggestions?


Thanks
Srikanth.

Subject: Real Time image capture

From: Herbert Ramoser

Date: 3 Jun, 2005 08:12:44

Message: 2 of 9

Srikanth wrote:
> Hi
>
> I need to use a webcam for some real time tracking application. Could
> anyone tell me how to capture images in real time? I can't use any of
> the standard windows functions - when i try to use the real time
> workshop, it gives errors with c code having calls to windows
> functions. An external dll call doesn't seem to work in real time
> either. Since i need it to run in real time, all my s functions are c
> code based and i can't use any of the matlab function calls..
>
> Is there any image capture block for simulink or something like that,
> which will work with real time?
>
> The rate i need is not that high, say 10 fps. The camera is a USB based
> webcam. Can i grab data directly from the usb port in real time? If so,
> is there any standard by which i can retrieve the picture from the data
> or does it depend on the camera manufacturer?
>
> Any suggestions?

Take a look at:
http://www.mathworks.com/products/image/
http://www.mathworks.com/products/imaq/
http://www.mathworks.com/products/viprocessing/
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=247&objectType=file
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=2939&objectType=file

-Herbert

Subject: Real Time image capture

From: Srikanth

Date: 3 Jun, 2005 04:08:57

Message: 3 of 9

Hi
Thanks for the reply, but this is not what i had in mind.. I tried the
VFM before, but the problem is that it is still an external dll and
doesn't work with RTWT. I can't use the source since it calls the vfw.h
and uses windows commands... Or is there any method to use VFM/VCAPG in
real time?

The video processing toolbox doesn't seem to have any capture routines,
while the image acqusition toolbox is used at command line.

Does anyone know if the rtwinlib of Matlab 6.5+ have any built in
blocks for image capturing? Or is there any other solution for
capturing the image for real time application?

Thanks
Srikanth

Subject: Real Time image capture

From: Herbert Ramoser

Date: 3 Jun, 2005 13:36:42

Message: 4 of 9

Srikanth wrote:
> Hi
> Thanks for the reply, but this is not what i had in mind.. I tried the
> VFM before, but the problem is that it is still an external dll and
> doesn't work with RTWT. I can't use the source since it calls the vfw.h
> and uses windows commands... Or is there any method to use VFM/VCAPG in
> real time?
>
> The video processing toolbox doesn't seem to have any capture routines,
> while the image acqusition toolbox is used at command line.
>
> Does anyone know if the rtwinlib of Matlab 6.5+ have any built in
> blocks for image capturing? Or is there any other solution for
> capturing the image for real time application?

If you really have to use the RTWT you will be in trouble. Why don't you
just use plain Matlab (or Simulink) to do the image processing. If timer
is not sufficiently accurate it should be fairly easy to write a MEX
that acquires images at a fixed rate. If you take advantage of the IPP
accelerated image processing toolbox functions you should be able to
achieve a high frame rate.

If RTWT does not give you access to Windows functions it will be
difficult to acquire images from a camera (unless you have the SDK for
your camera which bypasses Windows).

-Herbert

Subject: Real Time image capture

From: Brian Wherry

Date: 3 Jun, 2005 11:52:12

Message: 5 of 9

Hi Srikanth,

The Image Acquisition Toolbox has a Simulink block that allows you to
capture video from a DirectX USB camera in real-time. It also supports RTW
code generation for host targets, meaning you can generate a standalone .exe
for your capture/processing system. The block does not support RTWT,
though -- it still needs DirectX.

Look here:
http://www.mathworks.com/access/helpdesk/help/toolbox/imaq/blocks.html

HTH,

Brian

"Srikanth" <skt@xdtech.com> wrote in message
news:1117769924.684816.252380@g49g2000cwa.googlegroups.com...
> Hi
>
> I need to use a webcam for some real time tracking application. Could
> anyone tell me how to capture images in real time? I can't use any of
> the standard windows functions - when i try to use the real time
> workshop, it gives errors with c code having calls to windows
> functions. An external dll call doesn't seem to work in real time
> either. Since i need it to run in real time, all my s functions are c
> code based and i can't use any of the matlab function calls..
>
> Is there any image capture block for simulink or something like that,
> which will work with real time?
>
> The rate i need is not that high, say 10 fps. The camera is a USB based
> webcam. Can i grab data directly from the usb port in real time? If so,
> is there any standard by which i can retrieve the picture from the data
> or does it depend on the camera manufacturer?
>
> Any suggestions?
>
>
> Thanks
> Srikanth.
>

Subject: Real Time image capture

From: Srikanth

Date: 3 Jun, 2005 22:10:34

Message: 6 of 9

Hi

Thanks for the information. The problem is, that after capturing the
image, I do some calculations and provide some output to a port. This
is done in RTWT. If i try it in simulink, the simulation is too fast
for the correct o/p...

Any suggestions?
Thanks
Srikanth

Subject: Real Time image capture

From: Joel PĂ©rez Gallardo

Date: 27 Nov, 2005 15:15:09

Message: 7 of 9

I'm using a Web cam for Visual Serviong whit 30ftp
and Real Time Target and windows, but in necessary not use s
function, the embedded block is right.

Subject: Real Time image capture

From: santhosh

Date: 6 Feb, 2006 05:30:45

Message: 8 of 9

Srikanth wrote:
>
>
> Hi
>
> I need to use a webcam for some real time tracking application.
> Could
> anyone tell me how to capture images in real time? I can't use any
> of
> the standard windows functions - when i try to use the real time
> workshop, it gives errors with c code having calls to windows
> functions. An external dll call doesn't seem to work in real time
> either. Since i need it to run in real time, all my s functions are
> c
> code based and i can't use any of the matlab function calls..
>
> Is there any image capture block for simulink or something like
> that,
> which will work with real time?
>
> The rate i need is not that high, say 10 fps. The camera is a USB
> based
> webcam. Can i grab data directly from the usb port in real time? If
> so,
> is there any standard by which i can retrieve the picture from the
> data
> or does it depend on the camera manufacturer?
>
> Any suggestions?
>
>
> Thanks
> Srikanth.
>
>

Subject: dsp using power saving unit

From: santhosh

Date: 6 Feb, 2006 05:37:20

Message: 9 of 9

santhosh
> Hi
>
> i want to know that is there any usb to parallel converter
> does it requires any driver to be installed
>please reply me soon
>& what this function do<I=vfm('grab',1);>
>thankyou

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us