I got myself a Meike 7.5mm f/2.8 micro 4/3 lens for fun. It is not in the Lensfun database, and has no electronic contacts.
I am wondering if there is a way to defish the image manually (ie by eyeballing the result), either in (preferred) or outside Darktable, using FOSS on Linux. The lens correction module sliders are greyed out in Darktable.
If you have a photo of a grid, eg a brick wall taken face-on, we can take a look.
If the lens is close to an ideal equidistant fisheye, an atan() transformation will make it rectilinear. A Windows BAT script to do this with ImageMagick is:
This takes an input image %SRC% and makes an output image %OUTFILE%. There is only one parameter, RAT, a number. For a GoPro camera, this is 3.1.
If you know the angle alpha captured from corner to corner, then:
RAT = tan (alpha / 2)
The commands above supersample the image by a factor of 4. It creates a displacement map which can be reused for any other inputs. Gory details are at De-barrel distortion: De-fisheye.
It also occurs to me that the Hugin toolset might do the job. Take a couple or three overlapping photos and throw these at Hugin, and it might figure out the geometric transformation that makes them match. I’ve never tried this, and I’m not a Hugin expert.
Another possibility: Fred Weinhaus has a bash script (using ImageMagick) to convert a fisheye image to rectilinear. Unlike my code above, Fred’s can cope with different types of fisheye: linear, equalarea, orthographic, or stereographic.
Thanks for all the suggestions. Apparently Hugon has a GUI tool, I will try to take some images of a rectilinar-looking object and then add the lens to LensFun.
Hugin was how I was able to generate a DCP profile for a Mi Sphere 360 camera - I saved a reference image in RawTherapee and then defished it using Hugin before feeding to dcamprof.
It should also be (IIRC) possible to build a lensfun profile from Hugin calibration parameters that can be manually selected/applied. I’m pretty sure Hugin’s distortion model is identical to one of lensfun’s.