Last updated: 23 February 2026

How to use machine vision for weeds inspection

Max Reijngoudt

When it comes to weeds inspection and targeted pesticide spray, it’s important to implement a high-quality vision system which is critical in detecting harmful plants/weeds which can affect production of crops. We understand that it can be difficult to determine the correct machine vision set-up and software needed to promote the standard best to achieve optimal production of crops and more. Our machine vision products and pricing are available and easily accessible to provide direct access to information about this weed inspection / pesticide spray vision system.

How to use machine vision for weeds inspection

A customer in precision agriculture used a high-FPS machine vision camera mounted on a tractor beam to detect weeds in real time.

  • The system identifies small and large weeds while driving through the field, and triggers targeted pesticide spraying only where needed.

Camera Selection for Weed Detection

For a tractor-mounted machine vision system used for weed detection and targeted pesticide spraying, the camera must meet several key requirements:

  • High frame rate (FPS)
    The tractor is moving continuously, so the camera needs enough frames per second to capture weeds reliably at driving speed.
  • Sufficient resolution (megapixels)
    A higher resolution helps detect both small and large weeds, especially when the camera covers a wide area of crops.
  • Color imaging
    A color camera is often required to distinguish weeds from crops more clearly, especially in complex outdoor scenes.
  • Global shutter sensor
    Since the tractor and camera mount are constantly in motion, a global shutter is important to avoid motion distortion. Global shutter sensors capture the entire image at once, helping maintain sharp images during movement and vibration.
  • Reliable long-distance connection
    Tractor-mounted systems often have the camera mounted on a long arm or beam. When the distance between the camera and PC becomes several meters, GigE is usually more suitable than USB3.0, because it supports longer cable runs and more robust installation.
  • Simplified cabling (power + data)
    In mobile setups, using a single cable for both power and data helps reduce complexity and improve reliability.

  • Our recommendation for this application was the 3MP GigE color camera MER2-302-37GC-P, because it supports long cable lengths, enables single-cable installation, and provides the required resolution, frame rate, and global shutter performance for weed detection on a moving tractor.

Technical Specifications

Interface GigE Vision
Resolution 2048x1536
Shutter type Global Shutter
Color/Monochrome Color
Frame rate (fps) 37

Lens selection for weeds inspection

After confirming the required resolution, the next step was selecting the correct lens for the application. Lens selection is mainly based on the required field of view (FOV), the sensor format, and the working distance. For this, we used our Online Lens Calculator.

In this setup, the camera uses a 1/1.8” sensor, and the customer’s target coverage area required a field of view of approximately 1050 × 880 mm.

Based on the customer requirements and the lens calculation, the key outcomes were:

  • Sensor format: 1/1.8”
  • Target field of view (FOV): 1050 × 880 mm
  • Required focal length: 6 mm
  • Calculated final FOV: ~1029 × 772 mm

After reviewing the final field of view with the customer, it was confirmed to be more than sufficient for the application. If needed, the system can also use a Region of Interest (ROI) to fine-tune the exact field of view, for example to match a 1000 mm horizontal FOV (HFOV) more precisely.

  • Our recommendation for this setup was the VA-LCM-5MP-06MM-F1.4-015 (6 mm C-mount lens), which provides a suitable match for this sensor format and application.

Technical Specifications

Resolution (megapixel) 5
Image format / circle 2/3"
Focal length (mm) 6
Mount C

Frame grabber for weed inspection

Because each tractor arm will contain around 10 cameras, the system also needs sufficient hardware to handle stable data transmission from multiple GigE cameras at the same time. In multi-camera machine vision setups, this is commonly solved using frame grabbers or multi-port GigE interface cards, which provide multiple independent Ethernet connections inside the PC.

This approach is especially useful because it supports:

  • Stable multi-camera streaming (less risk of dropped frames)
  • Independent camera connections (each camera has its own port and bandwidth)
  • Simpler cabling with PoE (power + data over one Ethernet cable)

PoE is particularly useful for long tractor arms and moving equipment, because it reduces the number of cables and improves installation reliability.

To determine the required camera resolution, the customer provided the minimum detail that needed to be detected. Using the common guideline of 3 pixels per smallest feature, the minimum required image size was estimated at at least 2000 × 1000 pixels. This ensures that small weeds can still be detected with enough pixel detail for consistent identification.

  • Our recommendation for this setup was the 3MP GigE camera MER2-302-37GC-P (2048 × 1536), as it meets the required resolution and fits well into a multi-camera GigE + PoE system.

VA-PCIe4-1GP-4 Framegrabber GigE 1

Protection for your machine vision setup

The customer also needed a machine vision camera housing to make sure that there was no dust or moisture which moved into the camera and lens. These machine vision camera housings are IP67
rated to ensure that your machine vision camera stays protected.

Multiple Machine Vision Cameras on a Tractor

In this application, the customer required a 20-camera setup, with 10 cameras mounted on each tractor arm. All cameras were the same model as described earlier in this article, and the same lens type was used across the system to ensure consistent image quality.

Using multiple cameras provides full coverage of the crops and the surrounding area, which supports reliable weed detection across a wide field of view. The image data is then used to trigger targeted pesticide spraying on weeds during operation.

Because of the distance between the cameras and the processing unit, each camera required a 10-meter 10GigE Ethernet cable to support stable data transmission in a multi-camera system.

VA-CABLE-cat6a-10m Cable 10GigE 1

Machine vision lighting for weed inspection

For this particular application, there was lighting already available on the arms of the tractor as well as the tractor itself, which led to there being enough lighting for their solution. If your application is in a low light scenario there may be a need for other machine vision lighting in which you can get in touch with us at the bottom of the page using our customer support form.

Image processing software to detect weeds

In some cases, our cameras, lenses, and lighting solutions are not enough for a vision system. Our cameras are GenIcam compatible, which means that they can be used with a variety of 3rd party software including MvTec Halcon, NI Labview, Cognex Vision Pro, Matlab, OpenCV and Arm Boards software. For first programming, our free SDK can be used to acquire images and set the camera parameters. The software development kit is compatible with regular and industrial PCs and ARM platforms, including NVIDIA TX series and Raspberry Pi. Supported operating systems include Windows, Linux, and Android.

For example, the customers have designed their own software package that worked with our SDK. For your unique application you may need to use one of our computer vision software packages.

Daheng Imaging SDK

Support for weed detection vision system

Machine vision offers a powerful and precise solution for weed inspection and targeted pesticide application. By implementing a camera system with high frame rates and appropriate resolution, farmers can achieve significant improvements in crop yield and resource management. By combining the mentioned machine vision components in this article, farmers can gain a valuable tool for optimizing weed control and maximizing crop health.

Would you like assistance from one of our machine vision specialists in building your own weed detection/pesticide spray vision system? Feel free to reach out using the form below and we will get back to you as soon as possible.

Questions? Ask Us!