Lens missing from Darktable/Lensfun

Finally got my Canon RF 24-105mm F4L IS USM lens working in Darktable (DT). In that case the problem seemed to be that while the data for the lens was included in the Lensfun database the camera’s identification of the lens didn’t match what was being used in the database.

Now DT does NOT recognize my “Canon EF 70-300mm f/4-5.6 IS II USM” lens. In this case I cannot find anything that matches in the Lensfun database. There is a similar lens with an identification of “Canon EF 70-300mm f/4-5.6 IS USM”. I would guess that is a predecessor to my lens but I do think my lens has been around for quite a while. Even though its’ capabilities are similar a comparison of the specifications indicates that the design is different.

While my version (3.8.1) of DT is using Lensfun Version 1 I did check the Lensfun Version 2 database and it is no better.

I also notice that other software, such as Rawtherapee & Art, that I use for raw file post processing has no problem finding correction data for my lens. The current version of RT (5.8) was released more than 2 years ago. However, I believe it is using Adobe LCP files rather than Lensfun.

Is it possible that someone knows how to find correction data for Lensfun Version 1that matches my lens (Canon EF 70-300mm f/4-5.6 IS II USM).

I’m not seeing that lens listed in RawTherapee. Can you clarify which one it might be?

Untitled

Maybe I’m half blind, but I’m not seeing a ‘II’ designation by any of these listed here, which is a screenshot from RT 5.9 Dev.

I would also like to note, that my ART and RT don’t have this lens too.

They both use lensfun, same as DT. They just give you the additional option to use Adobe LCP, but they don’t have them shipped.

Lensfun has a utility to convert LCP to lensfun files, if you have an LCP file already or can get one. LCPs are sometimes of dubious quality, and when lensfun doesn’t have your lens ready, its often best to shoot your own correction files and submit them to the project.

What you show is what I have for Lensfun but RT allows the use of Adobe LCP files which do include it.

That does sounds correct. I guess I’ve been using Adobe LCP long enough that I forgot the database needed to be obtained separately. I also think this means that my Adobe LCP files are pretty old but they do include this newer version of the lens.

Thanks for that information. I’ll see if I can find the utility.

I was aware that users could create there own files for Lensfun but that is NOT something I’ve yet learned how to do. Maybe someday!

Start easy and start with distortion correction.

Looks like I failed to disclose that I do my photo processing on Windows rather than Linux.

However, something I’ve now learned about is that the complete Lensfun package includes code that can be used to periodically update the database in addition to converting lcp files for use in Lensfun databases. Given that new lenses constantly come into being the idea of constantly updating the database makes a lot sense, at least, from the packager’s point of view. I’m also aware that Lensfun has both a Version 1 and a Version 2. If the databases are different one might expect that both versions are NOT receiving all of the updates. Is it possible that Version 1 which seems to be what both Darktable & Rawtherapee are using is NO longer being updated?

I found another post on this forum from someone in a pretty similar situation to mine who would also like to run Lensfun on Windows. The answer was pretty specialized back in Jan 2021 which makes me think reliability could be at issue. This causes me to ask is Lensfun better positioned to run on Windows than it was back then?

Another thought. I do have an old computer that runs Linux. Thought I might be able to do conversion or updates there and transfer results to my Windows computer. However, my computer is 32bit and it looks like the most current version of Ubuntu for such is 18.04. I installed all available updates. Then installed Lensfun. When I ran lensfun-update-data it concluded that the database was up to date. However, all of the files are dated for sometime in 2015. Also, there is no lensfun-convert-lcp app.

This begs the question. Python is something I haven’t yet used but, I think, it is multi-platform and supposed to be easy. If Lensfun is written in Python shouldn’t I be able to install Python on Windows and run it?

Version 1 of the database is for lensfun version 0.3.2 and 0.3.3, 0.3.3 being the latest stable release. Version 2 of the database is for lensfun 0.3.95, an alpha version, and for the master branch of the lensfun repo. 0.3.95 doesn’t quite work right from what I understand, though I can’t elaborate further than that.

There is a script in the lensfun source repo that converts v2 db back to v1. V1 db still gets the same updates are version 2.

What version of the database for lensfun that darktable and rawtherapwe expect depends on how they are packaged. You can compile both rt and dt against either version of lensfun and the compilation will be successful.

Having a script is convienent, but if you just want to brute force of, you can download the v1 db files and overwrite the existing files in your dt or rt install. Not the greatest way to do things, but it should work.

@ggbutcher made a small exe file to update the lensfun db, I’m mobile right now and can’t find it. But he’s so helpful I’m sure he will chime in.

When I compile rawproc for release, I use the master branch and it works fine.

https://github.com/butcherg/lensfun_dbupdate

Go to Releases, there’s just one. Copy the .exe file to a directory in your $PATH variable, or the directory I specify in the next sentence. It has to be run from the directory above version_1, version_2, or whatever version you’re using, and it’s run this way:

C:/whatever_dir/> lensfun_dbupdate <number>

where number is the version number.

1 Like

Hugin exists for Windows, so the distortion correction is possible in Windows. For tca and vignetting I have a prepared VirtualBox if you want to try that later, but start with distortion.

I have reviewed this page regarding how to create lens calibration data. Would be happy to submit such photos but there are requirements that make it hard to say when I can get it done.

ggbutcher’s program looks like a good idea but right now it does NOT look like updating the data base will get what I need. I think what I need now is lensfun-convert-lcp rather than lensfun-update-data.

If Hugin refers to this software I find that quite interesting because I’d love to be able to make good panoramic images but that might need to wait for another day.

It looks to me like for those of you using an up-to-date Linux distribution it might be quite easy to run the lensfun-convert-lcp app to create a file that I could use with Lensfun. Here is a link to the Man Page. Therefore, I came up with the idea of asking if someone might be willing to convert this file for me?

After doing a little research on how Python works I was able to figure out how to perform the mentioned conversion. It seems that even though I couldn’t install a version of Lensfun that includes the “lensfun-convert-lcp” script I did have Python3 which was able to function without error.

Here is a link to the resulting file. It says it is for Lensdatabase Version 2 but I don’t see anything different about the syntax in it and what is being used in my Version 1 database.

At the same time the resulting file contained only 18 lines (distortion calibration numbers for 5 different focal lengths) whereas the converted lcp file contained 8677 lines. Haven’t tried it yet but looks like a lot of work to end up with a file that might NOT be worth much.

Also, the idea of a crop-factor of 1 doesn’t make much sense to me. Seems like it would, by definition, be 1 for a full frame lens and something more like 1.6 for a Canon camera with a crop sensor. Might this means the data is only valid for a full frame sensor. As it turns out the camera I use it on does have a crop sensor?