expand_noncircular: Expand non-circular

expand_noncircularR Documentation

Expand non-circular

Description

Add NA margins to a hemispherical photograph to align radiance at the zenith with the image center. In this context, “zenith” denotes the location in the image that corresponds to the projection of the vertical direction when the optical axis is aligned vertically. Intended for non-circular images.

Usage

expand_noncircular(caim, z, zenith_colrow)

Arguments

caim

terra::SpatRaster. Typically the output of read_caim().

z

terra::SpatRaster generated with zenith_image().

zenith_colrow

numeric vector of length two. Raster coordinates of the zenith (column, row). See calc_zenith_colrow(). Coordinates follow the raster convention (column, row), not matrix order.

Value

terra::SpatRaster with the same layers and pixel values as caim, but with NA margins added to center the zenith.

Note

rcaiman uses terra without geographic semantics: rasters are kept with unit resolution (cell size = 1) and a standardized extent ext(0, ncol, 0, nrow) with CRS EPSG:7589.

Examples

## Not run: 
# Non-circular fisheye images from a smartphone with an auxiliary Lens
# (also applicable to non-circular fisheye images from DSLR cameras)
path <- system.file("external/APC_0836.jpg", package = "rcaiman")
caim <- read_caim(path)
z <- zenith_image(2132/2,  lens("Olloclip"))
a <- azimuth_image(z)
zenith_colrow <- c(1063, 771)/2
caim <- expand_noncircular(caim, z, zenith_colrow)
plot(caim$Blue, col = seq(0, 1, 1/255) %>% grey())
m <- !is.na(caim$Red) & !is.na(z)
plot(m, add = TRUE, alpha = 0.3, legend = FALSE)

## End(Not run)

rcaiman documentation built on Sept. 9, 2025, 5:42 p.m.