Create lens calibration data for lensfun

You need to install it in the venv.

You can try:

python3 pip install numpy

Or, if there is a requirements.txt file:

python3 pip install -r requirements.txt

Here is what I get

(.venv) martin@MBP16-MC Sigma 16-300mm % python3 pip install numpy
/Users/martin/Pictures/Lensfun calibrations/Sigma 16-300mm/.venv/bin/python3: can't open file '/Users/martin/Pictures/Lensfun calibrations/Sigma 16-300mm/pip': [Errno 2] No such file or directory
(.venv) martin@MBP16-MC Sigma 16-300mm % 

Sorry, my bad:

python3 -m pip install numpy

1 Like

That worked. I keep peeling the onion … had to do the same with two other modules but now stuck with this.

(.venv) martin@MBP16-MC Sigma 16-300mm % ./lens_calibrate.py init
/Users/martin/Pictures/Lensfun calibrations/Sigma 16-300mm/./lens_calibrate.py:50: DeprecationWarning: Please import `leastsq` from the `scipy.optimize` namespace; the `scipy.optimize.minpack` namespace is deprecated and will be removed in SciPy 2.0.0.
  from scipy.optimize.minpack import leastsq
Traceback (most recent call last):
  File "/Users/martin/Pictures/Lensfun calibrations/Sigma 16-300mm/./lens_calibrate.py", line 52, in <module>
    from pyexiv2.metadata import ImageMetadata
ModuleNotFoundError: No module named 'pyexiv2.metadata'
(.venv) martin@MBP16-MC Sigma 16-300mm % 

mind you I have no RAW files copied yet so I don’t know why it looks for metadata at this point, only doing the init phase

For what it’s worth, if you don’t feel like doing all that yourself, I submitted some RAWs for a lens recently and it was completed within a few days.

https://wilson.bronger.org/calibration#instructions

Yeah, it imports everything at the start. It’s unfortunate that they do not provide a requirements file, it would be much easier.

For that one you can install pyexiv2

First of all, I have to apologize for not fulfilling my promise to post again after carrying out my experiments on my working hypothesis for the cause of the extra vignetting caused by an acrylic sheet placed on the camera lens. In fact, my experiments did not show up a way for reducing the extra vignetting and after that I lost a bit track of the issue.

My working hypothesis was that the extra vignetting is caused by the angle dependency of the reflectance back into the sheet occurring at the sheet side facing the lens. Since the light rays focused at a point at the edge of the sensor will on average exit the acrylic sheet at a smaller angle as the light rays focused in the center, the fraction of scattered light reflected back into the sheet should be larger for the former case and thus the light intensity arriving at the sensor should drop towards the edges of the frame.

Based on this working hypothesis, I figured that using an acrylic plate having a rough surface facing the lens might alleviate this effect and reduce the vignetting caused by the sheet. Therefore, I ordered three more samples of white matte acrylic sheets which are satined, i.e. slightly roughened, on one face. Samples were Plexiglas WH46 SC (transmittance 40%), Plexiglas WH02 SC (transmittance 44%) and Plexiglas WM513 SC (transmittance 67%), all 3 mm thick. The Plexiglas WH72 GT sheet with two smooth faces which I used before has a transmittance of 31 %.

With each of these acrylic sheets, I took pictures with the camera pointing straight upwards into a cloud covered sky and the sheet lying loosely on top of the lens. Settings were ISO 125, focal length 10.4 mm (equivalent to 28 mm full frame), focal distance at infinity and aperture at 1.8, 2.2 and 4.5. Two pictures were taken for each setting with the camera rotated by 180° in between. Two sets of pictures were taken with the satined sheets, one with the satined surface facing the lens and one with the smooth surface facing the lens (and the satined surface facing the sky).

For all sheets, except the Plexiglas WM513 SC, the pictures taken before and after rotating the camera were identical. Flat field correction of the first picture with the second picture gave a perfectly flat result. However, for Plexiglas WM513 SC the same procedure gave a slight brightness gradient across the frame, i.e. the scattering in the sheet was not sufficient to even out all brightness differences across the sky.

To my surprise, there was no difference between the pictures taken with the satined sheets flipped, i.e. between the satined surface facing the lens and the smooth surface facing the lens. In fact, there was also no difference between the pictures taken with the three sheets having less than 50 % transmittance. Flat field correcting a picture taken with one sheet with a picture taken at the same settings with another sheet gave a perfectly flat result.

To sum it up:

All white matte acrylic sheets providing sufficiently homogeneous scattering provide the same results and suffer from the same extra vignetting, no matter whether their surface is smooth or roughened.

Acrylic sheets having a transmittance of more than 50% should be avoided because they do not provide homogeneous scattering. (For a sheet with perfectly homogeneous scattering illuminated from one side, the amount of light leaving the sheet on the illuminated side would be the same as the amount of light leaving the sheet on the opposite side and therefore transmittance will be less than 50%.)

4 Likes

Nice work @schorschbey. Do you want to update the article? The source code is here:

Dear Andreas,

I have to admit that I have no experience in editing a HTML file, so I think you are more qualified for making such an update than me.

What should be updated is that the transmittance of the matte sheet should be less than 50% and a comment, that the sheet can be checked for sufficiently even scattering by taking a second picture with the camera rotated by 180° and comparing the two pictures. They should be identical. In RawTherappe, this can be done by flat field correcting the RAW of the first picture with the RAW of the second picture. The result should be a perfectly flat scene with sharp symmetrical peaks in the histogram (the peak width corresponding to photon noise).

You should also update the source for ordering a suitable acrylic sheets:

I used the 100 x 75 mm material sample which is large enough for the small lens of my camera. For a larger lens, as the one shown in your article, you can order a larger sheet cut to size (at 20 x 20 cm approx. 15-20 €). As far as I know, this sheet material has been specifically developed for backlighting LCD screens with an array of white LEDs, so it is optimized for homogeneous scattering.

I think it is premature to add a cautioning note on the slight extra vignetting caused by the acrylic sheet, because I cannot quantify this effect yet and do not have data on how strong it will be for different focal lengths and apertures. I still have to find out a way to get a photo of a homogeneously lit and homogeneously scattering surface, where two photos of the surface with the camera rotated by 180° in between will be the same.

So I wasn’t too far off. Thanks for confirming that, @schorschbey (and sorry for the late answer, I’m not checking this site often these days).

I assume the vignetting error depends on the angle and the transmittance, so the focal length is another important parameter.

@asn No problem, only trying to help. :wink:

The article is written in Markdown.

I’ve been waiting for months for an dull, even, gray sky.

Probably a dumb question, but would a plain blue sky with no clouds whatsoever work? This year at least, it seems like the only possibility where I’m located.

@patdavid I cant find this repo. Can you assist?

We have moved pixlsus/website: The PIXLS.US website - Codeberg.org

1 Like

The link to the new folder location: