Newbie question - webcam

Hi guys!

Just found out now about arduino, and its great :slight_smile:

I want to develop a small project, and I want you guys to tell me if its possible to do it in arduino.

Basicly, I would like to know if its possible to connect a usb webcam to the arduino and make it process the image(photo) and then do something(for instance, controll some led's)

If that is possible to implement with the arduino, is it possible to run it with out beeing connected to the PC.

Just want to know if its possible, so I can start to digg on it :smiley:

Sorry if my questions are a bit stupid... :wink:

I'm not sure the arduino has enough processing power to do that. Maybe it does ^^
Maybe you could check this thread (in french the start, but it goes in english)
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1154816099

You can process what is coming from an optical mouse sensor, and it's fairly "easy" and fast, maybe a camera is possible, but I don't think it'll be at 30fps ^^

Basicly, I would like to know if its possible to connect a usb webcam to the arduino

Unfortunately the Arduino can't act as a USB host which this would require. You might be able use a camera element that is more low level.

--Phil.

I just unscrewed my Logitech webcam, to see if I can find the chip behind the ccd & it's datasheet, check if there's some kind of I2C or whatever, but all I can find was the CCD, a bunch of SMD resitors & caps et a crystal. I took the lens off and it seems that the CCD & the microcontroller are embedded in the same chip, and no markings.
My advice : try to find the cheapest webcam possible, maybe you'll be able to find the chip & learn a bit more about it, don't buy any thing with Logitech or Microsoft written on it ^^

Hi,

Basicly, I would like to know if its possible to connect a usb webcam to the arduino and make it process the image(photo) and then do something(for instance, controll some led's)

No way!

Just imagine a webcam that delivers an image at a really bad resolution and not even color only b/w.
This image will still have 76800 pixels so you would need to have at least RAM enough for 9600 byte just to store the image somewhere, no processing yet or anything else. But the arduino has only 1024 of RAM, so obviously it can't be done.

You will need a bit more processing power and RAM for any kind of image processing.
Eberhard

Hi,

Basicly, I would like to know if its possible to connect a usb webcam to the arduino and make it process the image(photo) and then do something(for instance, controll some led's)

No way!

Just imagine a webcam that delivers an image at a really bad resolution and not even color only b/w.
This image will still have 76800 pixels so you would need to have at least RAM enough for 9600 byte just to store the image somewhere, no processing yet or anything else. But the arduino has only 1024 of RAM, so obviously it can't be done.

You will need a bit more processing power and RAM for any kind of image processing.
Eberhard

That was my first thought, too, but what if you add 256kB memory (static RAM or something like that), to hold the image?

You could eventually poll the CCD regularly and retrieve the data for one full frame via I2C or whatever, store those datas on an external EEPROM or SDcard ... then take your time for processing the data. Once you finished processing, restart the procedure.
You'll have a loosy framerate, and you still have to find the right webcam with the good chip, but may be done eventually, don't you think?

try to find the cheapest webcam possible, maybe you'll be able to find the chip & learn a bit more about it,

I think trying to adapt a USB webcam will be a frustrating task--better to look at image capture components that are targetted at the embedded market.

--Phil.

You'll have a loosy framerate, and you still have to find the right webcam with the good chip, but may be done eventually, don't you think?

The question is why? It's like saying that you might be able to weld a joint with a lighter. It might be doable eventually, but the right tool exists for the job, so why not use that? If you want to be doing embedded image processing, use a microcontroller that can handle it (e.g. XMegas, 32-bit ARMs, etc), or get a camera that does most of the image processing for you.

  • Ben

That was my first thought, too, but what if you add 256kB memory (static RAM or something like that), to hold the image?

You would need 18 IO-Pins from the arduino simply to select the address of a 256kb static RAM and another 8 IO-Pins to read or write the value to/from RAM that counts up to 26.
Arduino only has 20 IO-Lines? Too bad doesn't seem to work :cry:

Seriously : Forget it!
Get yourself a mini-itx-board and a linux that runs on it. That will work, and is probably the cheapest solution around.

Eberhard

Hi!

Thank you all guys, it seems thats almost impossible to do it with the arduino.

I'll think on something else.

You would need 18 IO-Pins from the arduino simply to select the address of a 256kb static RAM and another 8 IO-Pins to read or write the value to/from RAM that counts up to 26.
Arduino only has 20 IO-Lines? Too bad doesn't seem to work :cry:

Eberhard

Oh, please. Parallel has a degenerate cousin. His name is Serial. Check him out.
You can do it with one I/O line (http://www.microchip.com/UNIO).

It's pretty obvious why this guy would like to go about it the way he's thinking about. You can get a USB webcam for $5, whereas you'd be very lucky to find a sensor+lens+interface "designed" for this less than $50. The economies of scale are so incredibly appealing for repurposing a mass-market widget that as a hobbyist, you'd be a moron to not at least consider trying to gut something packaged to start with. Great example, $20 for a Wii Nunchuck or $35-40 for a breakout board from Sparkfun, the former which many people can use immediately for $0 additional cost by whacking off the connector.

I'm not saying that you'll be totally successful in what you're looking to do, but there's a chance you can get at least something working if you're lucky enough to find the right item to hack. It should also be obvious that you're not going to be able to get very fancy with just an Arduino, though, too.

If you want a sample datapoint, check out the CMUCam. It does some pretty cool (but not astounding) stuff -- in the $200 price range. But it'll give you an idea about how quickly vision processing gets complicated/expensive. It's something that you can learn a ton from. Good luck.

-e

You could always use a DSP like the Blackfin with the webcam. I have a friend that worked at Analog Devices and he loved the Blackfin.

why not connect arduino to a router based board with linux to work with the webcam...(sorry for the dumb post, first post) :stuck_out_tongue:

Here's a project that used a image processing chip controlled by an AtMega32 as a security camera. It doesn't do any image processing, but it does show how one might capture images with a microcontroller.

http://www.riccibitti.com/witnesscam/entry/witnesscam.htm

Image processing is a pretty compute-intensive application. You either need an actual computer or some very specialized chips.

I was just searching for a similar solution, came across this thread and also this youtube video - control de estados flash+arduino+webcam - YouTube (can't post a hyperlink till I've done my first post, which this is...).

I'm guessing that the camera is actually connected to the PC with flash doing the processing, it's sufficient for what I wanted so I thought I'd put it on for anyone else looking for similar.

Maybe this cam is suitable for your needs: CMOS Camera - 640x480 - SEN-08667 - SparkFun Electronics
Note that it has a comfy I2C interface.
Cheers,
-P.

If you're looking for a cam you can hook up to the arduino AND use it, have a look at this:

http://thisismyrobot.blogspot.com/

He's using a cam that's read out by a parallax chip. The price is quite steep tho.
Just found it here (http://www.seattlerobotics.com/)

how about just use arduino to get the data from the webcam and then send the data by wireless to a PC to processsing the images?

what about using some thing like this?
http://www.ifirobotics.com/camera.shtml#Specifications

I was part of my local robotics team :slight_smile: