calc_co | R Documentation |
Calculate canopy openness
calc_co(bin, z, a, m = NULL, angle_width = 10)
bin |
SpatRaster. Binarized hemispherical canopy image. |
z |
SpatRaster built with |
a |
SpatRaster built with |
m |
SpatRaster. A mask. For hemispherical photographs,
check |
angle_width |
Numeric vector of length one. It should be |
Canopy openness calculated as in the equation from \insertCiteGonsamo2011;textualrcaiman:
CO = \sum_{i = 1}^{N} GF(\phi_i, \theta_i) \cdot [(cos(\theta_1) -
cos(\theta_2))/n]
,
where GF(\phi_i, \theta_i)
is the gap fraction of the cell i
,
\theta_1
and \theta_2
are the minimum and maximum zenith angle of
the cell i
, n
is the number of cells on the ring delimited by
\theta_1
and \theta_2
, and N
is the total number of cells.
When a mask is applied using the m
argument, the equation is adjusted to
account for the reduced portion of the image that contributes to the
calculation:
\frac{
CO = \sum_{i = 1}^{N} GF(\phi_i, \theta_i) \cdot [(cos(\theta_1) -
cos(\theta_2))/n]
}{ \sum_{i = 1}^{N} (cos(\theta_1) - cos(\theta_2))/n}
.
The denominator ensures that the canopy openness remains correctly scaled even when part of the image is masked. Without this normalization, the total openness could be underestimated since the summation in the numerator will be one only when the full hemisphere of an totally unobstructed image is included. Therefore, masking requires the normalization provided by the denominator.
Numeric vector of length one.
caim <- read_caim()
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
m <- select_sky_vault_region(z, 0, 70)
bin <- apply_thr(caim$Blue, thr_isodata(caim$Blue[m]))
plot(bin)
calc_co(bin, z, a, m, 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.