Hi everyone,

currently, I'm playing with a relay system to increase the image circle of a small CCTV primary lens until to cover a MFT (m4/3) sensor.

This "old trick" allows to increase the depth of field thanks to the short focal lenght of the primary lens, whose primary image is magnified by the relay lens.

There are various examples on the web, like THIS:

http://makrofokus.se/blogg/2016/9/22/di ... sheye.html

Now, when I use a relay system (composed by the primary lens and the relay lens), how can I calculate (which formulas) the effective focal length (EFL), the final depth of field (DOF) e the real field of view (FOV) of the complete optical system?

Just for example, the depth of field seems to be influenced by the aperture set on the relay lens much more than by the aperture on the primary lens...

Thanks in advance.

Ciao.

Toni

## Relay system and optical formulas

**Moderators:** rjlittlefield, ChrisR, Chris S., Pau

- rjlittlefield
- Site Admin
**Posts:**23937**Joined:**Tue Aug 01, 2006 8:34 am**Location:**Richland, Washington State, USA-
**Contact:**

Thanks for providing the link to John Hallmén's article. It has been a long time since I read that article. The reminder is good. I am also amused to see that my own name now appears late in the comments, suggested as someone who might be able to answer questions similar to yours.

Unfortunately I cannot answer your questions exactly, because exact answers would depend on details of the setup that I don't know and that probably could be determined only by experiment. But perhaps I can give you some ideas of how to think about the calculations.

For starters, let me describe a little more about how these setups work.

At first blush, you can divide the optical system into two parts: a front lens section that forms a real aerial image, and a rear lens section that focuses on that first aerial image and in turn forms a second real image back on the sensor.

The magnification of the rear section is determined by lens characteristics and extension distances. That will be m = totalExtension/FL - 1, where FL is the focal length and totalExtension is the distance from the sensor to the appropriate principal plane of the lens. Unfortunately we don't know where the principal plane of the lens is located, so we cannot compute this exactly. It would be far simpler to just remove the front lens, place a ruler in focus by the rear lens, take a picture, then do the usual division: m = mmOnSensor/mmOnRuler.

Once the magnification of the rear section is known, it's a pretty good approximation that the effective aperture of the rear section by itself is just equal to (m+1)*nominalAperture. For example if you're running at 5X and nominal f/8, then the effective aperture is (5+1)*8 = f/48. An exact calculation would depend on pupil ratio (as described HERE), but the simple calculation is pretty close when a reversed lens is used at magnifications that are far above 1X.

Now, the great simplification in thinking about these setups is that if the front lens has an f-number that is smaller than the rear lens, and you're not getting any vignetting, then the "limiting aperture" is provided entirely by the rear lens. That, in turn, implies that the effective aperture of the whole system (as seen by the sensor) is simply the effective aperture of the rear section by itself. In this situation, you get to ignore the front lens!

In John's setup, the conditions are satisfied because the front lens is f/1.6 and the rear lens is f2.8 at widest, and typically stopped down quite a bit. So if John's rear lens section is running at 5X and nominal f/8, then the whole setup is still effective f/48 (=(5+1)*8) even when the front lens is installed for taking pictures.

Overall magnification of the whole setup is just the product of front lens magnification and rear lens magnification.

Note, however, that front lens magnification is very dependent on spacing between the front and rear lenses. With a front lens having FL 2.1 mm, the difference between 0.1X and 0.05X is only 0.105 mm of separation! With a 5X rear section, that 0.105 mm of separation makes the difference between 0.5X and 0.25X overall magnification.

So again, trying to calculate the front section magnification with any accuracy is quite difficult; it's far simpler to just focus on a ruler and get the magnification from that.

Once you have the magnification and the effective f-number, you can calculate DOF using something like the classic circle-of-confusion method:

totalDepthOfField = 2*C*Feff/(m*m), where Feff is the effective aperture, m is the overall magnification for both lens sections combined, and C is the acceptable circle of confusion based on sensor size.

It may be puzzling that the depth of field of the relay system, when calculated this way, comes out to be just the same as any other lens system that provides the same overall magnification and effective aperture. The reason for this equivalence is that the DOF of the wide-angle relay system in fact IS just the same as any other lens system, when we're talking only about parts of the image that are close enough in focus to be considered sharp. The obvious improvement in DOF comes entirely from areas that are significantly blurred. Compared to a conventional macro lens, what the wide-angle setups do is to render the background more sharply (because the entrance pupil is smaller) and to pack a lot more background into the same image area.

You asked also about effective focal length (EFL) and FOV. I'm not sure exactly what you mean by either of those terms.

For an optical designer, EFL is equivalent to "How much additional extension would I need to add, to add 1X of overall magnification?". But I suspect that's not a number that would be very helpful to you.

So, what do

As for FOV, taken literally that means "field of view" and it's a linear measurement taken across the in-focus plane. But of course that depends on overall magnification, which depends strongly on the separation between front and rear lenses.

I'm wondering instead if you mean "angle of view" (AOV), the angle between lines joining foreground and background points at opposite edges of the frame.

We can estimate that by calculating the width of the aerial image as imageWidth = sensorWidth/magnificationOfRearLensSection, then doing the usual trig calculation 2*arctan((imageWidth/2)/FL), where FL is the front lens FL. That won't account for shifts due to focusing, or for fisheye-like lens distortions typical of very short lenses, but it should get you in the ballbark.

All this is only from thought experiments, no physical experiments to confirm anything, so higher than normal chances of being wrong.

One last comment... If you try building simple models of these relay lens systems, say using just two "thin lenses" with appropriate spacing, I expect you'll find that the models fail rather badly. For example they predict severe vignetting due to the two lens apertures "fighting" with each other. In the simple model, off-axis rays that get through the front lens tend to miss the aperture of the second lens, and that effect gets worse as you stop down the second lens. A simple model of John's setup, with a 1.5 mm diameter aperture on the rear lens at 24mm f/16, predicts hopeless vignetting. What makes the real setups work well, I think, is that these short lenses tend to be telecentric toward the aerial image in the middle of the setup. That is, the front lens is designed so that its image is formed by cones of light whose centers are nearly parallel to the optical axis, and likewise the rear lens is designed so that, when reversed, it accepts cones of light in that same orientation. Given this situation, stopping down the rear lens can make all the cones of light narrower at the same time, without blocking the corners of the frame to cause vignetting. At least, that's my speculation. Again, no experimental confirmation.

I hope this helps.

--Rik

Unfortunately I cannot answer your questions exactly, because exact answers would depend on details of the setup that I don't know and that probably could be determined only by experiment. But perhaps I can give you some ideas of how to think about the calculations.

For starters, let me describe a little more about how these setups work.

At first blush, you can divide the optical system into two parts: a front lens section that forms a real aerial image, and a rear lens section that focuses on that first aerial image and in turn forms a second real image back on the sensor.

The magnification of the rear section is determined by lens characteristics and extension distances. That will be m = totalExtension/FL - 1, where FL is the focal length and totalExtension is the distance from the sensor to the appropriate principal plane of the lens. Unfortunately we don't know where the principal plane of the lens is located, so we cannot compute this exactly. It would be far simpler to just remove the front lens, place a ruler in focus by the rear lens, take a picture, then do the usual division: m = mmOnSensor/mmOnRuler.

Once the magnification of the rear section is known, it's a pretty good approximation that the effective aperture of the rear section by itself is just equal to (m+1)*nominalAperture. For example if you're running at 5X and nominal f/8, then the effective aperture is (5+1)*8 = f/48. An exact calculation would depend on pupil ratio (as described HERE), but the simple calculation is pretty close when a reversed lens is used at magnifications that are far above 1X.

Now, the great simplification in thinking about these setups is that if the front lens has an f-number that is smaller than the rear lens, and you're not getting any vignetting, then the "limiting aperture" is provided entirely by the rear lens. That, in turn, implies that the effective aperture of the whole system (as seen by the sensor) is simply the effective aperture of the rear section by itself. In this situation, you get to ignore the front lens!

In John's setup, the conditions are satisfied because the front lens is f/1.6 and the rear lens is f2.8 at widest, and typically stopped down quite a bit. So if John's rear lens section is running at 5X and nominal f/8, then the whole setup is still effective f/48 (=(5+1)*8) even when the front lens is installed for taking pictures.

Overall magnification of the whole setup is just the product of front lens magnification and rear lens magnification.

Note, however, that front lens magnification is very dependent on spacing between the front and rear lenses. With a front lens having FL 2.1 mm, the difference between 0.1X and 0.05X is only 0.105 mm of separation! With a 5X rear section, that 0.105 mm of separation makes the difference between 0.5X and 0.25X overall magnification.

So again, trying to calculate the front section magnification with any accuracy is quite difficult; it's far simpler to just focus on a ruler and get the magnification from that.

Once you have the magnification and the effective f-number, you can calculate DOF using something like the classic circle-of-confusion method:

totalDepthOfField = 2*C*Feff/(m*m), where Feff is the effective aperture, m is the overall magnification for both lens sections combined, and C is the acceptable circle of confusion based on sensor size.

It may be puzzling that the depth of field of the relay system, when calculated this way, comes out to be just the same as any other lens system that provides the same overall magnification and effective aperture. The reason for this equivalence is that the DOF of the wide-angle relay system in fact IS just the same as any other lens system, when we're talking only about parts of the image that are close enough in focus to be considered sharp. The obvious improvement in DOF comes entirely from areas that are significantly blurred. Compared to a conventional macro lens, what the wide-angle setups do is to render the background more sharply (because the entrance pupil is smaller) and to pack a lot more background into the same image area.

You asked also about effective focal length (EFL) and FOV. I'm not sure exactly what you mean by either of those terms.

For an optical designer, EFL is equivalent to "How much additional extension would I need to add, to add 1X of overall magnification?". But I suspect that's not a number that would be very helpful to you.

So, what do

*you*mean by EFL?As for FOV, taken literally that means "field of view" and it's a linear measurement taken across the in-focus plane. But of course that depends on overall magnification, which depends strongly on the separation between front and rear lenses.

I'm wondering instead if you mean "angle of view" (AOV), the angle between lines joining foreground and background points at opposite edges of the frame.

We can estimate that by calculating the width of the aerial image as imageWidth = sensorWidth/magnificationOfRearLensSection, then doing the usual trig calculation 2*arctan((imageWidth/2)/FL), where FL is the front lens FL. That won't account for shifts due to focusing, or for fisheye-like lens distortions typical of very short lenses, but it should get you in the ballbark.

All this is only from thought experiments, no physical experiments to confirm anything, so higher than normal chances of being wrong.

One last comment... If you try building simple models of these relay lens systems, say using just two "thin lenses" with appropriate spacing, I expect you'll find that the models fail rather badly. For example they predict severe vignetting due to the two lens apertures "fighting" with each other. In the simple model, off-axis rays that get through the front lens tend to miss the aperture of the second lens, and that effect gets worse as you stop down the second lens. A simple model of John's setup, with a 1.5 mm diameter aperture on the rear lens at 24mm f/16, predicts hopeless vignetting. What makes the real setups work well, I think, is that these short lenses tend to be telecentric toward the aerial image in the middle of the setup. That is, the front lens is designed so that its image is formed by cones of light whose centers are nearly parallel to the optical axis, and likewise the rear lens is designed so that, when reversed, it accepts cones of light in that same orientation. Given this situation, stopping down the rear lens can make all the cones of light narrower at the same time, without blocking the corners of the frame to cause vignetting. At least, that's my speculation. Again, no experimental confirmation.

I hope this helps.

--Rik

and thank you very much for your really precious contribute!

Well, now my relay system is composed as indicated below:

Front section: CCTV 4K lens 3.2mm f/2.0 1/1.7"

Rear section: Schneider Xenoplan 28mm f/2.0 C-mount (inverted)

The Xenoplan inverted gives me an effective magnification of 1.75x, so the f-number of the rear section is f/5.6 (@ f/2.0 nominal) and f/16 (@ f/5.6 nominal). As you explained above, in this case the f-number of the whole relay system is determined only by the rear section (because the f-number of the front section is f/2.0...).

Now, It would be nice to find a correct way to calculate the DOF at various magnification ratio, cosidering that the front section is "fixed aperture"...

You are right...my expression "EFL" was unhappy and imprecise! I meant "Focal lenght of the whole relay system"...moreover, "FOV" is also incorrect and "AOV" (angle of view) is the correct term. I can calculate them "experimentally" but It would be nice to use a mathematical way.

Thanks again or your really illuminating contribute!

Ciao

Toni

- rjlittlefield
- Site Admin
**Posts:**23937**Joined:**Tue Aug 01, 2006 8:34 am**Location:**Richland, Washington State, USA-
**Contact:**

Thanks for the further information about your setup.

Let me talk through some more calculations.

A good way to think about the relay is that what you have is equivalent to a 1.75X teleconverter placed behind a 3.2 mm main lens.

So then, following one of the common rules for "equivalent focal length", the whole system is equivalent to 3.2*1.75 = 5.6 mm focal length.

This calculation is a pretty good representation of your system, and it's wonderfully simple to explain. At least I hope it's wonderfully simple to explain, because the short description above is supposed to have done that.

But it's not a perfect description, in the same way that putting a 2X teleconverter behind a 50 mm lens (call it "50mm*2X") doesn't really give you a 100mm lens.

How can I show that the 50mm*2X is not the same as a true 100mm? Because a true 100 mm lens would reach 1X magnification when it's 200 mm away from the subject, while the 50*2X system will reach the same 1X overall magnification when it's only 150 mm away from the subject. A single lens that would give 1X at 150 mm from subject would be only 75mm FL, not 100 mm. So, when focused for 1X, the 50mm*2X system acts like 75mm, not 100mm. At infinite focus it acts like 100mm, but at 1X focus it acts like 75mm. There's really no single value that accurately represents its behavior in both conditions.

In the same way, your 3.2mm*1.75X system will not act exactly like a 5.6mm lens. Instead, at say 25mm focus distance, giving an overall magnification around 0.25, the system will act more like a 5.1 mm lens. The difference between 5.6 and 5.1 is not huge, but if you're inclined to want 2 or more digits of precision, then be aware that you're asking for the impossible.

With luck, the AOV of your system will be roughly the same as you'd expect from doing the trigonometry with a 5.6 mm lens positioned at FL*(1+overallMagnification) in front of your sensor. Assuming the situation I described above, 5.6*(1+0.25) = 7 mm equivalent distance from sensor to lens, then with a 17.3 mm sensor width, 2*atan((17.3/2)/7) = 102 degrees. Another way of getting about the same number is to calculate as 17.3mm sensor width, divided by 0.25 magnification, equals 67 mm of subject width, and since I've calculated all this based on having the subject 25 mm in front of the lens, 2*atan((67/2)/25) = 106 degrees.

The reason I say "with luck" is that the actual AOV can vary depending on exactly where the entrance pupil ends up. (Extreme example: the AOV of a lens that is telecentric on the subject side is zero degrees, regardless of what the lens focal length, focus distances, or magnification happen to be.) But for the system you're using, I'd expect the entrance pupil to be near the front of the front lens, giving a number similar to the calculations above.

Now, about that DOF...

The formula that I gave earlier should apply here.

totalDepthOfField = 2*C*Feff/(m*m), where Feff is the effective aperture (from the standpoint of the sensor), m is the overall magnification for both lens sections combined, and C is the acceptable circle of confusion based on sensor size.

For example, let's assume your rear lens is set on nominal f/5.6, giving effective f/15.4 (=5.6*(1+1.75)) for the whole system as seen by the sensor. Standard COC for micro four thirds is about 0.015 mm. The whole calculation then goes as 2*0.015*15.4/(0.25*0.25) ~= 7.4 mm.

In contrast, the 1/4-lambda criterion from wave optics, DOF = lambda/NA^2, would calculate that the subject-side NA is equal to m/(2*Feff) = 0.25/(2*15.4) = 0.008, so the corresponding DOF at wavelength 550 nm would be 0.00055mm/(0.008^2) ~= 8.6 mm.

As with all DOF numbers, there's a lot of leeway for interpretation. But either of these approaches should get you in the right ballpark.

As before, this is all from thought experiments with limited opportunity for cross-checking, so there's more than the usual opportunity for outright error.

I will be interested to hear how your experiments come out.

--Rik

Let me talk through some more calculations.

A good way to think about the relay is that what you have is equivalent to a 1.75X teleconverter placed behind a 3.2 mm main lens.

So then, following one of the common rules for "equivalent focal length", the whole system is equivalent to 3.2*1.75 = 5.6 mm focal length.

This calculation is a pretty good representation of your system, and it's wonderfully simple to explain. At least I hope it's wonderfully simple to explain, because the short description above is supposed to have done that.

But it's not a perfect description, in the same way that putting a 2X teleconverter behind a 50 mm lens (call it "50mm*2X") doesn't really give you a 100mm lens.

How can I show that the 50mm*2X is not the same as a true 100mm? Because a true 100 mm lens would reach 1X magnification when it's 200 mm away from the subject, while the 50*2X system will reach the same 1X overall magnification when it's only 150 mm away from the subject. A single lens that would give 1X at 150 mm from subject would be only 75mm FL, not 100 mm. So, when focused for 1X, the 50mm*2X system acts like 75mm, not 100mm. At infinite focus it acts like 100mm, but at 1X focus it acts like 75mm. There's really no single value that accurately represents its behavior in both conditions.

In the same way, your 3.2mm*1.75X system will not act exactly like a 5.6mm lens. Instead, at say 25mm focus distance, giving an overall magnification around 0.25, the system will act more like a 5.1 mm lens. The difference between 5.6 and 5.1 is not huge, but if you're inclined to want 2 or more digits of precision, then be aware that you're asking for the impossible.

With luck, the AOV of your system will be roughly the same as you'd expect from doing the trigonometry with a 5.6 mm lens positioned at FL*(1+overallMagnification) in front of your sensor. Assuming the situation I described above, 5.6*(1+0.25) = 7 mm equivalent distance from sensor to lens, then with a 17.3 mm sensor width, 2*atan((17.3/2)/7) = 102 degrees. Another way of getting about the same number is to calculate as 17.3mm sensor width, divided by 0.25 magnification, equals 67 mm of subject width, and since I've calculated all this based on having the subject 25 mm in front of the lens, 2*atan((67/2)/25) = 106 degrees.

The reason I say "with luck" is that the actual AOV can vary depending on exactly where the entrance pupil ends up. (Extreme example: the AOV of a lens that is telecentric on the subject side is zero degrees, regardless of what the lens focal length, focus distances, or magnification happen to be.) But for the system you're using, I'd expect the entrance pupil to be near the front of the front lens, giving a number similar to the calculations above.

Now, about that DOF...

The formula that I gave earlier should apply here.

totalDepthOfField = 2*C*Feff/(m*m), where Feff is the effective aperture (from the standpoint of the sensor), m is the overall magnification for both lens sections combined, and C is the acceptable circle of confusion based on sensor size.

For example, let's assume your rear lens is set on nominal f/5.6, giving effective f/15.4 (=5.6*(1+1.75)) for the whole system as seen by the sensor. Standard COC for micro four thirds is about 0.015 mm. The whole calculation then goes as 2*0.015*15.4/(0.25*0.25) ~= 7.4 mm.

In contrast, the 1/4-lambda criterion from wave optics, DOF = lambda/NA^2, would calculate that the subject-side NA is equal to m/(2*Feff) = 0.25/(2*15.4) = 0.008, so the corresponding DOF at wavelength 550 nm would be 0.00055mm/(0.008^2) ~= 8.6 mm.

As with all DOF numbers, there's a lot of leeway for interpretation. But either of these approaches should get you in the right ballpark.

As before, this is all from thought experiments with limited opportunity for cross-checking, so there's more than the usual opportunity for outright error.

I will be interested to hear how your experiments come out.

--Rik

My actual configuration is far from perfect, but you can have a good idea what I want to obtain looking at the bottom picture:

A small scorpion in wideangle-macro perspective...there is some chromatic aberration, but I have to try new lens combinations, especially for the relay lens.

The results are much more convincing in FullHD videos, that are less demanding form themselves...

Thanks again for your priceless contribute and stay tuned :-)

P.S. No one else is experimenting with relay systems?

- rjlittlefield
- Site Admin
**Posts:**23937**Joined:**Tue Aug 01, 2006 8:34 am**Location:**Richland, Washington State, USA-
**Contact:**

Toni, I'm glad I could help. Thinking through these things helps my understanding also, so it's a win-win.

I have not ever physically worked with a relay system like yours or John's, so I am very interested to know how well the simple theory works out.

If you have an opportunity to measure the AOV and the width of the in-focus plane, I would be very interested to hear the numbers.

--Rik

I have not ever physically worked with a relay system like yours or John's, so I am very interested to know how well the simple theory works out.

If you have an opportunity to measure the AOV and the width of the in-focus plane, I would be very interested to hear the numbers.

--Rik