Giter Site home page Giter Site logo

opendronemap / fieldimager Goto Github PK

View Code? Open in Web Editor NEW
221.0 221.0 86.0 4.83 MB

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.

License: GNU General Public License v2.0

R 98.97% Dockerfile 1.03%

fieldimager's Introduction

ODM Logo

An open source command line toolkit for processing aerial drone imagery. ODM turns simple 2D images into:

  • Classified Point Clouds
  • 3D Textured Models
  • Georeferenced Orthorectified Imagery
  • Georeferenced Digital Elevation Models

images-diag

The application is available for Windows, Mac and Linux and it works from the command line, making it ideal for power users, scripts and for integration with other software.

If you would rather not type commands in a shell and are looking for a friendly user interface, check out WebODM.

Quickstart

The easiest way to run ODM on is via docker. To install docker, see docs.docker.com. Once you have docker installed and working, you can run ODM by placing some images (JPEGs or TIFFs) in a folder named “images” (for example C:\Users\youruser\datasets\project\images or /home/youruser/datasets/project/images) and simply run from a Command Prompt / Terminal:

# Windows
docker run -ti --rm -v c:/Users/youruser/datasets:/datasets opendronemap/odm --project-path /datasets project

# Mac/Linux
docker run -ti --rm -v /home/youruser/datasets:/datasets opendronemap/odm --project-path /datasets project

You can pass additional parameters by appending them to the command:

docker run -ti --rm -v /datasets:/datasets opendronemap/odm --project-path /datasets project [--additional --parameters --here]

For example, to generate a DSM (--dsm) and increase the orthophoto resolution (--orthophoto-resolution 2) :

docker run -ti --rm -v /datasets:/datasets opendronemap/odm --project-path /datasets project --dsm --orthophoto-resolution 2

Viewing Results

When the process finishes, the results will be organized as follows:

|-- images/
    |-- img-1234.jpg
    |-- ...
|-- opensfm/
    |-- see mapillary/opensfm repository for more info
|-- odm_meshing/
    |-- odm_mesh.ply                    # A 3D mesh
|-- odm_texturing/
    |-- odm_textured_model.obj          # Textured mesh
    |-- odm_textured_model_geo.obj      # Georeferenced textured mesh
|-- odm_georeferencing/
    |-- odm_georeferenced_model.laz     # LAZ format point cloud
|-- odm_orthophoto/
    |-- odm_orthophoto.tif              # Orthophoto GeoTiff

You can use the following free and open source software to open the files generated in ODM:

  • .tif (GeoTIFF): QGIS
  • .laz (Compressed LAS): CloudCompare
  • .obj (Wavefront OBJ), .ply (Stanford Triangle Format): MeshLab

Note! Opening the .tif files generated by ODM in programs such as Photoshop or GIMP might not work (they are GeoTIFFs, not plain TIFFs). Use QGIS instead.

API

ODM can be made accessible from a network via NodeODM.

Documentation

See http://docs.opendronemap.org for tutorials and more guides.

Forum

We have a vibrant community forum. You can search it for issues you might be having with ODM and you can post questions there. We encourage users of ODM to participate in the forum and to engage with fellow drone mapping users.

Windows Setup

ODM can be installed natively on Windows. Just download the latest setup from the releases page. After opening the ODM Console you can process datasets by typing:

run C:\Users\youruser\datasets\project  [--additional --parameters --here]

GPU Acceleration

ODM has support for doing SIFT feature extraction on a GPU, which is about 2x faster than the CPU on a typical consumer laptop. To use this feature, you need to use the opendronemap/odm:gpu docker image instead of opendronemap/odm and you need to pass the --gpus all flag:

docker run -ti --rm -v c:/Users/youruser/datasets:/datasets --gpus all opendronemap/odm:gpu --project-path /datasets project

When you run ODM, if the GPU is recognized, in the first few lines of output you should see:

[INFO]    Writing exif overrides
[INFO]    Maximum photo dimensions: 4000px
[INFO]    Found GPU device: Intel(R) OpenCL HD Graphics
[INFO]    Using GPU for extracting SIFT features

The SIFT GPU implementation is CUDA-based, so should work with most NVIDIA graphics cards of the GTX 9xx Generation or newer.

If you have an NVIDIA card, you can test that docker is recognizing the GPU by running:

docker run --rm --gpus all nvidia/cuda:10.0-base nvidia-smi

If you see an output that looks like this:

Fri Jul 24 18:51:55 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.82       Driver Version: 440.82       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |

You're in good shape!

See https://github.com/NVIDIA/nvidia-docker and https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker for information on docker/NVIDIA setup.

Native Install (Ubuntu 21.04)

You can run ODM natively on Ubuntu 21.04 (although we don't recommend it):

git clone https://github.com/OpenDroneMap/ODM
cd ODM
bash configure.sh install

You can then process datasets with ./run.sh /datasets/odm_data_aukerman

Native Install (MacOS)

You can run ODM natively on Intel/ARM MacOS.

First install:

  • Xcode 13 (not 14, there's currently a bug)
  • Homebrew

Then Run:

git clone https://github.com/OpenDroneMap/ODM
cd ODM
bash configure_macos.sh install

You can then process datasets with ./run.sh /datasets/odm_data_aukerman

This could be improved in the future. Helps us create a Homebrew formula.

Updating a native installation

When updating to a newer version of native ODM, it is recommended that you run:

bash configure.sh reinstall

to ensure all the dependent packages and modules get updated.

Build Docker Images From Source

If you want to rebuild your own docker image (if you have changed the source code, for example), from the ODM folder you can type:

docker build -t my_odm_image --no-cache .

When building your own Docker image, if image size is of importance to you, you should use the --squash flag, like so:

docker build --squash -t my_odm_image .

This will clean up intermediate steps in the Docker build process, resulting in a significantly smaller image (about half the size).

Experimental flags need to be enabled in Docker to use the --squash flag. To enable this, insert the following into the file /etc/docker/daemon.json:

{
   "experimental": true
}

After this, you must restart docker.

Video Support

Starting from version 3.0.4, ODM can automatically extract images from video files (.mp4, .mov, .lrv, .ts). Just place one or more video files into the images folder and run the program as usual. Subtitles files (.srt) with GPS information are also supported. Place .srt files in the images folder, making sure that the filenames match. For example, my_video.mp4 ==> my_video.srt (case-sensitive).

Developers

Help improve our software! We welcome contributions from everyone, whether to add new features, improve speed, fix existing bugs or add support for more cameras. Check our code of conduct, the contributing guidelines and how decisions are made.

Installation and first run

For Linux users, the easiest way to modify the software is to make sure docker is installed, clone the repository and then run from a shell:

$ DATA=/path/to/datasets ./start-dev-env.sh

Where /path/to/datasets is a directory where you can place test datasets (it can also point to an empty directory if you don't have test datasets).

Run configure to set up the required third party libraries:

(odmdev) [user:/code] master+* ± bash configure.sh reinstall

You can now make changes to the ODM source. When you are ready to test the changes you can simply invoke:

(odmdev) [user:/code] master+* ± ./run.sh --project-path /datasets mydataset

Stop dev container

 docker  stop odmdev

To come back to dev environement

change your_username to your username

docker start odmdev
docker exec -ti odmdev bash
su your_username

If you have questions, join the developer's chat at https://community.opendronemap.org/c/developers-chat/21

  1. Try to keep commits clean and simple
  2. Submit a pull request with detailed changes and test results
  3. Have fun!

Troubleshooting

The dev environment makes use of opendronemap/nodeodm by default. You may want to run docker pull opendronemap/nodeodm before running ./start-dev-env.sh to avoid using an old cached version.

In order to make a clean build, remove ~/.odm-dev-home and ODM/.setupdevenv.

Credits

ODM makes use of several libraries and other awesome open source projects to perform its tasks. Among them we'd like to highlight:

Citation

OpenDroneMap Authors ODM - A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. OpenDroneMap/ODM GitHub Page 2020; https://github.com/OpenDroneMap/ODM

Trademark

See Trademark Guidelines

fieldimager's People

Contributors

agurel avatar bhavyagoel avatar chris-schnaufer avatar didiermurillof avatar diego91964 avatar dlebauer avatar filipematias23 avatar nfahlgren avatar pierotofy avatar pspawar71 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fieldimager's Issues

problems installing FIELDimageR in docker

Dear maintainers,
First all of, thanks to develop this package which is a great tool that i am using mostly for image crop/soil segmentation.

I have a problem in order to build a docker image, that has inside the FIELDimageR package.

This is my dockerfile

FROM rocker/r-ver:4.1.2
RUN apt-get update && apt-get install -y  gdal-bin git-core imagemagick libcurl4-openssl-dev libfontconfig1-dev libgdal-dev libgeos-dev libgeos++-dev libgit2-dev libicu-dev libjq-dev libpng-dev libpq-dev libproj-dev libprotobuf-dev libsasl2-dev libssl-dev libudunits2-dev libv8-dev libxml2-dev make pandoc pandoc-citeproc protobuf-compiler libprotoc-dev zlib1g-dev && rm -rf /var/lib/apt/lists/*
RUN echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl', Ncpus = 4)" >> /usr/local/lib/R/etc/Rprofile.site
RUN R -e 'install.packages("remotes")'
RUN Rscript -e 'remotes::install_version("glue",upgrade="never", version = "1.6.2")'
RUN Rscript -e 'remotes::install_version("xml2",upgrade="never", version = "1.3.3")'
RUN Rscript -e 'remotes::install_version("htmltools",upgrade="never", version = "0.5.2")'
RUN Rscript -e 'remotes::install_version("processx",upgrade="never", version = "3.5.2")'
RUN Rscript -e 'remotes::install_version("ggplot2",upgrade="never", version = "3.3.5")'
RUN Rscript -e 'remotes::install_version("data.table",upgrade="never", version = "1.14.2")'
RUN Rscript -e 'remotes::install_version("DBI",upgrade="never", version = "1.1.2")'
RUN Rscript -e 'remotes::install_version("lubridate",upgrade="never", version = "1.8.0")'
RUN Rscript -e 'remotes::install_version("shiny",upgrade="never", version = "1.7.1")'
RUN Rscript -e 'remotes::install_version("e1071",upgrade="never", version = "1.7-9")'
RUN Rscript -e 'remotes::install_version("sp",upgrade="never", version = "1.4-6")'
RUN Rscript -e 'remotes::install_version("sf",upgrade="never", version = "1.0-6")'
RUN Rscript -e 'remotes::install_version("raster",upgrade="never", version = "3.5-15")'
RUN Rscript -e 'remotes::install_version("plotly",upgrade="never", version = "4.10.0")'
RUN Rscript -e 'remotes::install_version("viridis",upgrade="never", version = "0.6.2")'
RUN Rscript -e 'remotes::install_version("leaflet",upgrade="never", version = "2.0.4.1")'
RUN Rscript -e 'remotes::install_version("zip",upgrade="never", version = "2.2.0")'
RUN Rscript -e 'remotes::install_version("plotrix",upgrade="never", version = "3.8-2")'
RUN Rscript -e 'remotes::install_version("rvest",upgrade="never", version = "1.0.2")'
RUN Rscript -e 'remotes::install_version("readxl",upgrade="never", version = "1.3.1")'
RUN Rscript -e 'remotes::install_version("googlesheets4",upgrade="never", version = "1.0.0")'
RUN Rscript -e 'remotes::install_version("DT",upgrade="never", version = "0.20")'
RUN Rscript -e 'remotes::install_version("rgdal",upgrade="never", version = "1.5-28")'
RUN Rscript -e 'remotes::install_version("rgeos",upgrade="never", version = "0.5-9")'
RUN Rscript -e 'remotes::install_version("timetk",upgrade="never", version = "2.7.0")'
RUN Rscript -e 'remotes::install_version("mapview",upgrade="never", version = "2.10.0")'
RUN Rscript -e 'remotes::install_version("leaflet.extras",upgrade="never", version = "1.0.0")'
RUN Rscript -e 'remotes::install_version("config",upgrade="never", version = "0.3.1")'
RUN Rscript -e 'remotes::install_version("attempt",upgrade="never", version = "0.3.1")'
RUN Rscript -e 'remotes::install_version("waiter",upgrade="never", version = "0.2.5")'
RUN Rscript -e 'remotes::install_version("tidyverse",upgrade="never", version = "1.3.1")'
RUN Rscript -e 'remotes::install_version("tidymodels",upgrade="never", version = "0.1.4")'
RUN Rscript -e 'remotes::install_version("SpatialPosition",upgrade="never", version = "2.1.1")'
RUN Rscript -e 'remotes::install_version("shinymanager",upgrade="never", version = "1.0.400")'
RUN Rscript -e 'remotes::install_version("RStoolbox",upgrade="never", version = "0.3.0")'
RUN Rscript -e 'remotes::install_version("rpostgis",upgrade="never", version = "1.4.3")'
RUN Rscript -e 'remotes::install_version("testthat",upgrade="never", version = "3.1.1")'
RUN Rscript -e 'remotes::install_version("spelling",upgrade="never", version = "2.2")'
RUN Rscript -e 'remotes::install_version("writexl",upgrade="never", version = "1.4.0")'
RUN Rscript -e 'remotes::install_version("weathermetrics",upgrade="never", version = "1.2.2")'
RUN Rscript -e 'remotes::install_version("SPEI",upgrade="never", version = "1.7")'
RUN Rscript -e 'remotes::install_version("spdplyr",upgrade="never", version = "0.4.0")'
RUN Rscript -e 'remotes::install_version("skimr",upgrade="never", version = "2.1.3")'
RUN Rscript -e 'remotes::install_version("shinyWidgets",upgrade="never", version = "0.6.4")'
RUN Rscript -e 'remotes::install_version("shinyvalidate",upgrade="never", version = "0.1.1")'
RUN Rscript -e 'remotes::install_version("shinyjs",upgrade="never", version = "2.1.0")'
RUN Rscript -e 'remotes::install_version("shinycssloaders",upgrade="never", version = "1.0.0")'
RUN Rscript -e 'remotes::install_version("shinyalert",upgrade="never", version = "3.0.0")'
RUN Rscript -e 'remotes::install_version("sever",upgrade="never", version = "0.0.7")'
RUN Rscript -e 'remotes::install_version("rtsdata",upgrade="never", version = "0.1.3")'
RUN Rscript -e 'remotes::install_version("RPostgres",upgrade="never", version = "1.4.3")'
RUN Rscript -e 'remotes::install_version("randomForest",upgrade="never", version = "4.7-1")'
RUN Rscript -e 'remotes::install_version("owmr",upgrade="never", version = "0.8.2")'
RUN Rscript -e 'remotes::install_version("NbClust",upgrade="never", version = "3.0")'
RUN Rscript -e 'remotes::install_version("nasapower",upgrade="never", version = "4.0.6")'
RUN Rscript -e 'remotes::install_version("modeltime",upgrade="never", version = "1.1.1")'
RUN Rscript -e 'remotes::install_version("measurements",upgrade="never", version = "1.4.0")'
RUN Rscript -e 'remotes::install_version("mapedit",upgrade="never", version = "0.6.0")'
RUN Rscript -e 'remotes::install_version("leaflet.extras2",upgrade="never", version = "1.1.0")'
RUN Rscript -e 'remotes::install_version("gstat",upgrade="never", version = "2.0-8")'
RUN Rscript -e 'remotes::install_version("golem",upgrade="never", version = "0.3.2")'
RUN Rscript -e 'remotes::install_version("geojsonlint",upgrade="never", version = "0.4.0")'
RUN Rscript -e 'remotes::install_version("geojsonio",upgrade="never", version = "0.9.4")'
RUN Rscript -e 'remotes::install_version("earth",upgrade="never", version = "5.3.1")'
RUN Rscript -e 'remotes::install_version("climatol",upgrade="never", version = "3.1.2")'
RUN Rscript -e 'remotes::install_version("cicerone",upgrade="never", version = "1.0.4")'
RUN Rscript -e 'remotes::install_version("bs4Dash",upgrade="never", version = "2.0.3")'
RUN Rscript -e 'remotes::install_github("filipematias23/FIELDimageR@09923cfa768a638023dd88242097b4e77d4f2439")'
RUN mkdir /build_zone
ADD . /build_zone
WORKDIR /build_zone
RUN R -e 'options(warn = 2);remotes::install_local(upgrade="never")'
EXPOSE 80
CMD R -e "options('shiny.port'=80,shiny.host='0.0.0.0');webapp4::run_app()"

And when i use the docker build command in the line "RUN R -e 'options(warn = 2);remotes::install_local(upgrade="never")'"

I have the follow error output

 => ERROR [76/76] RUN R -e 'options(warn = 2);remotes::install_local(upgrade="never")'                                                                                                                       45.7s
------
 > [76/76] RUN R -e 'options(warn = 2);remotes::install_local(upgrade="never")':
#80 0.742
#80 0.742 R version 4.1.2 (2021-11-01) -- "Bird Hippie"
#80 0.742 Copyright (C) 2021 The R Foundation for Statistical Computing
#80 0.742 Platform: x86_64-pc-linux-gnu (64-bit)
#80 0.742
#80 0.742 R is free software and comes with ABSOLUTELY NO WARRANTY.
#80 0.742 You are welcome to redistribute it under certain conditions.
#80 0.742 Type 'license()' or 'licence()' for distribution details.
#80 0.742
#80 0.742   Natural language support but running in an English locale
#80 0.742
#80 0.742 R is a collaborative project with many contributors.
#80 0.742 Type 'contributors()' for more information and
#80 0.742 'citation()' on how to cite R or R packages in publications.
#80 0.742
#80 0.743 Type 'demo()' for some demos, 'help()' for on-line help, or
#80 0.743 'help.start()' for an HTML browser interface to help.
#80 0.743 Type 'q()' to quit R.
#80 0.743
#80 0.828 > options(warn = 2);remotes::install_local(upgrade="never")
#80 3.819 * checking for file ‘/tmp/RtmpUhb2pN/file837fdb88f/build_zone/DESCRIPTION’ ... OK
#80 4.068 * preparing ‘webapp4’:
#80 4.068 * checking DESCRIPTION meta-information ... OK
#80 4.555 * checking for LF line-endings in source and make files and shell scripts
#80 4.556 * checking for empty or unneeded directories
#80 4.564 * building ‘webapp4_0.0.0.9000.tar.gz’
#80 29.85
#80 30.20 Installing package into ‘/usr/local/lib/R/site-library’
#80 30.20 (as ‘lib’ is unspecified)
#80 43.72 ERROR: dependency ‘FIELDimageR’ is not available for package ‘webapp4’
#80 43.72 * removing ‘/usr/local/lib/R/site-library/webapp4’
#80 45.60 Error: Failed to install 'webapp4' from local:
#80 45.60   (converted from warning) installation of package ‘/tmp/RtmpUhb2pN/file84c59464f/webapp4_0.0.0.9000.tar.gz’ had non-zero exit status
#80 45.60 Execution halted
------
executor failed running [/bin/sh -c R -e 'options(warn = 2);remotes::install_local(upgrade="never")']: exit code: 1

Do you know how can i solve this issue?

Use a buffer for canopy calculation

Hello,

I would like to calculate the canopy for each plot and buffer the area near the border of each plot.

I have been able to successfully calculate the canopy area per plot with the 'fieldArea' function, however this function does not allow the user to input a desired buffer. I have also tried to use the 'fieldInfo' function to apply the buffer to the output of the 'fieldArea' function, but I have not been able to get the 'fieldArea' function to accept the canopy input.

Please advise on the best practice to applying a buffer to a canopy calculation. Thanks!!

Extract individual plots & working with large files

Hey Filipe, thanks a ton for your work and sharing it with us. I have a couple of questions about your package:

  1. Is there a provision to extract individual plots from a field? I want to conduct analysis on each of the plots from a orthomosaic image.
  2. I was experimenting with a very large tif image (~2GB). When I used fieldCrop (with fast.plot = T) to select the target field, the result was an extremely blurry image although the original image is of very high quality. What could be the reason for this? I am able to remove soil & build the plot shape but the plots are again quite blurry. Can you please advice on the best practice?

Subsampling within plot

Hello Filipe,

I just checked the functionalities that you made available. I was wondering how hard would it be to add an extra function to subdivide the plots polygon (in a smaller subgrid).

I will give it a look, if you find the idea interesting, let me know and I will implement it.

Cheers,

error installing, object elide not supported by package

Hi guys,

I have been trying to install the fieldimager package and did it both ways, but still get the same error. I am using a macOS and have the updated version of Rstudio.

Here is what I am getting:

"Downloading GitHub repo OpenDroneMap/FIELDimageR@HEAD
── R CMD build ────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/private/var/folders/0b/s1x9xvgx4ggccbm_3x50sp_r0000gn/T/RtmpWjRrT9/remotes92a95fb16cdd/OpenDroneMap-FIELDimageR-c0a3f92/DESCRIPTION’ (340ms)
─  preparing ‘FIELDimageR’:
✔  checking DESCRIPTION meta-information
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
   Omitted ‘LazyData’ from DESCRIPTION
─  building ‘FIELDimageR_0.3.3.tar.gz’
   
* installing *source* package ‘FIELDimageR’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: object ‘elide’ is not exported by 'namespace:maptools'
Execution halted
ERROR: lazy loading failed for package ‘FIELDimageR’
* removing ‘/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/FIELDimageR’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/0b/s1x9xvgx4ggccbm_3x50sp_r0000gn/T//RtmpWjRrT9/file92a97962523f/FIELDimageR_0.3.3.tar.gz’ had non-zero exit status"

Please let me know if you have any tips to solve this error. I have downloaded the maptools package, terra, sp.

Parallel and loop to evaluate multiple images

Hi all,
I am using the object n.core from the function "fieldInfo" and when I set up the number of cores, this function does not work
Do you have any thoughts on what it can be?

Thanks

Leonardo Volpato

Upcoming changes to R spatial packages

Article: https://geocompx.org/post/2023/rgdal-retirement/

The packages rgdal, rgeos, and maptools are being removed from CRAN October 2023.

FIELDimageR does not use these directly (except for maptools, which can be removed after merging #43), but it uses sp, which has all of these as dependencies.

The article discusses the need to shift from sp to modern alternatives sf or terra.

FIELDimageR imports the following from sp:

sp::Polygon --> sf::st_polygon

sp::Polygons --> sf:: st_multipolygon

sp::SpatialPointsDataFrame --> sf:: st_sf

sp::SpatialPolygons --> sf:: st_sfc

sp::SpatialPolygonsDataFrame --> sf:: st_sf

sp::bbox --> sf:: st_bbox

sp::over --> sapply(sf::st_intersects(x, y), function(z) if (length(z) == 0) NA_integer_ else z[1])

sp::proj4string --> sf::st_crs

sp::spsample --> sf:: st_sample

sp::elide --> ?

Resources:

Suggested additions and changes to a FIELDimageR Dockerfile

These suggestions are from issue #7 and placed here so they don't get lost

If you start from rocker/geospatial you get a lot of these dependencies already built in (including tidyverse and a lot of geospatial utilities - not just those required by FieldImageR but some that could be useful for running downstream analyses, as well as a lot of bloat!!)

it is quite a stack (not clear if additional size / dependencies are worth it), but
rocker/geospatial https://github.com/rocker-org/geospatial/blob/master/Dockerfile builds on
rocker/verse https://github.com/rocker-org/rocker-versioned/blob/master/verse/3.6.3.Dockerfile which builds on
rocker/tidyverse https://github.com/rocker-org/rocker-versioned/blob/master/tidyverse/3.6.3.Dockerfile which builds on
rocker/rstudio https://github.com/rocker-org/rocker-versioned/blob/master/rstudio/3.6.3.Dockerfile which builds on
rocker/r-ver which is the base for the versioned images ...

Couldn't able to install FIELDimageR pacakage both using zip file format and devtools intsallation method

I have properly gone through the documentation on the page. I install R 4.30, rstudio, rtools as well when giving this bellow command
install.packages("devtools")
devtools::install_github("OpenDroneMap/FIELDimageR")
i am getting this error : Installing package into ‘C:/Users/Asus/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)

  • installing source package 'FIELDimageR' ...
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error: object 'elide' is not exported by 'namespace:maptools'
    Execution halted
    ERROR: lazy loading failed for package 'FIELDimageR'

  • removing 'C:/Users/Asus/AppData/Local/R/win-library/4.3/FIELDimageR'
    Warning message:
    In i.p(...) :
    installation of package ‘C:/Users/Asus/AppData/Local/Temp/RtmpuKAye4/file5b43a3ad8f/FIELDimageR_0.3.3.tar.gz’ had non-zero exit status

    is there any specific version of R that needs to be installed?

    I have tried this method as well :
    unzip("FIELDimageR-master.zip")
    file.rename("FIELDimageR-master", "FIELDimageR")
    shell("R CMD build FIELDimageR") # or system("R CMD build FIELDimageR")
    install.packages("FIELDimageR_0.3.2.tar.gz", repos = NULL, type="source") # Make sure to use the right version (e.g. 0.3.2)

but i am still facing error to install i have placed the zip folder in the folder where i opens the R file but i am getting below error
unzip("FIELDimageR-master.zip")
Warning message:
In unzip("FIELDimageR-master.zip") : error 1 in extracting from zip file

any suggestion or any help would be really helpful this is really great library for plant phenotyping. if anyone assist on this problem i could able do some research using this for my learning purpose

Install FIELDimageR.Extra

I am having trouble installing FIELDimageR.Extra and below is what I get. Any thoughts on this?  
devtools::install_github("filipematias23/FIELDimageR.Extra")

devtools::install_github("filipematias23/FIELDimageR.Extra")
Downloading GitHub repo filipematias23/FIELDimageR.Extra@HEAD
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────
✔ checking for file 'C:\Users\benlopez\AppData\Local\Temp\RtmpWAvMQ3\remotes18a0293c3591\filipematias23-FIELDimageR.Extra-42d2558/DESCRIPTION'
─ preparing 'FIELDimageR.Extra':
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building 'FIELDimageR.Extra_0.0.2.tar.gz'

  • installing source package 'FIELDimageR.Extra' ...
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    there is no package called 'leafsync'
    Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
    Execution halted
    ERROR: lazy loading failed for package 'FIELDimageR.Extra'
  • removing 'C:/Users/benlopez/AppData/Local/Programs/R/R-4.3.1/library/FIELDimageR.Extra'
    Warning message:
    In i.p(...) :
    installation of package ‘C:/Users/benlopez/AppData/Local/Temp/RtmpWAvMQ3/file18a0339a5655/FIELDimageR.Extra_0.0.2.tar.gz’ had non-zero exit status

Dockerfile missing

Hi,

Is there any chance the Dockerfile will be added back?

I have a copy of Dockerfile based on rocker/tidyverse:4.1.0 and am happy to share it.

Regards,

Kenyon

Could not find function "fieldCrop"

> EX1.Crop <- fieldCrop(mosaic = EX1, plot = T) # For heavy images (large, high resolution, etc.) please use: fast.plot=T

Error fieldCrop(mosaic = EX1, plot = T) : could not find function "fieldCrop"

@filipematias23 Pls help!

Rotation incorrectly reprojects image

Rotating the image in the instructions causes the image to reproject. This causes the rotated image to have incorrect geographic coordinates. The pixels need to be rotated and the geographic information to remain intact.

A way to think about this is recognizing that the original image covers a certain area of the ground; represented by the geographic coordinate system and the image geographic extents. When the rotation step is performed, the image still represents the exact same geographic coordinate system and extents as the original image, only the pixel representation is different.

The following, unassociated, link shows the effect of the reprojection geographically: https://gis.stackexchange.com/questions/131465/gdal-rotate-dem (first response, under Update). As can be seen, the image is now covering a different geographic area after rotation.

The two images in the Rotating the image section display the same area of ground, only the pixel representation has changed.

What worked for me
I couldn't find an easy way to rotate the pixels in R, not a strong language for me. What I was able to do is assign the Crop crs and extent back to the rotated image as follows:

crs(EX1.Rotated)<-crs(EX1.Crop)
extent(EX1.Rotated)<-extent(EX1.Crop)

Having a background in GIS, I need to point out that this is an inexact solution that may be considered "close enough".

Selection point is shifted

Hello,
When I make a region selection, the position of the selected point is always shifted when I select a point on the image.
How can I solve this problem?
Thanks!

Problem to install FIELDImageR in costum dockerfile

Dear Authors,
First of all thanks to make pubblic availble this package case is really usefull.

This isssue is related to #32

I would like to add the package to a docker container but i am getting a lot of problem

This is my dockerfile.

FROM rocker/verse:4.2.0
RUN groupadd -g 61000 docker
RUN useradd -g 61000 -l -M -s /bin/false -u 61000 docker
RUN apt-get update && apt-get install -y curl gdal-bin git-core imagemagick libcurl4-openssl-dev libfontconfig1-dev libgdal-dev libgeos-dev libgeos++-dev libgit2-dev libicu-dev libjq-dev libpng-dev libpq-dev libproj-dev libprotobuf-dev libsasl2-dev libssl-dev libudunits2-dev libsqlite3-dev libv8-dev libxml2-dev make pandoc pandoc-citeproc protobuf-compiler libprotoc-dev zlib1g-dev libfftw3-dev && rm -rf /var/lib/apt/lists/*
RUN echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl', Ncpus = 4)" >> /usr/local/lib/R/etc/Rprofile.site
RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
    apt-get update -qq && \
    apt-get -y install \
    ./google-chrome-stable_current_amd64.deb && \
    rm google-chrome-stable_current_amd64.deb
RUN mkdir -p /usr/local/lib/R/etc/ /usr/lib/R/etc/
RUN echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl', Ncpus = 4)" | tee /usr/local/lib/R/etc/Rprofile.site | tee /usr/lib/R/etc/Rprofile.site
RUN R -e 'install.packages("remotes")'
RUN Rscript -e 'remotes::install_version("htmltools",upgrade="never", version = "0.5.3")'
RUN Rscript -e 'remotes::install_version("stringr",upgrade="never", version = "1.5.0")'
RUN Rscript -e 'remotes::install_version("processx",upgrade="never", version = "3.8.0")'
RUN Rscript -e 'remotes::install_version("rmarkdown",upgrade="never", version = "2.18")'
RUN Rscript -e 'remotes::install_version("knitr",upgrade="never", version = "1.41")'
RUN Rscript -e 'remotes::install_version("glue",upgrade="never", version = "1.6.2")'
RUN Rscript -e 'remotes::install_version("data.table",upgrade="never", version = "1.14.6")'
RUN Rscript -e 'remotes::install_version("DBI",upgrade="never", version = "1.1.3")'
RUN Rscript -e 'remotes::install_version("lubridate",upgrade="never", version = "1.9.0")'
RUN Rscript -e 'remotes::install_version("ggplot2",upgrade="never", version = "3.4.0")'
RUN Rscript -e 'remotes::install_version("shiny",upgrade="never", version = "1.7.3")'
RUN Rscript -e 'remotes::install_version("e1071",upgrade="never", version = "1.7-12")'
RUN Rscript -e 'remotes::install_version("sp",upgrade="never", version = "1.5-0")'
RUN Rscript -e 'remotes::install_version("sf",upgrade="never", version = "1.0-9")'
RUN Rscript -e 'remotes::install_version("raster",upgrade="never", version = "3.6-11")'
RUN Rscript -e 'remotes::install_version("forecast",upgrade="never", version = "8.19")'
RUN Rscript -e 'remotes::install_version("plotly",upgrade="never", version = "4.10.1")'
RUN Rscript -e 'remotes::install_version("viridis",upgrade="never", version = "0.6.2")'
RUN Rscript -e 'remotes::install_version("leaflet",upgrade="never", version = "2.1.1")'
RUN Rscript -e 'remotes::install_version("xml2",upgrade="never", version = "1.3.3")'
RUN Rscript -e 'remotes::install_version("zip",upgrade="never", version = "2.2.2")'
RUN Rscript -e 'remotes::install_version("pkgload",upgrade="never", version = "1.3.2")'
RUN Rscript -e 'remotes::install_version("plotrix",upgrade="never", version = "3.8-2")'
RUN Rscript -e 'remotes::install_version("rvest",upgrade="never", version = "1.0.3")'
RUN Rscript -e 'remotes::install_version("readxl",upgrade="never", version = "1.4.1")'
RUN Rscript -e 'remotes::install_version("DT",upgrade="never", version = "0.26")'
RUN Rscript -e 'remotes::install_version("rgdal",upgrade="never", version = "1.6-3")'
RUN Rscript -e 'remotes::install_version("rgeos",upgrade="never", version = "0.6-1")'
RUN Rscript -e 'remotes::install_version("reshape",upgrade="never", version = "0.8.9")'
RUN Rscript -e 'remotes::install_version("gstat",upgrade="never", version = "2.1-0")'
RUN Rscript -e 'remotes::install_version("gt",upgrade="never", version = "0.8.0")'
RUN Rscript -e 'remotes::install_version("timetk",upgrade="never", version = "2.8.2")'
RUN Rscript -e 'remotes::install_version("mapview",upgrade="never", version = "2.11.0")'
RUN Rscript -e 'remotes::install_version("leaflet.extras",upgrade="never", version = "1.0.0")'
RUN Rscript -e 'remotes::install_version("config",upgrade="never", version = "0.3.1")'
RUN Rscript -e 'remotes::install_version("attempt",upgrade="never", version = "0.3.1")'
RUN Rscript -e 'remotes::install_version("waiter",upgrade="never", version = "0.2.5")'
RUN Rscript -e 'remotes::install_version("tidyverse",upgrade="never", version = "1.3.2")'
RUN Rscript -e 'remotes::install_version("tidymodels",upgrade="never", version = "1.0.0")'
RUN Rscript -e 'remotes::install_version("SpatialPosition",upgrade="never", version = "2.1.1")'
RUN Rscript -e 'remotes::install_version("shinymanager",upgrade="never", version = "1.0.410")'
RUN Rscript -e 'remotes::install_version("RStoolbox",upgrade="never", version = "0.3.0")'
RUN Rscript -e 'remotes::install_version("rpostgis",upgrade="never", version = "1.4.3")'
RUN Rscript -e 'remotes::install_version("testthat",upgrade="never", version = "3.1.5")'
RUN Rscript -e 'remotes::install_version("spelling",upgrade="never", version = "2.2")'
RUN Rscript -e 'remotes::install_version("ranger",upgrade="never", version = "0.14.1")'
RUN Rscript -e 'remotes::install_version("collapse",upgrade="never", version = "1.8.9")'
RUN Rscript -e 'remotes::install_version("cubeview",upgrade="never", version = "0.2.0")'
RUN Rscript -e 'remotes::install_version("echarts4r",upgrade="never", version = "0.4.4")'
RUN Rscript -e 'remotes::install_version("automap",upgrade="never", version = "1.0-16")'
RUN Rscript -e 'remotes::install_version("writexl",upgrade="never", version = "1.4.1")'
RUN Rscript -e 'remotes::install_version("weathermetrics",upgrade="never", version = "1.2.2")'
RUN Rscript -e 'remotes::install_version("SPEI",upgrade="never", version = "1.7")'
RUN Rscript -e 'remotes::install_version("spdplyr",upgrade="never", version = "0.4.0")'
RUN Rscript -e 'remotes::install_version("shinyWidgets",upgrade="never", version = "0.7.5")'
RUN Rscript -e 'remotes::install_version("shinyvalidate",upgrade="never", version = "0.1.2")'
RUN Rscript -e 'remotes::install_version("shinyjs",upgrade="never", version = "2.1.0")'
RUN Rscript -e 'remotes::install_version("shinycssloaders",upgrade="never", version = "1.0.0")'
RUN Rscript -e 'remotes::install_version("shinyalert",upgrade="never", version = "3.0.0")'
RUN Rscript -e 'remotes::install_version("sever",upgrade="never", version = "0.0.7")'
RUN Rscript -e 'remotes::install_version("rtsdata",upgrade="never", version = "0.1.3")'
RUN Rscript -e 'remotes::install_version("RPostgres",upgrade="never", version = "1.4.4")'
RUN Rscript -e 'remotes::install_version("RMySQL",upgrade="never", version = "0.10.24")'
RUN Rscript -e 'remotes::install_version("randomForest",upgrade="never", version = "4.7-1.1")'
RUN Rscript -e 'remotes::install_version("pagedown",upgrade="never", version = "0.19")'
RUN Rscript -e 'remotes::install_version("owmr",upgrade="never", version = "0.8.2")'
RUN Rscript -e 'remotes::install_version("NbClust",upgrade="never", version = "3.0.1")'
RUN Rscript -e 'remotes::install_version("nasapower",upgrade="never", version = "4.0.8")'
RUN Rscript -e 'remotes::install_version("modeltime",upgrade="never", version = "1.2.4")'
RUN Rscript -e 'remotes::install_version("measurements",upgrade="never", version = "1.4.0")'
RUN Rscript -e 'remotes::install_version("mapedit",upgrade="never", version = "0.6.0")'
RUN Rscript -e 'remotes::install_version("leaflet.extras2",upgrade="never", version = "1.2.0")'
RUN Rscript -e 'remotes::install_version("kableExtra",upgrade="never", version = "1.3.4")'
RUN Rscript -e 'remotes::install_version("golem",upgrade="never", version = "0.3.5")'
RUN Rscript -e 'remotes::install_version("glmnet",upgrade="never", version = "4.1-6")'
RUN Rscript -e 'remotes::install_version("geojsonlint",upgrade="never", version = "0.4.0")'
RUN Rscript -e 'remotes::install_version("geojsonio",upgrade="never", version = "0.10.0")'
RUN Rscript -e 'remotes::install_version("earth",upgrade="never", version = "5.3.1")'
RUN Rscript -e 'remotes::install_version("climatol",upgrade="never", version = "3.1.2")'
RUN Rscript -e 'remotes::install_version("cicerone",upgrade="never", version = "1.0.4")'
RUN Rscript -e 'remotes::install_version("bs4Dash",upgrade="never", version = "2.1.0")'
RUN Rscript -e 'remotes::install_version("shiny.pwa",upgrade="never", version = "0.2.1")'
RUN Rscript -e 'remotes::install_version("httr",upgrade="never", version = "1.4.4")'
RUN Rscript -e 'remotes::install_version("jsonlite",upgrade="never", version = "1.8.4")'
RUN Rscript -e 'remotes::install_version("agroclim",upgrade="never", version = "0.3.0")'
RUN Rscript -e 'remotes::install_version("pollen",upgrade="never", version = "0.82.0")'
RUN Rscript -e 'remotes::install_github("rfortherestofus/pagedreport@ace07abe531009a3d675bfbb36c63adc20e3482f")'
RUN Rscript -e 'remotes::install_github("Appsilon/shiny.i18n@e11ea740994be5787066e29d4f9e17dee3772da5")'
RUN Rscript -e 'remotes::install_github("filipematias23/cleanRfield@ce8edc5ceaf3cd82f620702be965f623ff1951b0")'
RUN Rscript -e 'remotes::install_github("ropensci/skimr@4c48f8e1c7dd6f58c7eabf178fbbd1e664793591")'
RUN Rscript -e 'remotes::install_github("MichelNivard/gptstudio@055558509abdc7140ea9801140753be49e436d05")'
RUN Rscript -e 'install.packages("emayili")'
RUN Rscript -e 'install.packages("devtools")'
RUN R -e 'devtools::install_github("OpenDroneMap/FIELDimageR"); if (!library(FIELDimageR, logical.return=T)) quit(status=10);'
RUN mkdir /build_zone
ADD . /build_zone
WORKDIR /build_zone
RUN R -e 'options(warn = 2);remotes::install_local(upgrade="never")'
EXPOSE 587/tcp
EXPOSE 80
CMD R -e "options('shiny.port'=80,shiny.host='0.0.0.0');webapp4::run_app()"

And when i am checking if the package is installed with the following command

"if (!library(FIELDimageR, logical.return=T)) quit(status=10)"

I have the following error output

 Error: .onLoad failed in loadNamespace() for 'tcltk', details:
#107 183.3   call: dyn.load(file, DLLpath = DLLpath, ...)
#107 183.3   error: unable to load shared object '/usr/local/lib/R/library/tcltk/libs/tcltk.so':
#107 183.3   libtcl8.6.so: cannot open shared object file: No such file or directory
#107 183.3 Execution halted
#107 183.3 ERROR: lazy loading failed for package ‘misc3d’
#107 183.3 * removing ‘/usr/local/lib/R/site-library/misc3d’
#107 183.3 cat: plot3D.out: No such file or directory
#107 183.3 cat: ks.out: No such file or directory
#107 183.3 cat: spatialEco.out: No such file or directory
#107 183.3
#107 183.3 The downloaded source packages are in
#107 183.3      ‘/tmp/Rtmp84B6zK/downloaded_packages’
#107 183.5 * checking for file ‘/tmp/Rtmp84B6zK/remotes7692aef91/OpenDroneMap-FIELDimageR-c0a3f92/DESCRIPTION’ ... OK
#107 183.5 * preparing ‘FIELDimageR’:
#107 183.5 * checking DESCRIPTION meta-information ... OK
#107 183.6 * checking for LF line-endings in source and make files and shell scripts
#107 183.6 * checking for empty or unneeded directories
#107 183.6 Omitted ‘LazyData’ from DESCRIPTION
#107 183.6 * building ‘FIELDimageR_0.3.3.tar.gz’
#107 183.6
#107 183.6 Installing package into ‘/usr/local/lib/R/site-library’
#107 183.6 (as ‘lib’ is unspecified)
#107 183.8 ERROR: dependency ‘spatialEco’ is not available for package ‘FIELDimageR’
#107 183.8 * removing ‘/usr/local/lib/R/site-library/FIELDimageR’
#107 183.8 Warning messages:
#107 183.8 1: In i.p(...) : installation of one or more packages failed,
#107 183.8   probably ‘misc3d’, ‘plot3D’, ‘ks’, ‘spatialEco’
#107 183.8 2: In i.p(...) :
#107 183.8   installation of package ‘/tmp/Rtmp84B6zK/file74ef0e5a6/FIELDimageR_0.3.3.tar.gz’ had non-zero exit status
#107 183.8 Warning message:
#107 183.8 In library(FIELDimageR, logical.return = T) :
#107 183.8   there is no package called ‘FIELDimageR’
------
executor failed running [/bin/sh -c R -e 'devtools::install_github("OpenDroneMap/FIELDimageR"); if (!library(FIELDimageR, logical.return=T)) quit(status=10);']: exit code: 10

resolution and computing - EX1.Crop definition

Hey there,

as I was running the #11 resolution and computing script I received an error for the missing object EX1.Crop
by simply adding "EX1.Crop<-rast("EX1_RGB_HighResolution.tif")" I received: Error in if (raster::projection(fieldShape) != raster::projection(mosaic)) { : missing value, where TRUE/FALSE is requiered

would be awesome to hear your solution / how you got your script running

(same issue turns up in chapters 12 and 13)

thanks for your help upfront

When trying to install

The downloaded binary packages are in
C:\Users\astey\AppData\Local\Temp\RtmpmqcqSk\downloaded_packages
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file 'C:\Users\astey\AppData\Local\Temp\RtmpmqcqSk\remotes697433156bf\OpenDroneMap-FIELDimageR-9a8c4ab/DESCRIPTION' ...
─ preparing 'FIELDimageR':
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
Omitted 'LazyData' from DESCRIPTION
─ building 'FIELDimageR_0.3.3.tar.gz'

Installing package into ‘C:/Users/astey/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
ERROR: dependency 'spatialEco' is not available for package 'FIELDimageR'

  • removing 'C:/Users/astey/AppData/Local/R/win-library/4.3/FIELDimageR'
    Warning messages:
    1: package ‘spatialEco’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
2: In i.p(...) :
installation of package ‘C:/Users/astey/AppData/Local/Temp/RtmpmqcqSk/file6974701d7021/FIELDimageR_0.3.3.tar.gz’ had non-zero exit status

setwd("C:\Users\astey\Downloads\FIELDimageR-master.zip")
Error: '\U' used without hex digits in character string (:1:11)

n.cores option causing fieldRotate error

Hi,
I am new to UAV image processing and am working through simple steps in FIELDimageR to get the hang of it. The n.cores option, which I would like to be able to use with larger images, is creating a problem. Running this:

EX0 <- stack("mosaic0.jpg")
EX0.Rotated <- fieldRotate(mosaic = EX0, clockwise=TRUE, h=FALSE, fast.plot=TRUE, n.core=2)

Gives this error:
Error in file(fn, "rb") : cannot open the connection
In addition: Warning message:
In file(fn, "rb") :
cannot open file 'C:\Users\username\AppData\Local\Temp\Rtmp84cN89\raster\r_tmp_2022-03-23_174608_12732_49880.gri': No such file or directory

The same code runs fine without the n.core=2 option. Any idea how I can fix this?

Thanks!

Another Problem with FieldimageR installation

I'm trying to install FIELDimageR but i get this error everytime. I would be very gratefull if you could help me with this

devtools::install_github("OpenDroneMap/FIELDimageR")
Downloading GitHub repo OpenDroneMap/FIELDimageR@HEAD
✔ checking for file 'C:\Users\Lucas\AppData\Local\Temp\Rtmp0qy9B0\remotes1d7c43847052\OpenDroneMap-FIELDimageR-72de3eb/DESCRIPTION' ...
─ preparing 'FIELDimageR':
✔ checking DESCRIPTION meta-information ...
Warning: fieldAUC.Rd:30: unknown macro '\times'
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
Omitted 'LazyData' from DESCRIPTION
─ building 'FIELDimageR_0.6.1.tar.gz'

Installing package into ‘C:/Users/Lucas/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)

  • installing source package 'FIELDimageR' ...
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    there is no package called 'dplyr'
    Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
    Ejecución interrumpida
    ERROR: lazy loading failed for package 'FIELDimageR'
  • removing 'C:/Users/Lucas/AppData/Local/R/win-library/4.3/FIELDimageR'
    Warning message:
    In i.p(...) :
    installation of package ‘C:/Users/Lucas/AppData/Local/Temp/Rtmp0qy9B0/file1d7c1fa311f3/FIELDimageR_0.6.1.tar.gz’ had non-zero exit status

fieldArea

Hi dear Filipe,
Happy new year!

I was trying to use the function fieldArea and noticed that the ID order of the objects don't match so the cbind does not work here. What I did was to include this (fieldShape <- arrange(fieldShape, ID)) in the function to fix it, but it guess you have a better way to do it.

imagen

Thank you for developing this amazing package!
Johan

Maintenance ways between plots

Hello,
the solution is the best an this time and very user-friendly. I have a question about how to deal with maintenance ways between the plots. We have such fields with plots and ways for our tractors. The ways are regulary but smaller than a plot. Is it possible to exclude ways from calculation ?

Thanks in advance for an answer

"spatialEco" ERROR during install

Below is the code i used to install the package and i get the error "dependency 'spactialEco'. What can I do to fix this? I also tried installing from github using devtools with no success.

setwd("C:/R/FIELDimageR") # ~ is the path from where you saved the file.zip
unzip("FIELDimageR-master.zip")
file.rename("FIELDimageR-master", "FIELDimageR")
shell("R CMD build FIELDimageR") # or system("R CMD build FIELDimageR")
install.packages("FIELDimageR_0.3.3.tar.gz", repos = NULL, type="source") # Make sure to use the right version (e.g. 0.3.2)
unzip("FIELDimageR_0.3.3.tar.gz")

install.packages("FIELDimageR_0.3.3.tar.gz", repos = NULL, type="source") # Make sure to use the right version (e.g. 0.3.2)
ERROR: dependency 'spatialEco' is not available for package 'FIELDimageR'

  • removing 'C:/Users/benlopez/AppData/Local/Programs/R/R-4.3.1/library/FIELDimageR'
    Warning in install.packages :
    installation of package ‘FIELDimageR_0.3.3.tar.gz’ had non-zero exit status

Problem in Section 9

Hi Filipe,

When I am using EX1.Shape<- fieldInfo_extra(mosaic = CHVM$newMosaic$height,
fieldShape = EX1.Shape,
fun=mean)
script, it showed Error in match(x, table, nomatch = 0L) : 'match' requires vector arguments. And I tried to run fieldshape and set it again, but still got this problem. Could you tell me how to solve this promblem?

Thank you,
COCO

Modifying fieldIndex to add more VIs

Hi @filipematias23,
I added more VIs to the Indices.txt file used to run the fieldIndex function.

image

When i run this code;
X.Indices2 <- fieldIndex2(X.RemSoil$newMosaic,Red=1,Green=2,Blue=3,RedEdge=4,NIR=5,
index = c("NDVI","NDRE", "BI", "SCI", "GLI", "HI","NGRDI", "SI", "VARI", "HUE", "BGI", "PSRI", "GNDVI",
"RVI", "TVI", "CVI", "CIG", "CIRE", "DVI", "EVI", "GDVI","GLI","GOSAVI","GRVI", "GEMI","GARI"
,"GSAVI","IPVI","LAI", "MNLI","MSAVI2","MSR","NLI","OSAVI","RDVI","SAVI","TDVI","VARI","WDRVI","SR"))

I get an error: Error in eval(parse(text = as.character(Ind$eq[as.character(Ind$index) == :
object 'EVI' not found
In addition: Warning messages:
1: In for (f in 1:length(filename)) { :
closing unused connection 4 (C:/Users/pjjagwe/AppData/Local/Temp/RtmpaOFv1e/raster/r_tmp_2023-08-25_181651.200041_16852_88055.gri)
2: In for (f in 1:length(filename)) { :
closing unused connection 3 (C:/Users/pjjagwe/AppData/Local/Temp/RtmpaOFv1e/raster/r_tmp_2023-08-25_180154.128608_16852_62923.gri)

Installation

I have tried installing FIELDimageR but keep this error message. Can anyone here help me? Thanks

devtools::install_github("OpenDroneMap/FIELDimageR")
Downloading GitHub repo OpenDroneMap/FIELDimageR@HEAD
Skipping 1 packages not available: rgdal
── R CMD build ───────────────────────────────────────────────────────────────────────────────

checking for file 'C:\Users\pakiina\AppData\Local\Temp\RtmpSmfFBu\remotes7a03b55da7\OpenDroneMap-FIELDimageR-093d6cc/DESCRIPTION' ...

checking for file 'C:\Users\pakiina\AppData\Local\Temp\RtmpSmfFBu\remotes7a03b55da7\OpenDroneMap-FIELDimageR-093d6cc/DESCRIPTION' ...

✔ checking for file 'C:\Users\pakiina\AppData\Local\Temp\RtmpSmfFBu\remotes7a03b55da7\OpenDroneMap-FIELDimageR-093d6cc/DESCRIPTION'

─ preparing 'FIELDimageR':
checking DESCRIPTION meta-information ...

checking DESCRIPTION meta-information ...

✔ checking DESCRIPTION meta-information

Warning:

Warning: fieldAUC.Rd:30: unknown macro '\times'

─ checking for LF line-endings in source and make files and shell scripts

─ checking for empty or unneeded directories

Omitted 'LazyData' from DESCRIPTION

─ building 'FIELDimageR_0.4.0.tar.gz'

ERROR: dependency 'rgdal' is not available for package 'FIELDimageR'

  • removing 'C:/Users/pakiina/AppData/Local/Programs/R/R-4.3.1/library/FIELDimageR'
    Warning message:
    In i.p(...) :
    installation of package ‘C:/Users/pakiina/AppData/Local/Temp/RtmpSmfFBu/file7a072452643/FIELDimageR_0.4.0.tar.gz’ had non-zero exit status

Add FIELDimageR Plugin to QGIS

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.

  • is anyone in this community familiar with QGIS plugin development and interested in helping?
  • who are some users actively using the functionality (and interested in using QGIS) who can help review and guide the implementation?

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:

  • Most important:
    • what are key features / functions that should have a plugin?
    • For each one, what are inputs and outputs? What is the priority?
  • where should the repository be maintained?

Error: Failed to install 'unknown package' from GitHub:

I managed to install the following;

install.packages("leafsync") install.packages("caret") install.packages("leafem") install.packages("mapedit") install.packages("stars")
However after the installation of all this upon trying the installation of the devtools::install_github("filipematias23/FIELDimageR.Extra")
A new error came up `Error: Failed to install 'unknown package' from GitHub:
HTTP error 403.
API rate limit exceeded for 41.89.227.171. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

Rate limit remaining: 0/60
Rate limit reset at: 2023-11-21 11:27:51 UTC

To increase your GitHub API rate limit

  • Use usethis::create_github_token() to create a Personal Access Token.
  • Use usethis::edit_r_environ() and add the token as GITHUB_PAT.`

To avoid encountering of these errors I had to restart by Rstudio and re install all the libraries as follows:

install.packages("devtools") devtools::install_github("OpenDroneMap/FIELDimageR") install.packages("leafsync") install.packages("caret") install.packages("leafem") install.packages("mapedit") install.packages("stars") devtools::install_github("filipematias23/FIELDimageR.Extra")

Problems with FIELDImageR Installation

I need help with the installation of FIELDimage package.

I followed all the instructions and I could download everything, unfortunately today I was unable to run FIELDimageR and I had to remove all the packages related to it.

Now, I’m trying to download everything and it appears the following messages with DEVTOOLS:

devtools::install_github(“OpenDroneMap/FIELDimageR”)
devtools::install_github(“filipematias23/FIELDimageR”)

ERROR: dependency ‘EBImage’ is not available for package ‘FIELDimageR’

removing ‘C:/Users/Maggie/AppData/Local/R/win-library/4.3/FIELDimageR’
Warning message:
In i.p(…) :
installation of package ‘C:/Users/Maggie/AppData/Local/Temp/Rtmpwn6zds/file22cc5f8f3d78/FIELDimageR_0.6.0.tar.gz’ had non-zero exit status
In the other site, when I try to install: FIELDimageR_0.6.0.tar.gz (FIELDimageR_0.1.6) and (FIELDimageR_0.4.1) appears the following message:

install.packages(“FIELDimageR_0.6.0.tar.gz”, repos = NULL, type=“source”)

Installing package into ‘C:/Users/Maggie/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
ERROR: dependency ‘EBImage’ is not available for package ‘FIELDimageR’

removing ‘C:/Users/Maggie/AppData/Local/R/win-library/4.3/FIELDimageR’
Warning in install.packages :
installation of package ‘FIELDimageR_0.6.0.tar.gz’ had non-zero exit status

Even devtools is givin problems, unable to download it.

I’m still working on it. I tried with several R versions and even downloaded LINUX MINT in order to work with DOCKER. But I’m at home right now and my internet is not soo good. When I come back to the lab I’ll work on it, but I’m seriously looking for other options, because that package had given a lot of problems to many people. It is an excellent job but unfortunately it’s unsustainable to work like that.

Got problem in Uploading .jpeg in section 6

Hi there

When I followed EX.P<-rast("EX_Pollen.jpeg") sentence, it showed "Warning message: [rast] unknown extent". Does it mean raster do not support .jpeg? and what should I do if I still want to count the number.

Thanks

The map selection point always moves

Hello, I just started to use the FILDimageR package, I encountered a very critical problem, in the loaded image to select the point operation, the calibration point is always automatically moved, tried a lot of methods are still not resolved, I see that in the past there is a similar problem has been raised, and tried to try the solution is still not resolved, I hope that someone to help me, it's very important for me to come to the water!

dependencies error

Hi,
Its probably something that I am overlooking (Its been a few years since I used R). When I entered the code install.packages("FIELDimageR_........ I get this error message:

ERROR: dependencies 'EBImage', 'attempt', 'config', 'DT', 'fftwtools', 'git2r', 'maptools', 'DescTools', 'raster', 'rgdal', 'scales', 'sp', 'foreach', 'doParallel', 'plyr', 'spatialEco' are not available for package 'FIELDimageR'

Would greatly appreciate any suggestions.
Yours most confused

Use `withr::local_par` to set graphical parameters

Hi,

Would you consider using withr::local_par to set the graphical parameters?

The current code sets the graphical windows to par(mfrow = c(1, 1)) at the end of functions. However, this line of code won't be executed if the functions exit prematurely. It also forcibly set the user's graphical windows to c(1, 1) which might not be desirable.

withr::local_par will only set the parameters in the local scope and revert the parameters back to its original state whenever functions stop running.

EX1.Shape$fieldShapeGIS does not have a CRS

When following the examples in the README, I found I was not able to transform EX1.Shape$fieldShapeGIS to a Lat-Long coordinate system due to a lack of CRS. I found a CRS on EX1.Shape$fieldShape and was able to assign that, perform the translation, and export the GeoJSON of EX1.Shape$fieldShapeGIS

It would be nice to have the CRS automatically assigned to EX1.Shape$fieldShapeGIS

SpacialEco requierment

Is there a fix for the SpatialEco requirement yet?

ERROR: dependency 'spatialEco' is not available for package 'FIELDimageR'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.