Packaging inspection lens guide

Machine Vision Lenses for Food, Beverage, and Pharmaceutical Packaging Inspection: A Selection Guide

Machine vision optics for food and beverage lines need to handle fill level, cap/seal, date-code, and foreign-object checks. Pharmaceutical packaging lines add blister-pack completeness, label verification, and tamper-evidence inspection on top of that.

By Max Henkart, Commonlands · Updated July 2026 · 9 min read

A Commonlands C-mount machine vision lens inspecting backlit glass bottles on a conveyor

Food, beverage, and pharmaceutical packaging lines test machine vision optics harder than most inspection environments. High conveyor speeds call for short exposures, which come from a fast aperture, brighter or strobed lighting, or a more sensitive sensor, and washdown cycles degrade unsealed lenses. 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 points to an IP69K-rated Commonlands M12 lens sized to the belt, or a sealed housing; neither rating covers detergents or sanitation chemistry.

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 its aperture works with standard line illumination for reasonable exposures, with sensor response and exposure time setting the actual margin, 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 sometimes pairs machine vision with NIR illumination, because some contaminants that blend into white light differ in reflectance across 700nm to 1100nm. Whether it works is case-specific: the contaminant, its thickness, the product matrix, and the illumination geometry all matter. Silicon NIR often finds insects and dark plant material; clear glass, bone, and metal in bulk product commonly need hyperspectral, SWIR, or X-ray instead.

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 collects more light geometrically 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 be decoded 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. A lens under about 0.5% distortion is a common target for skipping software correction, but the real threshold follows the allowed positional error, field position, and measurement tolerance.

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 an 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.

Where standard optics stop

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.

Commonlands C-mount lenses use cam-driven focus; the focus mechanism and its near-limit behavior are product-specific, so check the product page. The C-mount standard itself dictates no focus mechanism; other C-mount lenses use unit or front-cell focus, or ship fixed-focus. 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 arrays of 10–20 cameras on wide conveyors that 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-driven focus (product-specific)
Washdown rating IP69K available (CIL190, CIL337, CIL355, CIL384) 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) covers narrow fields at longer standoff. A wide belt needs a much shorter focal length, so size the field first, then check the IP69K CIL337 (3.6mm), CIL384 (3.34mm), and CIL355 (5.5mm) against it. C-mount installations in direct washdown zones 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 headroom if the sensor format changes later.

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 detection 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 dust ingress plus immersion to 1 meter for 30 minutes, the IEC 60529 IPX7 test. IP6K9K (industry shorthand IP69K) comes from ISO 20653, a separate road-vehicle standard, and covers a defined high-pressure, high-temperature jet spray, not the same test as IEC 60529. These are different requirements: an IP67 rating makes no claim against an 80°C pressure-washer stream, so do not assume it survives one.

Either rating applies to the tested lens variant in its mounted configuration, under that standard's water and dust exposures only. It does not cover detergents, steam, repeated sanitation cycles, or the rest of the camera. Check it against the plant's 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.

For lenses without an IP rating, a sealed housing with an AR-coated optical window is the standard approach, which keeps transmission losses low. The IP rating guide covers what each rating actually tests and its limits.

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. 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.

Food and beverage
6mm Two Thirds Inch Lens

6mm C-Mount Lens 2/3" 5MP

$249.00

CIL530-F1.8-CMANIR — 2 in stock

Download .STPView Product
8mm C Mount Lens Kowa Computar 2/3"

8mm C-Mount Lens 2/3" 12MP

$149.00

CIL531-F2.8-CMANIR — 49 in stock

Download .STPView Product
12mm C Mount Lens Kowa Lucid Vision

12mm C-Mount Lens 2/3" 12MP

$149.00

CIL532-F2.0-CMANIR — 39 in stock

Download .STPView Product
16mm C-Mount Lens Kowa Computar Lucid Vision Edmund Optics

16mm C-Mount Lens 2/3" 12MP

$149.00

CIL533-F2.0-CMANIR — 10 in stock

Download .STPView Product
25mm C Mount Lens Amazon

25mm C-Mount Lens 2/3" 12MP

$149.00

CIL534-F2.0-CMANIR — 16 in stock

Download .STPView Product
35mm C-Mount lens Computar

35mm C-Mount Lens 2/3" 12MP

$149.00

CIL535-F2.0-CMANIR — 54 in stock

Download .STPView Product
Lucid Vision Basler C Mount Lens IMX566

50mm C-Mount Lens 2/3" 12MP

$149.00

CIL536-F2.8-CMANIR — 25 in stock

Download .STPView Product
12mm C Mount Lens Hikrobot Basler

12mm C-Mount Lens 1.2" 25MP

$249.00

CIL552-F2.8-CMANIR — 20 in stock

Download .STPView Product

Browse Machine Vision Lenses for Quality Inspection

Pharmaceutical packaging
6mm Two Thirds Inch Lens

6mm C-Mount Lens 2/3" 5MP

$249.00

CIL530-F1.8-CMANIR — 2 in stock

Download .STPView Product
8mm C Mount Lens Kowa Computar 2/3"

8mm C-Mount Lens 2/3" 12MP

$149.00

CIL531-F2.8-CMANIR — 49 in stock

Download .STPView Product
12mm C Mount Lens Kowa Lucid Vision

12mm C-Mount Lens 2/3" 12MP

$149.00

CIL532-F2.0-CMANIR — 39 in stock

Download .STPView Product
16mm C-Mount Lens Kowa Computar Lucid Vision Edmund Optics

16mm C-Mount Lens 2/3" 12MP

$149.00

CIL533-F2.0-CMANIR — 10 in stock

Download .STPView Product

Browse Machine Vision Lenses for Quality Inspection

A washdown-rated camera in a sealed stainless housing above a wet food conveyor
A sealed housing protects an unrated lens. Commonlands IP69K variants such as the CIL190, CIL337, CIL384, and CIL355 carry the rating on the barrel itself.

Frequently asked questions

What focal length do I need for a 600mm-wide conveyor belt?

Working distance and sensor size set it through the far-conjugate approximation EFL = (WD × sensor width) / FOV width, close when WD is much longer than the EFL. For a 600mm belt at 300mm working distance on a 2/3″ sensor (8.8mm width), EFL = (300 × 8.8) / 600 = 4.4mm. At equal framing and F#, depth of field depends on magnification and the blur criterion, not focal length. 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, and it preserves pixel density only if its pixel count scales with the larger area.

M12 is right when the inspection head has a hard size constraint and the surface is flat and consistent. It also works well when 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 rated to IP6K9K: the CIL190 (19mm M12) carries that ISO 20653 rating for a high-pressure, high-temperature water jet, and the shorter CIL337 (3.6mm), CIL384 (3.34mm), and CIL355 (5.5mm) carry it too for wider fields. Confirm your line's jet pressure and temperature against that test, then size the field of view and pick the lens that fits.

For lenses without an IP rating, a sealed housing with an AR-coated optical window is the standard approach. An IP6K9K lens is not a hygienic-design claim: under ISO 20653 the rating covers water and dust on the tested variant, not detergents, sanitation cycles, or the camera behind it. 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.