OpenDroneMap / FIELDimageR

FIELDimageR: A R package to analyze orthomosaic images from agricultural field trials. This package is a compilation of functions to analyze pos-mosaicking images from research fields, and allows to: crop the image; remove soil effect; build vegetation indices; rotate the image; build the plot shapefile; extract information for each plot; and evaluate stand count, canopy percentage, and plant height.
GNU General Public License v2.0
230 stars 89 forks source link

Add FIELDimageR Plugin to QGIS #15

Open dlebauer opened 3 years ago

dlebauer commented 3 years ago

It would be great to be able to use FIELDImageR as a Plugin to QGIS. I have never done this and haven't had time yet, but I looked into it and wanted to start the discussion / leave notes for someone to pick up or make comments on.

This would leverage the Resource Sharing Plugin http://qgis-contribution.github.io/QGIS-ResourceSharing/

Here are some examples of R scripts in the official QGIS plugin repository: https://github.com/qgis/QGIS-Resources/tree/master/collections/qgis_rscripts/rscripts

This will require creating a separate repository for sharing the plugins.

A few initial questions:

filipematias23 commented 3 years ago

Hi everyone,

Waw that’s awesome David, thank you for the initiative. Python and QGIS guys, please join us in this project.

About the questions. Let’s hear what the community says, but in my opinion, we can start with the functions fieldCrop, fieldMask, fieldShape, fieldPolygon, fieldIndex, and fieldInfo.

The basic arguments are:

1) fieldCrop Input • mosaic = object of class raster. • nPoint = number of points necessary to select field boundaries or area to remove. • remove = if TRUE the selected area will be removed from the image. Output • Image format raster.

2) fieldMask Input • mosaic = object of class raster. • Red,Green,Blue,RedEdge,NIR = respective position of the band at the original image file. • Index = vector with the vegetation indices to be calculated. • cropValue = referent value of soil in the image. • cropAbove = if TRUE all values above the cropValue will be accounted to make the mask. Output • Image format raster (all layers) and a binary mask (1 and 0).

3) fieldShape Input • mosaic = object of class raster. • ncols = number of ranges. • nrows = number of rows. • fieldMap = matrix with plots ID identified by rows and ranges, please use first the funsction fieldMap(). • fieldData = data frame with plot ID and all attributes of each plot (Traits as columns and genotypes as rows). • ID = name of plot ID in the fieldData file to combine with fieldShape.. Output • List with fieldShape format SpatialPolygonsDataFrame and image format raster.

4) fieldPolygon Input • mosaic = object of class raster. • nPolygon = number of polygons. • polygonID = a vector with polygon names with same order of drawing. If is NULL the ID will be the sequence of drawing. • polygonData = data frame with polygon ID and all attributes of each polygon (Traits as columns and polygon as rows). • ID = the column in polygonData with polygons names (ID) which the data will be combined with fieldShape. • remove = if TRUE the selected area will be removed from the image. Output • List with fieldShape format SpatialPolygonsDataFrame and image format raster.

5) fieldIndex Input • mosaic = object of class raster. • Red,Green,Blue,RedEdge,NIR = respective position of the band at the original image file. • Index = vector with the vegetation indices to be calculated. For the list of indices please visit the FIELDimageR manual at link: • myIndex = user can calculate a different index using the bands names, e.g. "(Green+Blue)/Red-NIR/RedEdge" Output • Image format raster with the original bands (layers) and with the new indices’ layers.

6) fieldInfo Input • mosaic = object of class raster. • fieldShape = plot shape file, please use first the function fieldShape(). • fun = function to summarize the values (e.g. mean). • Buffer = negative values should be used to remove boundaries from neighbor plot (normally the unit is meters, please use values as 0.1 = 10 cm). Output • Table with data extracted per plot.

Let us know if there are questions…!!! Thank you, Filipe