Hi all, I have a project that is capturing image using a camera and string the images in micro SD card using a microcontroller.
Camera link is below. http://www.tigal.com/1787
Interface: RS232 Min size of SD card support required is 1GB.
Since the camera sends the image data in Snapshot Picture Preview (RAW) Picture JPEG Picture these formats, I would like my controller to receive them as it is and store them in SD card either using file system or without file system (No complex processing). Controlling the camera will be done by my controller.
My questions are: 1. Does a windows computer can read an image file without file system (Raw image)? 2. Which controller will be cheep and best for this project (Cheep evaluation board is better; I can’t invest more than 200USD). 3. To interface SD card, LPC is having dedicated pins for them. So selecting LPCxxxx series would be better option.
Try this one - it rocks:
elm-chan.org/.../00index_e.html
Your camera gives jpeg images, so there is no "raw" sensor data requiring any program for conversion.
My assumption is that you want to use the SD card because you want to capture images from the camera without any PC available, and at a later time either connect your device to a PC or remove the SD card and connect to the PC to retrieve the connected photos.
You can find free file system implementations to use, so you don't have to write your own. But you will have to adapt the file system for your hardware, since a generic file system will not know how to read and write a sector using your specific hardware.
If you want to move the SD card into the PC and have the PC see the images without special software, then you do need a file system.
If you are ok with writing a custom application then you have multiple options.
One option is to have the PC write a huge "dummy" file to an empty FAT16 or FAT32-formatted SD card (should result in this file being stored in a continuous sequence of sectors). Then you can create your own simple system for storing image data, time stamps etc and a customized PC program can retrieve the data and mark the internals of this huge "dummy" file as empty. This is quite ugly, but possible. Internally inside the container file, you can store your image data as a variant of a linked list. Store header info + image data. Potentially pad to start of next sector for next header info (file name + size + capture time) + image data.
Another option is to skip any file system completely on the SD card and just store the image data in whatever format you want. But it will make it a bit harder for the PC program to pick up the data since it needs to perform raw accesses to the SD card. And the customer who puts the SD card into a memory card reader will be told that it doesn't contain any valid file system and asked if it should be formatted. So this is every uglier - there is a good chance that the user will reformat and lose all captured data.
A third option is to keep the SD card in your device and have a custom PC program use the serial port to retrieve captured images from your device. Then you can use a similar serial protocol as the camera does for retrieving the photos. And you can use whatever allocation scheme you can think of for storing the image data on the SD card without having to consider what will happen if the card is placed in the PC. One disadvantage is that the serial port will not be as fast when retrieving the data as the raw read speeds you get from a directly connected SD card.
The nicest method - and the only that doesn't require special PC software - is that you do use a standard file system, and do require the user to move the SD card from your device to the PC. With a real file system, you can then also with ease add logic to erase files on the card using some suitable policy if the SD card goes full because the user forgot to erase the files that was copied to the PC, or because the user left your device to capture photos for too long time.
According to the details quoted, the camera has the option to provide "RAW" data.
www.lmgtfy.com
Hi Andrew, I think i didnt explain you clearly, Final product cant be connected with any PC because that there will not be any PC available. But only to become familiar with camera functionality, i can use very well use your idea.
As i mentioned in my old post >>Whenever i want to see the images stored in the SD card, just remove the SD card from controller SD slot and view it on any PC by connecting to it.
I store the images in SD card and use a PC to view the captured photos.
As per said i will consider implementing free file system or use the second option.
For the first option, in a FAT formatted SD card if we write any raw data ex: Spiwrite("Nice to discuss my issues here", 30);, wont it destroy the file system?
I think you are still confused about the different meanings of "raw" data.
In the context of this discussion, it is used with 2 distinct meanings:
1. "raw" data from the camera; ie, unprocessed data direct from the image sensor.
2. "raw" access to the SD-Card; ie, directly accessing the sectors of the card without regard to any file system.
Clearly, writing directly to the sectors of the card without regard to any file system will corrupt any file system that happens to be on the Card!
"Final product cant be connected with any PC because that there will not be any PC available."
You didn't even mention that!
"Clearly, writing directly to the sectors of the card without regard to any file system will corrupt any file system that happens to be on the Card!"
But there's nothing to stop you using the files system to write a file that contains "raw" image data from the camera!
Hi Andrew,
>>>>"Final product cant be connected with any PC because that there will not be any PC available."
>>You didn't even mention that!
Ok. sorry for that. cool down :)
The "RAW" data which i was talking about, wether the camera gives the Raw unprocessed data or a compressed .jpeg format data, if we write the received data from camera into a SDcard(FAT filesystem formatted) by not using filesystem, that is Raw data to SD card and that destroys the file system of SD card. Am i correct?
Yes, the OP did post a protocol showing support for both RAW and jpeg.
But the KISS principle would suggest the use of jpeg data if that is the required end result, unless there is a need for maximum quality, i.e. no lossy compression and possibly a higher dynamic range than what fits into 8-bit color values.
More specifically, the OP did write "Flow is that using my controller trigger the CAM, get an Image, name it as Image1.jpeg and store it in SD card using same name, get an other image next time, name it as Image2.jpeg and store it in SD card using same name, and it goes on." so was talking about jpeg data.
Hence, I did write that there were no raw image data needing any special program for conversion. But still potential for raw memory card data accesses requiring special code to locate the image data.