View source: R/extract_sky_points.R
extract_sky_points | R Documentation |
Extract sky points for model fitting
extract_sky_points(r, bin, g, dist_to_black = 3)
r |
SpatRaster. A normalized greyscale image. Typically, the
blue channel extracted from a canopy photograph. Please see |
bin |
SpatRaster. This should be a preliminary binarization of
|
g |
SpatRaster built with |
dist_to_black |
Numeric vector of length one or |
This function will automatically sample sky pixels from the sky regions
delimited by bin
. The density and distribution of the sampling points is
controlled by the arguments g
and dist_to_black
.
As the first step, sky pixels from r
are evaluated to find the pixel with
maximum digital value per cell of the g
argument. The dist_to_black
argument allows users to establish a buffer zone for bin
, meaning a size
reduction of the original sky regions.
An object of the class data.frame with two columns named row and col.
fit_cie_sky_model()
Other Tool Functions:
calc_oor_index()
,
calc_spherical_distance()
,
colorfulness()
,
correct_vignetting()
,
defuzzify()
,
display_caim()
,
extract_dn()
,
extract_feature()
,
extract_rel_radiance()
,
extract_sun_coord()
,
find_sky_pixels()
,
masking()
,
optim_dist_to_black()
,
optim_normalize()
,
percentage_of_clipped_highlights()
,
read_bin()
,
read_caim()
,
read_caim_raw()
,
read_ootb_sky_model()
,
sor_filter()
,
vicinity_filter()
,
write_bin()
,
write_caim()
,
write_ootb_sky_model()
## Not run:
caim <- read_caim()
r <- caim$Blue
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
m <- !is.na(z)
bin <- regional_thresholding(r, rings_segmentation(z, 30),
method = "thr_isodata")
mx <- optim_normalize(caim, bin)
caim <- normalize_minmax(caim, 0, mx, TRUE)
plotRGB(caim*255)
sky_blue <- polarLAB(50, 17, 293)
ecaim <- enhance_caim(caim, m, sky_blue = sky_blue)
bin <- apply_thr(ecaim, thr_isodata(ecaim[m]))
g <- sky_grid_segmentation(z, a, 10)
sky_points <- extract_sky_points(r, bin, g,
dist_to_black = 3)
plot(bin)
points(sky_points$col, nrow(caim) - sky_points$row, col = 2, pch = 10)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.