extract_rl: Extract relative luminance

View source: R/extract_rl.R

extract_rlR Documentation

Extract relative luminance

Description

Extract the luminance relative to the zenith digital number.

Usage

extract_rl(
  r,
  z,
  a,
  sky_points,
  no_of_points = 20,
  z_thr = 2,
  use_window = TRUE
)

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.

sky_points

An object of class data.frame. The result of a call to extract_sky_points. As an alternative, both ImageJ and HSP software package \insertCiteLang2013rcaiman can be used to manually digitize points. See extract_dn and read_manual_input for details.

no_of_points

Numeric vector on length one. The number of near-zenith points required for the estimation of the zenith DN.

z_thr

Numeric vector on length one. The starting maximum zenith angle used to search for near-zenith points.

use_window

Logical vector of length one. If TRUE, a 3 \times 3 window will be used to extract the sky digital number from r.

Details

The search for near-zenith points starts in the region ranged between 0 and z_thr. If the number of near-zenith points is less than no_of_points, the region increases by steps of 2 degrees of zenith angle till the required number of points is reached.

Value

A list of three objects, zenith_dn and max_zenith_angle from the class numeric, and sky_points from the class data.frame; zenith_dn is the estimated zenith digital number, max_zenith_angle is the maximum zenith angle reached in the search for near-zenith sky points, and sky_points is the input argument sky_points with the additional columns: a, z, dn, and rl, which stand for azimuth and zenith angle in degrees, digital number, and relative luminance, respectively. If NULL is provided as no_of_points, then zenith_dn is forced to one and dn, and rl are equals.

References

\insertAllCited

See Also

Other Tool Functions: colorfulness(), defuzzify(), extract_dn(), extract_feature(), extract_sky_points(), masking(), read_bin(), read_caim(), write_bin(), write_caim()

Examples

## Not run: 
path <- system.file("external/DSCN4500.JPG", package = "rcaiman")
caim <- read_caim(path, c(1280, 960) - 745, 745 * 2, 745 * 2)
z <- zenith_image(ncol(caim), lens("Nikon_FCE9"))
a <- azimuth_image(z)
r <- gbc(caim$Blue)
g <- sky_grid_segmentation(z, a, 10)
bin <- find_sky_pixels(r, z, a)
sky_points <- extract_sky_points(r, bin, g)
rl <- extract_rl(r, z, a, sky_points, 1)

## End(Not run)

rcaiman documentation built on May 31, 2023, 7:35 p.m.

Related to extract_rl in rcaiman...