#368 Save Lensfun configuration (On/Off, Model, Auto, ...) to .ufrawrc

open
5
2014-03-05
2014-03-03
Volker
No

While it is possible to save the Lensfun configuration in the image's ID file, e. g.

<Lensfun>
<LensModel>Nikon, Nikon AF Nikkor 50mm f/1.8D</LensModel>
<Distortion Index="None">
<Model Label="PanoTools lens model">
-0.002550
0.008410
<c>-0.011070</c>
</Model>
</Distortion>
<LensGeometry>Rectilinear</LensGeometry>
</Lensfun>

, the resource file (.ufrawrc) always stays untouched, even if I deactivate Lensfun and explicitly use the option Save/Save image defaults/Just this once.

Users will consider it a bug when just the Lensfun configuration is NOT saved as a default setting to be remembered between activations.

While it is negotiable, if things like the state of the "Automatically find lens and set lens corrections" button should be saved (I think they should), there are definitely photographers, who would like to use Lensfun only with lenses, manually, that could profit from such a correction and accept the tradeoff of slightly reduced sharpness.

Suggestion:

Save state of
- "Automatically find lens and set lens corrections"-button,
- if NOT activated/pressed:
- save state of correction controls (Camera, Lens, focal width, aperture, distance, parameters, etc.)
- if activated/pressed
- don't save (or overwrite at startup) state of correction controls (Camera, Lens, focal width, aperture, distance, parameters, etc.) for the lateral CA, vignetting, lens distortion and geometry tabs.

Discussion

  • Volker

    Volker - 2014-03-03

    Sorry. The ID file should have been:

      <Lensfun>
          <LensModel>Nikon, Nikon AF Nikkor 50mm f/1.8D</LensModel>
          <Distortion Index='None'>
            <Model Label='PanoTools lens model'>
              <a>-0.002550</a>
              <b>0.008410</b>
              <c>-0.011070</c>
            </Model>
          </Distortion>
          <LensGeometry>Rectilinear</LensGeometry>
      </Lensfun>
    
     
  • Udi Fuchs

    Udi Fuchs - 2014-03-04

    The correct place to save lens model is in the lensfun database. The other option would be to save settings per lens in ufrawrc, but that would require reimplementing the lensfun database, which does not make sense.

    The state of lensfun correction in ufraw (on/off) should probably be saved in ufrawrc. A patch would be welcome.

     
  • Volker

    Volker - 2014-03-05

    Hi Udi!

    I don't know how Lensfun corrections are implemented in UFRaw. But since I can set parameters for unknown lenses or even decide myself, that I indeed want to have visible vignetting, I suspect the the actual parameters are reported to the Lensfun module and not just the name of the lens or its ID.

    That said, I would appreciate UFRaw to use my settings that I have decided to use for processing a raw image and save it in the .ufraw recipe, so there are no automatisms applied that I am not in control of when I run ufraw-batch. Or more concretely: If I set a=0.0, b=0.0, c=0.0, k1=0.6, k2=1.3, k3=1.8 for an image taken with my 50mm Nikkor F/1.8 AF-D, I want them to stay that way when running ufraw-batch.

    To-date, UFRaw/Lensfun looks up the 50mm Nikkor F/1.8 AF-D in its database again and applies default correction(s). Furthermor and IMHO, the state of lensfun correction (ON/OFF for aberration, vignetting, distortion, geometry) must be saved in .ufrawrc, so that ufraw and ufraw-batch honor them.

    Unfortunately, I'm developing on Win7x64 with MS Visual Studio 2012. Installing msys, mingw-runtime, w32api, binutils and gcc is a bit too time-consuming right now. So my workaround is, to hide the Lensfun database from UFRaw and not to use ufraw-batch when vignetting correction etc. is involved.

    Thanks for your support and many greetings,
    Volker

     
  • Volker

    Volker - 2014-03-05

    Addendum: Sorry, I'm feeling a bit stupid now.

    Precisely put, UFRaw only automatically (and errationally) looks up lens correction data,
    - if the lens is known in the database,
    - the "Lens correction/Lens" editbox is populated
    - if you set "Lens correction/Lens distortion/Model" to "None",
    - save the .ufraw recipe
    - and reopen it with UFRaw.

    An exemplary .ufraw recipe section looks like this:

            <LensfunAuto>no</LensfunAuto>
            <Lensfun>
              <LensModel>Nikon, Nikkor 105mm f/2.8D AF</LensModel>
              <Distortion Index='None'>
                <Model Label='PanoTools lens model'>
                  <a>0.000000</a>
                  <b>0.001420</b>
                  <c>0.000000</c>
                </Model>
              </Distortion>
              <LensGeometry>Rectilinear</LensGeometry>
            </Lensfun>
    

    , so you would expect "Lens correction/Lens distortion/Model" being "None" after reopening. In fact, it is "PanoTools lens model".

    Here comes the fun part: If you manually remove the

        <LensModel></LensModel>
    

    entry from the .ufraw file, UFRaw opens it correctly with "Lens correction/Lens distortion/Model"="None"! In that case, it doesn't matter if

        <LensfunAuto>no</LensfunAuto>
    

    or

        <LensfunAuto>yes</LensfunAuto>
    

    is present in either .ufraw or .ufrawrc. Long story short:

        <LensModel>
    

    somehow takes priority over

        <Distortion>
    

    which it shouldn't. On a sidenote: ufraw-batch behaves the same.

    I hope you can make some sense out of those observations and thank you for your patience.

    Volker

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks