Lens Correction - Embedded Metadata vs. Lensfun Different Results

dt4.6.1
Sony a6400 + Tamron 18-300

I’ve noticed lens correction gives slightly different corrections for pincushion (?) / barrel (?) results depending on whether you use lensfun or embedded metadata.

I went on a quest to find out which one is more correct and just made my head spin. I took a picture of a garage door, which has a lot of straight lines in both directions. When you toggle lensfun vs. embedded metadata, there is a difference, but I am having a hard time figuring out which one is most correct. Eyeballing the grid over the image doesn’t give a clear answer. See the video below for the differences in the two lens correction states.

I guess I could export both of them and measure in Gimp, etc. But if anyone has experience / comments, that would save some time.

edit: the image that started this quest is Mr. Squirrel. Maybe because I had to crop in, but the difference between lensfun and embedded metadata is much larger.

Garage door test:
DSC02022.ARW.xmp (11.8 KB)
DSC02022.ARW (23.8 MB)

Mr. Squirrel
DSC01561.ARW.xmp (14.8 KB)
DSC01561.ARW (24.2 MB)

You could use “rotate and perspective” module to draw (right-click) straight lines along the “straight” lines in the image. Compare deviations for different ways of correction.

TL/DR: embedded metadata gives the straightest lines

I did an initial rotate and perspective correction by drawing a few straight lines. Then exported with both lens correction settings. Imported both to GIMP and drew ruler lines.

Embedded metadata seems like a new setting. The Tamron is also new. I only remember the lensfun setting in previous versions and with my older lens.

Are there conditions where embedded metadata would fail? Should I re-submit a photo to Lensfun to get the Tamron 18-300 better data?

The lens profile embedded in the metadata is the “more correct” lens profile than the lens profile from the lensfun database.

Lensfun relies on people sending images taken with that specific lens.

The lens profile embedded in the metadata is the one that is calibrated for your specific lens at the end of the production line as the last step before packaging.

As far as I remember, this was started by Olympus with their Zuiko 4/3rd lenses, but this was popularized and made it common by Fujifilm with their “cheap” X-mount lenses. This would cut manufacturing costs and also provide shortcuts in the lens design.

BTW 1, the differences are due to the variations in the manufacturing process.

BTW 2, if you want to see the “raw” output, you can rawtherapee/art. There must be other software capable of displaying the uncorrected view.

The distortion correction in Lensfun only has one distance. It means that if your calibration target is 20 m away it will not be decent when you want to correct something at 1 m. It also seems like Lensfun is lacking TCA and vignetting data for your lens, so go for the embedded metadata.