Project

General

Profile

Camera Support #11813

Embedded RAW data vs library support (lensfun)

Added by Robert Lousnberry 11 days ago. Updated 11 days ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
General
Target version:
Start date:
11/08/2017
Due date:
% Done:

0%

Affected Version:
2.2.5

Description

I've spoken to a few people and they have told me that there's no SDK to do the same thing that Lightroom would do to read the RAW data. Has anyone out there had any luck reading this data and knowing how to use it to return the information so it can be read? Finding the information is not the problem. I'm just looking for someone who may have experience as to how to use embedded RAW data once it's found.

History

#1 Updated by Tobias Ellinghaus 11 days ago

I don't really understand what you are asking. What data do you want to access? Lens correction? Pixels? And since I never used Lightroom I am not sure what it does either.

#2 Updated by Robert Lousnberry 11 days ago

Tobias Ellinghaus wrote:

I don't really understand what you are asking. What data do you want to access? Lens correction? Pixels? And since I never used Lightroom I am not sure what it does either.

I'm referring to the lens distortion/correction information. I'd like to understand better what the problem is in reading that information so it can return the proper distortion correction by reading the RAW file instead of relying on a third party database. Nobody knows what LR does, I just know they read the embedded data and I'm looking for a way to accomplish the same goal regardless of how LR implements their solution.

#3 Updated by Roman Lebedev 11 days ago

How is this relevant for darktable, exactly?

Robert Lousnberry wrote:

Tobias Ellinghaus wrote:

I don't really understand what you are asking. What data do you want to access? Lens correction? Pixels? And since I never used Lightroom I am not sure what it does either.

I'm referring to the lens distortion/correction information. I'd like to understand better what the problem is in reading that information so it can return the proper distortion correction by reading the RAW file instead of relying on a third party database. Nobody knows what LR does, I just know they read the embedded data and I'm looking for a way to accomplish the same goal regardless of how LR implements their solution.

Some raws contain the lens corrections, e.g. https://raw.pixls.us/getfile.php/1312/exiftool/14-bit-compressed.ARW.exiftool.txt LightFalloffParams DistortionCorrParams, but as you could have guessed, it is stored in makernotes, so there isn't exactly a documentation for it.
And most likely, the parameters are for some correction model that is not implemented in lensfun.

What's wrong with using lensfun, and providing your calibrations to the lensfun?

#4 Updated by Robert Lousnberry 11 days ago

Only that we have to wait on manual updates. There's nothing 'wrong' with using it. I'm just trying to better understand the difficulty in reading this information and why it's so hard, thereby requiring the use of a third party library. I would imagine that the end goal for any product would be to provide the most efficient way to perform a process and obviously reading the existing RAW data would be more efficient than waiting on third party lens updates. This is a problem I'd like to see addressed so I'm starting research on why it's so hard, what are the challenges, and why a solution hasn't been found yet. I understand there's no document for this stuff, and I'm not sure if reading them would require different code for each individual lens or just large groups like makes of the lens or all lenses at once.

I'm interested in speaking with someone who has had some success at this but maybe not found a full spectrum solution to the problem.

#5 Updated by Roman Lebedev 11 days ago

Robert Lousnberry wrote:

Only that we have to wait on manual updates. There's nothing 'wrong' with using it.

Are you aware of the lensfun-update-data tool?

I'm just trying to better understand the difficulty in reading this information and why it's so hard,

thereby requiring the use of a third party library.

Even if we would be using the lens corrections from the raw files themselves, i'm quite sure, we would still be using lensfun.
lensfun is not just the lens correction data.

I would imagine that the end goal for any product would be to provide the most efficient way to perform a process

I personally don't believe darktable is a Product, thus i don't believe any of the following is really applicable.

and obviously reading the existing RAW data would be more efficient than

waiting on third party lens updates.

darktable does not wait for anything. it simply uses whatever your local version of lensfun has.

This is a problem I'd like to see addressed so I'm starting research on why it's so hard, what are the challenges, and why a solution hasn't been found yet. I understand there's no document for this stuff, and I'm not sure if reading them would require different code for each individual lens or just large groups like makes of the lens or all lenses at once.

1. if the data is stored in raw, it is in the metadata, in exif, most likely in maker-specific makernotes
2. the format is obviously most likely custom for each maker
3. most likely, the actual correction model (formula) is different for different makers, and is different from what is already implemented in lensfun
4. when that data is supposed to be applied?

So
1. exiv2 would most likely need to at least learn what exif/makernote tags contain these corrections <- for each raw format, and not all formats have that data.
2. lensfun would have to grow some API to a) either directly use exiv2 to get these values, or b) darktable would need to read them, and pass to lensfun
3. lensfun would need to implement N new correction formulas (good luck reverse-engineering them)

It's huge endeavour with very little benefits IMO.
You can already get lens corrections, at max you need to help the community by doing the profiling yourself, and sharing the results :)

I'm interested in speaking with someone who has had some success at this but maybe not found a full spectrum solution to the problem.

Well, good luck :)

Also available in: Atom PDF