The DOF is too small, what can I do?

For some applications a certain depth of field (DOF) is given. Objects at different distances have to be focused at the same time.

We have calculator for this, see Calculator for given DOF

This calculator tells you interactively what parameters will influence your DOF, and so far how many percent of the wanted DOF you achieved already.

There are just three parameters that influence the DOF:

  • focal length (indirectly given if you have sensor size, working distance and field of view (FOV)
  • CoC (the circle of maximum confusion describes you definitiion of the diameter of the light disk (instead of a mathematical point) that you still call focused. A typical measure here is
    CoC = 4 times the pixel size. So by choosing the sensor you indirectly choose the CoC too
  • F-Number : The higher the F-Number, the higher the DOF. Nice. However : The Rayleigh Criterion tell us that a higher F-Number can also descrease the resolution.

High DOF and high resolution contradict!

So we see, there is not too much freedom.

What if we need high resolution AND a high DOF ?
Things depend if you have time. if you have time, you could take a series of pictures in different distances, using focus modules , for example from https://www.piezolution.com/.

These include the complete controller for the used Piezo actuator.
The focus position can easily be changed by simple  ASCII command sent over USB or UART or I2C.
The repeatability here is +/- 3um for the standard type an +/- 0.5um for the precision type.

With such modules you could take a series of images in different image distances and therefore different Object distances.

One application could be Iris detection , taking an image series with a free running highspeed camera , for example with 300fps – every 2cm from 500-1000mm, then choose image from the series that has the best sharpness.