Machine Vision
Depth of Field Calculator
Estimate near and far focus limits, total depth of field, and hyperfocal distance for machine vision lenses.
Machine vision workflowStep 5 of 6
Next workflow step
Continue to Camera Bandwidth Calculator — 2448x2048 resolution · 30 FPS
Related tools
How it works: Uses standard thin-lens DoF formulas. Circle of confusion defaults to sensor diagonal / 1500 when left blank. Results assume focused at the subject distance.
Learn about this tool
What it is, when to use it, formulas, and common questions
What is this?
Calculates near/far focus limits, total depth of field, and hyperfocal distance for a given lens and aperture.
When do engineers use it?
Use when object height varies (e.g. stacked products) or when you need to confirm the full part stays sharp.
Formula
Total DoF depends on focal length, f-number, subject distance, and circle of confusion.
Example
At f/8 and 400 mm WD, a 25 mm lens may give ~40 mm total DoF — check against your tallest product.
FAQ
- What circle of confusion should I use?
- For machine vision, CoC is often tied to pixel size (roughly 1–2 pixels). A smaller CoC (stricter sharpness) shrinks DoF. If you are unsure, start near your pixel pitch.
- Will stopping down always keep the part in focus?
- Smaller apertures increase DoF but add diffraction blur and need more light or exposure. Past f/8–f/11 on small pixels you can lose the resolution you just gained.
- Is hyperfocal distance useful on a factory camera?
- Sometimes, for large working distances. On typical 300–800 mm inspection mounts, compute near/far limits against part height instead of relying on landscape-style hyperfocal rules.
- Does sensor size change DoF?
- Indirectly. A different sensor with the same lens changes FOV and often the CoC you should use. Recalculate when you change format, not only when you change f-number.