calibrateCameras: Finds the optimized DLT coefficients for a stereo camera...

View source: R/calibrateCameras.R

calibrateCamerasR Documentation

Finds the optimized DLT coefficients for a stereo camera setup

Description

This function uses a checkerboard at different positions and angles within a stereo camera setup to estimate DLT calibration coefficients for use in stereo reconstruction. This function is a wrapper for the function dltCalibrateCameras.

Usage

calibrateCameras(img.dir, sq.size, nx, ny, cal.file, corner.dir,
                 print.progress = TRUE, flip.view = FALSE, verify.dir = NULL,
                 error.dir = NULL, min.views = 'max', exec.dir = NULL, 
                 undistort = FALSE, num.aspects.read = 'auto', 
                 num.sample.est = 'auto', num.sample.sets = 'auto', 
                 num.aspects.sample = 'auto', max.sample.optim = 30, nlm.calls.max = 20, 
                 fit.min.break = 1, objective.min = 1, objective.min.break = 5, 
                 with.circles = FALSE, sample.est = NULL, ...)

Arguments

img.dir

folder containing images of the checkerboard pattern, separated into separate folders by view.

sq.size

character string indicating size of checkerboard squares (length along one dimension) including the unit of measure (e.g. '6.35 mm').

nx

integer indicating the number of internal corners along one dimension of the checkerboard.

ny

integer indicating the number of internal corners along the other dimension of the checkerboard.

cal.file

file path to the output calibration file (if it does not already exist one will be created).

corner.dir

folder where the detected checkerboard corners will be saved (if it does not already exist one will be created).

print.progress

logical indicating whether function processes should be printed to the console.

flip.view

logical indicating whether one camera view is upside-down relative to the other.

verify.dir

folder where the images of the checkerboards with detected corners overlaid will be written (if it does not already exist one will be created).

error.dir

folder where the error diagnostic plots will be saved (if it does not already exist one will be created).

min.views

integer indicating the minimum views in which corners must be detected in order to use in coefficient estimation. If set to 'max' (default) this will be equal to the number of input views.

exec.dir

file path to folder containing external executables for reading video files (still under development).

undistort

logical indicating whether to estimate lens distortion correction coefficients (still under development).

num.aspects.read

number (integer) of frames to be read from video input. Requires external executables (still under development).

num.sample.est

number (integer) of aspects from total that will be sampled calibration coefficient estimation.

num.sample.sets

number (integer) of unique sets of aspects to try.

num.aspects.sample

number (integer) of aspects to sample for each set.

max.sample.optim

maximum number (integer) of aspects to be used in identifying the best DLT coefficient set (once already estimated).

nlm.calls.max

maximum number (integer) of different sets of random starting parameters to use during coefficient optimization. This parameter cannot exceed 576.

fit.min.break

minimum error at which resampleGridImagePoints() will stop iterating to find a better fit.

objective.min.break

minimum error at which optimization will stop estimating the position of additional checkerboards.

objective.min

The expected mean reconstruction error when optimizing the calibration coefficients (the minimum, or objective value returned by nlminb()). A value between 0.2 and 1.2 should be reasonable.

with.circles

logical indicating whether the checkerboard pattern includes concentric circles for identifying the starting corner. Requires external executables (still under development).

sample.est

vector of explicitly defined aspects to use in coefficient estimation.

...

further arguments to be passed to dltCalibrateCameras.

Details

Please see StereoMorph tutorials for step-by-step tutorials on how to use StereoMorph for 2D or 3D shape data collection.

Value

a list of class "calibrateCameras" with the following elements:

cal.coeff

a matrix of 11 optimized DLT calibration coefficients per camera view.

mean.reconstruct.rmse

the RMS error when coor.2d and the optimized calibration coefficients cal.coeff are input to dltReconstruct.

coefficient.rmse

the RMS error when coor.2d and the optimized 3D coordinates coor.3d are input to dltCoefficients.

Author(s)

Aaron Olsen

References

For a general overview of DLT: http://kwon3d.com/theory/dlt/dlt.html

See Also

digitizeImages, reconstructStereoSets


StereoMorph documentation built on May 25, 2022, 5:06 p.m.