darktable 3.8 and lensfun database

Hi,

I am using dt 3.8 on a mac (fantastic job by the developers!) and one of the lens I am using (Nikkor 50mm f/2.0) does not seem to be included in the darktable embedded database, although it is present in lensfun (Lensfun). Is there a way to update the database to the current lensfun version?

thanks!
giuseppe

lensfun-update-data
has been discussed several times in this forum.

Thanks for the pointer, I did previously search the forum. However, installing the lensfun port via macports and running lensfun-update-data returns the error:

Traceback (most recent call last):
File ā€œ/opt/local/bin/lensfun-update-dataā€, line 46, in
import lensfun
ModuleNotFoundError: No module named ā€˜lensfunā€™

But upon further reflection, it also seems odd that the lens is not present in the darktable embedded database, as it seems to be included in lensfun at least from version 0.3.0 (latest release is 0.3.2). Furthermore, the list of lenses in darktable does not seem to match one-to-one that on the lensfun webpage (for instance, all the nikon coolpix camera lenses are present on the lensfun webpage, but not in darktable).

Sorry, canā€™t help regarding Mac specific questions, Iā€™m on linux. Getting lensfun-update-data to run without error seems the most obvious first step for me.

Even strangerā€¦ If I open the file:

darktable.app/Contents/Resources/share/lensfun/version_1/slr-nikon.xml

I do find the lens spec:

Nikon Nikkor 50mm f/2
(sorry, I do not seem to be able to post here the xml snippet, as it gets formatted)

Why then it is not showing up in the dt interface?

installing lensfun via macports ist not that easy because you need an older version :wink: see https://github.com/darktable-org/darktable/blob/master/packaging/macosx/BUILD.txt

Relevant steps:

mkdir -p ~/ports/graphics/
cp -R "$(port dir lensfun)" ~/ports/graphics
curl -Lo ~/ports/graphics/lensfun/Portfile https://github.com/macports/macports-ports/raw/c94887a0760bdbfaf1469e20b85d06635ff294d1/graphics/lensfun/Portfile
portindex ~/ports

Add file:///Users/<username>/ports (change to your actual login) to /opt/local/etc/macports/sources.conf before [default] line.

Then uninstall lensfun

sudo port uninstall lensfun

and then

sudo port install lensfun

Thank you Martin. Although, as per my last message, I guess that wonā€™t help as the lens seems to be included in lensfun/version_1/slr-nikon.xml: it just doesnā€™t show up in the dt interface

<model>Nikon Nikkor 50mm f/2</model>
        <model lang="en">Nikkor 50mm f/2</model>
        <mount>Nikon F</mount>
        <!-- Average crop factor of Nikon APS-C cameras -->
        <cropfactor>1.528</cropfactor>

so itā€™s just defined for APS-C cameras.

And btw: no need to update your lens db yet since there arenā€™t changes since packaging of dt3.8 ā€¦

Interesting! it is definitely wrong though, as this is a classic slr lens (pre-digital) for 35mm film cameras. If I removed the two lines abou the crop factor, would the lens show up?

Hi @gpagnon ,

But what name does your lens really report?

In a terminal, run this command

exiftool xxxxx.yyy | grep Lens

and copy|paste the result here.
(xxxxx.yyy is of course one of your raw images)

ā€” or simply upload one of your RAWs here, so we can
see with our own fingers what happensā€¦ ā€”

Have fun!
Claes in Lund, Sweden

Actually the lens is an old manual lens so exiftool does not return any useful information. But I am pretty sure the APS-C spec in the xml file is wrong, as there does not exist any Nikkor 50mm f2 for APS-C cameras (indeed, the lens spec is found under the slr-nikon file, and slr nikons were obviously all 35mm).

Just to be precise:

Lens Type : MF
Lens : 0mm f/0
Lens Data Version : 0204
Lens ID Number : 0
Lens F Stops : 0.00
Lens ID : Manual Lens No CPU
Lens Spec : 0mm f/0 MF

Ciao, Guiseppe,

So, if the lens does not report itself,
it is no wonder that darktable does not
recognize it :slight_smile:

Sounds like a preset in darktable would
be a solution for you.

/Claes

Yes, but the correction wonā€™t help since these were calculated from an image taken with an APS-C sensor :wink:
You might have a look at PIXLS.US - Create lens calibration data for lensfun

To be precise: it will show up in the lens correction module

1 Like

Hi Claes,

I was not assuming that darktable would automatically recognize the lens: I just wanted to be able to select it from the drop down listā€¦

Hi Martin,

I seeā€¦ so the calibration was probably done by somebody mounting the full-frame lens on an APS-C camera. In that case, yes, I guess I would need to do the thing myself . Thanks for clarifying.

best
giuseppe

Distortion correction samples:

Vignetting correction samples:

Tca correction sample to:

1 Like

I tried to convert an existing LR profile for the lens, using lensfun-convert-lcp (on a linux box), and managed to get the xml snippet for the lens, but unfortunately stumbled upon the issue that lensfun-convert-lcp produces a version 2 lensfun database while dt uses a version 1 (so the lens isnā€™t really read in by the interface). Oh well, I guess Iā€™ll let it sit for a whileā€¦

I might be wrong, but seems to me the only difference ATM is the number 1 or 2 on the first line of the XML fileā€¦

I never succeded converting lcp files from Adobe to Lensfun in darktable. Or rather, darktable didnā€™t find the generated data.