Possible camera integrations ?

22 Oct 2009

Hi - I've just (this minute) got my device up & running, and I have some newbie questions.

 

I'd like to get a camera up & running for some simple vision experiments. So:

(1) Is there any way to use a USB webcam with the mbed ? Can it act as a USB master ?

(2) Has anyone else tried using a camera ? If so, what camera did you use, and how did you talk to it ?

 

Thanks,
Richard

22 Oct 2009

Oh, and one more - if a chap were to use a camera like this one:

http://www.skpang.co.uk/catalog/product_info.php?cPath=169_176&products_id=543

and get jpeg data back over a serial connection, how hard is the jpeg decoding going to be on an mbed ?

 

thanks,

 

Richard

22 Oct 2009

Hi Richard,

Richard Sewell wrote:
I'd like to get a camera up & running for some simple vision experiments. So: (1) Is there any way to use a USB webcam with the mbed ? Can it act as a USB master ? (2) Has anyone else tried using a camera ? If so, what camera did you use, and how did you talk to it ?

Sounds like a great project, but a quick warning about the USB route. These cameras are usually made really cheap so suffer from two main problems; they can put a lot of demand on the host (the micro in this case), and it is often really hard to find information about what chip they use, and even then, the details of how it works.

This doesn't mean it is not possible; the mbed 1768 can act as a USB host, but we don't have any of those libraries in place yet, so it'd be ground up. If you do want to go this route, maybe spend a little time finding a camera with a well known chip/driver. A place to look could be linux device drivers maybe? It'd be a wonderful thing to get working.

Richard Sewell wrote:
Oh, and one more - if a chap were to use a camera like this one: http://www.skpang.co.uk/catalog/product_info.php?cPath=169_176&products_id=543 and get jpeg data back over a serial connection, how hard is the jpeg decoding going to be on an mbed ?
I think this could be a much better starting point to get results. Good find! Omnivision chips, which I think this is based on, tend to have reasonably good documentation, so this would be a much easier route I suspect.

Jpeg should be possible (ram might be the limiting factor - depends on what sizes you are planning). For jpeg codecs, maybe look at something like http://www.ijg.org. There may already be some ports around the internet for this for the Cortex-M3 (at least for ARM, as i'm sure i've seen people using it on the gameboy).

You may also find the camera has a mode where it just dumps out raw data, so it would be higher bandwidth/slower transfer time, but might allow you to get something going before worrying about jpeg.

Simon

22 Oct 2009

Hey Richard,

Although it is possible to connect a usb camera to an mbed, it is highly unlikely that you will be able to process more then 1 frame every 2-3 seconds.

The jpeg camera on the other hand is much easyer to connect with the mbed. Just connect the ground to the ground, the power to 3.3+ and the serial connections from TX and RX to pin 9 and 10 of your mbed. I dont know exactly how this product works, but you will probably have to write some code to capture the jpeg data and store it.

Another more suitable altertative is to use a program is Processing on your computer to capture USB webcam data. You can then let your computer transmit the serial data to the mbed so the decoding is done by the computer and only the commands are getting send via the serial USB port. I have experimented alot with USB processing so I could help you out if you are interested.

22 Oct 2009

Simon, Vlad - thanks for that.

I shall avoid the pain of USB for the moment, and look forward to basking in its glory when someone else has done the hard work. And, in the meantime, set to work with that skpang serial camera and the ijg codebase.

Richard

22 Oct 2009

Actually, this camera:

http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=45&products_id=369

seems to be better documented, and is definitely an Omnivision. There will clearly be code to write to talk to it, but the protocol seems to be specified.