undistort transforms an image to compensate for radial
and tangential lens distortion.
Usage
undistort(
image,
camera_matrix,
dist_coefs,
new_camera_matrix = camera_matrix,
target = "new"
)Arguments
- image
An
Imageobject.- camera_matrix
A 3x3 camera intrinsic matrix as returned by
calibrateCamera.- dist_coefs
A single row matrix with 4, 5, 8, 12 or 14 elements as returned by
calibrateCamera.- new_camera_matrix
A 3x3 camera intrinsic matrix as returned by
getOptimalNewCameraMatrixif you chose to execute this optional step (default:camera_matrix).- target
The location where the results should be stored. It can take 3 values:
- "new":
a new
Imageobject is created and the results are stored inside (the default).- An
Imageobject: the results are stored in another existing
Imageobject. This is fast and will not replace the content ofimagebut will replace that oftarget. Note thattargetmust have the same dimensions, bit depth, and number of channels asimage.
Value
If target="new", the function returns an Image
object. If target is an Image object, the function
returns nothing and modifies that Image object in place.
Author
Simon Garnier, garnier@njit.edu
Examples
# See the help vignette:
if (FALSE) { # \dontrun{
vignette("z8_calib", package = "Rvision")
} # }