Project

General

Profile

Bug #9999

TCA correction does not work until you choose a lens

Added by YAFU YAFU about 5 years ago. Updated about 5 years ago.

Status:
Confirmed
Priority:
Low
Assignee:
-
Category:
Darkroom
Target version:
Start date:
06/23/2014
Due date:
% Done:

10%

Estimated time:
Affected Version:
git development version
System:
Ubuntu
bitness:
64-bit
hardware architecture:
amd64/x86

Description

Hello.
After trying for a long time and I think that TCA correction did not work, I realized that I had to first select a lens to TCA correction has effect. My camera has no lens profiles for LensFun, but if I choose a generic lens, then TCA correction works very well.
In UFRaw the chromatic aberration correction can work without its being necessary to choose a lens. Maybe Darktable could work in the same way.
Using Darktable 1.5+1286~ged22281 on Kubuntu 14.04.

lensfun-broken-tca-changed.patch (1.85 KB) lensfun-broken-tca-changed.patch Pascal de Bruijn, 08/22/2014 07:41 PM

Related issues

Related to darktable - Feature #9273: lens correction enhancement - more understandable interfaceNew02/18/2013

History

#1 Updated by Christian Kanzian about 5 years ago

Hi,

If you are looking for general CA correction, you could use the Chromatic aberrations modul:
http://www.darktable.org/usermanual/ch03s04s04.html.php#d0e7372

christian

#2 Updated by YAFU YAFU about 5 years ago

Hi Christian, thanks.
I had discussed this in the IRC channel. Chromatic aberrations module does not seem to do much on the kind of chromatic aberrations of my photos. On IRC I had shared some examples before I realize that TCA correction really worked on Darktable, but it was necessary first to choose a lens for TCA correction take effect. This is the link of the samples (press Slow Download button):
http://www.fileswap.com/dl/5X2o9FZLWh

#3 Updated by Christian Kanzian about 5 years ago

Hi,

Sorry I didn't know that. So this sounds more like a feature request "Use TCA correction for not supported lenses". As workaround you could maybe create a fake lens entry in the lensfun library - can be in your path - so that you don't need to select a general lens by hand. The best of course would be to calibrate it.

christian

#4 Updated by Torsten Bronger about 5 years ago

There is already a "generic lens" in Lensfun. However, this is not obvious and inconvenient.

#5 Updated by Pascal de Bruijn about 5 years ago

So I've briefly looked into this issue...

When you switch to manual TCA correction in UFRaw, it seems UFRaw synthezis a generic lens:

http://ufraw.cvs.sourceforge.net/viewvc/ufraw/ufraw/ufraw_lensfun.cc?content-type=text%2Fplain

char *lens_model = g_strdup_printf("Generic, Crop factor %.4g",
Transformation.CropFactor);

Which turns into something like "Generic, Crop factor 1.5", which matches the "Generic, Crop factor 1.5 (APS-C)" lens in the lensfun database because UFRaw does fuzzy matching IIRC.

Now in Darktable this won't work since we don't do fuzzy matching (as we want to avoid accidental lens matches and inadvertant invalid corrections). I've attached a (quasi-broken) patch which should implement a similar heuristic to lensfun, but it's not working properly, and would require further work to become functional and may very well require changes on lensfun's side as well.

To mitigate the usability side of the issue somewhat I've disabled the TCA sliders when they are non-functional:

https://github.com/darktable-org/darktable/commit/2c0e4905967b48a3fc46d187dd1e9e0d99095a03

It's not quite ideal, but slightly better still.

#6 Updated by Pascal de Bruijn about 5 years ago

Actually I've extended this to the entire lens correction module user interface:

https://github.com/darktable-org/darktable/commit/7d293cd5e8412e22de48037a343acad52c15dbf6

#7 Updated by Torsten Bronger about 5 years ago

One should be able to perform manual TCA correction by making up a lens and a modifier object. The following snippet is probably non-working and possibly not even valid C, but it may get the idea across:

lens = lf_lens_new();
lens.crop = 1;
lens.aspect_ratio = 1;
struct tcac = {LF_TCA_MODEL_LINEAR, 1, [red_slider, blue_slider]}
lf_lens_add_calib_tca(lens, &tcac)
modifier = lf_modifier_new(lens, 1, width, height);
lf_modifier_initialize(lens, format, 1, 1, 1, 1, targetgeom, LF_MODIFY_TCA, false);

#8 Updated by Roman Lebedev over 4 years ago

  • Related to Feature #9273: lens correction enhancement - more understandable interface added

Also available in: Atom PDF

Go to top