Transform background digital number into threshold values
thr_mblt(dn, intercept, slope)
An object of the same class and dimensions than dn
.
Numeric vector or SpatRaster. Digital number of the background. These values should be normalized and, if they are extracted from a JPEG image, gamma back corrected.
Numeric vector of length one. These are linear function coefficients.
This function transforms background digital numbers into threshold values by
means of the Equation 1 from Diaz2018;textualrcaiman, which is
a linear function with the slope modified by a weighting parameter. This
simple function was found by studying canopy models, also known as targets,
which are perforated surfaces made of a rigid and dark material . These
models were backlighted with homogeneous lighting, photographed with a Nikon
Coolpix 5700 set to acquire in JPEG format, and those images were gamma back
corrected with a default gamma value equal to 2.2 (see gbc()
). Results
shown that the optimal threshold value was linearly related with the
background digital number (see Figure 1 and Figure 7 from
Diaz2018;textualrcaiman). This shifted the aim from finding
the optimal threshold, following Song2014;textualrcaiman
method, to obtaining the background DN as if the canopy was not there, as
Lang2010;textualrcaiman proposed.
Diaz2018;textualrcaiman observed the following linear relationship between the background value, usually the sky digital number (SDN), and the optimal threshold value (OTV):
\(IV = a + b \cdot SDN\) | (Equation 1a) |
\(OTV = a + b \cdot w \cdot SDN\) | (Equation 1b) |
were IV is the initial value Wagner2001rcaiman, which is the boundary between SDN and the mixed pixels, i.e, the pixels that are neither Gap or Non-gap Macfarlane2011rcaiman, \(a\) and \(b\) are the intercept and slope coefficients, respectively, and \(w\) is a weighting parameter that takes into account that OTV is always lower than IV. If SDN is calculated at the pixel level, a local thresholding method can be applied by evaluating, pixel by pixel, if the below canopy digital number (CDN) is greater than the OTV. Formally, If \(CDN>OTV\), then assign Gap class, else assign Non-gap class.
This conclusion drawn from an image processing point of view matches with previous findings drawn from a radiometric measurement paradigm, which are introduced next.
Cescatti2007;textualrcaiman posed that cameras can be used as a radiation measurement device if they are properly calibrated. This method, denominated by the author as LinearRatio, seeks to obtain the transmittance (T) as the ratio of below to above canopy radiation:
\(T = CDN/SDN\) | (Equation 2) |
were CDN is below canopy digital number (DN), i.e., the DN extracted from a canopy hemispherical photograph.
The LinearRatio method uses T as a proxy for gap fraction. It requires twin cameras, one below and the other above the canopy. In contrast, Lang2010;textualrcaiman proposed to obtain SDN by manually selecting pure sky pixels from canopy hemispherical photographs and reconstructing the whole sky by subsequent modeling and interpolating---this method is often referred to as LinearRatio single camera or LinearRatioSC.
Equation 2 can be seen as a standardization of the distance between CDN and SDN. With that in mind, it is useful to rewrite Equation 1b as an inequality that can be evaluated to return a logical statement that is directly translated into the desired binary classification:
\(CDN > a + b \cdot w \cdot SDN\) | (Equation 3) |
Then, combining Equation 2 and 3, we find that Diaz2018;textualrcaiman parameters can be applied to T:
\(CDN/SDN > a + b \cdot w \cdot SDN/SDN\) | (Equation 4a) |
\(T > a + b \cdot w\) | (Equation 4b) |
From Equation 2 it is evident that any bias introduced by the camera optical and electronic system will be canceled during the calculation of T as long as only one camera is involved. Therefore, After examining Equation 4b, we can conclude that intercept 0 and slope 1 are theoretically correct.In addition, the w parameter can be used to filter out mixed pixels. The greater w, the greater the possibility of selecting pure sky pixels.
normalize()
, gbc()
, apply_thr()
and regional_thresholding()
.
Other Binarization Functions:
apply_thr()
,
obia()
,
ootb_mblt()
,
ootb_obia()
,
regional_thresholding()
,
thr_isodata()
thr_mblt(gbc(125), -7.8, 0.95 * 0.5)
Run the code above in your browser using DataLab