Hey,
I'm looking for a good tutorial on how to interface a cmos camera with an arduino.
I'd like to start with:
In code, take snap shot of 640x480 RGB values
Store into matrix
Transmit matrix over serial to laptop. << I know how to do this
Construct Image File "ppm" << I know how to do this already
Display PPM << I know how to do this too...
I'm really just looking for a quick little 1 page summary of how to power the camera (3.3v, I'm guessing), to reading the data (just DI/O, I'm guessing).
Is there any kind of i2c command I need to know to turn on the camera or will it just start snapping at power on?
But is it possible to do this byte by byte?
Has anyone interfaced a cmos camera using an arduino?
I actually want to interface two cmos cameras and do image analysis on their pictures. So I dont need to store the entire photo in memory, only an array of the information I care about most. So, I'm not as worried about the memory as I am the interface.
void photo(void){
for(int y = 0; y<352; y++){
while(isVSYNup);
while(isVSYNdown);
for(int r = 0;r<244;r++){
while(isHREFdown);
for(int h = 0;h<y;h++){
while(isPCLKup);
while(isPCLKdown);
}
usart_putc(PINY);
while(isHREFup);
}
}
}
I'm trying to figure out if this would work with an arduino...
Obviously the constants:isHREFup, isPCLKdown would need slight conversion.
But what I'm most concerned about is: the Breakout Board from Sparkfun has: MCLK PCLK LVL FVL DST and ENB...
I'm not sure how these correspond to isVSYNup, isHREFup
Thus... I'm wondering: has anyone ever used this interface board before? Ive read that I would need around 11MHZ to do it... my arduino is 16MHZ. So... should be possible?
Even if I just streamed the 8 bits as a char to the computer of serial, one bit at a time...
I'd like to interface this camera using an Arduino because its C++ and it's a known platform, and I have a bunch of these micros kicking about in my desk.
Has anyone ever interfaced those formats to get "pixel" data?
I mean, I just wana get data into a micro from a camera...
Which camera is slightly irrelevant.
Also... What about Maple from Leaf Labs? Would 70MHZ do the job?
Generating is a whole lot easier, and generally low resolution.
I've had 3 or 4 bit CCIR video out of a 4MHz (1MHz instruction rate) 18 pin PIC, but the resolution was very low. It is possible to get Pong on a PIC.
PAL resolution is 720x576 full frame (25Hz) or 720x288 (50Hz).
You can trade resolution (temporal or spatial) but both have downsides, depending on your application.
[edit]Just to put it into context, a single line of PAL/CCIR video is 64us long, of which about 52us contains video.
A single pixel is therefore about 72ns long.
By comparison, a single bit period (and it takes ten periods to transmit a whole byte) on a 9600 baud serial line lasts 104us.
[/edit]
I cannot help with concrete tasks, but at least I can tell you what can be done.
I got a mate at the university that reads out a 320x200 cmos camera with an ATmega32 and does his computer vision on it. He traces along the image to track connected regions. He uses one color channel for that.
He optimized some of the code in assembler so that the he doesn't have to wait for every newline signal but exactly knows when it should be there and stuff like that.
But hell, this is almost impossible, so I would look for an easier setup to start with.