unimodal_threshold: Binarize an image between sky and vegetation pixels

Description Usage Arguments Value References See Also Examples

View source: R/utils.R

Description

This functions applies the histogram-based unimodal thresholding method

Usage

1

Arguments

img

A raster object with a single (blue) band.

Value

A raster object, where sky pixels are 0 and vegetation pixels are 1.

References

Macfarlane, C. (2011). Classification method of mixed pixels does not affect canopy metrics from digital images of forest overstorey. Agricultural and Forest Meteorology, 151(7), 833-840.

See Also

gap_fraction LAI_from_gf_at_57

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(raster)
file_path = system.file("extdata", "IMG_7595.JPG", package = "LAI")

# View the original image
plotRGB(
  brick(file_path),
  asp = 1
)

# View the binarized image
plot(
  unimodal_threshold(
    raster(file_path, band = 3)
  )
  ,useRaster = TRUE
  ,asp = 1
)

cmartin/LAI documentation built on May 13, 2019, 8:23 p.m.