View source: R/fit_trend_surface.R
fit_trend_surface | R Documentation |
Fit a trend surface using spatial::surf.ls()
as workhorse function.
fit_trend_surface(r, z, a, bin, filling_source = NULL, np = 6)
r |
SpatRaster. A normalized greyscale image. Typically, the
blue channel extracted from a canopy photograph. Please see |
z |
SpatRaster built with |
a |
SpatRaster built with |
bin |
SpatRaster. This should be a preliminary binarization of
|
filling_source |
SpatRaster. An actual or reconstructed
above-canopy image to complement the sky pixels detected through the gaps
of |
np |
degree of polynomial surface |
This function is meant to be used after fit_coneshaped_model()
.
This method was presented in \insertCiteDiaz2018;textualrcaiman, 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"
).
A list with an object of class SpatRaster and of class trls
(see spatial::surf.ls()
).
If an incomplete above-canopy image is available as filling source,
non-sky pixels should be turned NA
or they will be erroneously considered
as sky pixels.
thr_mblt()
Other Sky Reconstruction Functions:
cie_sky_image()
,
fit_cie_sky_model()
,
fit_coneshaped_model()
,
interpolate_sky_points()
,
ootb_fit_cie_sky_model()
,
ootb_interpolate_and_merge()
## 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)
r <- correct_vignetting(r, z, c(0.0638, -0.101)) %>% normalize_minmax()
bin <- regional_thresholding(r, rings_segmentation(z, 30), "thr_isodata")
bin <- bin & select_sky_vault_region(z, 0, 80)
sky_points <- extract_sky_points(r, bin, sky_grid_segmentation(z, a, 3))
sky_points <- extract_rel_radiance(r, z, a, sky_points, no_of_points = NULL)
model <- fit_coneshaped_model(sky_points$sky_points)
summary(model$model)
sky_cs <- model$fun(z, a)
plot(sky_cs)
plot(r/sky_cs)
sky_s <- fit_trend_surface(r, z, a, bin, sky_cs)$image
plot(sky_s)
plot(r/sky_s)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.