An object of class SpatRaster with values 0 and
1. This layer masks pixels that are very likely pure sky pixels.
Arguments
r
SpatRaster. A normalized greyscale image. Typically, the
blue channel extracted from a canopy photograph. Please see read_caim()
and normalize().
z
SpatRaster built with zenith_image().
a
SpatRaster built with azimuth_image().
sample_size_pct
Numeric vector of length one. Minimum percentage of
cells to sample. The population is comprised of 1296 cells of \(5 \times
5\) degrees.
Details
This function assumes that:
there is at least one pure sky pixel at the level of cells of \(30
\times 30\) degrees, and
sky pixels have a digital number (DN) greater than canopy pixels have.
For each \(30 \times 30\) cell, this method computes a quantile value and
uses it as a threshold to select the pure sky pixels from the given cell. As
a result, a binarized image is produced in a regional binarization fashion
(regional_thresholding()). This process starts with a quantile
probability of 0.99. After producing the binarized image, this function uses
a search grid with cells of \(5 \times 5\) degrees to count how many of
these cells have at least one sky pixel (pixels equal to one in the binarized
image). If the percentage of cells with sky pixels does not reach argument
sample_size_pct, it goes back to the binarization step but decreasing
the probability by 0.01 points.
If probability reach 0.9 and the sample_size_pct criterion were not
yet satisfied, the sample_size_pct is decreased one percent and the
process starts all over again.