CoFly-Project / Problematic-Areas-Detection

Identification of the problematic areas based on vegetation indices (VIs) maps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problematic Areas Detection

The main objective of the Problematic-Areas-Detection module is to identify individual field regions of the examined area that present poor conditions, in terms of vegetation health. Utilizing the indices arrays (*.npy files) extracted from the Vegetation-Indices module, a pixel-wise pipeline has been developed to detect the problematic regions. As problematic are considered areas where the corresponding index value is low. For every detected area, the center of mass is calculated leading to a set of points, considered as points of interest.

The output of the module is an image representation of the VI where the detected points of interest are annotated accordingly and a json file containing for each detected point the geolocation, if the input image is georeferenced, otherwise pixel coordinates of the point of interest. The extracted files are named according to the name of the input image and the name of VI, e.g. img_name_VARI.json. In Figure 1, we present an overview of the Problematic-Areas-Detection module.

Figure 1. Workflow of the Problematic-Areas-Detection module. The points of interest are displayed with blue color.

How to run

  1. Clone this repo
  2. Open terminal on ~REPO_PATH
  3. Run:
python3 areas_dection.py --input_image ~IMAGE_PATH --index ~VI_ARRAY_PATH

ARGUMEΝTS

  • --input_image: refers to the path of the VI image representation (*.tif)
  • --index: refers to the path where the correspndinding VI array (*.npy) is stored

Results

Visualizations

(a) VARI (b) GLI (c) NGRDI (d) NGBDI

Figure 2. Detected points of interest (blue marks) for a set of different VIs.

Example of a *.json file (2 detected points of interest)

Presuming that VI image representation is georeferenced, the *.json file has the following format:

[
    {
        "Lat": 40.573296620493295,
        "Lon": 22.999613709891232
    },
    {
        "Lat": 40.57339888054105,
        "Lon": 22.998593432140527
    }
]

Otherwise:

[
    {
        "X_pixel": 1040,
        "Y_pixel": 1022
    },
    {
        "X_pixel": 2155,
        "Y_pixel": 890
    }
]

Dependencies

Install all the neccecary dependencies using pip3 install <package name>

Required packages:

  • opencv-python (version >= 4.5.3)
  • numpy (version >= 1.21.3)
  • scipy (version >= 1.4.1)
  • gdal (version >= 3.2.2)
  • argparse (version >= 1.1)
  • skimage (version >= 0.18.1)
  • matplotlib (version >= 3.2.2)
  • scikit-learn (version >= 0.24.0)
  • json (version >= 2.0.9)

How to install GDAL

  • On Linux, GDAL binary and Python binding are available through ubuntugis repository.
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get install gdal-bin
sudo apt-get install python3-gdal
  • On Windows, the easiest way to install GDAL Python Binding is to use the packages build by Christoph Gohlke. The *.whl package file contains a stand alone GDAL installation including all needed files (binaries, libraries, Python binding, etc.). After downloading the correct version of *.whl package based on the installed python version on the operating system, install the wheel file with the following command:
~PATH_TO_WHL_PACKAGE python.exe -m pip install GDAL-X.X.X-cpXX-cpXXm-win_amd64.whl

To finalize the installation, it's necessary to define new Windows environment variables:

  • GDAL_DATA pointing the directory C:\Program Files\GDAL\gdal-data
  • GDAL_DRIVER_PATH pointing the directory C:\Program Files\GDAL\gdalplugins

Citation

(not published yet)

Acknowledgment

This research has been financed by the European Regional Development Fund of the European Union and Greek national funds through the Operational Program Competitiveness, Entrepreneurship and Innovation, under the call RESEARCH - CREATE - INNOVATE (T1EDK-00636).

About

Identification of the problematic areas based on vegetation indices (VIs) maps.

License:MIT License


Languages

Language:Python 100.0%