Machine Vision Lenses for Food, Beverage, and Pharmaceutical Packaging Inspection: A Selection Guide
Choosing machine vision optics for fill level, cap/seal, date-code, and foreign-object checks, plus blister-pack, label, and tamper-evidence inspection on regulated pharmaceutical packaging lines.
Food, beverage, and pharmaceutical packaging lines test machine vision optics harder than most inspection environments. High conveyor speeds need fast apertures, washdown cycles degrade unsealed lenses, and regulated packaging adds traceability requirements a cosmetic defect check does not have. No single focal length or mount type fits every station.
For most tasks the choice is between Commonlands M12 lenses (compact, inexpensive, suited to multi-camera arrays) and C-mount lenses (adjustable iris, higher resolution ceiling, more tuning margin). A flat packaging surface, a tight mechanical envelope, and a sensor 1/1.8″ or smaller point to M12. Product height variation, a need for iris control, or a sensor 2/3″ and larger point to C-mount. Direct high-pressure washdown on the lens itself points to the Commonlands CIL190 or a sealed housing.
Contents
- Conveyor belt defect detection
- Label and barcode verification
- Fill level and cap inspection
- Foreign object and contamination detection
- Sorting and grading
- Pharmaceutical packaging inspection
- M12 vs C-mount for food and pharma production
- Sensor pairing and resolution
- Environmental considerations
- Commonlands products
- Top 5 lenses for food and pharma packaging inspection
- Frequently asked questions
Conveyor belt defect detection
Low distortion matters on belt inspection because distorted frames make consistent bounding-box or contour detection harder across the field. The Commonlands CIL512 (12mm C-mount, approximately −1.8% TV distortion) suits wide-belt coverage on a 1.1″ sensor. The CIL533 (16mm, −0.1% optical/rectilinear distortion, a different metric, not directly comparable to CIL512's TV figure) is the lower-distortion choice for narrower fields at longer working distances.
Label and barcode verification
Working distances for label stations typically fall between 150–400mm, where M12 lenses with good off-axis correction are competitive. The Commonlands CIL052 (5.2mm M12, −0.1% distortion) holds consistent resolution across a 1/1.8″ sensor for full-label capture at short working distances. The CIL042 (4.2mm M12, −0.7% distortion) covers a wider field for larger labels, though the higher distortion limits OCR edge-accuracy near the corners.
Fill level and cap inspection
Multi-camera setups are common here, one camera per lane or per product variant, so cost matters. The Commonlands CIL083 (8mm M12, $19) is the cost-effective choice: at F/2.8 it gathers enough light for reasonable exposures under standard line illumination, and −0.5% TV distortion is adequate for threshold pass/fail.
For measurement-grade systems where image height maps to a physical volume, the CIL553 (16mm C-mount, −0.09% distortion, 25MP) gives better geometric accuracy and supports higher-resolution sensors for finer increments.
Foreign object and contamination detection
Foreign object detection (glass, bone, metal, insects) often pairs machine vision with NIR illumination, because many contaminants invisible in white light absorb or reflect differently in the 700–1100nm range. A standard lens with an IR-cut filter strongly attenuates that range, so it is unsuitable for NIR work regardless of sensor sensitivity.
For NIR food inspection, specify a lens variant without the IR-cut filter. Commonlands offers CIL083-F2.8-M12ANIR for compact M12 installations and CIL512-F2.8-CMANIR for C-mount setups. Both transmit beyond 700nm for use with NIR illumination sources. See the NIR imaging guide for sensor and illumination pairing.
For visible-light contamination such as surface marks, color patches, or label anomalies, standard lens variants work fine. What matters most is contrast performance at the spatial frequencies of the smallest contaminant you need to flag.
Sorting and grading
Items need to stay fully in frame as they pass, which means a wide-angle lens or a camera set farther back. The Commonlands CIL042 (4.2mm, F/1.9) gives the widest field here and passes more light than F/2.8 alternatives, so it suits fast lanes where motion blur is the main concern. The CIL083 (8mm, F/2.8) works better for texture grading over a smaller inspection area.
Pharmaceutical packaging inspection
| Inspection task | Primary optical constraint | Lens starting point |
|---|---|---|
| Label and lot-code / UDI verification | Low distortion, pixel density on smallest character | Low-distortion M12 or C-mount, <0.5% distortion |
| Blister pack and pouch completeness | Depth of field across cavity height variation | C-mount with adjustable iris |
| Seal and flap / tamper-evidence inspection | Depth of field over folded edges and raised seams | C-mount with adjustable iris |
| Carton label placement / print-position | Low distortion across full field | C-mount, 2/3″ or 1.1″ sensor |
Traceability pushes lot-code and UDI reading toward lower distortion and higher edge resolution than a presence check: every character in the lot code and expiration date has to decode for recall and serialization audits under frameworks like DSCSA. A lens with 2% barrel distortion compresses character strokes near the periphery, lowering OCR confidence where wide-zone label text sits. Under 0.5% distortion usually removes the need for software correction, which adds latency and per-unit calibration.
The CIL052 (5.2mm M12) is a compact option for code-reading and label heads. The CIL522 (12mm C-mount, 0.4% distortion, F/1.4) adds adjustable iris for packaging with depth-of-field pressure.
Blister cavities, formed pouches, and folded flaps sit at different distances from the camera, so at a wide aperture even a few millimeters of height variation can defocus part of the frame. Stopping down extends depth of field, and because machine vision illumination is usually programmable, a two-stop reduction is compensated with more strobe power, not a lens change.
The CIL512 covers up to 1.1″ sensors with a 17.6mm image circle for carton and tray coverage. The CIL544 25mm C-mount handles small-character lot-code work at longer standoff. M12 still fits embedded code readers and compact label heads where the envelope forces a smaller lens and the surface stays flat.
Continuous-web label inspection at line speed needs a line-scan camera and line-scan optics, not area-scan. 360-degree vial inspection needs multiple cameras or a pericentric lens. SWIR imaging through opaque packaging needs a sensor and lens matched to the SWIR band. None are current Commonlands products. For those tasks, a specialist in that modality is the better starting point.
M12 vs C-mount for food and pharma production
M12 and C-mount are different optical systems, not variations of the same design. M12 lenses use a rigid body: focus is set by threading the barrel, and there is no internal mechanism for aberration rebalancing at different focus positions. C-mount lenses use a cam refocus system that moves internal groups, which rebalances off-axis aberrations as focus is adjusted. This distinction matters when changing products or working distances. See the full mount comparison guide for the mechanical details.
M12 lenses are smaller, lighter, and cheaper, typically $19–79 in the Commonlands food and packaging range. Across multi-camera arrays of 10–20 cameras on wide conveyors, that cost difference adds up, and M12 integrates cleanly into compact embedded smart cameras.
| Factor | M12 | C-mount |
|---|---|---|
| Cost (Commonlands range) | $19–79 | $119–349 |
| Size and weight | Compact, low mass | Larger, heavier |
| Aperture control | Fixed aperture | Adjustable iris ring |
| Sensor format coverage | Most models up to 1/1.8″; select models to 1/1.6″ | Up to 1.1″ and above |
| Focus adjustment | Thread rotation, rigid body | Cam refocus, aberration-rebalanced |
| Washdown rating | IP69K available (CIL190) | Typically relies on external sealed housing |
| Multi-camera arrays | Preferred for cost | Used when resolution or DOF tuning demands it |
For IP69K washdown protection on the lens itself, the CIL190 (19mm M12, F/1.6, IP69K) is the specific option. C-mount installations in direct washdown zones typically rely on an external sealed housing, since the iris mechanism is not rated for high-pressure water.
Sensor pairing and resolution
Basic pass/fail inspection includes fill level threshold, cap presence, or gross defect detection. For these tasks, a 1/3″ sensor with an M12 lens provides adequate resolution at lower cost per camera head. The CIL083 covers up to 1/1.8″ sensors, giving flexibility if sensor format changes in a later system revision.
Label reading and barcode verification need more pixels across the inspection area. 1/1.8″ sensors at 8–12MP give the pixel density needed for character recognition. The Commonlands CIL052 covers 1/1.8″ at 10MP+, and the CIL042 covers 1/1.7″ at 5–6MP. Stepping up to a 2/3″ sensor means moving to a C-mount lens, because these M12 image circles do not reach an 11mm diagonal.
High-resolution defect detection on large areas benefits from 1″ or larger sensors. Examples include texture grading, print-quality verification, and foreign material on wide-format labels. The CIL512 covers a 1.1″ image circle on sensors like the IMX253 for that field coverage and resolution. Use the DOF calculator to check depth of field across your product height range at the chosen aperture.
Environmental considerations for food and pharma production
Washdown (IP67 vs IP69K)
IP67 covers submersion to 1 meter. IP69K covers high-pressure, high-temperature jet spray, the standard used in food plant sanitation. These are different requirements: an IP67 rating makes no claim against an 80°C pressure-washer stream, so do not assume it survives one. Check the rating against the plant's sanitation protocol. Not every station needs IP69K. Many pharmaceutical labeling and carton cells run in dry, climate-controlled rooms where a standard sealed lens is enough.
The CIL190 is IP69K rated for direct spray-down. For lenses without an IP rating, sealed housing with a protective optical window is the standard approach. Specify AR-coated glass for the window to keep transmission losses low. The IP rating guide covers what each rating actually tests and its limits. IP69K on a lens also does not imply IP69K on the camera or mount. Confirm the full system rating, not just the lens.
Temperature cycling
Lenses moving between cold storage (0–5°C) and warm production areas (20–30°C) can fog optical elements or shift focus as mechanical tolerances tighten. Optical polymers have higher, less predictable thermal expansion than glass, so element materials and how the design is athermalized both affect focus stability. Check the datasheet operating-temperature range rather than assuming a construction type wins. See ruggedized machine vision lenses for the Commonlands products built for thermal cycling.
Commonlands lenses for food, beverage, and pharma packaging inspection
Top 5 machine vision lenses for food and pharma packaging inspection
| Rank | Lens | Mount | EFL | F# | Sealing note | Best for |
|---|---|---|---|---|---|---|
| 1 | CIL052 | M12 | 5.2mm | F/3.4 | No IP rating; dry or lightly sealed stations | Label and barcode verification (−0.1% distortion) |
| 2 | CIL544 | C-mount | 25mm | F/1.8 (adjustable iris) | No IP rating; add sealed housing for wet zones | Date-code and lot-code OCR at longer standoff |
| 3 | CIL083 | M12 | 8mm | F/2.8 | No IP rating; standard sealed line use | Fill-level pass/fail, multi-camera arrays |
| 4 | CIL512 | C-mount | 12mm | F/2.8 | No IP rating; sealed housing for washdown | Foreign-object and NIR contamination (NIR variant available) |
| 5 | CIL042 | M12 | 4.2mm | F/1.9 | No IP rating; dry sorting enclosures | High-speed sorting and grading (wide FOV) |
Where a bare Commonlands lens is the wrong call: large-format C-mount stations that need factory-automation glass rated for continuous line duty are better served by a Fujinon or Kowa FA lens with longer published shock and MTF data. For a direct washdown zone, a full IP69K camera housing protects the whole optical stack, which a per-lens rating cannot.
Frequently asked questions
What focal length do I need for a 600mm-wide conveyor belt?
It depends on working distance and sensor size: EFL = (WD × sensor width) / FOV width. For a 600mm belt at 300mm working distance on a 2/3″ sensor (8.8mm width), EFL = (300 × 8.8) / 600 = 4.4mm. A shorter EFL at fixed FOV and sensor size gives more depth of field, not less. The real tradeoffs at 4.4mm are distortion, keystone effects at the belt edges, and corner performance.
At 500mm the EFL rises to 7.3mm, easing those edge effects. A 1″ sensor (12.8mm) at 400mm gives about 8.5mm. Iterate with the FOV calculator before committing.
What is the best budget lens for a multi-camera food inspection line?
The CIL083 at $19 is the practical answer for cost-sensitive multi-camera lines. It covers 1/1.8″ sensors at F/2.8 with −0.5% TV distortion, adequate for pass/fail inspection. For label stations, the CIL052 at $79 gives −0.1% distortion and better off-axis performance. Running 14 fill-level stations on CIL083 and 6 label stations on CIL052 across a 20-camera line saves about $840 without compromising where optics matter.
Can one lens cover both label reading and defect detection?
Usually not with a single station. Label reading needs the frame filled with the label for maximum pixel density per character, while defect detection may need to cover the whole product including edges. These fields of view conflict, and a lens optimized for one leaves the other underserved.
If a single camera must serve both, choose the field of view for the more demanding task and verify the other still meets acceptance criteria at the resulting resolution.
Is C-mount better than M12 for pharmaceutical packaging lines?
C-mount is the better default for most fixed-station packaging inspection: adjustable iris, larger sensor support, and more tuning margin. A 2/3-inch or 1.1-inch sensor covers a wider packaging zone at the same working distance without sacrificing pixel density.
M12 is right when the inspection head has a hard size constraint, the surface is flat and consistent, and a modest sensor is enough. Many embedded code readers and compact label heads use M12 for exactly this reason.
How do I protect the lens in a washdown environment?
The direct option is a lens with an IP69K rating: the CIL190 (19mm M12) is rated for the high-pressure, high-temperature jet spray used in food plant sanitation. For lenses without an IP rating, a sealed housing with an AR-coated optical window is the standard approach. See the IP rating guide for what each rating covers and what it does not.
Need help specifying a lens for a packaging line?
Browse M12 lenses and C-mount lenses for food, beverage, and pharmaceutical packaging inspection.
Size focal length with the FOV calculator, or contact Commonlands engineering with your sensor format, working distance, and inspection task.






