lens {rcaiman} | R Documentation |
Access the lens database
Description
Database of lens projection functions and field of views.
Usage
lens(type = "equidistant", max_fov = FALSE)
Arguments
type |
Character vector of length one. The name of the lens. |
max_fov |
Logical vector of length one. Use |
Details
In upward-looking leveled hemispherical photography, the zenith is the center of a circle whose perimeter is the horizon. This is true only if the lens field of view is 180º. The relative radius is the radius of concentric circles expressed as a fraction of the radius that belongs to the circle that has the horizon as perimeter. The equidistant model, also called polar, is the most widely used as a standard reference. Real lenses can approximate the projection models, but they always have some kind of distortion. In the equidistant model, the relation between zenith angle and relative radius is modeled with a straight line. Following Hemisfer software, this package uses a polynomial curve to model lens distortion. A third-order polynomial is sufficient in most cases (Frazer et al. 2001). Equations should be fitted with angles in radians.
Eventually, this will be a large database, but only the following lenses are available at the moment:
equidistant: standard equidistant projection (Schneider et al. 2009).
Nikkor_10.5mm: AF DX Fisheye Nikkor 10.5mm f/2.8G ED (Pekin and Macfarlane 2009)
Nikon_FCE9: Nikon FC-E9 converter (Díaz and et al. 2024)
Olloclip: Auxiliary lens for mobile devices made by Olloclip (Díaz and et al. 2024)
Nikkor_8mm: AF–S Fisheye Nikkor 8–15mm f/3.5–4.5E ED (Díaz and et al. 2024)
Value
If max_fov
is set to TRUE
, it returns a numeric vector of length
one, which is the lens maximum field of view in degrees. Otherwise, it
returns a numeric vector with the coefficients of the lens function.
References
Díaz GM, et al. (2024).
“Simple calibration of fisheye lenses for hemipherical photography of the forest canopy.”
Manuscript in preparation.
Frazer GW, Fournier RA, Trofymow JA, Hall RJ (2001).
“A comparison of digital and film fisheye photography for analysis of forest canopy structure and gap light transmission.”
Agricultural and Forest Meteorology, 109(4), 249–263.
doi:10.1016/s0168-1923(01)00274-x.
Pekin B, Macfarlane C (2009).
“Measurement of crown cover and leaf area index using digital cover photography and its application to remote sensing.”
Remote Sensing, 1(4), 1298–1320.
doi:10.3390/rs1041298.
Schneider D, Schwalbe E, Maas H (2009).
“Validation of geometric models for fisheye lenses.”
ISPRS Journal of Photogrammetry and Remote Sensing, 64(3), 259–266.
doi:10.1016/j.isprsjprs.2009.01.001.
See Also
Other Lens Functions:
azimuth_image()
,
calc_diameter()
,
calc_relative_radius()
,
calc_zenith_colrow()
,
calibrate_lens()
,
crosscalibrate_lens()
,
expand_noncircular()
,
extract_radiometry()
,
fisheye_to_equidistant()
,
fisheye_to_pano()
,
test_lens_coef()
,
zenith_image()
Examples
lens("Nikon_FCE9")
lens("Nikon_FCE9", max_fov = TRUE)
.fp <- function(theta, lens_coef) {
x <- lens_coef[1:5]
x[is.na(x)] <- 0
for (i in 1:5) assign(letters[i], x[i])
a * theta + b * theta^2 + c * theta^3 + d * theta^4 + e * theta^5
}
theta <- seq(0, pi/2, pi/180)
plot(theta, .fp(theta, lens()), type = "l", lty = 2,
ylab = "relative radius")
lines(theta, .fp(theta, lens("Nikon_FCE9")))