I have an Arduino Leonardo and a Philips SPC220NC webcam. It's a 640x480@24bit pixels camera. It also can make still images. I need to photograph a Rubik' cube.
The question is: can I link the webcam to the Arduino so than I can send the data back to PC? I know that this kind of image size overflows the RAM of the Arduino, so maybe should I send the data in chunks?
I've looked on the forum regarding this topic, but I didn't find something conclusive.
It all depends on the camera and the protocol it uses. Do you have documentation for that?
can I link the webcam to the Arduino so than I can send the data back to PC?
Why not connect it directly to the PC?
Once it has to solve the Rubik's cube, you must put the camera in an exact position. One of the machine's purpose is to be in some way portable. How can I call it portable now if choose to link it directly to PC? I'll break the rule.
Regarding the documentation I don't know what to say...It's more like a ,,commercial" documentation, not a technical data. I got the idea of using a webcam, instead of a color sensor, because it's cheaper for me (I already have the camera). Along the color sensor I also need some servos, so the price goes up.
If I get no conclusive facts, than I'll be forced to use the other method.
You can get cameras which are designed to work with Arduinos. eg. Go on eBay and search for "Arduino camera".
An indirect solution for overall portability is to use a Raspberry PI motion to send image data over network or GPIO to the Arduino.
The bottom line is that you are not going to get the Arduino to read your webcam. And if you are streaming it to the PC per your original question, how does that make it anymore portable than simply connecting to the PC? It still requires the PC.
For one, even if the Arduino could handle the image, you would need a USB host and all the stack code and overhead to go with it to connect to the camera. Think about the resources involved in that part, and then you want to process an image on top of that?
Leaving the USB connectivity part aside, I suppose you could ignore a ton of data from the camera by breaking into blocks and just focus on average color value to use the camera as a color sensor. But even with that, you are going to get stuck on the pesky USB connection part.
I think you need to re-think this. A color sensor probably is the best choice. Or using a raspberry pi as suggested.