Fisheye lenses have a wide field of view and the same distortion in all
directions running orthogonally to the optical axis. The latter property
allows fitting a precise mathematical relationship between distances to the
zenith on the image space and zenith angles on the hemispherical space
(assuming upward-looking hemispherical photography with the optical axis
vertically aligned).
The method
outlined here, known as the simple method, is explained in details in
Diaz2024;textualrcaiman. Next explanation might serve mostly
as a handbook.
Step-by-step guide for producing a CSV file to feed this function
Materials
this package and ImageJ
camera and lens
tripod
standard yoga mat
table at least as wide as the yoga mat width
twenty two push pins of different colors
one print of this sheet (A1 size,
almost like a research poster).
scissors
some patience
Instructions
Cut the sheet by the dashed line. Place the yoga mat extended on top of the
table. Place the sheet on top of the yoga mat. Align the dashed line with the
yoga mat border closest to you. Place push pins on each cross. If you are
gentle, the yoga mat will allow you to do that without damaging the table. Of
course, other materials could be used to obtain the same result, such as
cardboard, foam, nails, etc.

Place the camera on the tripod. Align its optical axis with the table while
looking for getting an image showing the overlapping of the three pairs of
push pins, as instructed in the print. In order to take care of the line of
pins at 90º relative to the optical axis, it may be of help to use the naked
eye to align the entrance pupil of the lens with the pins. The alignment of
the push pins only guarantees the position of the lens entrance pupil, the
leveling should be cheeked with an instrument, and the alignment between the
optical axis and the radius of the zenith push pin should be taken into
account. In practice, the latter is achieved by aligning the camera body with
the orthogonal frame made by the quarter circle.
Take a photo and transfer it to the computer, open it with ImageJ, and use
the point selection tool
to digitize the push pins, starting from the zenith push pin and not skipping
any shown push pin. End with an additional point where the image meets the
surrounding black (or the last pixel in case there is not blackness because
it is not a circular hemispherical image. There is no need to follow the line
formed by the push pins). Then, use the dropdown menu Analyze>Measure to open
the window Results. To obtain the CSV, use File>Save As...

Use test_lens_coef()
to test if coefficients are OK.