Hi,
i m use sparkfun's jpeg color camera - uart interface C328 module with Arduino mega.
The problem is module is too slow for my project when i use JPEG data format. i decided to get picture uncompressed format to accelerate the system thence i got rid of data header and checksum and my system is i want as fast as but this time module is sending to me 8 bit YCbCr code type.
The question is how can i convert this data format to JPEG and which programming language need i use to do this the easiest way?
i googled and read lots of titles and e-books and than i confused, could someone lead to me the right way,please?
Hi Richard,
Firstly thanks your quick reply
You re right, i have to more information about what i try to do. I try to do wireless QR decoding system. And i'll make a network with XBees so speed is more important than data volume for me.
The properities of which i take photo;
color type : 2-bit gray scale
preview resolution : 80 x 60
snapshot : uncompressed
so size of the picture is 1200 bytes
On the other hand OV528 chip is caused communication error with Arduino. if i get picture uncompressed type, there isnt any comminication error.
I send this uncompressed photo datas a host PC with XBee modules after i took the photo from the camera module so JPEG conversion will be doing on PC.
Arduino is only sending datas which gets the camera.
In fact what excatly i want to ask which programming language need i to conversion YCbCr to Jpeg on PC the easiest way? :-/
No, of course it doesnt have to be JPEG, it can be gif or etc. I dont know anything about Huffman code but i ll read it as soon as possible. i ll find this link on wikipedia, could you offer any link about this subject?
I dont understand "run-legth code?" means by the way? which code's size did you ask? arduino code(4888 byte at the moment but i ll add this code a little bit :D) or QR decoding code( i havent written this program yet :o)??
I dont know anything about Huffman code but i ll read it as soon as possible
You'll need to anyway if you want to do JPEG encode/decode.
Run-length (sorry for the typo) coding is simply counting the number of identical samples along a row or column, and replacing the run with the count and the sample value. Fax machines used run-length coding, because documents were mostly monochrome, with large areas of only one tone.
Sometimes, it is possible to code the differences (deltas) between adjacent pixels.
JPEG is tricky for a slow eight bit processor, because it involves a discrete cosine transform over 8x8 pixel blocks, followed by quantisation of the coefficients, run-length coding following a zig-zag path through the coefficients and then huffman coding of the run-lengths.
For 80x60, you'd either have to lose some pixels, or pad, because 60 isn't an integer multiple of 8.
Which compression algorithm you choose really depends on the sort of images you expect to transmit the most.