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.
Usage
fisheye_to_pano(r, z, a, fun = mean, angle_width = 1)
Value
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.
Arguments
r
terra::SpatRaster of one or more layers (e.g., RGB channels or
binary masks) in fisheye projection.
function taking a numeric/logical vector and returning a single
numeric or logical value (default mean).
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
lapply(c(45, 30, 18, 10), function(a) vapply(0:6, function(x) a/2^x, 1)).
Details
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.