sky_grid_segmentation {rcaiman} | R Documentation |
Do sky grid segmentation
Description
Segment the hemisphere view into segments of equal angular resolution for both zenith and azimuth angles.
Usage
sky_grid_segmentation(z, a, angle_width, sequential = FALSE)
Arguments
z |
SpatRaster built with |
a |
SpatRaster built with |
angle_width |
Numeric vector of length one. It should be |
sequential |
Logical vector of length one. If it is |
Details
Intersecting rings with sectors makes a grid in which each cell is a
portion of the hemisphere. Each pixel of the grid is labeled with an ID that
codify both ring and sector IDs. For example, a grid with a regular interval
of one degree has segment from 1001
to 360090
. This numbers are
calculated with: sectorID \times 1000 + ringID
, where sectorID
is
the ID number of the sector and ringID
is the ID number of the ring.
Value
An object from the class SpatRaster with segments shaped like windshields, though some of them will look elongated in height. The pattern is two opposite and converging straight sides and two opposite and parallel curvy sides.
See Also
Other Segmentation Functions:
chessboard()
,
mask_hs()
,
mask_sunlit_canopy()
,
polar_qtree()
,
qtree()
,
rings_segmentation()
,
sectors_segmentation()
Examples
z <- zenith_image(600, lens())
a <- azimuth_image(z)
g <- sky_grid_segmentation(z, a, 15)
plot(g == 24005)
## Not run:
g <- sky_grid_segmentation(z, a, 15, sequential = TRUE)
col <- terra::unique(g) %>% nrow() %>% rainbow() %>% sample()
plot(g, col = col)
## End(Not run)