thr_mblt: Compute model-based thresholds

thr_mbltR Documentation

Compute model-based thresholds

Description

Compute threshold values from background digital numbers (DN) using Equation 1 in \insertCiteDiaz2018;textualrcaiman, a linear function whose slope can be weighted.

Usage

thr_mblt(dn, intercept, slope)

Arguments

dn

numeric vector or terra::SpatRaster. Background digital number. Values must be normalized; if taken from JPEG, apply gamma back correction.

intercept, slope

numeric vectors of length one. Linear coefficients.

Details

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 \insertCiteDiaz2018;textualrcaiman). This shifted the goal from estimating an optimal threshold \insertCiteSong2014;textualrcaiman to estimating the background DN as if the canopy were absent, as proposed by \insertCiteLang2010;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.

Value

An object of the same class and dimensions as dn.

Note

Users are encouraged to acquire raw files (see read_caim_raw()).

References

\insertAllCited

See Also

normalize_minmax(), invert_gamma_correction()

Examples

thr_mblt(invert_gamma_correction(125), -7.8, 0.95 * 0.5)

rcaiman documentation built on Sept. 9, 2025, 5:42 p.m.