View source: R/vicinity_filter.R
vicinity_filter | R Documentation |
Filters out nearby points based on a minimum distance threshold in either planar (image space) or spherical (sky coordinates) systems.
vicinity_filter(
sky_points,
r = NULL,
z = NULL,
a = NULL,
min_dist = 3,
use_window = TRUE
)
sky_points |
The output of |
r |
SpatRaster or |
z |
SpatRaster built with |
a |
SpatRaster built with |
min_dist |
Numeric vector of length one. Minimum allowed distance
between points. In degrees for spherical space or pixels for planar space.
What space is used depend on the arguments |
use_window |
Logical vector of length one. If |
This function selects a subset of spatial points ensuring that no selected
points are closer than min_dist
. Optionally, it can prioritize retention of
points with high values in a specific dimension such as image digital number.
The argument sky_points
with fewer rows due to the removal of
points closer each other than min_dist
.
Other Tool Functions:
calc_oor_index()
,
calc_spherical_distance()
,
colorfulness()
,
correct_vignetting()
,
defuzzify()
,
display_caim()
,
extract_dn()
,
extract_feature()
,
extract_rel_radiance()
,
extract_sky_points()
,
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()
,
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")
bin <- bin & select_sky_vault_region(z, 0, 80)
g <- sky_grid_segmentation(z, a, 5, first_ring_different = TRUE)
sky_points <- extract_sky_points(r, bin, g,
dist_to_black = 3)
sky_points_p <- vicinity_filter(sky_points, r, min_dist = 100)
plot(r)
points(sky_points$col, nrow(caim) - sky_points$row, col = 2, pch = 10)
points(sky_points_p$col, nrow(caim) - sky_points_p$row, col = 3, pch = 0)
sky_points_s <- vicinity_filter(sky_points, r, z, a, min_dist = 30)
plot(r)
points(sky_points$col, nrow(caim) - sky_points$row, col = 2, pch = 10)
points(sky_points_s$col, nrow(caim) - sky_points_s$row, col = 3, pch = 0)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.