Why does the lens correction module require a camera name?

I’ve noticed that darktable Lens correction module is not working with my Nikon Z9, as it does not recognize the camera. Why is the camera name necessary? Does the same lens on my D810 distort differently from on the Z9?

Supplementary question: Can I tell the DB about my camera? If so, what file do I need to edit?

I believe the camera model is needed to tell lensfun the sensor size. That’s all. You can probably duplicate the Z7 ii entry and change the name.

Thanks.

What’s the filename to change?

Probably milnikon.xml or soemthing like that.

1 Like

I don’t have such a file on my computer.
What directory should I be looking in?

What OS?

Exact file name is mil-nikon.xml

Linux.

Looks like it’s /usr/share/lensfun

Run lensfun-update-data and then modify the files that command produces (which will probably be somewhere in your home directory). For me it puts the files in ~/.local/share/lensfun/updates/version_1

That seems to be a Nikon 1 file. Not Nikon Z.

It contains all Nikon mirrorless. So compacts and Nikon Z.

Mine doesn’t.

It’s located in /usr/share/lensfun/version_1 and only has CX mount in it, and is dated Nov 15 2015, which is long before the Z mount was produced.

Thanks.

Working now.

Does this mean it won’t work correctly for shots taken in a crop mode?

It should not work with camera/lens combinations that don’t have the same <cropfactor> tag in the xml. In this case, no corrections would be applied.

And the crop mode of the Z9 using a FF lens, I would expect the corrections to be “scaled down” and not to be “cropped”. So they most likely would be wrong. But it looks like you would be the one to test this.

You should probably use lensfun-update-data instead of tweaking the DB manually…

And if you want dt to detect the lens on the Z 9 rather than selecting it manually, you’ll also need a patched version of exiv2.