Re: grabbing from USB-Webcam (2nd)
On Sat, 2003-11-29 at 02:06, Markus Hansen wrote:
> Does someone have an idea, how to grab an image from a webcam
> and store the image in a variable in C++?
> I want to do some Vision-Control on an industrial robot,
> therefore I have to grab images from the webcam at regular intervals.
> I do want to code this in C++.
> Has someone have an idea or can send me a link to someone,
> who is grabbing images from webcams?
I wrote a library called libfg  for image capture that will do what
you want. It is written in C and uses the Video4Linux API, so will work
with TV tuner cards, video capture cards, and even USB cameras. It has
been tested on a variety of cards (mostly bttv based) and a few
cameras. It should work with Firewire cameras using the V4L loopback
interface, but I haven't tried it yet.
It was written for our Robocup  team  and is also used in a few
other projects . It provides a simple interface for controlling
capture parameters, and transparently handles double-buffering. It has
been used in several realtime applications, and provides a simple fast
way for image capture.
If you are doing industrial control, I suggest you look at something
better than a webcam for image acquisition. Both the frame rate and the
image quality is typically not very good. I suggest you have a look at
a decent analog camera (with a real lens) or (even better) a Firewire
There are a variety of image processing libraries you can choose from
also. Check out VXL , OpenCV  and Gandalf . They are all
FS/OSS, and you can interface libfg with them all.
Have fun, and Good luck!
Gavin Baker // gavinb*antonym_org // Linux|Python|Esperanto|MIDI|Cheese