Compute threshold values from background digital numbers (DN) using Equation 1 in Diaz2018;textualrcaiman, a linear function whose slope can be weighted.
thr_mblt(dn, intercept, slope)An object of the same class and dimensions as dn.
numeric vector or terra::SpatRaster. Background digital number. Values must be normalized; if taken from JPEG, apply gamma back correction.
numeric vectors of length one. Linear coefficients.
The model was derived from canopy targets (perforated, rigid, dark
surfaces) backlit under homogeneous illumination, photographed with a
Nikon Coolpix 5700 in JPEG mode. Images were gamma-back-corrected with
a default gamma of 2.2 (see invert_gamma_correction()). Results showed that the optimal
threshold is linearly related to the background DN (see Figures 1 and 7
in Diaz2018;textualrcaiman). This shifted the goal from
estimating an optimal threshold Song2014;textualrcaiman to
estimating the background DN as if the canopy were absent, as proposed by
Lang2010;textualrcaiman.
To apply the weighting parameter (w) from Equation 1, supply slope as
\(slope \times w\).
Equation 1 was developed with 8-bit images. New coefficients should be
calibrated in the 0–255 domain, which is what thr_mblt() expects, even
though the dn argument must be normalized. This design choice harmonizes
behavior across the package.
normalize_minmax(), invert_gamma_correction()
thr_mblt(invert_gamma_correction(125), -7.8, 0.95 * 0.5)
Run the code above in your browser using DataLab