7 min read · Machine vision

Many lemon packing houses already have a conveyor and a sorting point and want to add a camera without rebuilding the whole line. This is possible in many cases, but check the site first, because an existing line usually has little space, uneven light, and lemons that roll around.
The examples in this article are hypothetical. All figures are made up to explain the reasoning. They are not results from a real packing house or a customer project.
Start by walking the line, not by choosing a camera
Before choosing a camera, stand at the sorting line while it is running and note what you see. Take photos and measure distances. Plans often fail because there is not enough room above the conveyor for the camera and light hood, or because the conveyor vibrates so much that the image blurs.
| Item | What to check | If it does not fit |
|---|---|---|
| Space | Is there enough room above or beside the conveyor for the camera mount, light hood and cables? | Move the inspection point, or use a smaller camera with lighting adapted to the space |
| Ambient light | Does sunlight or factory lighting change with the time of day? | Put a light shield around the inspection point |
| Vibration | Does the conveyor frame shake when the motor runs? | Mount the camera on a frame separate from the vibrating part |
| Conveyor speed | Measure the actual speed running at full load | Set up the camera and lighting to cope with that speed, or reduce the speed as far as throughput allows |
| Fruit arrangement | Is the fruit in a row, overlapping, or touching? | Add dividers or separate lanes |
| Existing rejecter | Is rejection done by air or by an arm, what commands it, and can the signal be tapped? | See the section on connecting the rejecter |
Lighting and image trigger
Lemon skin is glossy and curved, so it easily produces white reflection spots. A reflection can be read as a defect or can hide a real mark. Choosing the lighting matters as much as choosing the camera. The principles are in the article on choosing lighting for machine vision.
- Use soft, diffuse light, for example through a diffuser panel, to reduce reflections
- Enclose the inspection point enough to cut out ambient light, and use the system's own lighting as the main source
- Try several background colours and see which gives the sharpest fruit edge
- Set the camera to lock auto exposure so that images stay consistent
The image trigger must know when a lemon is under the camera. A common choice is an object-detection sensor placed before the camera, or an encoder fitted to the conveyor. If conveyor speed is not steady, an encoder is usually more accurate than counting time.
Conveyor speed and motion blur
The lemon moves while the camera is exposing. If the exposure is too long, the image blurs. A rough calculation is shown below. The full concept is in the article on global shutter and moving conveyors.
Suppose the conveyor runs at 0.4 metres per second, or 400 millimetres per second, and the camera views a 400 mm width with an image 800 pixels wide, so each pixel is 0.5 mm. If the fruit should move no more than half a pixel during exposure, which is 0.25 mm, the exposure time must be no more than 0.25 ÷ 400 = 0.000625 seconds, or about 0.6 milliseconds. That is very short. It needs enough light, and often a short strobe flash helps.
Rolling fruit and incomplete views
Round or oval fruit rolls easily. Fruit that rolls along the way ends up in inconsistent positions, and a single camera sees only the top. A defect on the underside may never be seen.
- Use rollers that rotate the fruit, or a channel that turns it as it passes the camera, and take several images per fruit
- Use pockets or dividers so each fruit sits in its own slot and does not roll into another
- If several sides must be seen, use several cameras or extra mirrors, but weigh the cost against the benefit
- Accept that some defects may be missed, and set up spot checks by a person at the end of the line
Connecting to the existing rejecter
The camera decides, but a failed fruit must be pushed out by a rejecter downstream of the camera. The existing rejecter may be driven by a PLC or a relay. The common problem is timing. If the command is too late or too early, the wrong fruit is pushed out.
Suppose the rejecter is 1.2 metres from the imaging point. At 0.4 metres per second, a fruit reaches the rejecter in 1.2 ÷ 0.4 = 3.0 seconds. If the camera system takes 0.2 seconds to decide, there are still 3.0 − 0.2 = 2.8 seconds left to send the signal and wait for the right moment. Design it around an encoder so the position stays accurate even when the speed changes. Details of the reject command and its confirmation are in the article on Vision and the PLC Reject Handshake.
- Photograph and note the layout of the control cabinet and the existing rejecter, with the plant's electrician opening the cabinet.
- Agree on which signal will command the reject and who edits the PLC program.
- Give the camera system a fault state that stops the line or alerts someone when the camera or lighting is unavailable, so fruit is not passed silently.
- Test with lemons of known grade and check that the fruit pushed out matches what the camera commanded.
- Record the test results and timings to compare against when changes are made later.
Test on the real line before deciding
A lab always gives nicer images than the plant floor, so test on the real conveyor at working speed with several lots of lemons before deciding to buy the whole set of equipment. Start in silent mode: the camera decides but does not command rejection, and its decisions are compared with those of people. This approach is described in the article on AI Vision Shadow Mode.
- Test both day and night shifts if the ambient light differs
- Test lemons of several sizes and ripeness levels
- Count the fruit the camera judged wrongly and look at the images of those fruit
- Check that the system runs through a whole shift without needing a restart
Limitations and cautions
A line with an added camera is still limited by the physical constraints of the existing line, such as space, vibration and speed. Some lines may need a section adjusted or moved. A camera cannot see defects on the underside of the fruit or inside it. The figures in this article, such as 0.4 metres per second, 800 pixels, 0.6 milliseconds, the 1.2 metre distance, and the times of 3.0 and 0.2 seconds, are hypothetical examples to explain the reasoning. They are not values from a real line or a BT San project. Work on electrical control cabinets should be done by a licensed electrician following the plant's safety procedures.
Starting references
- Wikipedia — Machine vision
- Wikipedia — Optical sorting
- Wikipedia — Conveyor system
- Wikipedia — Strobe light




