News
How to Choose a Machine Vision Lens and Lighting (Guide)
Short answer: Choose the lens first from three numbers: working distance, field of view and sensor size. Then choose the lighting technique that makes the defect or feature stand out, such as backlight for silhouettes or dark field for surface flaws. Check that the lens covers your sensor and matches its resolution. Test the lighting on real parts before you finalize the design.
What Do Lens and Lighting Do in a Vision System?
A lens focuses the scene onto the camera sensor. Lighting controls how the part reflects light, and so how much contrast the camera sees.
Good optics and lighting make the software's job easy. Poor ones cannot be fixed later by software alone. If you are new to the basics, read what machine vision is first.
How Do You Choose a Machine Vision Lens?
Start with the working distance (lens to object), the field of view (the area you must see) and the sensor size. These three values determine the focal length you need.
Edmund Optics describes the same logic in its basic lens selection guide: longer focal length lenses have longer minimum working distances, and a larger sensor gives a proportionally larger field of view with the same lens.
Sensor size comes from the camera, so decide on the camera type first. Area scan vs line scan explains which fits your line, and the datasheet of your area scan cameras gives the exact sensor dimensions.
How Do You Calculate Lens Focal Length?
A common approximation, given by The Imaging Source, is:
Focal length (mm) = sensor size (mm) × working distance (mm) ÷ field of view (mm)
Hypothetical example: a sensor 8.8 mm wide, a working distance of 300 mm and a 100 mm field of view give about 26.4 mm. You would then pick the closest available lens and confirm it with the manufacturer's calculator.
This is the logic behind any machine vision lens focal length calculator. Use the exact formulas from the lens maker for final decisions.
Which Lens Specs Cause the Most Mistakes?
Most lens mistakes come from mismatched sensor, mount or resolution. Check these before you order.
| Check | Why it matters |
|---|---|
| Image circle vs sensor | The lens image must cover the sensor diagonal, or the corners go dark (vignetting) |
| Mount type | C-mount (17.526 mm flange distance) is common in industry; CS-mount is 12.526 mm |
| Lens resolution vs sensor | A lens made for a 5 MP sensor may underperform on a higher-resolution one |
| Aperture (f-number) | Low f-numbers gather more light but give shallow depth of field; high ones add depth |
These are the common mistakes when selecting machine vision lenses. They are cheap to avoid on paper and expensive to fix after installation. Matching lens resolution to the sensor matters most where details are small, as in the electronics industry.
What Are the Main Machine Vision Lighting Techniques?
The main techniques are ring, bright field, dark field, dome, backlight and coaxial lighting. Each suits a different surface.
| Technique | Best for | Watch out for |
|---|---|---|
| On-axis ring | General-purpose inspection | Hot spots, so mount a few degrees off perpendicular |
| Dark field | Scratches, bumps, surface irregularities | Must sit very close to the part, often within an inch |
| Diffused dome | Curved or uneven objects | Softens sharp details |
| Backlight | Silhouettes, holes, dimensions | Shows only the outline, not surface detail |
| Diffused on-axis | Shiny flat surfaces | Flat surfaces only |
The table follows Balluff's guide to lighting techniques. For backlight vs dome vs ring light, ask what you need to see. Edges and holes point to backlight. Even light on a curved or shiny part points to a dome. A general surface check usually starts with a ring light.
Ring Light or Bar Light: Which Should You Use?
Use a ring light for even illumination close to the camera, and a bar light for large or irregular objects or when you need to adjust angle and distance. Smart Vision Lights summarizes the trade-off.
- Ring light: simple to mount around the lens, minimal shadows, but limited angle adjustment.
- Bar light: adjustable height and angle, often more total light, but needs careful alignment and setup.
How Do You Select Lighting for a Machine Vision Application?
Select lighting by testing. Start from the defect you must detect, then try techniques on real parts.
- Define the feature (edge, scratch, print, hole).
- Pick a technique from the table above.
- Choose a light color that contrasts with the target. Vision Systems Design gives the example of green light to read red text.
- Test with good and bad samples under production conditions.
For a compact setup, smart cameras combine the camera and processing in one unit, which keeps the number of parts to light and mount small.
What Are the Most Common Lighting Mistakes?
The same source lists the most common machine vision lighting pitfalls:
- Considering lighting too late in the design.
- Choosing the wrong light color.
- Ignoring the environment, such as coolant splash, where a higher IP rating helps.
- Using rigid lighting that cannot adapt to product changes.
- Overlooking lens effects such as brightness falloff at the edges.
Avoiding these keeps results consistent from shift to shift, which is the foundation of machine vision quality control.
How Do Lens, Lighting and Camera Fit Together?
Choose the three as one system. Resolution and sensor size set the lens requirement, and the lens and part set the lighting.
Browse the full range of Hikrobot machine vision cameras once you know your field of view and resolution. For multi-camera tasks, pair them with vision controllers.
Frequently Asked Questions
How do I choose a lens for a machine vision camera?
Use working distance, field of view and sensor size to find the focal length. Then check mount, image circle and resolution match.
What is the most common lighting technique?
An on-axis ring light is the most common general-purpose choice. Backlight is the most robust for silhouettes and holes.
Is a ring light or a bar light better?
Ring lights are simpler and give even light. Bar lights are more adjustable and suit large or irregular parts.
Why does lighting matter more than software?
Software works on the image it receives. Good lighting creates contrast that software cannot invent later.
Can a lens limit a high-resolution camera?
Yes. A lens designed for a lower-resolution sensor may underperform on a higher-resolution one.
