I am interfacing an embedded device with a camera module that returns a single jpeg compressed frame each time I trigger it.
I would like to take three successive shots (approx 1 frame per 1/4 second) and further compress the images into a single file. The assumption here is that there is a lot of temporal redundancy, therefore lots of room for more compression across the three frames (compared to sending three separate jpeg images).
I will be implementing the solution on an embedded device in C without any libraries and no OS.
The camera will be taking pics in an area with very little movement (no visitors or screens in the background, maybe a tree with swaying branches), so I think my assumption about redundancy is pretty solid.
When the file is finally viewed on a pc/mac, I don’t mind having to write something to extract the three frames (so it can be a nonstandard cluge)
So I guess the actual question is: What is the best way to compress these three images together given the fact that they are already in JPEG format (it is a possibly to convert back to a raw image, but if i dont have too…)
I’m adding this as a second answer because it’s VERY different from my first now that I better understand your problem.
I find it HIGHLY unlikely that you will be able to work with the jpeg files directly. In compressed files, a small change tends to be propagated across a large portion of the file, causing the two files to fail to compare in many places.
I have two suggestions.
1: zip the images up. Seems too simple, you probably already thought of it, but the zip protocol is well known and freely available and will automatically take advantage of any similarities it can. Again just get a camera take three pictures; zip them up and see how it goes.
2: A little more complex but you could uncompress the three jpegs into bmps, concatenate the bmps (line them up one after the other) then re-compress to a jpeg. The jpeg protocol should take full advantage of the similarities in the three images and the work is pretty minimal from your point of view.