stereoParametersFromOpenCV
Syntax
Description
converts the OpenCV stereo parameters, specified by the input arguments, into a MATLAB®
stereoParams
= stereoParametersFromOpenCV(intrinsicMatrix1
,distortionCoefficients1
,intrinsicMatrix2
,distortionCoefficients2
,rotationOfCamera2
,translationOfCamera2
,imageSize
)stereoParameters
object stereoParams
.
The OpenCV spatial coordinate system specifies the upper-left pixel center at
(0,0
), whereas the MATLAB spatial coordinate system specifies the pixel center at
(1,1
). The stereoParametersFromOpenCV
function
compensates for this difference by adding 1 to both of the x and
y-values for the converted principal point.
OpenCV stereo parameters cannot be converted to a MATLAB
stereoParameters
object when:
The OpenCV pinhole camera model uses more than five distortion coefficients.
An OpenCV fisheye model is used.
In these cases, you can recalibrate the stereo camera using the Stereo Camera Calibrator app.
specifies a string stereoParams
= stereoParametersFromOpenCV(___,WorldUnits=worldUnits)worldUnits
, that describes the units of the world
points in addition to the input arguments from the previous syntax. Specify worldUnits as a
character vector or string scalar. For example, stereoParametersFromOpenCV( ___
,WorldUnits="mm")
describes all parameters in terms of the world units
"mm".
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2021b