
Machine Vision for Food and Beverage Lines
Cerox Engineering designs and builds camera systems for Sri Lankan food and beverage manufacturers: grading and sorting by colour, size and defect, label and packaging inspection, date code, batch code and barcode verification, and presence and fill level checks. For tea, spice, coconut, dairy, beverage and bakery products.
Machine vision on a food line at a glance
- Bulk product
- Grading and sorting by colour, size and defect, with rejects removed from the stream.
- Packs
- Label presence, position and artwork, closure present and seated, fill level and visible seal faults.
- Codes
- Date codes, batch codes and barcodes read, verified against the batch and graded for print quality.
- Records
- Reject counts by fault type and a saved image of each failure, per batch and shift.
The checks that are too fast and too repetitive for people
Sri Lanka has a deep food and beverage manufacturing base: tea exporters, spice packers, coconut processors, dairy producers, bottled beverages and bakeries. Much of the quality control on those lines is still a person looking at product going past, picking out what should not be there and glancing at labels and date codes.
Natural products vary piece by piece, lines run faster than anyone can inspect, and a changeover is the classic moment for the wrong label reel or the previous date code to stay on the line. A camera looks at every unit with the same thresholds on every shift, rejects what fails, and keeps a record.
Six vision systems we design and build for food lines
Grading and Sorting
Colour, near-infrared and hyperspectral cameras grade product by colour, size and defect and remove stalks, stones and off-grade pieces.
Learn moreLabel and Packaging Inspection
Checks that the right label is present, straight and undamaged, and that the pack looks as it should before it reaches a carton.
Learn moreDate, Batch and Barcode Verification
Reads printed dates and batch numbers by OCR, decodes barcodes and 2D codes, and rejects any that are wrong or unreadable.
Learn morePresence and Fill Checks
A camera confirms the closure, the contents and every item in a tray or multipack are there, and measures fill level through clear containers.
Learn moreSurface Defect and Foreign-Object Detection
Lighting chosen for the defect reveals discolouration, damage, mould and foreign material on the visible surface of product and packs.
Learn moreVision Sorting Station
A camera, lighting and air-jet ejector station that removes off-spec product from a moving stream.
Learn moreEmpty Bottle Inspection
Checks returnable glass bottles after the washer for chipped finishes, cracks, dirt, foreign objects and leftover liquid, and rejects them before the filler.
Learn moreHygiene and PPE Monitoring
AI on CCTV checks hairnets, beard nets, masks and handwashing at line entrances, with compliance records for GMP and buyer audits.
Learn moreAutomatic Counting
Counts packs, bottles and cartons on the line or at dispatch, by camera, sensor or weight, with counts sent to your PLC or ERP.
Learn moreSort by colour, size and defect
Grading separates product by quality: removing what should not be there, and sorting the rest into grades. By hand it is slow and hard to keep consistent. An optical sorter images a moving stream of product and removes each rejected piece:
- Product is spread into a thin, even stream so every piece can be seen
- Colour cameras remove discoloured, burnt, mouldy or immature pieces and grade the rest by colour
- Near-infrared and hyperspectral cameras detect plastic, wood, stones and shell that look the same colour as the product
- Length, width and shape are measured to remove broken pieces or to grade by size
- Air jets eject rejected pieces from the stream, and whole items such as fruit are diverted into grade lanes
- Throughput, reject counts and grade yields are logged for each batch

Every pack checked before it reaches a carton
A wrong date code or a label from the previous product can mean recalling a whole batch. These checks suit a camera well, because the correct answer is already known from the production order. The station sits on your existing line, after the machine whose output it checks, and drives a rejector.

Label inspection
Pattern matching compares each label with the approved artwork for the current job, and measures position and skew. A label from the wrong reel after a changeover is rejected at once. Several cameras cover a round container whichever way the label faces.
Date and batch codes
OCR reads the best-before date and batch number after the coder, and OCV checks them against the active production order. A changeover check can hold the line until the new code is confirmed.
Barcodes and 2D codes
EAN/UPC, Code 128, GS1-128, QR and Data Matrix codes are decoded on every unit and compared with the product. Print quality can be graded to ISO/IEC 15416 for linear codes and ISO/IEC 15415 for 2D codes, which shows a printer declining before codes stop scanning.
Presence and fill
The camera confirms the closure is present and seated by its height and tilt, counts items in a tray or multipack, and measures the liquid line through a clear container against the target level.
Seals and pack condition
Heat seals on pouches are checked for wrinkles, gaps and product trapped in the seal area, and carton flaps are checked closed. These are checks of what the camera can see, not a leak test.
Surface defects and foreign objects
Cameras over open product find discolouration, damage, mould and foreign material on the visible surface before the pack is closed. Cameras do not see inside the product or a sealed pack.
Four points on a food or beverage line
Each station checks one thing well. Most producers start with the fault that causes the most complaints and add the others later.
Raw material intake
- Sorting of incoming tea, spices, nuts, grains or produce by colour and defect
- Removal of stones, stalks, plastic and other foreign matter
- Reject counts per supplier lot
After processing, before packing
- Final colour and size grading of the finished product
- Surface checks on open product for defects and foreign objects
- Portion and presence checks in trays and cups
After the primary pack is closed
- Closure present and seated, fill level through clear containers
- Label present, correct, straight and undamaged
- Date code and batch code verified after the coder
Cartons and dispatch
- Carton label and barcode read and compared with the batch
- Count of units per carton before the flaps close
- Units linked to cartons for traceability records
What a camera checks, by product
- Tea: Stalk and fibre removal by colour and shape, colour grading, and date and batch code checks on retail packs
- Spices and condiments: Foreign matter removal before packing, colour grading, label and code verification on jars and sachets
- Coconut and nut products: Discoloured piece and shell removal, size grading, pack label and code checks
- Bottled beverages: Closure presence and seating, fill level through the bottle, label position and version, date code verification
- Dairy: Lid presence and position on cups, date code verification, label and carton barcode checks
- Bakery and confectionery: Colour and shape checks on open product, item count per tray, pack label and date code checks
These are typical checks, not a fixed list. What is realistic for your product is confirmed by testing samples. Cameras, lenses and lighting are also available from our machine vision hardware catalogue, and the full list of applications is on the machine vision page.
Send us samples of your product and packs
Tell us which fault reaches your customers, and share good product alongside examples of what you want caught. We will show you what a camera makes of them.
Common questions
What can machine vision do on a food or beverage line?+
Cameras take over the checks that people do by eye. On bulk product they grade and sort by colour, size and defect. On packed product they confirm the right label is present and straight, the date code, batch code and barcode are correct and legible, the closure is present and seated, the pack is filled to the right level, and the visible surface is free of defects and foreign objects. Faulty units are rejected and each result is recorded.
Can a camera read the date and batch code printed by our coder?+
Yes. Optical character recognition reads dot-matrix inkjet, thermal transfer and laser-marked text, and optical character verification confirms the text is exactly what should be printed for the current batch. A wrong or unreadable code is rejected, and repeated failures can stop the line so the printer can be checked.
How does a camera check fill level?+
For clear or translucent containers, a backlight shines through the container and the camera measures where the liquid line sits against the target. For open trays and cups, a camera from above confirms the product is present and the portion looks complete. A camera cannot see through an opaque sealed pack, so that case needs a different method, and we will say so at the feasibility stage.
Can machine vision detect foreign objects in food?+
On the visible surface, yes. Colour cameras find material that differs in colour or shape from the product, and near-infrared or hyperspectral cameras separate plastic, wood, stones and shell that look the same colour as the product. Cameras do not see inside the product or inside a sealed pack. Contamination buried in the product needs metal detection or X-ray equipment, which is a separate system.
Which Sri Lankan products can be graded and sorted by camera?+
Tea, spices, coconut products, cashew and other nuts, rice and grains, dried fruit and fresh produce are all suited to optical sorting or grading. Small pieces are inspected as a stream and rejects are removed with air jets. Larger items such as fruit are graded one by one and sent to a lane for their grade. Suitability is confirmed by testing your own product.
Does vision inspection work with our existing line?+
Usually, yes. An inspection station mounts on the conveyor you already have, after the machine whose output it checks, takes the expected code or label from your production data, and drives a rejector on the same line. We build the inspection. The packing machinery stays as it is.
Is the equipment suitable for a food environment?+
Stations for food areas are built with stainless steel and enclosures chosen to suit how the area is cleaned. The right enclosure rating depends on whether the area is wiped down or washed down, so it is agreed with your QA team during design. The saved images and reject records can be used as evidence in your own food safety system.
How do we start a machine vision project with Cerox?+
Start with a conversation and samples: good product, examples of each defect you want removed, and packs with the faults you want caught. We run a feasibility study on your own product and then scope a station for one line. A site visit, where one is needed, is chargeable based on location. Contact Cerox through the enquiry form at ceroxengineering.com/contact or at info@ceroxengineering.com.
Photographs show representative plants and equipment, not Cerox installations or client sites. Photo credits, via Wikimedia Commons: Tea factory, Nuwara Eliya by Yercaud-elango, CC BY-SA 4.0; Optical sorting machine by MB-one, CC BY-SA 4.0; Bottling line by ChristianBier, CC BY-SA 3.0.