Missing lenses in module lens correction

I have been trying to update the lensfun module in darktable for some time. I believe I tried everything I could find about it here in the forum as well as in the rest of the internet. It still remains, there are a lot of lenses missing from the list.
Is there a step-by-step guide somewhere on how to bring lensfun up to date and have darktable recognize the lenses?
The following about the installation status:

dnf list \*lensfun\*
Last metadata expiration check: 3:08:42 ago on Mon 02 Jan 2023 12:14:47 CET.
Installed Packages
lensfun.x86_64                                                         0.3.3-1.fc37                                                  @rawhide
lensfun-devel.x86_64                                                   0.3.3-1.fc37                                                  @rawhide
lensfun-tools.x86_64                                                   0.3.3-1.fc37                                                  @rawhide
python3-lensfun.x86_64

It’s all version 0.3.3-1

Screenshot_20230102_151647

Did you run lensfun-update-data ?
(at least in Linux that’s the database update command)

1 Like

If you’re looking for the lens in the screenshot, Zeiss C Sonnar T* 50mm f1.5 ZM, I don’t think it’s in the database. Did a grep on “Sonnar” to the github master database, and came up with this:

glenn@bena:~/ImageStuff/lensfun/data/db$ grep Sonnar *
mil-zeiss.xml:        <model>Sonnar 85mm f/2.8 AEJ</model>
slr-sony.xml:        <model>Carl Zeiss Vario-Sonnar T* 16-35mm f/2.8 ZA SSM II (SAL1635Z2)</model>
slr-sony.xml:        <model lang="en">Zeiss Vario-Sonnar T* 16-35mm f/2.8 ZA SSM II</model>
slr-sony.xml:        <model>Carl Zeiss Vario-Sonnar T* 24-70mm f/2.8 ZA SSM II (SAL2470Z2)</model>
slr-sony.xml:        <model lang="en">Zeiss Vario-Sonnar T* 24-70mm f/2.8 ZA SSM II</model>
slr-zeiss.xml:        <model>Carl Zeiss Sonnar T* 135mm F1.8 ZA (SAL135F18Z)</model>
1 Like

if your darktable installation doesn’t use the system wide installed lens database updated by lensfun-update-data (e.g. for macOS package the database is included in the app package) then you need to copy the results yourself.
so first check, which lensfun database is used by darktable on your system …

sure. It doesn’t help to get any newer lenses into the db

I know, sorry. The lens in my example wasn’t the best choice. The screenshot should actually show how few lenses there are to choose from.

Thanks, I use Linux. I compiled the current darktable version from the git repository. The Lensfun version is installed from the Fedora repository.
I just checked this again by installing the darktable version from the Fedora repository. And lo and behold: Suddenly there are more cameras and also a little more lenses in the Fedora version of darktable.
Interestingly, the amount of lenses depends on the camera used. I didn’t know that lensfun had such dependencies built in.
The question is now, how can I check which lensfun directory is used by darktable from the Fedora repo and which one the compiled version?

Well, that’s more of the same problem, which is a dearth of representation in the database of your lens interests. Thing is, to solve it would require you to wade into the craft of lens correction. Or, wait for someone else to wade in…

I haven’t done it, but I’ve read through the documentation and it doesn’t appear to be that hard. Take a few shots with certain specifications, use them to extract alignment points and feed that to software that produces the correction parameters compatible with the lensfun algorithms. Take that with a grain of salt, I happen to think command line computing is easy… :laughing:

If you do decide to take it on, this forum is a good place to ask questions as you go.

1 Like

I guess the description of my problem was a bit confusing. I think - and this is what I believe the main problem - that my git-darktable uses a different database than the Fedora installed dt. The git-darktable has less lenses in the db. I just need to persuade the git-darktable to use the lensfun-database of Fedora-darktable.

Are you sure your lenses are in the master database? I have a clone of the lensfun github master branch, I can look up any if you want…

Try running lensfun-update-data and then run sudo lensfun-update-data. Without sudo, the .local/share/lensfun/update gets update with sudo /var/lib/lensfun-update/version_1

I think darktable uses the /var/ location.

first of all it is liblensfun. and it will search both locations. and the copy in /usr/share/lensfun too.

yes, it’s all up to date.

I now have a current and nice example. I own the lens “Sigma 35mm F1.2 DG DN | Art 019” for L-Mount. According to the lensfun website https://lensfun.github.io/lenslist/ this lens is supported and I am able to find the lens in directory version 1 & 2.

root@kirk version_2]# pwd
/var/lib/lensfun-updates/version_2
[root@kirk version_2]# grep "35mm F1.2 DG DN" *
mil-sigma.xml:        <model>35mm F1.2 DG DN | Art 019</model>
[root@kirk version_2]# grep "35mm F1.2 DG DN" ../version_1/*
../version_1/mil-sigma.xml:        <model>35mm F1.2 DG DN | Art 019</model>

The same results came up in directory /usr/share/lensfun/version_2 and version 1.

When I look for the lens in darktable the lens does not appear in the list as shown in the attached screentshot. How come?

1 Like

Did you check the name reported by Exiv2 and/or Exiftool for your lens?
Lenses can show slight variations in the name such that lensfun doesn’t recognise them anymore (branding based on country of sale is one exemple)

As for the Zeiss lens in the original question, I don’t think it is in the database. And perhaps you don’t need the distortion correction?
Keep in mind that the lensfun database is fed by volunteers, lens makers don’t automatically provide data for lens corrections to lensfun.

Mount: Sony E.

Your camera has Mount: Leica L

If you want to use the lens with Panasonic you will need to add Leica L as a mount for the lens.

1 Like

Thank you. Sure it is a Sony E mount. I’ll try to add L mount and hope both lenses have the same characteristics.

It works, thank you very much.

1 Like