weed camera

Weed Detection

Detect weeds with FarmBot’s camera.

Page Contents

  • Step 1: Select color range
  • Step 2: Tune processing parameters
  • Step 3: Detect weeds
  • Scan the entire garden
  • Remove weeds with FarmBot
  • How it works
  • Troubleshooting
    • Invalid coordinate conversion values
  • What’s next?

FarmBot is designed to remove weeds early and often, so that the weeds are always small, young, and fragile, and therefore easily removed by the weeding tool. FarmBot finds weeds by using computer vision software to detect all plants in the bed and then mark any detected plant that was not planted by FarmBot as a weed.

Calibration required

To use the weed detection feature, you must first calibrate the camera.

The weed detector software needs a range of color to look for when determining what is a plant and what is soil or other background. Use the sliders for HUE, SATURATION, and VALUE to select a range of colors you want to detect. The color boxes will give an indication of the range selected. For the hue slider, a green color range is approximately 30 to 90 .

Once an image has been taken with the camera, the weed detector software will process it. There are several processing parameters available (BLUR, MORPH, and ITERATION) that can help you fine tune the system to perform the best in your environment. It is recommended to use the default values at first, run a test, and then experiment with the processing parameter values to see how the results change.

Move the FarmBot over a section of soil. Press detect weeds to instruct FarmBot to take a photo and then process that image with the weed detection software. Any weeds found in the image will appear in the map, and be listed as PENDING in the weeds panel. See Weeds for additional information.

scan current image can be used to run weed detection on an image already taken, instead of taking a new photo.

Detect weeds across FarmBot’s entire bed by creating a sequence of movements in a grid pattern with a detect weeds command at each grid point. For step-by-step instructions, see the Scan the Garden for Weeds How-to guide.

Weed removal can be performed by creating a weed removal sequence that uses the weeding tool on weeds (points) in the farm designer.

If we process a photo of our garden bed without providing any information, we would detect all the plants in the image:

However, we want to determine what is a weed, and the locations of those weeds.

So we feed the plant detection software some calibration parameters, letting it determine the location of the objects in the image. Based on the known locations of desired plants in the image, we can determine which plants are desired plants, and which ones are weeds.

Known (desired) plants are marked with a green circle, the detected plants that match the desired plants are marked with a blue circle, and the detected plants that do not match desired plants are marked with a red circle (those are weeds):

But wait! Our weeding tool is a certain size, and disrupts the soil within a certain area, its region of influence. We can represent that disrupted region with a grey circle:

The software takes the weeding tool size into consideration with a feature called Safe Remove.

It adjusts the location to be weeded for weed 1 away from the lower left plant, removes weed 2 from the list since it can’t be removed safely, and keeps 3 on the list of weeds to remove since there are no conflicts. You can see the weeds to remove and the weeder location represented with the red and grey circles as before, and cyan circles drawn for weeds that may not be removed completely (or at all) because the action might harm a desired plant:

You may now instruct the machine to remove the weeds marked in red, and remove the weeds marked in cyan by hand.

Program text output

These are some common errors that can occur when doing weed detection.

[plant-detection] ERROR: Coordinate conversion calibration values invalid for provided image.

This error occurs because the camera was calibrated at a different z-axis height than the current z height. This error can also happen if the camera rotation value was changed significantly after camera calibration. The solution is to move to the calibrated height (usually 0) or re-calibrate the camera.

In this guide: Learn how to scan the whole garden for weeds using a group of points.

Detect weeds with FarmBot’s camera.

HiGrade: Cannabis Testing 17+

%THC Testing & Growing Advice

MyCrops Technologies Ltd.

Designed for iPad

    • 4.5 • 380 Ratings
    • Free
    • Offers In-App Purchases



Instantly test the quality of your cannabis flowers straight from your phone. Three photos are all you need to get a real insight into the health and quality of your bud. No lab equipment is necessary! Analyze your plant’s quality and %THC by harnessing the power of artificial intelligence and HiGrade’s proprietary testing algorithms. Turn your camera phone into an accurate, portable testing station so you can better understand the product in front of you.

For the personal consumer:
By understanding exactly what the levels of active compounds are in each plant, you are empowered to take control of your medication and monitor your personal dosage. Be confident that your weed is free of harmful pests and mold and of the highest quality.

For the professional grower:
HiGrade PRO is the ultimate on-the-go lab and cultivation center. Turn into a master grower with personalized cultivation advice that enables you to diagnose and treat plant disease, balance nutrients and find the optimal time for harvesting. Be able to test all of your flowers for active compounds so you can accurately maintain quality and consistency. HiGrade will turn you into a master grower, helping you to grow healthier plants with higher yields.

To activate HiGrade PRO you’ll need to purchase the HiGrade Kit, which comes with a unique activation code as well as a smartphone accessory that will turn your phone camera into a high resolution microscope. The HiGrade Kit gives us a better view of specific plant structures so we can accurately analyze and diagnose your plant in real time using cloud-based algorithms. Use your unique activation code to gain access to all HiGrade PRO features.

We’re your buds’ new best bud.
Download HiGrade today.

‎Read reviews, compare customer ratings, see screenshots, and learn more about HiGrade: Cannabis Testing. Download HiGrade: Cannabis Testing and enjoy it on your iPhone, iPad, and iPod touch.