Optical characteristics of the flat underwater lens port
By David Knight 

The lens port fitted to an underwater compact camera housing is almost invariably a flat sheet of optically transparent glass or plastic. Such ports are also used on housings for interchangeable lens cameras, in which situation they are often referred to as 'macro ports'. It is tempting to think that such a physically simple arrangement must be optically simple; but in fact the converse is true. In this article, we analyse the behaviour of the flat port in order to show its optical limitations and discuss any possible optimisations.

For the initial part of this analysis, the camera is modelled as an idealised symmetric thin-lens system [see optical magnification article]. This means that the camera is assumed to be perfect; and that the image distance (v) obtained from the model is hypothetical and cannot be used directly to calculate the focal plane position in an actual system.

Shown below are are two ray diagrams involving the same lens and object. The first diagram shows the object in air and its image as produced by a simple bi-convex thin lens. The ray diagram is constructed by assuming that the lens bends rays that enter parallel to the lens axis to make them pass through the focal point, whereas rays passing through the lens centre are undeflected. In the second diagram, the object distance u is unchanged, but a relatively thin flat port has been placed at a distance p from the entrance pupil, and the object has been immersed in water.

An off-perpendicular ray crossing the water-air boundary is deflected according to Snell's law:

nw Sinθw = na Sinθa                      . . . . . . . (1)

where nw and na are the refractive indeces of water and air. The effect of that deflection is to change the apparent position of the object, so that it now appears to be located at a distance u' ("u-prime") in front of the lens. Since u' is less than u, the camera must be refocused by changing the image distance from v to v', and the new image height hi' is larger than hi. Thus, the effect of adding a flat water-air boundary is to increase the magnification of the image, and this is one reason why the flat port is also sometimes called a 'macro port'.

The flat port magnifying effect can be quantified as follows:
The magnification of the lens system in air can be expressed in terms of the object distance and focal length [see optical magnification article]:

m = f / (u - f)

The magnification underwater is given similarly by using the apparent position of the object:

m' = f / (u' - f)                . . . . . . . . . . . . . . . (2)

The magnification due to the port is therefore the ratio of these two quantities:

mp = m' / m = (u - f) / (u' - f)              . . . . (3)

To put this ratio in terms of fixed system parameters, we need to eliminate u'. Referring to the diagram above, note that:

Tanθa = ho / u'


u' = ho / Tanθa 


ho = h1 + h2


h1 = (u - p) Tanθw 


h2 = p Tanθa 


u' = [ (u - p) Tanθw + p Tanθa ] / Tanθa


u' = (u - p) ( Tanθw / Tanθa ) + p        . . . . . . . . . . . . . . . (4)

Inserting this result into equation (3) we get:
Magnification due to a flat underwater port

mp = u - f
(u - p) ( Tanθw / Tanθa ) + p - f
      . . . . .  (5)

f = lens focal length
u = distance from object to entrance pupil
p = distance from port to entrance pupil (0 ≤ p ≤ u)
θa = angle of light ray relative to the lens axis
and, using Snell's law (1),

θw = Arcsin [ (na / nw) Sinθa ]             . . . . . . . . . . . . . . . . (6)

The first thing to notice about the formula (5) is that the magnification is a function of the angle θa . This means that the system will exhibit radial distortion (it will not be rectilinear). For small deviations from perpendicular however, we can use the limiting approximation:

As θ 0 , Tanθ  Sinθ

This allows us to make a substitution using Snell's law, i.e.:

Tanθw / Tanθa  Sinθw / Sinθa = na / nw

Inserting this into (5) gives:
Small-angle magnification due to a flat port

mp = u - f
(u - p) ( na / nw ) + p - f
      . . . . .  (7)

na is the refractive index of air (1.00028 for dry air at 1 Bar and 20°C, often approximated to 1), 
nw is the refractive index of water (often approximated to 4/3).

The small-angle formula (7) tells us that the magnification is reasonably anchored to the image distance u and the system parameters f and p (i.e., the loss of rectilinearity will not be too serious) provided that we use lenses having a small field of view (FOV). It also has a particular limiting behaviour when p is small (i.e., the port is close to the lens) and u >> f (the object is relatively distant).  In that case:

mp  nw / na ≈ 4/3

i.e., the small-angle magnification is about equal to the refractive index of water. Note incidentally that this condition applies exactly when p = f, i.e., if we substitute f in place of p in equation (7) we get:

mp = nw / na

Since the port is often located in the vicinity of the front focal point, the assumption that the port gives a small-angle magnification of about 4/3 is generally fairly realistic.

Chromatic aberration
As shown above, the good news for users of lenses of small FOV (such as macro lenses) is that the flat port provides additional magnification. The bad news however is that the magnification so obtained is highly correlated to the refractive index of water, and water is a dispersive medium (i.e., its refractive index is a function of wavelength).
     Shown in the table below are data from Kaye and Laby [1] for the refractive index for pure water at wavelengths close to the traditional colour primaries:

Wavelength / nanometres Refractive index (n) at 20°C Difference from green
435.84 1.340 210 +0.430 %
546.07 1.334 466 0
632.80 1.331 745 -0.204 %

It follows that, in situations where the overall magnification is proportional to the refractive index of water, the blue image will be about 0.43% larger than the green image, and the red image will be about 0.2% smaller than the green image (this is approximately true for small angles over a relatively wide range of system parameters). In other words, the system will suffer from chromatic aberration. The differences in magnification incidentally, are measured relative to the lens axis, which (for ordinary cameras) corresponds to the centre of the picture. Thus the three colour images will be correctly superimposed at the centre, but for any finite distance measured from the centre, the blue image will be about 0.43% out of register with the green (reference channel) image, and the red image will be about -0.2% out of register.
     Unfortunately, the figures discussed above only apply to lenses of small FOV. As mentioned before, the magnification also depends on the extent to which light rays crossing the port deviate from the perpendicular, and this serves to make matters much worse when a flat port is used with wide-angle lenses. 
To work out how bad the chromatic aberration will be in practice, we need to consider the overall magnification (rather than the relative magnification due to the port). This is obtained by combining equations (2) and (4):

Overall magnification, optical system with flat port

m = f
(u - p) ( Tanθw / Tanθa ) + p - f
      . . . . .  (8)

Using the small angle approximation:

Tanθw / Tanθa ≈ na / nw

we get:

Small-angle magnification, optical system with flat port

m = f
(u - p) ( na / nw ) + p - f
      . . . . .  (9)

Also note that, to find the magnification at the corners of the image, we can equate the angle θa to half the FOV of the lens. The FOV (Angle of coverage) of a lens focused at infinity is given by the expression :

α = 2Arctan(d / 2f)

where d is the image format diagonal. When the lens is focused closer than infinity however, the distance from the exit pupil to the image plane is no longer f, but v (the image distance), i.e.,

α = 2Arctan (d / 2v)

Hence, at the corners of the image:

θa = Arctan(d / 2v)


Tanθa = d / 2v

The image distance v can be obtained by rearranging the thin lens formula, but note that for the system under consideration here, the lens is focused on the apparent position of the object (at distance u' from the entrance pupil), i.e.:

(1/u') + 1/v = 1/f

After rearrangement, this gives:

v = u' f / (u' - f)

The apparent object distance u' is given by equation (4), but since the lens will normally be focused at the centre of the field, we can use the small angle value, i.e.:

u' = (u - p) (na / nw) + p


v = f [ (u - p) (na / nw) + p ] / [ (u - p) (na / nw) + p - f ]      . . . . . . . (10)

and thus:

Tanθa = d [ (u - p) (na / nw) + p - f ]
2 f [ (u - p) (na / nw) + p ]
     . . . . .  (11)

This formula can be used in conjunction with equation (8) to determine the corner magnification. The value for θw is, of course, obtained by inserting the result from (11) into equation (6).

Examining equation (8) to look for possible optimisations, we might first notice that effect of the water is eliminated by putting u = p . That however, merely corresponds to the trivial case of eliminating the effect of the port by pressing the object against the port; which is not generally a practical requirement.  It does however tell us that port magnification and its attendant chromatic aberration will be small when the object is close to the port (such as when using a macro lens at 1:1 magnification). For more commonly occurring situations however, u will be much greater than p, and the proximity effect will be negligible.

Graphs of radial chromatic aberration vs. focal length, calculated using equations (9) and (8) with (11) are shown below. The aberration is given as a percentage displacement relative to the middle of the image, i.e.:

Δmred = 100 [ (mred / mgreen ) - 1 ]


Δmblue = 100 [ (mblue / mgreen ) - 1 ]

Note that the severity of the chromatic aberration depends on the image size required for presentation. An aberration of 0.5% at a radius of 10mm corresponds to a displacement of 0.05 mm for the chosen colour component of a particular image detail relative to the green component, which will not be noticeable. The same aberration at a radius of 200 mm however, corresponds to a displacement of 1 mm, which will look bad.


The graph above is for an object distance of 1 m, and a port to pupil distance of 25 mm. This is fairly representative for compact camera housings, and shows why the corners of the image start to degrade when the zoom lens is set wider than about 35 mm.  


This graph is for an object distance of 25 cm, a situation more typical of macro photography. It shows that, for small object distances, the small-angle aberration increases gradually for very long focal lengths. Hence there is an optimum focal length range, at which the corner aberration is reasonably small and the small-angle abberation has yet to grow. This occurs at around f = 35 to 60 mm (35 mm equivalent), depending on the value of u.

dot_info If you want to inspect the calculations shown above, or repeat them using different parameters, download the Open Document Spreadsheet: mp_calcs.ods (see sheet 1)
You will need Open Office to view the file.

Fixed distance between port and image plane
Note that, with p at a fixed distance from the entrance pupil, as for the model used above; the situation is like that of using a flexible housing (e.g., ewa-marine), with the port attached to the lens filter ring and allowed to move in and out on a bellows. In a hard housing, with the camera screwed to an internal tray or otherwise retained, it is the distance between the port and the image plane that is fixed. In order to model that situation, and also to make allowance for practical lenses, we can re-parameterise the problem as in the diagram below:


In this diagram, the use of a compound (multi-element, thick) lens is represented by allowing a separation g between the entrance and exit pupils. Note that g is usually negative for wide angle lenses (the exit pupil is placed in front of the entrance pupil), but it can be near zero or positive for macro and telephoto lenses.
     Also note here that the ray heading directly for the entrance pupil has been drawn parallel to the ray emerging from the exit pupil, which implies that the lens is optically symmetric (it has the same focal length front and back). This is a fairly reasonable assumption for SLR and system camera macro lenses of focal length ≥50 mm. 
     Since the distance q is fixed (because both the camera body and the port are rigidly attached to the housing), the port to entrance pupil distance p varies as the camera is focused. This variation can be substantial for close-focusing macro lenses used on relatively large format (e.g., 35 mm) cameras. To obtain an accurate model for high-resolution underwater macro photography systems therefore, we must derive p from the other parameters. 

With reference to the diagram above, observe that:

q = p + g + v

but since both q and g are fixed, let us combine them into a single parameter:

q' = q - g = p + v          . . . . . . (12)

The image distance v , as determined on the assumption that the lens is focused at the centre of the field, was given earlier as equation (10). Here we show it rearranged in a form more suitable for the present problem:

v = f [ p (1 - na / nw) + u na / nw) ] / [ p (1 - na / nw) + u (na / nw) - f ]

Combining this with (12) and rearranging gives:

(q' - p) [ p (1 - na / nw) + u (na / nw) - f ] = f [ p (1 - na / nw) + u na / nw ]

Multiplying out and moving all terms to the left-hand side gives a quadratic equation in something approaching the standard form:

- p2 (1 - na / nw) - p [ u (na / nw) - f ] + p q' (1 - na / nw) - p f (1 - na / nw)
+ q' [ u (na / nw) - f ] - u f na / nw = 0

Now let

A = 1 - na / nw

and multiply throughout by -1 , i.e.:

A p2 + p [ u (na / nw) - f  - A q' + A f ] - q' [ u (na / nw) - f ] + u f na / nw = 0

Now let

B = u (na / nw) - f  + A ( f - q' )


C = - q' [ u (na / nw) - f ] + u f na / nw


p = [ -B ±√(B2 - 4AC ) ] / 2A

Of the two possibilities, it turns out that the +√ solution is the correct one in this case. Hence:
Port to entrance pupil distance, symmetric lens with rigid underwater housing

p = [ -B +√(B2 - 4AC) ] / 2A

A = 1 - na / nw
B = u (na / nw) - f + A (f - q + g) 
C = u f (na / nw) - (q - g) [ u (na / nw) - f ]
      . . . . (13)

q = distance from port to image plane
g = inter-pupil distance

Shown below is a graph of chromatic aberration vs. object distance for a 50 mm 1:1 macro lens on the 35 mm format. The curves were obtained by using formula (13) in equations (9) and (8) with (11). Note that when a symmetric macro lens is focused for 1:1 magnification, the image distance v = 2f.  The object distance is also 2f, but the lens must focus on the apparent rather than the actual position of the object, and so u' = 2f .
     The parameters for the example simulation were obtained by waving a set of engineer's calipers in the general vicinity of a Canon EF 50 mm f/2.8 1:1 macro lens. For that lens, the inter pupil distance g is 10 mm, and the entrance pupil is 50 mm in from the front of the filter ring. Hence, the lens will hit the port during focusing if q is allowed to be less than 160 mm (i.e.; 2×f + g + distance from front of lens to entrance pupil). Hence q was set at 170 mm to give some clearance.


Chromatic aberration at large object distances is pretty much as dictated by the differences in the refractive index of water for red, green and blue light. Due to the small FOV, the difference between centre and edge aberration is small, which means that the resulting images respond well to first-order radial correction (e.g., using Panorama Tools, or the de-fringing sliders in Adobe Lightroom).

dot_info To view or change the parameters of the calculations used to produce the graph above, download the spreadsheet file: mp_calcs.ods (see sheet 2)

Pincushion distortion
When the magnification due to an imaging system varies depending on the angle by which a ray passing through the centre of the lens deviates from the axial (perpendicular) direction, the resulting optical defect is known as 'radial distortion'. When there is no distortion, the system is said to be rectilinear; i.e., the image will reproduce straight lines correctly, and it will reproduce right angles correctly provided that object and image planes are parallel. If the magnification diminishes as the central ray moves away from the perpendicular, a rectangular object with its centre aligned on the lens axis will appear barrel-shaped in the image; and if the magnification increases, a rectangular object will appear pincushion-shaped.

For the purpose of modelling the radial distortion due to a flat port, we can represent the system as in the diagram below. This is the same as was used earlier to derive the system magnification, except that we are now also interested in the dimensions of the format and the way in which the deviation from perpendicular varies as we move across the format. Note that it is assumed that a ray travelling along the lens axis strikes the image plane at the exact centre (as is the case for ordinary cameras).


The maximum deviation from perpendicular is marked as θa(max) and is equal to half the field-of-view (FOV) at the working image distance v. Hence:

Tanθa(max) = d / 2v

where d is the format diagonal. Thus the actual deviation θa varies between 0 and θa(max) . To relate this angle to a locus (i.e., a set of points) in the picture, we can conveniently define a variable r , the relative radial displacement, such that the a point in the image at displacement r must lie somewhere on a circle of radius rd/2 centred on the image centre. This means that r varies between 0 (at the centre), and 1 (at the corners of the image), regardless of the actual format dimensions (i.e., it transfers unchanged from source to destination format as we magnify the image for presentation). Thus:

Tanθa = r d / 2v     . . . . . . . (14)

For the purpose of quantifying radial distortion, we can define it as the proportionate difference in magnification between an arbitrary point in the picture and the point at the centre. An expression for magnification in terms of image distance v is given in a separate article [see optical magnification].  If we define the centre magnification as m0, we get:

m0 = (v - f) / f

which can be rearranged:

v = f (m0 + 1)

Using this in (14) we get, for a ray passing through the lens centre:

θa = Arctan[ r d / 2 f (m0 + 1) ]

And using Snell's law as before:

θw = Arcsin[ (na / nw) Sinθa ]

These angles can be used in equation (8) to obtain the magnification as a function of r for a given value of m0 , i.e.;

m = f / [ (u - p)( Tanθw / Tanθ) + p - f ]

Notice here that when θa  0,  Tanθa  0 , and so the equation above will give a divide-by-zero error at that point. That problem can be circumvented by substituting the limiting value for Tanθa/Tanθw , i.e.:

When θa = 0 , Tanθw / Tanθa = na / nw .

Notice also that if we try to simulate the radial distortion for a lens focused at infinity, this corresponds to m0 = 0 . This will give a divide-by-zero error when attempting to calculate the proportionate or percentage change in magnification at a given radial displacement. Hence it is necessary always to input a non-zero value for the image centre magnification.

The set of curves below shows the percentage change in magnification at relative radius r for lenses of 35 mm equivalent focal length from 20 to 80 mm. The method of calculation  is as discussed above. An image centre magnification of 0.1 was chosen as being fairly representative of a wide range of situations encountered in underwater photography. The y-axis is:

Δm /% = 100[ (m / m0) - 1 ]

We may note that the underwater flat port introduces severe pincusion distortion when used with wide-angle lenses.


dot_info To view the calculations or change the parameters, download the spreadsheet file: mp_calcs.ods (see sheet 3).

Example pictures
No camera is perfect. Consequently, in order to show the optical defects associated with a supplementary optical system (such as an underwater port), it is necessary somehow to remove the defects introduced by the camera lens. This is particularly important when using a zoom lens, because such lenses generally exhibit radial distortion which varies according to the focal length setting. The solution used here was to acquire a set of reference pictures for the camera lens on its own (in air) at specific zoom settings, in each case using a magnification (i.e., the test-card size in the image) similar to that used in the corresponding test picture. The reference pictures were then individually computer-corrected for radial distortion and chromatic aberration [see lens correction article], and the same correction was applied to the corresponding test picture.
     The width of the test card is 451 mm. The focal lengths marked on the example pictures below are 35 mm-format equivalent. For the f = 19 mm example, the camera was an Olympus C-5060 with a WCON-07 wide converter in an Olympus PT-020 housing with a PPO-02 flat port.  For the examples from 24 to 50 mm, the camera was a Canon S100 in a Recsea housing. For the corner detail images, the pictures were resized to 5M pixels (2582 × 1937) before cropping. Hence, assuming that the computer screen being used to view the images has a resolution of 96ppi, the visibility of the chromatic aberration is as it would be when viewing a picture reproduced at a size of 27 × 20" (68 × 51 cm).

flat port with 24mm lens flat port with 19mm lens - Corner detail

flat port with 24mm lens flat port with 24mm lens - Corner detail

flat port with 28mm lens flat port with 28mm lens - Corner detail

flat port with 35mm lens flat port with 35mm lens - Corner detail

flat port with 50mm lens flat port with 50mm lens - Corner detail

According to the theory given earlier, the pincushion distortion due to a flat port will be severe with wide-angle lenses, but the geometry will settle down to something approaching rectilinearity as FOV is reduced. Corner chromatic aberration will also be severe at large FOV, but unlike the overall distortion, it will not tend to zero for zero FOV. Instead, the chromatic aberration settles down at long focal length and large object distance in such a way that the radial displacements become proportional to the diffences in the refractive indeces of water for red, green and blue light.
     The theoretically predicted trends are clearly visible in the example pictures. They lead to the already well-established conclusion that flat ports are unsuitable for use with wide-angle lenses; but also underline a less-obvious point, which is that the chromatic aberration will always be visible in large prints and displays, even when the lens FOV is small. Some supplementary lens systems can (in principle, if not always in practice) compensate for this deficiency, but in the absence of an optical cancellation method, the solution is to apply radial correction to the digital image.


[1] "Tables of Physical and Chemical Constants", Originally compiled by G W C Kaye and T H Laby. Longman. 15th ed. 1986, 1993 reprint. ISBN 0-582-46354-8.
See p108, 'Calibration of liquid refractometers'.
Alternatively, see Kaye & Laby Online. Refractive index of optical materials (scroll down for 'Calibration of liquid refractometers'.

© David W Knight 2012.  Updated Feb. 2018
Photographs by Steve Knight and David Knight.
David Knight asserts the right to be recognised as the author of this work.

Photography & Optics