Processing images

Hello,
I am a new arduino programer and I want to know if there is a
way to processing images in arduino.
For exemplo I want to know if some picture is green or yellow
using a webcam.
Thanks.

Not enough power to do that I'm afraid. Cirtainally without heavy duty hardware to go with it. What about something like the nxt colour sensor, instead of a webcam?

Yes... a color sensor will be better to me.
But the problem is that I don't Know a color sensor
or RGB to arduino. If the sensor wold be cheap.
Thanks.

I am not sure how to hook one up or what your budget is but Color Light Sensor - Avago ADJD-S371-Q999 - SEN-08618 - SparkFun Electronics may work?

Thanks a lot.
This kind of sensor I was needing.

Not enough power to do that I'm afraid.

Correction: Not enough power to do that quickly.

Also see:
http://www.cs.cmu.edu/~cmucam/

:stuck_out_tongue: How would you load the image into RAM? Even at .3 MP I dare say it is larger than 2KB. It would be faster to trian a team of elite ninja squirrels to gab red green and blue buttons.

How would you load the image into RAM? Even at .3 MP I dare say it is larger than 2KB. It would be faster to trian a team of elite ninja squirrels to gab red green and blue buttons.

IIRC, the cmucam does everything on-board (via a built-in mcu), and just spits out blob, color, position, and size information based on commands/requests from the external microcontroller.

:slight_smile:

How would you load the image into RAM?

Quite often, you simply don't need any more than a line or three of image in memory at any one time to do quite complex image processing.

I've done useful real-time processing on images with resolutions as low as 32x32 pixels with processors barely faster than an AVR.

Newbie dumb question along these lines...
What if I connected up one of these?

The C328-7221 is VGA camera module which is specially designed for serial communication and working under low light condition. It performs as a JPEG compressed still camera and can be attached to a wireless or PDA host. Users can send out a snapshot command from the host in order to capture a full resolution single-frame still picture. The picture is then compressed by the JPEG engine and transferred to the host thru serial port.

That gets me a jpg on a serial connection.

Assuming for a moment that I can get it,
and I provide space somewhere on a board to store it,
and that speed is not a metric I am concerned about,
Could I then take apart the jpg in arduino and identify blobs/positions, or are you saying that there are no libs that will do that on the arduino processor?

Could I then take apart the jpg in arduino and identify blobs/positions, or are you saying that there are no libs that will do that on the arduino processor?

I haven't come across a JPEG decoder library, but at some stage you're going to have to decompress (I would guess) at least a row's worth of 8x8 (64 byte) JPEG blocks, so you're going to need sufficient RAM to store all that.
Now, JPEG decode involves Huffman decode and inverse discrete cosine transform, neither of which is particularly suited to the AVR's architecture.
All of this has to be done before you can even start to examine the image.
There are a few tricks, like only decoding the DC component, which will give you a 64:1 image size reduction, and you can probably ignore both the U & V components.
I'm not saying it's impossible, but unless you're monitoring glaciers, or plate tectonics, I don't think this is a route worth pursuing.

What if I connected up one of these?

are you saying that there are no libs that will do that on the arduino processor?

Yes there are no libraries for this basically because even with JPEG compression the arduino only has 2K of memory for everything or 8K on the Mega. There is simply not enough room in which to put a file, to begin to take it apart.

Sounds like a job for a cortex M3 to me.. isn't there an M3 based board like the arduino out there?