fit_coneshaped_model {rcaiman}R Documentation

Fit cone-shaped model

Description

Statistical modeling for predicting digital numbers from spherical coordinates.

Usage

fit_coneshaped_model(sky_points, use_azimuth_angle = TRUE)

Arguments

sky_points

The data.frame returned by extract_rl() or a data.frame with same structure and names.

use_azimuth_angle

Logical vector of length one. If TRUE, the Equation 4 from Díaz and Lencinas (2018)) is used: sDN=a+bθ+cθ2+dsin(ϕ)+ecos(ϕ)sDN = a + b \cdot \theta + c \cdot \theta^2 + d \cdot sin(\phi) + e \cdot cos(\phi), where sDNsDN is sky digital number, a,b,c,da,b,c,d and ee are coefficients, θ\theta is zenith angle, and ϕ\phi is azimuth angle. If FALSE, the next simplified version based on Wagner (2001) is used: sDN=a+bθ+cθ2sDN = a + b \cdot \theta + c \cdot \theta^2.

Details

This method was presented in Díaz and Lencinas (2018), under the heading Estimation of the sky DN as a previous step for our method. If you use this function in your research, please cite that paper in addition to this package (⁠citation("rcaiman"⁠).

Value

A list of two objects, one of class function and the other of class lm (see stats::lm()). If the fitting fails, it returns NULL. The function requires two arguments–zenith and azimuth in degrees–to return relative luminance.

References

Díaz GM, Lencinas JD (2018). “Model-based local thresholding for canopy hemispherical photography.” Canadian Journal of Forest Research, 48(10), 1204–1216. doi:10.1139/cjfr-2018-0006.

Wagner S (2001). “Relative radiance measurements and zenith angle dependent segmentation in hemispherical photography.” Agricultural and Forest Meteorology, 107(2), 103–115. doi:10.1016/s0168-1923(00)00232-x.

See Also

thr_mblt()

Other Sky Reconstruction Functions: cie_sky_model_raster(), fit_cie_sky_model(), fit_trend_surface(), fix_reconstructed_sky(), interpolate_sky_points(), ootb_sky_reconstruction()

Examples

## Not run: 
path <- system.file("external/DSCN4500.JPG", package = "rcaiman")
caim <- read_caim(path, c(1250, 1020) - 745, 745 * 2, 745 * 2)
z <- zenith_image(ncol(caim), lens("Nikon_FCE9"))
a <- azimuth_image(z)
r <- gbc(caim$Blue)

sky_points <- extract_rl(r, z, a, extract_sky_points_simple(r, z, a),
                         NULL,
                         use_window = FALSE)#this is important when
                                            #extract_sky_points_simple()
                                            #is used
model <- fit_coneshaped_model(sky_points$sky_points)
summary(model$model)
sky_cs <- model$fun(z, a)
plot(r/sky_cs)
plot(sky_cs)

z <- zenith_image(50, lens())
a <- azimuth_image(z)
sky_cs <- model$fun(z, a)
persp(sky_cs, theta = 90, phi = 20)

## End(Not run)

[Package rcaiman version 1.2.2 Index]