Monday, August 31, 2020

DOFIS: Registering a lens

In this post we will discuss how to register a lens in DOFIS.

There are two lens models in DOFIS. A thin lens model, similar, but not identical, to the one built into Magic Lantern; and a split (zoom) thin lens model.

As we know, all/most lens manufactures protect their lens designs and do not usually share key design information, such as the position of the front principal plane, from which all DoF and hyperfocal calculations are carried out.

In ML the position of the (thin lens) 'front principal' is assumed to be a focal length away from the sensor, ie at infinity. That is there is no focusing, lens extension component built into the ML equations.

For distances towards the hyperfocal, the thin lens assumptions are 'good enough', but towards minimum focus the model begins to struggle. 

As an example, let's take the Sigma 12-24 F/4.5-5.6 II DG HSM lens. 

As we can see from this extract from the Sigma's lens catalogue, the following data is applicable for DOFIS registration:
  • Minimum Focus Distance: 280mm
  • Maximum Magnification: 1/6.4 = 0.15625
  • Maximum Focal Length: 24mm

However, if we look online, we will see a magnification of 0.16 or even 0.17 quoted. So which one is right?

The only way to be 'sure' we have the best data for DOFIS is to measure it:

  • Put the lens at the maximum focal length, ie where the maximum magnification occurs. In this case 24mm;
  • Put the lens at the minimum focus distance (MFD) the lens will go and confirm ML shows this, ie 28cm in this case;
  • Place a ruler at the MFD (280mm from the sensor plane) and take a picture.

The magnification can be simply found by noting the 36mm sensor maps to 5760 pixels, and, in the above case, a 100mm on the ruler maps to 2499 pixels. Thus the magnification is (2499/100)*(36/5760) = 0.156. In other words don't trust the advertising ;-)

Using the DOFIS additional info menu, I know the lens name and thus I'm able to register the lens, in the script, as follows:

mylens[1] = {}
mylens[1][1] = "12-24mm" -- lens name
mylens[1][2] = 0.156 -- Mag
mylens[1][3] = 280 -- FD
mylens[1][4] = 24 -- FL at Mag (use longest FL on a zoom)

In DOFIS, with the lens registered, and in Auto mode, the menu confirms that the lens has been found and that all is OK:

As we have selected lens thickness in the additional menu, we know that a split lens thickness of 74mm is required to match the manufacturer’s data.

The second way to register a lens in DOFIS is to manually enter it:

Here we have entered the same data as we measured, and, once again, see we have a lens thickness at 24mm of 74mm.

To illustrate why this was needed, let's switch the lens model to a thin lens one, ie a lens thickness of zero but with a thin lens focus extension, and see what maximum magnification we get at 24mm:

By switching the additional info field to show the magnification, and setting focus to the minimum focus distance, we can see the problem. At 24mm, and a focus of 280mm, the thin lens model predicts a magnification of 0.104, compared to 0.156.

Hopefully by now you should be comfortable in generating DOFIS registration data for all your lenses; well at least the wide angle and normal ones ;-)

As usual I welcome all feedback on this post.

No comments:

Post a Comment