Question

I am using LinkSprite JPEG Color Camera to take picture. I am getting hex values of the picture data as string in C Sharp from UART. User manual of the camera explains the data structure of the picture as starting with hex FFD8 ans ends with FFD9. The values I am getting fits this description. When I save this hex values to a file using ByteWriter but output file is invalid and I can not see the picture.How can I convert these values to JPEG file?

I am using HCS12 Microcontroller based DRAGON trainging board. I am getting camera data via UART. And I am using C to write my code on DRAGON board. Here is my code:

http://pastebin.com/dR4BJMBZ

Camera information:
http://www.sparkfun.com/products/10061

User manual:
http://www.linksprite.com/upload/file/1333187137.pdf

My C# code:

http://pastebin.com/WXnTL7jd

Was it helpful?

Solution

Olcay Ertaş ,, you are right it is not raw data

My friends and I faced the same problem while working with our camera. Like you we extracted the HEX data using the UART, and like you we didn't see the picture. For us the problem was that using a notepad to save the Hex data will only save it as an ASCII string. (we used notepad to save the raw data)

Here is how we solve it:

  1. We used the XVI32 hex-editor program (which is free).
  2. Take the hex data and copy it from the FF D8 ... till the FF D9.
  3. Use the program to insert the string into a new file.
  4. Save the file as a .jpg file.

I hope it works for you as it did with us.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top