ApplicationsApplication note

Dual camera spot spraying: build the vision system that decides

Build a dual camera spot spraying vision system: 1.4 m lookahead at 2 m/s, 0.21 mm ground pixels from a 16 mm lens, 0.2 ms exposure and a strobe decision.

LumaSpec Vision11 min read Share on LinkedIn

On this page 9 sections
  1. 01How far ahead of the nozzles must the camera look?
  2. 02Which cameras go on the tractor?
  3. 03What focal length puts the right pixels on a weed?
  4. 04How short must the exposure be at 2 m/s?
  5. 05When does the build need strobe lighting?
  6. 06How does the vision decision reach the nozzles?
  7. 07What survives dust, washdown water and vibration?
  8. 08What do you check before ordering the parts?
  9. 09Questions

A spot spraying rig does not need a smart tractor. It needs two cameras, an edge computer and a valve driver that turn each weed image into an open command for the right nozzle at the right moment. The geometry is unforgiving: everything hangs on how far ahead of the boom the camera looks. This guide works the numbers for a 2 m/s sprayer (7.2 km/h, typical of field spraying) and gives the lookahead distance, focal length, exposure limit, frame rate and strobe decision as values you can re-derive for your own speed. It is written for anyone bolting area scan cameras to an existing tractor and wiring the decisions into the sprayer's section valves.

How far ahead of the nozzles must the camera look?

Mount the detection camera 1.4 m ahead of the nozzle bar at 2 m/s travel: that is 2 m/s multiplied by a 0.7 s worst-case budget for image capture, inference, valve opening and droplet flight. Mounting closer means a late frame sprays behind the weed; the delay itself is calibrated in software, so this distance is the floor, not the target.

The budget at the reference build breaks down like this:

  • Capture and USB3 transfer of a 12 MP frame: about 33 ms, one frame period at 30 fps.
  • Detector inference on the edge computer: 60-100 ms per frame with a compact model.
  • Digital output, relay and solenoid valve: up to 50 ms.
  • Droplet travel from nozzle to leaf, 0.5 m at about 20 m/s: about 25 ms.

That sums to roughly 0.2 s measured end to end. The 0.7 s design budget carries about 3.5× margin: it absorbs a queued 10 fps frame (100 ms), scheduler jitter and a second pass over a hard patch.

L = v × t_sys L = 2 m/s × 0.7 s = 1.4 m

For the wider pattern of getting camera decisions into plant machinery, see edge inference camera integration for factory automation.

Which cameras go on the tractor?

Two cameras, both global shutter: a wide context camera on a mast watching row structure and headlands, and a 12 MP near-ground camera doing the weed detection at 0.212 mm ground pixels. A rolling shutter exposes different lines of the frame milliseconds apart, which skews mapped positions on a moving rig; pick global shutter for both. Filter by shutter type first in the camera finder.

The context camera logs coverage, flags row ends and wakes the detector at row entry, so it needs swath, not detail. The MV-CU020-90GC is a 2.5 MP GigE color camera with a global shutter on a 1/1.7" sensor.

The reference context camera and its lens:

Area scan camerasHikrobot MV-CU020-90GC 2.5 MP Area Scan Camera, GigE, GMAX4002, ColorMV-CU020-90GC
Sensor format
1/1.7"
Lens mount
C-mount
$309.00View part
Machine vision lensesFA lens, 8 mm, 2/3", C-mount, FOV 57.6° (LS-FFL-1582)LS-FFL-1582
Sensor format
2/3"
Mount
C-mount
$309.00View part

The LS-FFL-1582 is an 8 mm C-mount FA lens printed at a 57.6° field of view on the 2/3" format. On the smaller 1/1.7" format it covers a swath of roughly 2-2.3 m at a 2.5 m mast — enough to read row structure, not to resolve seedlings.

The detection camera needs resolution and a clean global shutter. The MV-CH120-11UC is a 12 MP color camera with a global shutter on a 1.1" sensor over USB3. Its sensor is an IMX304: the array is 4096 × 3000 pixels at 3.45 µm, so the active area is 14.13 mm wide, and those numbers drive every calculation below.

The reference detection camera:

Area scan camerasHikrobot MV-CH120-11UC 12 MP Area Scan Camera, USB3, IMX304, High-speed version, ColorMV-CH120-11UC
Sensor format
1.1"
Lens mount
C-mount
Interface
USB3
Resolution
12 MP
$2,339.00 · quotedView and quoteBuild a system with it

What focal length puts the right pixels on a weed?

Work backwards from weed size: to hold a 5 mm seedling at about 24 pixels you want 0.21 mm per ground pixel, and a 16 mm lens at 1.0 m camera height delivers that on the 12 MP sensor — an 869 mm field of view.

Set the pixel budget first. A 10 mm weed should span at least 40 pixels for a reliable mask, which fixes the ground pixel at 0.25 mm and the field of view at 4096 × 0.25 mm = 1024 mm. Magnification then gives the focal length:

m = sensor width / FOV = 14.13 / 1024 = 0.0138 f = WD × m / (1 + m) = 1000 mm × 0.0138 / 1.0138 = 13.6 mm

13.6 mm is not a stock focal length. The nearest shorter one, 12 mm, widens the field to 14.13 × 988 / 12 = 1163 mm and coarsens the pixel to 0.284 mm — over budget. Take the next longer standard:

FOV = sensor width × (WD − f) / f = 14.13 mm × 984 / 16 = 869 mm ground pixel = 869 mm / 4096 = 0.212 mm

So 16 mm at 1.0 m gives 0.212 mm ground pixels: a 5 mm seedling spans 24 pixels, a 10 mm weed 47. The imaged band along travel is 3000 × 0.212 mm = 636 mm long and 869 mm wide.

How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

That lands on a 16 mm C-mount lens covering the 1.1" format:

Machine vision lenses16 mm, 1.1", 20 MP, C-mount machine vision lens, F2.8-22, <0.3% distortion (LS-FFL-0567)LS-FFL-0567
Type
Machine vision fixed
Sensor format
1.1"
Mount
C-mount
Resolution
16-25 MP
$679.00View partBuild a system with it

The LS-FFL-0567 is a 16 mm, F2.8-22 C-mount lens for 1.1" sensors with less than 0.3% distortion. The distortion bounds mapping error to about 2.6 mm at the frame edge (0.3% of 869 mm), an order of magnitude inside a 0.1 m spray tolerance.

Size your own camera height and sensor into the focal length calculator:

Lens focal length, field of view and working distance
Units
Solve for
Focal length
– mm
Field of view
– mm
Working distance
– mm
Magnification
– x
Angle of view
– °
Pixel on the part
– mm

Thin-lens model: m = sensor width / field of view, f = WD × m / (1 + m). Accurate to a few percent above about 150 mm; check the lens's minimum object distance.

Find lenses with this focal length Open the full calculator

How short must the exposure be at 2 m/s?

Hold motion blur to two ground pixels: at 0.212 mm per pixel and 2 m/s that means a 0.2 ms exposure, which smears the image 0.4 mm; anything longer softens the leaf edges the detector needs.

blur = v × t_exp = 2000 mm/s × 0.2 ms = 0.4 mm ≈ 2 px

Exposure scales the smear linearly: at 1 ms the blur is 2 mm, nearly ten pixels, and small weeds become streaks. The fuller trade-off is covered in exposure time vs shutter speed for moving-part inspection.

Daylight supports 0.2 ms. The sunny-16 rule puts full sun at EV 15, roughly f/16 at 1/125 s at ISO-100-equivalent sensitivity. A 0.2 ms exposure is 1/5000 s, 5.3 stops faster, which lands near f/2.5-f/2.8 — so in full sun the lens works close to its f/2.8 floor. Fix exposure and gain manually and leave them there: automatic modes re-brighten every frame as clouds and canopy pass, and thresholds drift with them. The same discipline of limiting the exposure ceiling is covered in cap the maximum auto exposure time to stop motion blur.

Frame rate follows from overlap. At 10 fps the rig advances 200 mm between frames, so every ground point sits inside the 636 mm band for three consecutive frames (636 / 200 = 3.2). The floor is v / band = 2 / 0.636 = 3.1 fps; below that, some ground is never imaged.

When does the build need strobe lighting?

In full sun, never: the sky is the light source and 0.2 ms exposures are free. Strobe when light falls — dawn, dusk or dense canopy — firing a 0.5 ms white LED pulse around each 0.2 ms exposure so brightness and blur stop depending on the sky.

The shade arithmetic makes the case. Canopy shade costs about 3 stops against EV 15, which would demand roughly f/0.9 at 1/5000 s — no such lens exists. A strobed pulse restores control: the LED bank fires at a fixed drive, motion stays frozen by the 0.2 ms exposure, and every image matches the lighting the detector was trained on. State the rejection target the way acceptance tests do, as in the ambient light rejection specification for vision acceptance tests.

Duty cycle keeps the lamps cool: at 10 fps with 0.5 ms pulses the LEDs conduct 0.5% of the time, so heating never limits the pulse energy. The LS-CTL-0070 is a 4-channel, 24 V digital controller rated 200 W total with RS232 and a strobe feature; four channels drive one LED zone per camera on a four-zone boom, each pulsed from the camera's strobe output over its trigger line, which is what do you need a camera GPIO cable for image acquisition explains.

The reference strobe controller:

Light controllersDigital control box, 4 ch, 200 W, RS232 (LS-CTL-0070)LS-CTL-0070
Output
Constant voltage 24 V
Channels
4 channels
Control
Digital
Feature
Strobe
$549.00View partBuild a system with it

If your boom has more zones, browse the wider range of light controllers.

How does the vision decision reach the nozzles?

Run the detector on an edge computer beside the cameras, write the per-zone decisions to digital outputs, and fire each nozzle with a delay indexed by image row: delay = (mount distance + row offset) / travel speed.

With the camera 1.4 m ahead of the bar and the band reaching 0.32 m ahead of and behind the camera axis, the delays at 2 m/s are:

Ground point in the band Offset Delay to nozzle
Far edge +0.32 m (1.4 + 0.32) / 2 = 0.86 s
Camera axis 0 m 1.4 / 2 = 0.70 s
Near edge -0.32 m (1.4 - 0.32) / 2 = 0.54 s

Split the band into 10-20 row bins; that keeps any point within 16-32 ms of its true delay. Take travel speed live from a wheel encoder or GNSS, because slip on turns and slopes shifts v by tens of percent and every delay scales with it. The computer itself is a standard industrial mini PC on vibration mounts, and wiring its outputs into an existing sprayer controller follows the same patterns as scripting vision system integration with HMI and PLC hardware.

Detector quality decides chemical waste: every false positive sprays bare soil and every false negative misses a weed. Before trusting a model in new light and new fields, work through reducing object detection false positives in a new scene.

What survives dust, washdown water and vibration?

Put each camera in a dust- and washdown-sealed housing — NEMA 4X or IP66 — on vibration-damped brackets with locking connectors, because a tractor works in dust, spray drift and constant shock loads. The two ratings are not interchangeable and neither substitutes for sealed cable entries; NEMA 4X versus IP66 ratings sets out the difference. Inside the housing, condensation is the quieter failure: a sealed box breathing between cold nights and warm afternoons pumps humid air at the lens window, so fit a breather or desiccant and check the window at every service. Mount the mast to the chassis rather than the tool bar, so boom flex does not shake the optics.

What do you check before ordering the parts?

Six checks settle the design: measure latency end to end, read the valve response, size the pixel from your weeds, keep both shutters global, match controller channels to LED zones, and mount at least 1.4 m ahead.

  • Latency, measured, not assumed. Trigger a frame and an output together, timestamp both, and confirm capture-to-valve time sits well inside 0.7 s at your speed.
  • Valve response. Take the solenoid's opening time from the sprayer's documentation — direct-acting valves sit in the tens of milliseconds — and add it to the delay table.
  • Pixel budget from your weeds. Re-run the focal length arithmetic with the smallest weed you must catch; at 5 mm, keep ground pixels at or below about 0.25 mm.
  • Both shutters global. Rolling shutter shifts positions across the frame on a moving rig and invalidates the delay table.
  • Channels match zones. One controller channel per LED zone; four zones need four channels plus trigger wiring.
  • Mounting floor. Camera at least v × t_worst ahead of the nozzles, mast rigid, housing sealed, connectors locked.

When the numbers are yours, start the system configurator at the camera step and the finder pairs cameras, lenses and strobe controllers — or contact the team with your speed, boom width and weed sizes. The same geometry carries over to inter-row hoes and spot fertiliser rigs; the applications topic page collects more builds of this kind.

Questions

Does the 1.4 m lookahead still work at higher travel speeds?

Scale it linearly: L = v × t. At 4 m/s the same 0.7 s budget puts the camera 2.8 m ahead of the nozzles, and the exposure must halve to about 0.1 ms to keep blur at two pixels. Re-derive the whole delay table at the new speed, because every row delay shortens in proportion.

Why global shutter instead of rolling shutter on a moving sprayer?

A rolling shutter exposes each line a few milliseconds apart. At 2 m/s the skew reaches 20-60 mm across the frame — more than the spray tolerance — shifting every mapped weed position. Both reference cameras are global shutter, so each frame is one instant in time and the delay table stays valid.

How accurate is spray placement after calibration?

Without row indexing, the 0.64 m imaged band alone spreads firing time by ±0.32 m of ground at 2 m/s. A delay table indexed by image row removes that spread; what remains is valve response, droplet flight and wheel slip, of the order of 0.1 m at 2 m/s. Confirm it with a water-only pass over marked dry ground.

Can one wide camera do both context and weed detection?

At a 2.5 m mast the 8 mm lens covers about 2.3 m of swath, and the ground pixel grows to roughly 1 mm — a 5 mm seedling spans about five pixels, too few for a mask. Keep the second camera: 0.212 mm ground pixels give a 5 mm weed about 24 pixels across.

Does RGB work for grass weeds inside a cereal crop?

Sometimes. RGB separates weeds from crop by texture and leaf shape when growth stage or size differs. Where both are green and at the same stage, near-infrared or red-edge contrast helps the classifier split them. Run the detector on your own field images first, then add a spectral channel only where the confusion matrix shows the two classes merging.