Skip to contents
library(duflor)
#> Attaching duflor version 1.0.1 from library C:/Users/Claudius Main/AppData/Local/R/cache/R/renv/library/duflor-1030851c/windows/R-4.4/x86_64-w64-mingw32.

To quantify areas in an image, a general workflow can be accomplished by a different (set of) functions:

  1. Load the image as a cImg-array. (load_image())
  2. Define the HSV-spectra to quantify. (You may either define them yourself, or modify default-spectra loaded by spectrums <- getOption("duflor.default_hsv_spectrums"))
  3. Quantify pixels whose HSV-values fall within each spectrum defined above. (extract_pixels_HSV()/[rectangularRange_HSV_iteronce_cpp(),rectangularRange_HSV_cpp(),rectangularRange_HSV()]1)
  4. Convert the number of pixels into an area based on a known calibration-area (convert_pixels_to_area())

The alternative (and suggested) solution is to use the shiny front-end to the workflow provided above via the package duflor.gui.