Image processing with 4D uCam


Long time back I bought this serial camera from 4D System, and shortly after that dumped in one of the boxes… Lately, however, I started “investigating” the image processing option and seems the cheap solutions are no longer available on the market (AVRcam). After I’ve seen a project on a website using a uCam and MBED microcontroller solution, I started to think more about it. The project is just taking snaps, calculate the difference between 2 consecutive frames and if any change control some servos to move a big eye to look in that direction. A bit creepy, but interesting. While the guys do not give a dime if is 1 frame in few seconds, I need a solution that is cheap and can process at least 2-3 frames per second and detect blobs of different colors in a frame, then return  the position for each of them and the size.

Anyway, with a bit of hacking and lots of time and motivation managed to come up with a solution using MBED (LPC1786) and the uCam (actually can use any processor), that does a basic image processing, able to detect 3 blobs of different colors in a frame and with a speed of 3 fps when connected to Processing to visualise the data. Still working on the code, tuning the communication between the camera and microcontroller, but looks promising.

Last few days I was just playing around with it and considering to get a small arduino board to be able to work with it. Unfortunately, not sure how much speed can get from it, cause if we do the math: for a small (80 x 60 pixels) frame using 8 bits per pixel (RGB332)  we already talk about 4.8 Kbytes per frame, which means already 1 second almost for a frame on a 57600 serial line, idealy, maybe 2 fps for a 115200 line, which means no Atmega328P with NewSoftSerial option (that can not go well over 38400 bps), maybe something like Atmega644P instead?

Also, looking at the cheap OV7670 parallel cameras that are so cheap on eBay… Unfortunately, you need to build everything by yourself and very low-level… Anyway, I saw someone who managed to connect a OV7670 to Arduino, guess I’ll be digging in that direction too. For now the 3 FPS I get are more than enough just need to work on a GUI and fine-tune it a bit. Will post pictures and (maybe) movies soon ^_^

Advertisements

4 thoughts on “Image processing with 4D uCam

  1. I want to ask that would I able to track color with arduino mega and ov7670(+fifo) ?
    (I mean It should be fast enough)
    Is the arduino’s ram capable to hold the entire picture taken out from camera to color tracking?

    • A QVGA (320×240) frame takes 150 Kbytes, if you are using Arduino Mega 2650 you will have only 8 Kbytes of SRAM. You can use SPI SRAM to store an entire frame if this will help.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s