Understanding & Comparing C-Mount Microscope Lenses

How sharp can a digital microscope lens be? Are prime lenses better than zoom lenses? What’s best bang for buck?

Details

So many questions, when wanting to upgrade from my old Andonstar AD407 to something sharper, with more pixels, a bigger screen, a higher frame rate, and more working distance. It’s still a useful tool, and has allowed me to do some incredibly small patches, but it was time for something better.

My old Andonstar AD407

I was specifically looking for a c-mount camera body that outputs 4k@60fps on a low latency HDMI port, has autofocus, a bigger base, and preferably live focus stacking. This was quite easy to find – all specifications listed on product pages and datasheets. I ended up with the X5FCAM4K8MPA from ToupTek, sometimes rebranded as RisingCam. They specialize in nothing but microscope, astrophotography, and machine vision cameras – and don’t simply rebrand stuff from other manufacturers like Eakins. Perfect.

“Insert ToupTek Image”

Then I wanted lenses. Sharp and detailed lenses. With most affordable ones, these are not metrics listed anywhere. And what makes lenses sharp and detailed? Is there a limit to how sharp they can be? What are these limits? What other variables come into play? Can you get sharpness without breaking the bank?

These questions lead me down a rabbit hole, with numerous tests, lots of math, beautiful spreadsheets, and satisfying answers.

Defining Sharpness

First things first. I want sharp lenses. That means we need a way to define it, and a way to measure it. The first unit I found here was [lp/mm] – line pairs per mm. Sometimes called cycles per mm [c/mm].

USAF 1951 Resolution Target

What came up soon after – and what will help explain it – is the 1951 USAF resolution target.

The resolution target is basically a fractal, with a repeating pattern of two groups with six ‘elements’, getting smaller every time. Every element has two sets of three black lines, 90 degrees offset from each other. One black line, and one white space, make one line pair. If each line is 10 μm wide, the line pair will be 20 μm wide, and its resolution will be (1000 μm / (10 μm * 2)) = 50 lp/mm.

The target I got is chrome printed on glass, and goes from group 0 to group 7. Element 0-1 (the first element of group 0) has exactly 1.00 lp/mm. This doubles for every group, making 7-1 have 128.00 lp/mm. The six elements per group are spread logarithmically apart, making the smallest element I have, 7-6, come down at 228.1 lp/mm. That’s a line width of about 4 μm! A human hair is about 100 μm. Tiny tiny lines.

MTF50

The actual resolution of a camera system is often defined as the MTF50 – the resolution (in lp/mm) where the contrast drops to 50% of its original value. The black and white line pattern of the USAF target gets blurrier the less sharp an image is. Black and white fades to fuzzy dark grey and light grey, and then when the difference between the dark and light grey is half of the difference between the original black and white, you have this 50% point.

There are ways of computing the MTF50 from a single high contrast edge, using programs like MTF Mapper and Quick MTF, but I couldn’t get consistent results from those (and they didn’t give me the same numbers).

Instead I wrote a small Fiji macro that allows me to select a white and a black reference, draw a line through one of the USAF targets, and will then compute its MTF value. This way I can verify which element (and what lp/mm resolution) comes closest to the MTF50 point. Here’s an example of what it could look like to do so manually, to give an idea of what it’s doing:

 

Sharpness Limits

Now that we have a way to define and measure sharpness, we can start answering related questions. The first one I had – how sharp can a lens be.

Sensor Limit

The first obvious limit here is the sensor resolution. If your sensor has 2 μm pixels, and the magnification of your setup is 1x, nothing can ever be sharper than (1000 μm / (2 μm * 2)) = 250 lp/mm.

Diffraction Limit

The second limit I found, is the diffraction limit. When the lens’ aperture gets too small, diffraction will make the light spread out, blurring the image. I’ll get into the math of this more later, but the setups I tested were sometimes sensor limited, and sometimes diffraction limited, so this was one of the main things to take into account.

Depth of Field

Another important metric is depth of field. The maximum depth of your image you can get sharp. Sadly, the smaller the aperture, the larger the depth of field. Which goes in the opposite direction of the diffraction limit. So we can chose either a very sharp image with little depth of field, or a blurrier image with a larger depth of field. The amount of light the sensor gets is also directly dependent on this. The larger the aperture, the more light.

Optics Quality

The three limits above are hard limits that you can’t really avoid. From there on, it’s up to the sensor and optics to deliver. My goal then is to find affordable lenses that come as close to the theoretical limits as possible. Ideally with an adjustable aperture, so we can choose between absolute sharpness and depth of field.

Lens Types

My next question – what are the options? The c-mount is luckily the main standard in this realm of cameras and lenses, so there’s a lot to find. I found four paths we could take.

C-Mount Microscope Zoom Lenses

These are meant for exactly the purpose I’m using the camera for, and have a typical zoom range from 0.7x to about 5.6x.

They consist of three main parts. The front lens – the main one – sets the aperture, focal length, and working distance. From a cheap €60 zoom lens, this will cost about €25. You can get different types and swap them to change your general zoom range. Then there is the body, containing optics to zoom in and out from here, preferably with compensation to make sure the working distance doesn’t change with zoom. Lastly there is the TV relay / camera adapter, that projects the image onto the camera sensor. You can get often these in different magnifications (1.0x, 0.75x, 0.5x) to match various sensor sizes.

I haven’t seen any with adjustable aperture, so you’re stuck with whatever the front lens has – though they’re easily exchanged.

C-Mount Macro Prime Lenses

One of the main applications of these c-mount cameras is in Machine Vision. Often with lenses that will be installed in fixed locations in factory automation lines. From this market we’re able to get nice macro (made for focusing at close ranges) prime (no-zoom) lenses, with adjustable apertures. Despite not having zoom, we can still move them closer and further away from the subject and refocus. So we can change the field of view, but the working distance will change as well. (With a nice parfocal zoom lens, you would be able to zoom in and keep the image in focus without having to change the distance from the camera to the subject.)

With photography lenses, primes are usually sharper than zoom lenses. In the, but especially in the corners. Will that hold here?

C-Mount Lenses with Extension Tubes

Another way to get lenses to focus up close is by using extension tubes. They increase the distance from the lens to the sensor – the same thing as my c-mount camera’s autofocus mechanism does – which decreases the distance from object to lens you can still get in focus. This way we can get a nice, sharp, normal machine vision lens, and use it up close anyway. Not all lenses ‘like’ this though. The corners might get soft, and chromatic aberrations might increase, so it might not be ideal.

Microscope Objectives with Tube Lenses

The last method I found was using long working distance infinity corrected microscope objectives, and adapting them for use on a c-mount camera. These are similar to the front lenses of the microscope zoom lenses, and won’t form an image without additional optics. To do this you’d need an additional tube lens, and the magnifications on these lenses are typically specified for tube lenses with a 200mm focal length. If you want a twice as small image, you could for example also get a 100mm tube lens. This makes them pretty flexible, though they still start at about 2x magnification.

The quality of these microscope lenses tends to be extremely good. Negligible chromatic aberrations, extremely flat field, wide apertures. Which matches their typical price. I didn’t go down this route yet, as my main purpose (soldering tiny components) requires a wider field of view than these tend to offer.

Testing Lenses

Knowing how to define sharpness, what the limits are, and what the lens options are, it was time to start testing!

I borrowed as much as I could find, and purchased some other good looking options. In total I tested 11 lenses: three dedicated c-mount microscope zoom lenses, three c-mount macro prime lenses, three normal c-mount prime lenses, one normal c-mount zoom lens, and a macro prime designed for a full-frame photography camera.

To comparatively test them, I selected 5 different fields of view: 35mm, 21mm, 13mm, 8mm and 5mm wide. For each lens, I checked which I could reach, then followed a test plan on each of those:

  • Set and focus the lens to the field of view
  • Write down the working distance
  • In the case of a prime lens:
    • Write down the amount of extension tubes (or autofocus lens shift) necessary to focus
  • In case of a zoom lens:
    • Write down the specified magnification at this zoom point
  • Shoot an image of a uniform circuit board
  • Shoot an image of the center, and each of the corners, of the 1951 USAF Target
  • Write down the resolved elements