Free cookie consent management tool by TermsFeed

Esther Vera

Plant locator from row-view to global-view -> grid

12/02/2024

02 - PLANT LOCATOR FROM ROW-VIEW TO GLOBAL-VIEW -> GRID

🌿 Overview

This repository contains the complete workflow from detecting a plant in an image and locate this plant in the global-view orthomosaic following a predefined grid to visualize its health status. Besides, it also locates the drone positions from where the images where captured and the plant was analyzed.

πŸ—‚οΈ Structure

  • src:
    • Calculation.py: class to calculate drone positions.
    • Display.py: class to show row and global images with analysis.
    • GridPlantLocator.py: class to detect the middle plants of a rowview image and locate them in a global visualization.
    • LinesIntersection.py: class that calculates the intersection between the drone position and the parcels in a row.
    • Output.py: class to organize the data generated and export it.
    • read.py: functions to read the data before the processing.
  • README.md: explanation of the model and usage.
  • locate_plants_grid.py: main code to execute.
  • requirements.txt: file to easily install the libraries.

πŸ“„ Dataset

The dataset needed to execute this model should be download from UC1 GITHUB DATA FOLDER and copy the content to the data folder present in this repository. This UC1 GITHUB DATA FOLDER contains images and data that has been generated with the codes available in the section top_view.

No specific data preparation is needed.

πŸ’» Requirements

  • Environment configuration: please install the requirements.txt file into a conda environment to install the necessary libraries to execute the code.
  • Model: download the Yolov8 model to perform the plant detection and be able to execute the code and adjust the model path.
  • Data: download and add the dataset UC1 GITHUB DATA FOLDER to the data folder.

βš™οΈ Parameters

The parameters are defined directly in the code.

  • Data paths: usually the data paths point directly to the data folder. You can check and adjusts these paths in the locate_plants_grid.py file.
  • Variables: the constant variables are defined inside the init function of the classes in the src.

πŸš€ Usage

For using the model, just type the following command in the 02_plant_locator_v2 directory with the environment active:

python locate_plants_grid.py

The row images, such as the one shown on the left, are analyzed using the YOLOv8 model to detect the plant health. The results from this analysis are then mapped onto the orthomosaic view of the vineyards, as illustrated in the image on the right. This process allows for a comprehensive visualization of the detection outcomes across the entire vineyard.

πŸ“Š Results

As a result, the orthomosaic image of the vineyards will show the plant locations, their health status and the drone's positions. The plant locations follow a grid layout, meaning that the positions of the plants are predetermined to this grid structure. The grid was generated using the create_grid code. The drone’s position is determined through GPS data embedded in the images captured during flight. These coordinates can be mapped onto the orthomosaic view, as each pixel in the orthomosaic contains location-specific information.ains this information.

After processing all the row images, it is obtained the global visualization of the vineyards where the drones' positions are marked as blue triangles and the health status of the plants are shown as green rectangles (healthy) or red rectangles (unhealthy):

Upon zooming in on the output, the positions of the drones and the grid which marks the locations become clearly visible. The grid cells without color indicate areas where no drone captures were recorded close enough to those positions.

Authors

Acknowledgements

This project is funded by the European Union, grant ID 101060643.