darktable icon indicating copy to clipboard operation
darktable copied to clipboard

Feature Request or Bug [lens correction] Auto-calculation of params, when auto-applied via preset and modified "corrections"

Open AxelG-DE opened this issue 5 years ago • 25 comments

Is your feature request related to a problem? Please describe.

For some of my lenses I have a preset in lense correction, which I apply automatically based on camera/lens combination.

Today I realized, when I change "corrections" away from all e.g. to distortions&TCA, in that case the aperture and the distance to object (maybe even focal length) is stored as well and not automatically altered any more.

Actually the same problem occurs when copying even recognized lens corrections (w/o preset) over to another picture, apperture and distance to object are not altered (I mostly shoot prime, so donno for focal length). With this I almost consider this a bug

Describe the solution you'd like

It would be more logical and appreciated, that in all the other correction methods, the values still would be dynamically or automatically taken from the EXIF (I suppose), when applied via preset.

Same for copying lens correction via history stack (e.g. with distortion&TCA): The expectation is, that merely "lens correction = on with mode xyz" will be copied but not the aperture and distance to obj and focal length etc.

Alternatives

As I am doing Timelapses, I would not be over happy with a shortcut-workaround :-)

Additional context

AxelG-DE avatar Nov 22 '20 14:11 AxelG-DE

I stumbled across the same problem. My lens is not recognized automatically from the EXIF data, but is present in the lensfun database. So I have to create an auto-applied profile which sets the lens correction to the correct lens. Unfortunately, the focal length/aperture/distance values are also hardwired in the profile, which will be wrong in almost all other cases (zoom lens changes focal length, different aperture settings, different motive distances). Ugh, in retrospect the images sometimes look better without lens correction than with the wrongfully applied preset values.

acornsirup avatar Dec 11 '20 22:12 acornsirup

@acornsirup you may want to read #7022

AxelG-DE avatar Dec 12 '20 06:12 AxelG-DE

@AxelG-DE No, that actually doesn't solve anything. From what I understood in the other topic, darktable fails to correctly map the used lens despite existing EXIF data about the lens.

In my case, the EXIF doesn't contain information about the lens: $exiv2 -pa --grep lens/i Pictures/2020/PC174478.ORF Exif.Olympus.LensDistortionParams SShort 6 0 0 0 0 0 0

But I know the lens model, it's an Olympus Zuiko DigitalED 14-42mm f/3.5-5.6. I have an auto-applied preset which detects the "14-42mm" string and applies lens correction. But unfortunately it doesn't apply the correct aperture and focal length from the EXIF but uses the values of whatever picture that was used to save the preset.

acornsirup avatar Dec 18 '20 21:12 acornsirup

This issue did not get any activity in the past 30 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Jan 18 '21 01:01 github-actions[bot]

Apparently the missing lens description is a problem with my camera/lens configuration, as it was available in some older pictures. Still, there might be a incentive to fix this bug for all those cases where lensfun-profiled lenses are adapted to cameras of other brands and the EXIF data is lost somewhere in the adaption process.

Here is a RAW file with missing lens info: raw_picture_with_missing_lens_description.zip

acornsirup avatar Jan 22 '21 10:01 acornsirup

This is definitely still a good idea!

elstoc avatar Feb 01 '21 23:02 elstoc

Would changing the interpretation of params_t for this module, to not store the actual values for each field but only the overrides/adjustments to the default/autodetected values, solve this issue? This would require changes to gui_update, gui_changed (all params, even the _from_params sliders and combos, need to be adjusted after comparison with default_params) and commit_params. But we wouldn't need to detect and save the "modified" flag anymore.

The values for TCA could either be absolute numbers (or NaN if no override) or they could be relative numbers (i.e. take the autodetected value and add what is in params.

dterrahe avatar Feb 02 '21 09:02 dterrahe

Yes I think that sounds like the right sort of idea, though I'm not familiar with the code.

elstoc avatar Feb 02 '21 10:02 elstoc

The Profiled Denoise module manages to always account the ISO of the current image when applying presets. Maybe the parameters in the Lens Correction module have to be changed into the same kind of "parameter category"? Sorry, my coding skills and lingo are almost non-existent, please correct me if I'm wrong.

acornsirup avatar Feb 02 '21 19:02 acornsirup

This issue did not get any activity in the past 30 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Mar 05 '21 00:03 github-actions[bot]

This is still required. Just waiting for someone to work on it.

elstoc avatar Mar 05 '21 08:03 elstoc

This issue did not get any activity in the past 30 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Apr 05 '21 00:04 github-actions[bot]

This issue did not get any activity in the past 30 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar May 09 '21 00:05 github-actions[bot]

+1 from me Present behaviour is confusing If you set a preset for lens correction with corrections set to 'All' and everything left alone, it will correctly apply the focal length relevant to that image. If you select, for example 'Distortion and vignetting', as a preset, it pastes a constant value for focal length and doesn't read it from the image. As the CA corrections from 'Raw CA corrections' are much better than from lensfun, it would be useful to apply just distortion and vignetting as a preset that reads the focal length settings correctly. I am sure you are aware of this, and it is a matter of having time to fix it, but it would be great if this issue was fixed for 3.6. Thanks!

Yardlongbean avatar May 15 '21 08:05 Yardlongbean

This might be a complex dev work to fix, so seeing it land before 3.6 feature freeze is unlikely... But I do agree it would be a VERY welcome addition.

johnny-bit avatar May 15 '21 08:05 johnny-bit

OK, thanks, shame that it is complex to fix, I guess that's why it hasn't been done!

Yardlongbean avatar May 15 '21 09:05 Yardlongbean

This issue did not get any activity in the past 30 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Jun 15 '21 00:06 github-actions[bot]

I did not re-test yet, but assume, nothing has happened as there is no more "noise" :)

AxelG-DE avatar Mar 28 '22 17:03 AxelG-DE

I guess there hasn't been the time and resources to fix this, shame.

Yardlongbean avatar Apr 08 '22 06:04 Yardlongbean

TurboGit recently added the ability for presets to preserve the "auto" state of controls in a module. Does that address this feature request?

ralfbrown avatar May 09 '23 04:05 ralfbrown

@ralfbrown Can you provide a link, please? I'd love to read on that, thanks!

acornsirup avatar May 09 '23 09:05 acornsirup

See #13432. I just took a closer look, and it is all-or-nothing - if you wanted to use the auto-detected focal length, you can't also modify which corrections are applied. That would likely require binding a short Lua script to a shortcut.

ralfbrown avatar May 11 '23 05:05 ralfbrown

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Jul 11 '23 00:07 github-actions[bot]

ping :-)

AxelG-DE avatar Nov 04 '23 12:11 AxelG-DE

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar Jan 05 '24 00:01 github-actions[bot]

TurboGit recently added the ability for presets to preserve the "auto" state of controls in a module. Does that address this feature request?

I tested it again today (don't ask me, why I left it like this for long time). What happened is:

  • I tested pics with my 18.35/1.8 sigma
  • used a picture with 18mm and changed to distortion and TCA only (so the vignette remained in the pic)
  • copied over to a pic with the same lense but 35mm
  • What happened is, the module was on with its default parameters, which I assume is intended
  • the setting in corrections is then lost. If I understand the "all or nothing" correct, then this is the best, what can be achieved with reasonable efforts, I assume

me personally, I changed my habit and have many auto-applied presets in lens correction and hence almost all my lenses get automatically corrected. If I want to keep the vignette, I do this individually

AxelG-DE avatar May 31 '24 19:05 AxelG-DE