Cameras get the budget conversations, but in machine vision the lens quietly decides whether your system works. A superb sensor behind a mismatched lens produces images no algorithm can rescue. Matching a C-mount lens to your camera comes down to four numbers, and none of them is the camera's megapixel count.
1. Image circle must cover the sensor
Lenses project a sharp circular image; sensors are rectangles inside it. The lens image circle diameter must be at least as large as your sensor's diagonal. A 2/3" lens (11 mm circle) on a 1" sensor (16 mm diagonal) gives you a bright, sharp center with soft, dark, vignetted corners - a classic mistake when upgrading a camera without upgrading optics. Going the other way is safe: a 1" lens on a 2/3" sensor uses only the sharp middle of the image circle.
Check both datasheets: sensor optical format against lens image circle. When a lens says "for 2/3" sensors", that is the circle size, not a suggestion.
2. Focal length sets the field of view
Working distance (WD) and field of view (FOV) together pick the focal length through the pinhole relation: FOV = sensor width x WD / focal length. If your part is 160 mm wide, your camera's sensor is 8.8 mm wide (2/3" class), and you must stand 300 mm away, the focal length is 8.8 x 300 / 160 = about 16.5 mm - pick a 16 mm or 17 mm lens, or adjust WD. Industrial lens series come in fixed steps (8, 12, 16, 25, 35, 50 mm), which is why integrators tweak working distance to land between standard focal lengths rather than the reverse.
3. F-number trades depth for light
The aperture does two opposite things. Wide open (low F-number, f/2.0) you gather maximum light - fast exposures, motion frozen - but depth of field is razor thin and residual lens aberrations show. Stopped down (f/5.6-f/8) you get generous depth of field and better corner sharpness, but need more light or more exposure time.
The practical recipe: start at f/4-f/5.6, verify depth of field across your part's height variation, and add light until exposure time is short enough for your line speed. Machine vision runs on light, not on aperture heroics.
4. Lens resolution must match pixel size
A lens resolves detail in line pairs per millimeter (lp/mm), and your sensor demands a specific amount: roughly 1/(2 x pixel size). A sensor with 3.45 um pixels wants about 145 lp/mm; a 1.85 um pixel sensor wants about 270 lp/mm. Most standard FA lenses comfortably deliver the former and struggle with the latter - which is why the 12 MP MV-CU120-10GM with its 1.85 um pixels needs a better-corrected lens than the 5 MP MV-CS050-10GM at 3.45 um, even though the 12 MP sensor is physically smaller.
Lens makers label their series by the megapixel class they resolve (5 MP, 10 MP, 25 MP lenses). Match the label to your sensor, with one notch of margin.
5. The check that catches everything: shoot a target
Before committing optics, mount the lens, aim at a resolution chart or a real part with fine features, and inspect the corners at 100% zoom. Corners fail first - field curvature, astigmatism and lateral chromatic aberration all live there. Ten minutes on a test bench beats discovering smeared corners after the station is wired into the line.
A worked pairing
Take a conveyor station inspecting 120 mm wide parts at 200 mm working distance with the MV-CS050-10GM: sensor width 8.8 mm (2/3"), so focal length = 8.8 x 200 / 120 = about 14.7 mm - a 12 mm lens at 165 mm WD or a 16 mm at 218 mm both land close. The 3.45 um pixels need ~145 lp/mm, satisfied by any decent 5 MP-class FA lens. This is the whole calculation; nothing about it is mysterious.
Our industrial lens catalog lists image circle, focal length and resolution class for every model, and each camera page notes its optical format - the two numbers you check first, in that order.