Question
Olympus micro 4/3 cameras apply distortion correction on their in-camera JPEGs when used with a micro 4/3 lens. Panasonic cameras correct both distortion and chromatic aberration with their lenses.
Although I'm not sure where this information is stored, since this also works on the off-camera software I'd guess that it's in metadata attached to the RAW images.
Is this format documented anywhere (either officially or through reverse-engineering)? It would be nice to be able to implement this correction in open-source software (specifically lensfun) without needing to either calibrate the lens or rely on the calibration database.
EDIT: to make this perfectly clear - the objective is to take the RAW file from the camera and be able to apply the same correction that the in-camera JPEG gets, or that gets applied by the Olympus software.
Answer
There appears to be a pretty rich Open Source movement in the Linux community to generate raw file format processors for linux. I've found several wiki's that are working on compiling file format details for known RAW formats, and there are a few applications that contain some code. Some formats, like Canon's .CRW and .CR2, are open specifications and you can find the details online. It seems that the .ORF format (or the Panasonic .RAW format) are not open, so the only thing knowledge that can be gleaned is via reverse engineering. I doubt that the information you are looking for is contained within EXIF data, however if it is stored, it should be available in RAW format metadata. Here are some resources:
- http://osp.wikidot.com/raw
- Project to decode RAW file formats
- http://osp.wikidot.com/raw-linux-software-comparison
- List of open source programs that decode .ORF (and other formats)
- http://www.cybercom.net/~dcoffin/dcraw/
- Contains the DCRaw project
- Has some free code that does basic interpolation of raw bayer info for .ORF
- http://www.cgsecurity.org/wiki/PhotoRec
- Home of PhotoRec
- Source code can be downloaded here:
- http://www.rawsamples.ch/index_en.php
- Contains a bunch of sample raw formats, including Olympus
The bulk of a RAW file format is a direct sensor data dump, either from a Bayer array, CCD, or possibly a layered CMOS (like the Foveon.) That makes the image data pretty easy to spot, as it is very patterned. The data you are interested in will likely be more complex and and random, either stored at the beginning or possibly the end of a file format. I've done a fair amount of file format reverse engineering in my day, and may be able to recognize some structure in the .ORF format for you. (I worked on an editor for Sim City 4 and the Sims 2 a number of years ago, and alongside a few others, we must have decoded some 300+ file formats via HEX. I may be able to help provide some insight if I can get a hold of some .ORF raw files from the camera+lenses you have access to.) Your best bet, if you wish to have support for lens correction added to lensfun, would be the open source movements to bring RAW processing to Linux.
UPDATE:
Alternatively, it seems like Adobe has released a Lens Profile generator that can generate lens profiles for Lightroom 3/ACR. They cover geometric distortion, chromatic aberration, and vignetting. I know you mentioned something that could be used with the program lensfun, but this might be a viable alternative.
Check more discussion of this question.
No comments:
Post a Comment