Hello all,

I just realized that on my Sony a7R II (and this probably applies to all of
the cameras in this series, probably even the NEX), if you have certain
camera settings, some lens corrections are baked into the ARW files (Sony's
raw format) -- that is the bit values appear to change, not just the
metadata.

I've been doing some experiments with my lenses as I have been calibrating
them for lensfun (and now may have to re-do the TCA corrections).

The two corrections affected are vignetting corrections (Sony calls this
Shading Compensation), and CA corrections.

This means that when lensfun applies the corrections, they could be
applying them twice if the camera had already applied them to the raw.

Now, in an ideal world, we would instruct the user to always turn these
off, and apply lensfun corrections once, but perhaps an even better
approach would be to have the lens correction module *not* apply TCA and
vignette corrections depending on whether or not the EXIF data says it has
already been applied.

0x2011 VignettingCorrection (uint32); 2 = auto, 0 = off
0x2012 LateralChromaticAberration (uint32) 2 = auto, 0 = off

0x797d LightFalloffParams int16[17]; first integer seems to be 16 if this
is a supported lens with vignetting data, 11  when using a legacy adapted
lens (possibly a bit field?)
0x7980 ChromaticAberrationCorrParams : exact same as above

So the criteria would be:

if (VignettingCorrection == 0 || LightFalloffParams[0] != 16)
    applyVignetteCorrections();

and similar for CA.

An even more advanced approach would be to parse those values, undo them,
and apply the lensfun data, as the in-camera corrections don't seem to be
enough to get rid of the light fall off and CA as well as lensfun data does.

Distortion correction doesn't seem to ever be applied to the ARW file (just
the JPG), so we can always apply those.

Anyway the main question is, I can code this; but does this belong in
lensfun, rawspeed/libraw, or darktable's lens correction module?

References:
[1]
http://www.sonyalpharumors.com/the-big-sony-test-in-camera-lens-compensation-by-jorg-haag/
[2] https://diglloyd.com/blog/2015/20150527_0544-Sony-lens-corrections.html

P.S. Sorry about the formatting, I typed this in gmail. I can reformat if
needed.
-- 

-- 
Kelvie Wong

___________________________________________________________________________
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org

Reply via email to