Pages: [1]   Go Down
Author Topic: getting image data from camera  (Read 1500 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone!
Here goes the question about dealing image data from camera with arduino.


1. What I want to do

What I'm trying to do is to get single image data from camera, and process it in realtime while receiving data, and just proxing the data to Spi RAM.
I know there is no much room for whole image data on Arduino's SRAM,
but I read a sample code which wrote image data right into the SD card from camera in realtime, chunk by chunk.
(camera: http://www.linkspritedirect.com/product_info.php?products_id=16)
(sample code: http://www.linksprite.com/upload/file/1286079786.txt)

So in this sense, I think it is possible to read image from camera and do some process and store processed data to Spi RAM.

Image processing will not be so complex and its main regard will be just converting raw(?) pixel data into 1bit data(black/white), so that 8 pixels in a row makes only one byte.
I want 384x600 pixel black/white image, so final data size should be 384 / 8 * 600 = 28,800 (under 29kb).
I'm going to use 32k Spi RAM, so storage issue will not matter.


2. What I want to know

First, am I correct so far?

Second, is it possible to do this with CMOS camera like this? (not done enough research yet but: http://www.sparkfun.com/products/8667)
I noticed that the sample code I mentioned above is dealing with TTL camera, and the camera seems only offering 160*120 resolution, which is never sufficient.
I know almost nothing about camera, but found that TTL interface cameras are more expensive than just 'CMOS cameras,' if they offer same resolution.
So I wonder what are differences between them, and where I can find some tutorials dealing with CMOS camera with Arduino.


I know it would be somewhat annoying question which might makes no sense at all, since I know almost nothing about how camera makes/sends data.
But PLEASE HELP ME. My ears are all open, and any reply will be much appreciated!

**sorry for bad english
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh, the camera I first mentioned is JPEG camera.
I thought the data transmitting consists of pixel data, but now I think it might not.
I don't know how the JPEG data looks but I'm afraid it's not pixel by pixel data. It might be just bunch of compressed values.

Right?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26489
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't know how the JPEG data looks but I'm afraid it's not pixel by pixel data. It might be just bunch of compressed values.
Correct. The pixel data is transformed into the frequency domain and the results compressed.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks AWOL!

OMG where should I start this again?
Any clues please?


My prototype was using webcam with Processing.
Using Processing, getting pixel data and converting them wasn't any matter, but oh,
it's really hard to figure out how I can do the same thing independently, without computer.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ignoring the issues with capturing the data, what are you going to do with the image once you have it stored in the SPI RAM?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26489
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It is feasible to do a partial decode of the JPEG to get only the DC components of the image (which are only delta coded) and form a thumbnail and process that, but with a source image only 160x120, the thumbnail would only be 20x15.
I have done this in the past, but the processor was 32 bit, a little faster and had a barrel shifter, which made unpacking the Huffman-coded image quite a bit quicker.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for replies!

dxw00d, I'm trying to make instant camera with my thermal printer.
So my plan was re-read SPI RAM and write data to thermal printer.

AWOL, thanks, I see it is not feasible to decode JPEG file with Arduino instantly...



So.... I think now there are two ways to do this.
First way is getting new camera which gives data pixel by pixel, and it should not be too fast.
Maybe CMOS cameras can do this? I don't know please let me know how CMOS camera works.

Second way is to just forget about Arduino things and do it with other ARM things.
But I cannot do that! HOW SAD!
Logged

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Related topics:
http://arduino.cc/forum/index.php/topic,100179.msg755625.html#msg755625
http://arduino.cc/forum/index.php/topic,100576.msg755946.html#msg755946

You can send the JPG to PC then process individual x,y pixels using Processing.
Only a few lines of code in Processing to get started.
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know sbright33, I already made prototype(?) with Processing + Arduino.
The thing is that I want to make it completely independent, you know, not needing any PC things.

Thanks for your kind advice!
Logged

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I look forward to hearing about your success!  Even if it is only partial or limited...
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Pages: [1]   Go Up
Jump to: