regional_thresholding {rcaiman}R Documentation

Regional thresholding

Description

Regional thresholding of greyscale images.

Usage

regional_thresholding(
  r,
  segmentation,
  method,
  intercept = NULL,
  slope = NULL,
  prob = NULL
)

Arguments

r

SpatRaster. A normalized greyscale image. Typically, the blue channel extracted from a canopy photograph. Please see read_caim() and normalize().

segmentation

SpatRaster. The result of segmenting r. Arguably, the result of a call to rings_segmentation() will be the preferred choice for fisheye images.

method

Character vector of length one. See details for current options.

intercept, slope

Numeric vector of length one. These are linear function coefficients.

prob

Numeric vector of length one. Probability for stats::quantile() calculation.

Details

Methods currently implemented are:

Value

An object of class SpatRaster with values 0 and 1.

References

Díaz GM, Lencinas JD (2018). “Model-based local thresholding for canopy hemispherical photography.” Canadian Journal of Forest Research, 48(10), 1204–1216. doi:10.1139/cjfr-2018-0006.

Jonckheere I, Nackaerts K, Muys B, Coppin P (2005). “Assessment of automatic gap fraction estimation of forests from digital hemispherical photography.” Agricultural and Forest Meteorology, 132(1-2), 96–114. doi:10.1016/j.agrformet.2005.06.003.

Ridler TW, Calvard S (1978). “Picture thresholding using an iterative selection method.” IEEE Transactions on Systems, Man, and Cybernetics, 8(8), 630–632. doi:10.1109/tsmc.1978.4310039.

See Also

Other Binarization Functions: apply_thr(), obia(), ootb_mblt(), ootb_obia(), thr_isodata(), thr_mblt()

Examples

## Not run: 
path <- system.file("external/DSCN4500.JPG", package = "rcaiman")
caim <- read_caim(path, c(1250, 1020) - 745, 745 * 2, 745 * 2)
z <- zenith_image(ncol(caim), lens("Nikon_FCE9"))
r <- gbc(caim$Blue)
r <- correct_vignetting(r, z, c(0.0638, -0.101)) %>% normalize()
rings <- rings_segmentation(z, 15)
bin <- regional_thresholding(r, rings, "Diaz2018", -7.8, 0.95 * 0.5, 0.99)
plot(bin)
bin <- regional_thresholding(r, rings, "thr_isodata")
plot(bin)
#' 
## End(Not run)

[Package rcaiman version 1.2.2 Index]