crosscalibrate_lens: Cross-calibrate lens

View source: R/crosscalibrate_lens.R

crosscalibrate_lensR Documentation

Cross-calibrate lens

Description

Given two photographs taken from the same point (matching entrance pupils and aligned optical axes), with calibrated and uncalibrated cameras, derives a polynomial projection for the uncalibrated device. Intended for cases where a camera calibrated with a method of higher accuracy than calibrate_lens() is available, or when there is a main camera to which all other devices should be adjusted.

Points must be digitized in tandem with ImageJ and saved as CSV files. See calibrate_lens() for background and general concepts.

Usage

crosscalibrate_lens(
  path_to_csv_uncal,
  path_to_csv_cal,
  zenith_colrow_uncal,
  zenith_colrow_cal,
  diameter_cal,
  lens_coef,
  degree = 3
)

Arguments

path_to_csv_uncal, path_to_csv_cal

character vectors of length one. Paths to CSV files created with ImageJ’s point selection tool (uncalibrated and calibrated images, respectively).

zenith_colrow_uncal, zenith_colrow_cal

numeric vectors of length two. Raster coordinates of the zenith for the uncalibrated and calibrated images; see calc_zenith_colrow().

diameter_cal

numeric vector of length one. Image diameter (pixels) of the calibrated camera.

lens_coef

numeric vector. Lens projection coefficients of the calibrated camera.

degree

numeric vector of length one. Polynomial degree for the uncalibrated model fit (default 3).

Details

Estimate a lens projection for an uncalibrated camera by referencing a calibrated camera photographed from the exact same location.

Value

List with components:

ds

data.frame with zenith angle (theta, radians) and pixel radius (px) from the uncalibrated camera.

model

lm object: polynomial fit of px ~ theta.

horizon_radius

numeric vector of length one. Pixel radius at 90 deg.

lens_coef

numeric vector. Distortion coefficients normalized by horizon_radius.

See Also

calibrate_lens(), calc_zenith_colrow()


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