View source: R/fisheye_to_pano.R
fisheye_to_pano | R Documentation |
Reprojects a fisheye (hemispherical) image into a panoramic view using a cylindrical projection. The output is standardized so that rows correspond to zenith angle bands and columns to azimuthal sectors.
fisheye_to_pano(r, z, a, fun = mean, angle_width = 1)
r |
terra::SpatRaster of one or more layers (e.g., RGB channels or binary masks) in fisheye projection. |
z |
terra::SpatRaster generated with |
a |
terra::SpatRaster generated with |
fun |
function taking a numeric/logical vector and returning a single
numeric or logical value (default |
angle_width |
numeric vector of length one. Angle in deg that must
divide both 0–360 and 0–90 into an integer number of segments. Retrieve a
set of valid values by running
|
This function computes a cylindrical projection by aggregating pixel values
according to their zenith and azimuth angles. Internally, it creates a
segmentation grid with sky_grid_segmentation()
and applies
extract_feature()
to compute a summary statistic (e.g., mean) of pixel
values within each cell.
terra::SpatRaster with rows representing zenith angle bands and
columns representing azimuthal sectors. The number of layers and names
matches that of the input r
.
An early version of this function was used in \insertCiteDiaz2021;textualrcaiman.
## Not run:
caim <- read_caim()
z <- zenith_image(ncol(caim), lens())
a <- azimuth_image(z)
pano <- fisheye_to_pano(caim, z, a)
plotRGB(pano %>% normalize_minmax() %>% multiply_by(255))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.