lens_calibrate (calibrate lenses for lensfun data)


this is a thread about lens_calibrate, a script to calculate lens calibration data for the lensfun project.


I’ve just released lens_calibrate version 0.1.1. This adds adds preview files for vignetting correction to the tarball it creates when you run ‘ship’.

1 Like

Finally I have multiprocessing working with lens_calibrate :slight_smile:


I had some trouble with generate_xml. When the lenses.conf and the data in the .vig files diff generate_xml fails with a

if not focal_length in lenses[lens_model][‘vignetting’]:
KeyError: ‘Standard’

The vig’s are populated by exiv2 calls and ignore the lenses.conf. I added a Pentax stanza for the lens detection

tag = ‘Exif.PentaxDng.LensType’
if has_exif_tag(data, tag):
lens_model = data[tag].human_value

Perhaps it could be possible to produce the xml file even when the lens can’t be detected from exif?

You can write the missing data with the exiv2 command line tool or other tools to your image files. Problem solved.

Yes, there are plenty of work arounds. sed the vig’s etc.

It’s just that the script has a fallback when exiv2 fails to find a lens name, that is setting the lens to ‘Standard’ but this will fail at the generate_xml stage without saying why.

Throwing an error and refusing to generate vignette data when it can’t find a lens name would be reasonable. Then your solution to add exif data to the files would be a simple answer.

Then please log a bug in the bug tracker with providing as many details as you can. Patches are very welcome. Thanks! :slight_smile: