@opencvjs/types 4.10.0-release.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +23 -0
- package/lib/index.d.ts +2 -0
- package/lib/opencv/Affine3.d.ts +206 -0
- package/lib/opencv/Algorithm.d.ts +126 -0
- package/lib/opencv/AutoBuffer.d.ts +50 -0
- package/lib/opencv/BFMatcher.d.ts +37 -0
- package/lib/opencv/BOWTrainer.d.ts +43 -0
- package/lib/opencv/CascadeClassifier.d.ts +153 -0
- package/lib/opencv/DescriptorMatcher.d.ts +236 -0
- package/lib/opencv/DynamicBitset.d.ts +68 -0
- package/lib/opencv/Exception.d.ts +54 -0
- package/lib/opencv/Feature2D.d.ts +20 -0
- package/lib/opencv/FlannBasedMatcher.d.ts +57 -0
- package/lib/opencv/HOGDescriptor.d.ts +401 -0
- package/lib/opencv/Logger.d.ts +34 -0
- package/lib/opencv/LshTable.d.ts +81 -0
- package/lib/opencv/Mat.d.ts +1793 -0
- package/lib/opencv/MatExpr.d.ts +107 -0
- package/lib/opencv/MatOp.d.ts +72 -0
- package/lib/opencv/Matx.d.ts +228 -0
- package/lib/opencv/Node.d.ts +33 -0
- package/lib/opencv/ORB.d.ts +23 -0
- package/lib/opencv/PCA.d.ts +198 -0
- package/lib/opencv/RotatedRect.d.ts +73 -0
- package/lib/opencv/Tracker.d.ts +1 -0
- package/lib/opencv/TrackerMIL.d.ts +3 -0
- package/lib/opencv/_types.d.ts +48 -0
- package/lib/opencv/calib3d.d.ts +2937 -0
- package/lib/opencv/core_array.d.ts +3102 -0
- package/lib/opencv/core_cluster.d.ts +80 -0
- package/lib/opencv/core_hal_interface.d.ts +159 -0
- package/lib/opencv/core_utils.d.ts +748 -0
- package/lib/opencv/dnn.d.ts +505 -0
- package/lib/opencv/features2d_draw.d.ts +114 -0
- package/lib/opencv/fisheye.d.ts +26 -0
- package/lib/opencv/helpers.d.ts +274 -0
- package/lib/opencv/imgproc_color_conversions.d.ts +527 -0
- package/lib/opencv/imgproc_draw.d.ts +732 -0
- package/lib/opencv/imgproc_feature.d.ts +681 -0
- package/lib/opencv/imgproc_filter.d.ts +918 -0
- package/lib/opencv/imgproc_hist.d.ts +399 -0
- package/lib/opencv/imgproc_misc.d.ts +616 -0
- package/lib/opencv/imgproc_object.d.ts +58 -0
- package/lib/opencv/imgproc_shape.d.ts +724 -0
- package/lib/opencv/imgproc_transform.d.ts +574 -0
- package/lib/opencv/missing.d.ts +58 -0
- package/lib/opencv/objdetect.d.ts +103 -0
- package/lib/opencv/photo_inpaint.d.ts +39 -0
- package/lib/opencv/softdouble.d.ts +71 -0
- package/lib/opencv/softfloat.d.ts +71 -0
- package/lib/opencv/video_track.d.ts +370 -0
- package/package.json +18 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,2937 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
bool,
|
|
3
|
+
double,
|
|
4
|
+
float,
|
|
5
|
+
InputArray,
|
|
6
|
+
InputArrayOfArrays,
|
|
7
|
+
InputOutputArray,
|
|
8
|
+
int,
|
|
9
|
+
Mat,
|
|
10
|
+
OutputArray,
|
|
11
|
+
OutputArrayOfArrays,
|
|
12
|
+
Point2d,
|
|
13
|
+
Rect,
|
|
14
|
+
Size,
|
|
15
|
+
size_t,
|
|
16
|
+
TermCriteria,
|
|
17
|
+
Vec3d,
|
|
18
|
+
} from "./_types";
|
|
19
|
+
/*
|
|
20
|
+
* # Camera Calibration and 3D Reconstruction
|
|
21
|
+
* The functions in this section use a so-called pinhole camera model. In this model, a scene view is formed by projecting 3D points into the image plane using a perspective transformation.
|
|
22
|
+
*
|
|
23
|
+
* `\[s \; m' = A [R|t] M'\]`
|
|
24
|
+
*
|
|
25
|
+
* or
|
|
26
|
+
*
|
|
27
|
+
* `\[s \vecthree{u}{v}{1} = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1} \begin{bmatrix} r_{11} & r_{12} & r_{13} & t_1 \\ r_{21} & r_{22} & r_{23} & t_2 \\ r_{31} & r_{32} & r_{33} & t_3 \end{bmatrix} \begin{bmatrix} X \\ Y \\ Z \\ 1 \end{bmatrix}\]`
|
|
28
|
+
*
|
|
29
|
+
* where:
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
*
|
|
34
|
+
*
|
|
35
|
+
* * `$(X, Y, Z)$` are the coordinates of a 3D point in the world coordinate space
|
|
36
|
+
* * `$(u, v)$` are the coordinates of the projection point in pixels
|
|
37
|
+
* * `$A$` is a camera matrix, or a matrix of intrinsic parameters
|
|
38
|
+
* * `$(cx, cy)$` is a principal point that is usually at the image center
|
|
39
|
+
* * `$fx, fy$` are the focal lengths expressed in pixel units.
|
|
40
|
+
*
|
|
41
|
+
*
|
|
42
|
+
* Thus, if an image from the camera is scaled by a factor, all of these parameters should be scaled (multiplied/divided, respectively) by the same factor. The matrix of intrinsic parameters does not depend on the scene viewed. So, once estimated, it can be re-used as long as the focal length is fixed (in case of zoom lens). The joint rotation-translation matrix `$[R|t]$` is called a matrix of extrinsic parameters. It is used to describe the camera motion around a static scene, or vice versa, rigid motion of an object in front of a still camera. That is, `$[R|t]$` translates coordinates of a point `$(X, Y, Z)$` to a coordinate system, fixed with respect to the camera. The transformation above is equivalent to the following (when `$z \ne 0$` ):
|
|
43
|
+
*
|
|
44
|
+
* `\[\begin{array}{l} \vecthree{x}{y}{z} = R \vecthree{X}{Y}{Z} + t \\ x' = x/z \\ y' = y/z \\ u = f_x*x' + c_x \\ v = f_y*y' + c_y \end{array}\]`
|
|
45
|
+
*
|
|
46
|
+
* The following figure illustrates the pinhole camera model.
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
* Real lenses usually have some distortion, mostly radial distortion and slight tangential distortion. So, the above model is extended as:
|
|
50
|
+
*
|
|
51
|
+
* `\[\begin{array}{l} \vecthree{x}{y}{z} = R \vecthree{X}{Y}{Z} + t \\ x' = x/z \\ y' = y/z \\ x'' = x' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + 2 p_1 x' y' + p_2(r^2 + 2 x'^2) + s_1 r^2 + s_2 r^4 \\ y'' = y' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' + s_3 r^2 + s_4 r^4 \\ \text{where} \quad r^2 = x'^2 + y'^2 \\ u = f_x*x'' + c_x \\ v = f_y*y'' + c_y \end{array}\]`
|
|
52
|
+
*
|
|
53
|
+
* `$k_1$`, `$k_2$`, `$k_3$`, `$k_4$`, `$k_5$`, and `$k_6$` are radial distortion coefficients. `$p_1$` and `$p_2$` are tangential distortion coefficients. `$s_1$`, `$s_2$`, `$s_3$`, and `$s_4$`, are the thin prism distortion coefficients. Higher-order coefficients are not considered in OpenCV.
|
|
54
|
+
*
|
|
55
|
+
* The next figures show two common types of radial distortion: barrel distortion (typically `$ k_1 < 0 $`) and pincushion distortion (typically `$ k_1 > 0 $`).
|
|
56
|
+
*
|
|
57
|
+
*
|
|
58
|
+
*
|
|
59
|
+
*
|
|
60
|
+
*
|
|
61
|
+
* In some cases the image sensor may be tilted in order to focus an oblique plane in front of the camera (Scheimpfug condition). This can be useful for particle image velocimetry (PIV) or triangulation with a laser fan. The tilt causes a perspective distortion of `$x''$` and `$y''$`. This distortion can be modelled in the following way, see e.g. Louhichi07.
|
|
62
|
+
*
|
|
63
|
+
* `\[\begin{array}{l} s\vecthree{x'''}{y'''}{1} = \vecthreethree{R_{33}(\tau_x, \tau_y)}{0}{-R_{13}(\tau_x, \tau_y)} {0}{R_{33}(\tau_x, \tau_y)}{-R_{23}(\tau_x, \tau_y)} {0}{0}{1} R(\tau_x, \tau_y) \vecthree{x''}{y''}{1}\\ u = f_x*x''' + c_x \\ v = f_y*y''' + c_y \end{array}\]`
|
|
64
|
+
*
|
|
65
|
+
* where the matrix `$R(\tau_x, \tau_y)$` is defined by two rotations with angular parameter `$\tau_x$` and `$\tau_y$`, respectively,
|
|
66
|
+
*
|
|
67
|
+
* `\[ R(\tau_x, \tau_y) = \vecthreethree{\cos(\tau_y)}{0}{-\sin(\tau_y)}{0}{1}{0}{\sin(\tau_y)}{0}{\cos(\tau_y)} \vecthreethree{1}{0}{0}{0}{\cos(\tau_x)}{\sin(\tau_x)}{0}{-\sin(\tau_x)}{\cos(\tau_x)} = \vecthreethree{\cos(\tau_y)}{\sin(\tau_y)\sin(\tau_x)}{-\sin(\tau_y)\cos(\tau_x)} {0}{\cos(\tau_x)}{\sin(\tau_x)} {\sin(\tau_y)}{-\cos(\tau_y)\sin(\tau_x)}{\cos(\tau_y)\cos(\tau_x)}. \]`
|
|
68
|
+
*
|
|
69
|
+
* In the functions below the coefficients are passed or returned as
|
|
70
|
+
*
|
|
71
|
+
* `\[(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\]`
|
|
72
|
+
*
|
|
73
|
+
* vector. That is, if the vector contains four elements, it means that `$k_3=0$` . The distortion coefficients do not depend on the scene viewed. Thus, they also belong to the intrinsic camera parameters. And they remain the same regardless of the captured image resolution. If, for example, a camera has been calibrated on images of 320 x 240 resolution, absolutely the same distortion coefficients can be used for 640 x 480 images from the same camera while `$f_x$`, `$f_y$`, `$c_x$`, and `$c_y$` need to be scaled appropriately.
|
|
74
|
+
*
|
|
75
|
+
* The functions below use the above model to do the following:
|
|
76
|
+
*
|
|
77
|
+
*
|
|
78
|
+
*
|
|
79
|
+
*
|
|
80
|
+
*
|
|
81
|
+
* * Project 3D points to the image plane given intrinsic and extrinsic parameters.
|
|
82
|
+
* * Compute extrinsic parameters given intrinsic parameters, a few 3D points, and their projections.
|
|
83
|
+
* * Estimate intrinsic and extrinsic camera parameters from several views of a known calibration pattern (every view is described by several 3D-2D point correspondences).
|
|
84
|
+
* * Estimate the relative position and orientation of the stereo camera "heads" and compute the rectification* transformation that makes the camera optical axes parallel.
|
|
85
|
+
*
|
|
86
|
+
*
|
|
87
|
+
*
|
|
88
|
+
*
|
|
89
|
+
*
|
|
90
|
+
*
|
|
91
|
+
*
|
|
92
|
+
*
|
|
93
|
+
* * A calibration sample for 3 cameras in horizontal position can be found at opencv_source_code/samples/cpp/3calibration.cpp
|
|
94
|
+
* * A calibration sample based on a sequence of images can be found at opencv_source_code/samples/cpp/calibration.cpp
|
|
95
|
+
* * A calibration sample in order to do 3D reconstruction can be found at opencv_source_code/samples/cpp/build3dmodel.cpp
|
|
96
|
+
* * A calibration example on stereo calibration can be found at opencv_source_code/samples/cpp/stereo_calib.cpp
|
|
97
|
+
* * A calibration example on stereo matching can be found at opencv_source_code/samples/cpp/stereo_match.cpp
|
|
98
|
+
* * (Python) A camera calibration sample can be found at opencv_source_code/samples/python/calibrate.py
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* the overall RMS re-projection error.
|
|
102
|
+
* The function estimates the intrinsic camera parameters and extrinsic parameters for each of the
|
|
103
|
+
* views. The algorithm is based on Zhang2000 and BouguetMCT . The coordinates of 3D object points and
|
|
104
|
+
* their corresponding 2D projections in each view must be specified. That may be achieved by using an
|
|
105
|
+
* object with a known geometry and easily detectable feature points. Such an object is called a
|
|
106
|
+
* calibration rig or calibration pattern, and OpenCV has built-in support for a chessboard as a
|
|
107
|
+
* calibration rig (see findChessboardCorners ). Currently, initialization of intrinsic parameters
|
|
108
|
+
* (when CALIB_USE_INTRINSIC_GUESS is not set) is only implemented for planar calibration patterns
|
|
109
|
+
* (where Z-coordinates of the object points must be all zeros). 3D calibration rigs can also be used
|
|
110
|
+
* as long as initial cameraMatrix is provided.
|
|
111
|
+
*
|
|
112
|
+
* The algorithm performs the following steps:
|
|
113
|
+
*
|
|
114
|
+
* Compute the initial intrinsic parameters (the option only available for planar calibration patterns)
|
|
115
|
+
* or read them from the input parameters. The distortion coefficients are all set to zeros initially
|
|
116
|
+
* unless some of CALIB_FIX_K? are specified.
|
|
117
|
+
* Estimate the initial camera pose as if the intrinsic parameters have been already known. This is
|
|
118
|
+
* done using solvePnP .
|
|
119
|
+
* Run the global Levenberg-Marquardt optimization algorithm to minimize the reprojection error, that
|
|
120
|
+
* is, the total sum of squared distances between the observed feature points imagePoints and the
|
|
121
|
+
* projected (using the current estimates for camera parameters and the poses) object points
|
|
122
|
+
* objectPoints. See projectPoints for details.
|
|
123
|
+
*
|
|
124
|
+
* If you use a non-square (=non-NxN) grid and findChessboardCorners for calibration, and
|
|
125
|
+
* calibrateCamera returns bad values (zero distortion coefficients, an image center very far from
|
|
126
|
+
* (w/2-0.5,h/2-0.5), and/or large differences between `$f_x$` and `$f_y$` (ratios of 10:1 or more)),
|
|
127
|
+
* then you have probably used patternSize=cvSize(rows,cols) instead of using
|
|
128
|
+
* patternSize=cvSize(cols,rows) in findChessboardCorners .
|
|
129
|
+
*
|
|
130
|
+
* [calibrateCameraRO], [findChessboardCorners], [solvePnP], [initCameraMatrix2D], [stereoCalibrate],
|
|
131
|
+
* [undistort]
|
|
132
|
+
*
|
|
133
|
+
* @param objectPoints In the new interface it is a vector of vectors of calibration pattern points in
|
|
134
|
+
* the calibration pattern coordinate space (e.g. std::vector<std::vector<cv::Vec3f>>). The outer
|
|
135
|
+
* vector contains as many elements as the number of the pattern views. If the same calibration pattern
|
|
136
|
+
* is shown in each view and it is fully visible, all the vectors will be the same. Although, it is
|
|
137
|
+
* possible to use partially occluded patterns, or even different patterns in different views. Then,
|
|
138
|
+
* the vectors will be different. The points are 3D, but since they are in a pattern coordinate system,
|
|
139
|
+
* then, if the rig is planar, it may make sense to put the model to a XY coordinate plane so that
|
|
140
|
+
* Z-coordinate of each input object point is 0. In the old interface all the vectors of object points
|
|
141
|
+
* from different views are concatenated together.
|
|
142
|
+
*
|
|
143
|
+
* @param imagePoints In the new interface it is a vector of vectors of the projections of calibration
|
|
144
|
+
* pattern points (e.g. std::vector<std::vector<cv::Vec2f>>). imagePoints.size() and
|
|
145
|
+
* objectPoints.size() and imagePoints[i].size() must be equal to objectPoints[i].size() for each i. In
|
|
146
|
+
* the old interface all the vectors of object points from different views are concatenated together.
|
|
147
|
+
*
|
|
148
|
+
* @param imageSize Size of the image used only to initialize the intrinsic camera matrix.
|
|
149
|
+
*
|
|
150
|
+
* @param cameraMatrix Output 3x3 floating-point camera matrix $A =
|
|
151
|
+
* \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$ . If CV_CALIB_USE_INTRINSIC_GUESS and/or
|
|
152
|
+
* CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be initialized before
|
|
153
|
+
* calling the function.
|
|
154
|
+
*
|
|
155
|
+
* @param distCoeffs Output vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5,
|
|
156
|
+
* k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements.
|
|
157
|
+
*
|
|
158
|
+
* @param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view
|
|
159
|
+
* (e.g. std::vector<cv::Mat>>). That is, each k-th rotation vector together with the corresponding
|
|
160
|
+
* k-th translation vector (see the next output parameter description) brings the calibration pattern
|
|
161
|
+
* from the model coordinate space (in which object points are specified) to the world coordinate
|
|
162
|
+
* space, that is, a real position of the calibration pattern in the k-th pattern view (k=0.. M -1).
|
|
163
|
+
*
|
|
164
|
+
* @param tvecs Output vector of translation vectors estimated for each pattern view.
|
|
165
|
+
*
|
|
166
|
+
* @param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic
|
|
167
|
+
* parameters. Order of deviations values: $(f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6
|
|
168
|
+
* , s_1, s_2, s_3, s_4, \tau_x, \tau_y)$ If one of parameters is not estimated, it's deviation is
|
|
169
|
+
* equals to zero.
|
|
170
|
+
*
|
|
171
|
+
* @param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic
|
|
172
|
+
* parameters. Order of deviations values: $(R_1, T_1, \dotsc , R_M, T_M)$ where M is number of pattern
|
|
173
|
+
* views, $R_i, T_i$ are concatenated 1x3 vectors.
|
|
174
|
+
*
|
|
175
|
+
* @param perViewErrors Output vector of the RMS re-projection error estimated for each pattern view.
|
|
176
|
+
*
|
|
177
|
+
* @param flags Different flags that may be zero or a combination of the following values:
|
|
178
|
+
* CALIB_USE_INTRINSIC_GUESS cameraMatrix contains valid initial values of fx, fy, cx, cy that are
|
|
179
|
+
* optimized further. Otherwise, (cx, cy) is initially set to the image center ( imageSize is used),
|
|
180
|
+
* and focal distances are computed in a least-squares fashion. Note, that if intrinsic parameters are
|
|
181
|
+
* known, there is no need to use this function just to estimate extrinsic parameters. Use solvePnP
|
|
182
|
+
* instead.CALIB_FIX_PRINCIPAL_POINT The principal point is not changed during the global optimization.
|
|
183
|
+
* It stays at the center or at a different location specified when CALIB_USE_INTRINSIC_GUESS is set
|
|
184
|
+
* too.CALIB_FIX_ASPECT_RATIO The functions considers only fy as a free parameter. The ratio fx/fy
|
|
185
|
+
* stays the same as in the input cameraMatrix . When CALIB_USE_INTRINSIC_GUESS is not set, the actual
|
|
186
|
+
* input values of fx and fy are ignored, only their ratio is computed and used
|
|
187
|
+
* further.CALIB_ZERO_TANGENT_DIST Tangential distortion coefficients $(p_1, p_2)$ are set to zeros and
|
|
188
|
+
* stay zero.CALIB_FIX_K1,...,CALIB_FIX_K6 The corresponding radial distortion coefficient is not
|
|
189
|
+
* changed during the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the
|
|
190
|
+
* supplied distCoeffs matrix is used. Otherwise, it is set to 0.CALIB_RATIONAL_MODEL Coefficients k4,
|
|
191
|
+
* k5, and k6 are enabled. To provide the backward compatibility, this extra flag should be explicitly
|
|
192
|
+
* specified to make the calibration function use the rational model and return 8 coefficients. If the
|
|
193
|
+
* flag is not set, the function computes and returns only 5 distortion
|
|
194
|
+
* coefficients.CALIB_THIN_PRISM_MODEL Coefficients s1, s2, s3 and s4 are enabled. To provide the
|
|
195
|
+
* backward compatibility, this extra flag should be explicitly specified to make the calibration
|
|
196
|
+
* function use the thin prism model and return 12 coefficients. If the flag is not set, the function
|
|
197
|
+
* computes and returns only 5 distortion coefficients.CALIB_FIX_S1_S2_S3_S4 The thin prism distortion
|
|
198
|
+
* coefficients are not changed during the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the
|
|
199
|
+
* coefficient from the supplied distCoeffs matrix is used. Otherwise, it is set to
|
|
200
|
+
* 0.CALIB_TILTED_MODEL Coefficients tauX and tauY are enabled. To provide the backward compatibility,
|
|
201
|
+
* this extra flag should be explicitly specified to make the calibration function use the tilted
|
|
202
|
+
* sensor model and return 14 coefficients. If the flag is not set, the function computes and returns
|
|
203
|
+
* only 5 distortion coefficients.CALIB_FIX_TAUX_TAUY The coefficients of the tilted sensor model are
|
|
204
|
+
* not changed during the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the
|
|
205
|
+
* supplied distCoeffs matrix is used. Otherwise, it is set to 0.
|
|
206
|
+
*
|
|
207
|
+
* @param criteria Termination criteria for the iterative optimization algorithm.
|
|
208
|
+
*/
|
|
209
|
+
export declare function calibrateCamera(
|
|
210
|
+
objectPoints: InputArrayOfArrays,
|
|
211
|
+
imagePoints: InputArrayOfArrays,
|
|
212
|
+
imageSize: Size,
|
|
213
|
+
cameraMatrix: InputOutputArray,
|
|
214
|
+
distCoeffs: InputOutputArray,
|
|
215
|
+
rvecs: OutputArrayOfArrays,
|
|
216
|
+
tvecs: OutputArrayOfArrays,
|
|
217
|
+
stdDeviationsIntrinsics: OutputArray,
|
|
218
|
+
stdDeviationsExtrinsics: OutputArray,
|
|
219
|
+
perViewErrors: OutputArray,
|
|
220
|
+
flags?: int,
|
|
221
|
+
criteria?: TermCriteria,
|
|
222
|
+
): double;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* This is an overloaded member function, provided for convenience. It differs from the above function
|
|
226
|
+
* only in what argument(s) it accepts.
|
|
227
|
+
*/
|
|
228
|
+
export declare function calibrateCamera(
|
|
229
|
+
objectPoints: InputArrayOfArrays,
|
|
230
|
+
imagePoints: InputArrayOfArrays,
|
|
231
|
+
imageSize: Size,
|
|
232
|
+
cameraMatrix: InputOutputArray,
|
|
233
|
+
distCoeffs: InputOutputArray,
|
|
234
|
+
rvecs: OutputArrayOfArrays,
|
|
235
|
+
tvecs: OutputArrayOfArrays,
|
|
236
|
+
flags?: int,
|
|
237
|
+
criteria?: TermCriteria,
|
|
238
|
+
): double;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* This function is an extension of [calibrateCamera()] with the method of releasing object which was
|
|
242
|
+
* proposed in strobl2011iccv. In many common cases with inaccurate, unmeasured, roughly planar targets
|
|
243
|
+
* (calibration plates), this method can dramatically improve the precision of the estimated camera
|
|
244
|
+
* parameters. Both the object-releasing method and standard method are supported by this function. Use
|
|
245
|
+
* the parameter **iFixedPoint** for method selection. In the internal implementation,
|
|
246
|
+
* [calibrateCamera()] is a wrapper for this function.
|
|
247
|
+
*
|
|
248
|
+
* the overall RMS re-projection error.
|
|
249
|
+
* The function estimates the intrinsic camera parameters and extrinsic parameters for each of the
|
|
250
|
+
* views. The algorithm is based on Zhang2000, BouguetMCT and strobl2011iccv. See [calibrateCamera()]
|
|
251
|
+
* for other detailed explanations.
|
|
252
|
+
*
|
|
253
|
+
* [calibrateCamera], [findChessboardCorners], [solvePnP], [initCameraMatrix2D], [stereoCalibrate],
|
|
254
|
+
* [undistort]
|
|
255
|
+
*
|
|
256
|
+
* @param objectPoints Vector of vectors of calibration pattern points in the calibration pattern
|
|
257
|
+
* coordinate space. See calibrateCamera() for details. If the method of releasing object to be used,
|
|
258
|
+
* the identical calibration board must be used in each view and it must be fully visible, and all
|
|
259
|
+
* objectPoints[i] must be the same and all points should be roughly close to a plane. The calibration
|
|
260
|
+
* target has to be rigid, or at least static if the camera (rather than the calibration target) is
|
|
261
|
+
* shifted for grabbing images.
|
|
262
|
+
*
|
|
263
|
+
* @param imagePoints Vector of vectors of the projections of calibration pattern points. See
|
|
264
|
+
* calibrateCamera() for details.
|
|
265
|
+
*
|
|
266
|
+
* @param imageSize Size of the image used only to initialize the intrinsic camera matrix.
|
|
267
|
+
*
|
|
268
|
+
* @param iFixedPoint The index of the 3D object point in objectPoints[0] to be fixed. It also acts as
|
|
269
|
+
* a switch for calibration method selection. If object-releasing method to be used, pass in the
|
|
270
|
+
* parameter in the range of [1, objectPoints[0].size()-2], otherwise a value out of this range will
|
|
271
|
+
* make standard calibration method selected. Usually the top-right corner point of the calibration
|
|
272
|
+
* board grid is recommended to be fixed when object-releasing method being utilized. According to
|
|
273
|
+
* strobl2011iccv, two other points are also fixed. In this implementation, objectPoints[0].front and
|
|
274
|
+
* objectPoints[0].back.z are used. With object-releasing method, accurate rvecs, tvecs and
|
|
275
|
+
* newObjPoints are only possible if coordinates of these three fixed points are accurate enough.
|
|
276
|
+
*
|
|
277
|
+
* @param cameraMatrix Output 3x3 floating-point camera matrix. See calibrateCamera() for details.
|
|
278
|
+
*
|
|
279
|
+
* @param distCoeffs Output vector of distortion coefficients. See calibrateCamera() for details.
|
|
280
|
+
*
|
|
281
|
+
* @param rvecs Output vector of rotation vectors estimated for each pattern view. See
|
|
282
|
+
* calibrateCamera() for details.
|
|
283
|
+
*
|
|
284
|
+
* @param tvecs Output vector of translation vectors estimated for each pattern view.
|
|
285
|
+
*
|
|
286
|
+
* @param newObjPoints The updated output vector of calibration pattern points. The coordinates might
|
|
287
|
+
* be scaled based on three fixed points. The returned coordinates are accurate only if the above
|
|
288
|
+
* mentioned three fixed points are accurate. If not needed, noArray() can be passed in. This parameter
|
|
289
|
+
* is ignored with standard calibration method.
|
|
290
|
+
*
|
|
291
|
+
* @param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic
|
|
292
|
+
* parameters. See calibrateCamera() for details.
|
|
293
|
+
*
|
|
294
|
+
* @param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic
|
|
295
|
+
* parameters. See calibrateCamera() for details.
|
|
296
|
+
*
|
|
297
|
+
* @param stdDeviationsObjPoints Output vector of standard deviations estimated for refined coordinates
|
|
298
|
+
* of calibration pattern points. It has the same size and order as objectPoints[0] vector. This
|
|
299
|
+
* parameter is ignored with standard calibration method.
|
|
300
|
+
*
|
|
301
|
+
* @param perViewErrors Output vector of the RMS re-projection error estimated for each pattern view.
|
|
302
|
+
*
|
|
303
|
+
* @param flags Different flags that may be zero or a combination of some predefined values. See
|
|
304
|
+
* calibrateCamera() for details. If the method of releasing object is used, the calibration time may
|
|
305
|
+
* be much longer. CALIB_USE_QR or CALIB_USE_LU could be used for faster calibration with potentially
|
|
306
|
+
* less precise and less stable in some rare cases.
|
|
307
|
+
*
|
|
308
|
+
* @param criteria Termination criteria for the iterative optimization algorithm.
|
|
309
|
+
*/
|
|
310
|
+
export declare function calibrateCameraRO(
|
|
311
|
+
objectPoints: InputArrayOfArrays,
|
|
312
|
+
imagePoints: InputArrayOfArrays,
|
|
313
|
+
imageSize: Size,
|
|
314
|
+
iFixedPoint: int,
|
|
315
|
+
cameraMatrix: InputOutputArray,
|
|
316
|
+
distCoeffs: InputOutputArray,
|
|
317
|
+
rvecs: OutputArrayOfArrays,
|
|
318
|
+
tvecs: OutputArrayOfArrays,
|
|
319
|
+
newObjPoints: OutputArray,
|
|
320
|
+
stdDeviationsIntrinsics: OutputArray,
|
|
321
|
+
stdDeviationsExtrinsics: OutputArray,
|
|
322
|
+
stdDeviationsObjPoints: OutputArray,
|
|
323
|
+
perViewErrors: OutputArray,
|
|
324
|
+
flags?: int,
|
|
325
|
+
criteria?: TermCriteria,
|
|
326
|
+
): double;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* This is an overloaded member function, provided for convenience. It differs from the above function
|
|
330
|
+
* only in what argument(s) it accepts.
|
|
331
|
+
*/
|
|
332
|
+
export declare function calibrateCameraRO(
|
|
333
|
+
objectPoints: InputArrayOfArrays,
|
|
334
|
+
imagePoints: InputArrayOfArrays,
|
|
335
|
+
imageSize: Size,
|
|
336
|
+
iFixedPoint: int,
|
|
337
|
+
cameraMatrix: InputOutputArray,
|
|
338
|
+
distCoeffs: InputOutputArray,
|
|
339
|
+
rvecs: OutputArrayOfArrays,
|
|
340
|
+
tvecs: OutputArrayOfArrays,
|
|
341
|
+
newObjPoints: OutputArray,
|
|
342
|
+
flags?: int,
|
|
343
|
+
criteria?: TermCriteria,
|
|
344
|
+
): double;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* The function performs the Hand-Eye calibration using various methods. One approach consists in
|
|
348
|
+
* estimating the rotation then the translation (separable solutions) and the following methods are
|
|
349
|
+
* implemented:
|
|
350
|
+
*
|
|
351
|
+
* R. Tsai, R. Lenz A New Technique for Fully Autonomous and Efficient 3D Robotics Hand/EyeCalibration
|
|
352
|
+
* Tsai89
|
|
353
|
+
* F. Park, B. Martin Robot Sensor Calibration: Solving AX = XB on the Euclidean Group Park94
|
|
354
|
+
* R. Horaud, F. Dornaika Hand-Eye Calibration Horaud95
|
|
355
|
+
*
|
|
356
|
+
* Another approach consists in estimating simultaneously the rotation and the translation
|
|
357
|
+
* (simultaneous solutions), with the following implemented method:
|
|
358
|
+
*
|
|
359
|
+
* N. Andreff, R. Horaud, B. Espiau On-line Hand-Eye Calibration Andreff99
|
|
360
|
+
* K. Daniilidis Hand-Eye Calibration Using Dual Quaternions Daniilidis98
|
|
361
|
+
*
|
|
362
|
+
* The following picture describes the Hand-Eye calibration problem where the transformation between a
|
|
363
|
+
* camera ("eye") mounted on a robot gripper ("hand") has to be estimated.
|
|
364
|
+
*
|
|
365
|
+
* The calibration procedure is the following:
|
|
366
|
+
*
|
|
367
|
+
* a static calibration pattern is used to estimate the transformation between the target frame and the
|
|
368
|
+
* camera frame
|
|
369
|
+
* the robot gripper is moved in order to acquire several poses
|
|
370
|
+
* for each pose, the homogeneous transformation between the gripper frame and the robot base frame is
|
|
371
|
+
* recorded using for instance the robot kinematics `\\[ \\begin{bmatrix} X_b\\\\ Y_b\\\\ Z_b\\\\ 1
|
|
372
|
+
* \\end{bmatrix} = \\begin{bmatrix} _{}^{b}\\textrm{R}_g & _{}^{b}\\textrm{t}_g \\\\ 0_{1 \\times 3} &
|
|
373
|
+
* 1 \\end{bmatrix} \\begin{bmatrix} X_g\\\\ Y_g\\\\ Z_g\\\\ 1 \\end{bmatrix} \\]`
|
|
374
|
+
* for each pose, the homogeneous transformation between the calibration target frame and the camera
|
|
375
|
+
* frame is recorded using for instance a pose estimation method (PnP) from 2D-3D point correspondences
|
|
376
|
+
* `\\[ \\begin{bmatrix} X_c\\\\ Y_c\\\\ Z_c\\\\ 1 \\end{bmatrix} = \\begin{bmatrix}
|
|
377
|
+
* _{}^{c}\\textrm{R}_t & _{}^{c}\\textrm{t}_t \\\\ 0_{1 \\times 3} & 1 \\end{bmatrix} \\begin{bmatrix}
|
|
378
|
+
* X_t\\\\ Y_t\\\\ Z_t\\\\ 1 \\end{bmatrix} \\]`
|
|
379
|
+
*
|
|
380
|
+
* The Hand-Eye calibration procedure returns the following homogeneous transformation `\\[
|
|
381
|
+
* \\begin{bmatrix} X_g\\\\ Y_g\\\\ Z_g\\\\ 1 \\end{bmatrix} = \\begin{bmatrix} _{}^{g}\\textrm{R}_c &
|
|
382
|
+
* _{}^{g}\\textrm{t}_c \\\\ 0_{1 \\times 3} & 1 \\end{bmatrix} \\begin{bmatrix} X_c\\\\ Y_c\\\\
|
|
383
|
+
* Z_c\\\\ 1 \\end{bmatrix} \\]`
|
|
384
|
+
*
|
|
385
|
+
* This problem is also known as solving the `$\\mathbf{A}\\mathbf{X}=\\mathbf{X}\\mathbf{B}$`
|
|
386
|
+
* equation: `\\[ \\begin{align*} ^{b}{\\textrm{T}_g}^{(1)} \\hspace{0.2em} ^{g}\\textrm{T}_c
|
|
387
|
+
* \\hspace{0.2em} ^{c}{\\textrm{T}_t}^{(1)} &= \\hspace{0.1em} ^{b}{\\textrm{T}_g}^{(2)}
|
|
388
|
+
* \\hspace{0.2em} ^{g}\\textrm{T}_c \\hspace{0.2em} ^{c}{\\textrm{T}_t}^{(2)} \\\\
|
|
389
|
+
* (^{b}{\\textrm{T}_g}^{(2)})^{-1} \\hspace{0.2em} ^{b}{\\textrm{T}_g}^{(1)} \\hspace{0.2em}
|
|
390
|
+
* ^{g}\\textrm{T}_c &= \\hspace{0.1em} ^{g}\\textrm{T}_c \\hspace{0.2em} ^{c}{\\textrm{T}_t}^{(2)}
|
|
391
|
+
* (^{c}{\\textrm{T}_t}^{(1)})^{-1} \\\\ \\textrm{A}_i \\textrm{X} &= \\textrm{X} \\textrm{B}_i \\\\
|
|
392
|
+
* \\end{align*} \\]`
|
|
393
|
+
*
|
|
394
|
+
* Additional information can be found on this .
|
|
395
|
+
*
|
|
396
|
+
* A minimum of 2 motions with non parallel rotation axes are necessary to determine the hand-eye
|
|
397
|
+
* transformation. So at least 3 different poses are required, but it is strongly recommended to use
|
|
398
|
+
* many more poses.
|
|
399
|
+
*
|
|
400
|
+
* @param R_gripper2base Rotation part extracted from the homogeneous matrix that transforms a point
|
|
401
|
+
* expressed in the gripper frame to the robot base frame ( $_{}^{b}\textrm{T}_g$). This is a vector
|
|
402
|
+
* (vector<Mat>) that contains the rotation matrices for all the transformations from gripper frame to
|
|
403
|
+
* robot base frame.
|
|
404
|
+
*
|
|
405
|
+
* @param t_gripper2base Translation part extracted from the homogeneous matrix that transforms a point
|
|
406
|
+
* expressed in the gripper frame to the robot base frame ( $_{}^{b}\textrm{T}_g$). This is a vector
|
|
407
|
+
* (vector<Mat>) that contains the translation vectors for all the transformations from gripper frame
|
|
408
|
+
* to robot base frame.
|
|
409
|
+
*
|
|
410
|
+
* @param R_target2cam Rotation part extracted from the homogeneous matrix that transforms a point
|
|
411
|
+
* expressed in the target frame to the camera frame ( $_{}^{c}\textrm{T}_t$). This is a vector
|
|
412
|
+
* (vector<Mat>) that contains the rotation matrices for all the transformations from calibration
|
|
413
|
+
* target frame to camera frame.
|
|
414
|
+
*
|
|
415
|
+
* @param t_target2cam Rotation part extracted from the homogeneous matrix that transforms a point
|
|
416
|
+
* expressed in the target frame to the camera frame ( $_{}^{c}\textrm{T}_t$). This is a vector
|
|
417
|
+
* (vector<Mat>) that contains the translation vectors for all the transformations from calibration
|
|
418
|
+
* target frame to camera frame.
|
|
419
|
+
*
|
|
420
|
+
* @param R_cam2gripper Estimated rotation part extracted from the homogeneous matrix that transforms a
|
|
421
|
+
* point expressed in the camera frame to the gripper frame ( $_{}^{g}\textrm{T}_c$).
|
|
422
|
+
*
|
|
423
|
+
* @param t_cam2gripper Estimated translation part extracted from the homogeneous matrix that
|
|
424
|
+
* transforms a point expressed in the camera frame to the gripper frame ( $_{}^{g}\textrm{T}_c$).
|
|
425
|
+
*
|
|
426
|
+
* @param method One of the implemented Hand-Eye calibration method, see cv::HandEyeCalibrationMethod
|
|
427
|
+
*/
|
|
428
|
+
export declare function calibrateHandEye(
|
|
429
|
+
R_gripper2base: InputArrayOfArrays,
|
|
430
|
+
t_gripper2base: InputArrayOfArrays,
|
|
431
|
+
R_target2cam: InputArrayOfArrays,
|
|
432
|
+
t_target2cam: InputArrayOfArrays,
|
|
433
|
+
R_cam2gripper: OutputArray,
|
|
434
|
+
t_cam2gripper: OutputArray,
|
|
435
|
+
method?: HandEyeCalibrationMethod,
|
|
436
|
+
): void;
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* The function computes various useful camera characteristics from the previously estimated camera
|
|
440
|
+
* matrix.
|
|
441
|
+
*
|
|
442
|
+
* Do keep in mind that the unity measure 'mm' stands for whatever unit of measure one chooses for the
|
|
443
|
+
* chessboard pitch (it can thus be any value).
|
|
444
|
+
*
|
|
445
|
+
* @param cameraMatrix Input camera matrix that can be estimated by calibrateCamera or stereoCalibrate
|
|
446
|
+
* .
|
|
447
|
+
*
|
|
448
|
+
* @param imageSize Input image size in pixels.
|
|
449
|
+
*
|
|
450
|
+
* @param apertureWidth Physical width in mm of the sensor.
|
|
451
|
+
*
|
|
452
|
+
* @param apertureHeight Physical height in mm of the sensor.
|
|
453
|
+
*
|
|
454
|
+
* @param fovx Output field of view in degrees along the horizontal sensor axis.
|
|
455
|
+
*
|
|
456
|
+
* @param fovy Output field of view in degrees along the vertical sensor axis.
|
|
457
|
+
*
|
|
458
|
+
* @param focalLength Focal length of the lens in mm.
|
|
459
|
+
*
|
|
460
|
+
* @param principalPoint Principal point in mm.
|
|
461
|
+
*
|
|
462
|
+
* @param aspectRatio $f_y/f_x$
|
|
463
|
+
*/
|
|
464
|
+
export declare function calibrationMatrixValues(
|
|
465
|
+
cameraMatrix: InputArray,
|
|
466
|
+
imageSize: Size,
|
|
467
|
+
apertureWidth: double,
|
|
468
|
+
apertureHeight: double,
|
|
469
|
+
fovx: any,
|
|
470
|
+
fovy: any,
|
|
471
|
+
focalLength: any,
|
|
472
|
+
principalPoint: any,
|
|
473
|
+
aspectRatio: any,
|
|
474
|
+
): void;
|
|
475
|
+
|
|
476
|
+
export declare function checkChessboard(img: InputArray, size: Size): bool;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* The functions compute:
|
|
480
|
+
*
|
|
481
|
+
* `\\[\\begin{array}{l} \\texttt{rvec3} = \\mathrm{rodrigues} ^{-1} \\left ( \\mathrm{rodrigues} (
|
|
482
|
+
* \\texttt{rvec2} ) \\cdot \\mathrm{rodrigues} ( \\texttt{rvec1} ) \\right ) \\\\ \\texttt{tvec3} =
|
|
483
|
+
* \\mathrm{rodrigues} ( \\texttt{rvec2} ) \\cdot \\texttt{tvec1} + \\texttt{tvec2} \\end{array} ,\\]`
|
|
484
|
+
*
|
|
485
|
+
* where `$\\mathrm{rodrigues}$` denotes a rotation vector to a rotation matrix transformation, and
|
|
486
|
+
* `$\\mathrm{rodrigues}^{-1}$` denotes the inverse transformation. See Rodrigues for details.
|
|
487
|
+
*
|
|
488
|
+
* Also, the functions can compute the derivatives of the output vectors with regards to the input
|
|
489
|
+
* vectors (see matMulDeriv ). The functions are used inside stereoCalibrate but can also be used in
|
|
490
|
+
* your own code where Levenberg-Marquardt or another gradient-based solver is used to optimize a
|
|
491
|
+
* function that contains a matrix multiplication.
|
|
492
|
+
*
|
|
493
|
+
* @param rvec1 First rotation vector.
|
|
494
|
+
*
|
|
495
|
+
* @param tvec1 First translation vector.
|
|
496
|
+
*
|
|
497
|
+
* @param rvec2 Second rotation vector.
|
|
498
|
+
*
|
|
499
|
+
* @param tvec2 Second translation vector.
|
|
500
|
+
*
|
|
501
|
+
* @param rvec3 Output rotation vector of the superposition.
|
|
502
|
+
*
|
|
503
|
+
* @param tvec3 Output translation vector of the superposition.
|
|
504
|
+
*
|
|
505
|
+
* @param dr3dr1 Optional output derivative of rvec3 with regard to rvec1
|
|
506
|
+
*
|
|
507
|
+
* @param dr3dt1 Optional output derivative of rvec3 with regard to tvec1
|
|
508
|
+
*
|
|
509
|
+
* @param dr3dr2 Optional output derivative of rvec3 with regard to rvec2
|
|
510
|
+
*
|
|
511
|
+
* @param dr3dt2 Optional output derivative of rvec3 with regard to tvec2
|
|
512
|
+
*
|
|
513
|
+
* @param dt3dr1 Optional output derivative of tvec3 with regard to rvec1
|
|
514
|
+
*
|
|
515
|
+
* @param dt3dt1 Optional output derivative of tvec3 with regard to tvec1
|
|
516
|
+
*
|
|
517
|
+
* @param dt3dr2 Optional output derivative of tvec3 with regard to rvec2
|
|
518
|
+
*
|
|
519
|
+
* @param dt3dt2 Optional output derivative of tvec3 with regard to tvec2
|
|
520
|
+
*/
|
|
521
|
+
export declare function composeRT(
|
|
522
|
+
rvec1: InputArray,
|
|
523
|
+
tvec1: InputArray,
|
|
524
|
+
rvec2: InputArray,
|
|
525
|
+
tvec2: InputArray,
|
|
526
|
+
rvec3: OutputArray,
|
|
527
|
+
tvec3: OutputArray,
|
|
528
|
+
dr3dr1?: OutputArray,
|
|
529
|
+
dr3dt1?: OutputArray,
|
|
530
|
+
dr3dr2?: OutputArray,
|
|
531
|
+
dr3dt2?: OutputArray,
|
|
532
|
+
dt3dr1?: OutputArray,
|
|
533
|
+
dt3dt1?: OutputArray,
|
|
534
|
+
dt3dr2?: OutputArray,
|
|
535
|
+
dt3dt2?: OutputArray,
|
|
536
|
+
): void;
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* For every point in one of the two images of a stereo pair, the function finds the equation of the
|
|
540
|
+
* corresponding epipolar line in the other image.
|
|
541
|
+
*
|
|
542
|
+
* From the fundamental matrix definition (see findFundamentalMat ), line `$l^{(2)}_i$` in the second
|
|
543
|
+
* image for the point `$p^{(1)}_i$` in the first image (when whichImage=1 ) is computed as:
|
|
544
|
+
*
|
|
545
|
+
* `\\[l^{(2)}_i = F p^{(1)}_i\\]`
|
|
546
|
+
*
|
|
547
|
+
* And vice versa, when whichImage=2, `$l^{(1)}_i$` is computed from `$p^{(2)}_i$` as:
|
|
548
|
+
*
|
|
549
|
+
* `\\[l^{(1)}_i = F^T p^{(2)}_i\\]`
|
|
550
|
+
*
|
|
551
|
+
* Line coefficients are defined up to a scale. They are normalized so that `$a_i^2+b_i^2=1$` .
|
|
552
|
+
*
|
|
553
|
+
* @param points Input points. $N \times 1$ or $1 \times N$ matrix of type CV_32FC2 or vector<Point2f>
|
|
554
|
+
* .
|
|
555
|
+
*
|
|
556
|
+
* @param whichImage Index of the image (1 or 2) that contains the points .
|
|
557
|
+
*
|
|
558
|
+
* @param F Fundamental matrix that can be estimated using findFundamentalMat or stereoRectify .
|
|
559
|
+
*
|
|
560
|
+
* @param lines Output vector of the epipolar lines corresponding to the points in the other image.
|
|
561
|
+
* Each line $ax + by + c=0$ is encoded by 3 numbers $(a, b, c)$ .
|
|
562
|
+
*/
|
|
563
|
+
export declare function computeCorrespondEpilines(
|
|
564
|
+
points: InputArray,
|
|
565
|
+
whichImage: int,
|
|
566
|
+
F: InputArray,
|
|
567
|
+
lines: OutputArray,
|
|
568
|
+
): void;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* The function converts points homogeneous to Euclidean space using perspective projection. That is,
|
|
572
|
+
* each point (x1, x2, ... x(n-1), xn) is converted to (x1/xn, x2/xn, ..., x(n-1)/xn). When xn=0, the
|
|
573
|
+
* output point coordinates will be (0,0,0,...).
|
|
574
|
+
*
|
|
575
|
+
* @param src Input vector of N-dimensional points.
|
|
576
|
+
*
|
|
577
|
+
* @param dst Output vector of N-1-dimensional points.
|
|
578
|
+
*/
|
|
579
|
+
export declare function convertPointsFromHomogeneous(
|
|
580
|
+
src: InputArray,
|
|
581
|
+
dst: OutputArray,
|
|
582
|
+
): void;
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* The function converts 2D or 3D points from/to homogeneous coordinates by calling either
|
|
586
|
+
* convertPointsToHomogeneous or convertPointsFromHomogeneous.
|
|
587
|
+
*
|
|
588
|
+
* The function is obsolete. Use one of the previous two functions instead.
|
|
589
|
+
*
|
|
590
|
+
* @param src Input array or vector of 2D, 3D, or 4D points.
|
|
591
|
+
*
|
|
592
|
+
* @param dst Output vector of 2D, 3D, or 4D points.
|
|
593
|
+
*/
|
|
594
|
+
export declare function convertPointsHomogeneous(
|
|
595
|
+
src: InputArray,
|
|
596
|
+
dst: OutputArray,
|
|
597
|
+
): void;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* The function converts points from Euclidean to homogeneous space by appending 1's to the tuple of
|
|
601
|
+
* point coordinates. That is, each point (x1, x2, ..., xn) is converted to (x1, x2, ..., xn, 1).
|
|
602
|
+
*
|
|
603
|
+
* @param src Input vector of N-dimensional points.
|
|
604
|
+
*
|
|
605
|
+
* @param dst Output vector of N+1-dimensional points.
|
|
606
|
+
*/
|
|
607
|
+
export declare function convertPointsToHomogeneous(
|
|
608
|
+
src: InputArray,
|
|
609
|
+
dst: OutputArray,
|
|
610
|
+
): void;
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* The function implements the Optimal Triangulation Method (see Multiple View Geometry for details).
|
|
614
|
+
* For each given point correspondence points1[i] <-> points2[i], and a fundamental matrix F, it
|
|
615
|
+
* computes the corrected correspondences newPoints1[i] <-> newPoints2[i] that minimize the geometric
|
|
616
|
+
* error `$d(points1[i], newPoints1[i])^2 + d(points2[i],newPoints2[i])^2$` (where `$d(a,b)$` is the
|
|
617
|
+
* geometric distance between points `$a$` and `$b$` ) subject to the epipolar constraint
|
|
618
|
+
* `$newPoints2^T * F * newPoints1 = 0$` .
|
|
619
|
+
*
|
|
620
|
+
* @param F 3x3 fundamental matrix.
|
|
621
|
+
*
|
|
622
|
+
* @param points1 1xN array containing the first set of points.
|
|
623
|
+
*
|
|
624
|
+
* @param points2 1xN array containing the second set of points.
|
|
625
|
+
*
|
|
626
|
+
* @param newPoints1 The optimized points1.
|
|
627
|
+
*
|
|
628
|
+
* @param newPoints2 The optimized points2.
|
|
629
|
+
*/
|
|
630
|
+
export declare function correctMatches(
|
|
631
|
+
F: InputArray,
|
|
632
|
+
points1: InputArray,
|
|
633
|
+
points2: InputArray,
|
|
634
|
+
newPoints1: OutputArray,
|
|
635
|
+
newPoints2: OutputArray,
|
|
636
|
+
): void;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* This function decompose an essential matrix E using svd decomposition HartleyZ00 . Generally 4
|
|
640
|
+
* possible poses exists for a given E. They are `$[R_1, t]$`, `$[R_1, -t]$`, `$[R_2, t]$`, `$[R_2,
|
|
641
|
+
* -t]$`. By decomposing E, you can only get the direction of the translation, so the function returns
|
|
642
|
+
* unit t.
|
|
643
|
+
*
|
|
644
|
+
* @param E The input essential matrix.
|
|
645
|
+
*
|
|
646
|
+
* @param R1 One possible rotation matrix.
|
|
647
|
+
*
|
|
648
|
+
* @param R2 Another possible rotation matrix.
|
|
649
|
+
*
|
|
650
|
+
* @param t One possible translation.
|
|
651
|
+
*/
|
|
652
|
+
export declare function decomposeEssentialMat(
|
|
653
|
+
E: InputArray,
|
|
654
|
+
R1: OutputArray,
|
|
655
|
+
R2: OutputArray,
|
|
656
|
+
t: OutputArray,
|
|
657
|
+
): void;
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* This function extracts relative camera motion between two views observing a planar object from the
|
|
661
|
+
* homography H induced by the plane. The intrinsic camera matrix K must also be provided. The function
|
|
662
|
+
* may return up to four mathematical solution sets. At least two of the solutions may further be
|
|
663
|
+
* invalidated if point correspondences are available by applying positive depth constraint (all points
|
|
664
|
+
* must be in front of the camera). The decomposition method is described in detail in Malis .
|
|
665
|
+
*
|
|
666
|
+
* @param H The input homography matrix between two images.
|
|
667
|
+
*
|
|
668
|
+
* @param K The input intrinsic camera calibration matrix.
|
|
669
|
+
*
|
|
670
|
+
* @param rotations Array of rotation matrices.
|
|
671
|
+
*
|
|
672
|
+
* @param translations Array of translation matrices.
|
|
673
|
+
*
|
|
674
|
+
* @param normals Array of plane normal matrices.
|
|
675
|
+
*/
|
|
676
|
+
export declare function decomposeHomographyMat(
|
|
677
|
+
H: InputArray,
|
|
678
|
+
K: InputArray,
|
|
679
|
+
rotations: OutputArrayOfArrays,
|
|
680
|
+
translations: OutputArrayOfArrays,
|
|
681
|
+
normals: OutputArrayOfArrays,
|
|
682
|
+
): int;
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* The function computes a decomposition of a projection matrix into a calibration and a rotation
|
|
686
|
+
* matrix and the position of a camera.
|
|
687
|
+
*
|
|
688
|
+
* It optionally returns three rotation matrices, one for each axis, and three Euler angles that could
|
|
689
|
+
* be used in OpenGL. Note, there is always more than one sequence of rotations about the three
|
|
690
|
+
* principal axes that results in the same orientation of an object, e.g. see Slabaugh . Returned tree
|
|
691
|
+
* rotation matrices and corresponding three Euler angles are only one of the possible solutions.
|
|
692
|
+
*
|
|
693
|
+
* The function is based on RQDecomp3x3 .
|
|
694
|
+
*
|
|
695
|
+
* @param projMatrix 3x4 input projection matrix P.
|
|
696
|
+
*
|
|
697
|
+
* @param cameraMatrix Output 3x3 camera matrix K.
|
|
698
|
+
*
|
|
699
|
+
* @param rotMatrix Output 3x3 external rotation matrix R.
|
|
700
|
+
*
|
|
701
|
+
* @param transVect Output 4x1 translation vector T.
|
|
702
|
+
*
|
|
703
|
+
* @param rotMatrixX Optional 3x3 rotation matrix around x-axis.
|
|
704
|
+
*
|
|
705
|
+
* @param rotMatrixY Optional 3x3 rotation matrix around y-axis.
|
|
706
|
+
*
|
|
707
|
+
* @param rotMatrixZ Optional 3x3 rotation matrix around z-axis.
|
|
708
|
+
*
|
|
709
|
+
* @param eulerAngles Optional three-element vector containing three Euler angles of rotation in
|
|
710
|
+
* degrees.
|
|
711
|
+
*/
|
|
712
|
+
export declare function decomposeProjectionMatrix(
|
|
713
|
+
projMatrix: InputArray,
|
|
714
|
+
cameraMatrix: OutputArray,
|
|
715
|
+
rotMatrix: OutputArray,
|
|
716
|
+
transVect: OutputArray,
|
|
717
|
+
rotMatrixX?: OutputArray,
|
|
718
|
+
rotMatrixY?: OutputArray,
|
|
719
|
+
rotMatrixZ?: OutputArray,
|
|
720
|
+
eulerAngles?: OutputArray,
|
|
721
|
+
): void;
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* The function draws individual chessboard corners detected either as red circles if the board was not
|
|
725
|
+
* found, or as colored corners connected with lines if the board was found.
|
|
726
|
+
*
|
|
727
|
+
* @param image Destination image. It must be an 8-bit color image.
|
|
728
|
+
*
|
|
729
|
+
* @param patternSize Number of inner corners per a chessboard row and column (patternSize =
|
|
730
|
+
* cv::Size(points_per_row,points_per_column)).
|
|
731
|
+
*
|
|
732
|
+
* @param corners Array of detected corners, the output of findChessboardCorners.
|
|
733
|
+
*
|
|
734
|
+
* @param patternWasFound Parameter indicating whether the complete board was found or not. The return
|
|
735
|
+
* value of findChessboardCorners should be passed here.
|
|
736
|
+
*/
|
|
737
|
+
export declare function drawChessboardCorners(
|
|
738
|
+
image: InputOutputArray,
|
|
739
|
+
patternSize: Size,
|
|
740
|
+
corners: InputArray,
|
|
741
|
+
patternWasFound: bool,
|
|
742
|
+
): void;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* [solvePnP]
|
|
746
|
+
*
|
|
747
|
+
* This function draws the axes of the world/object coordinate system w.r.t. to the camera frame. OX is
|
|
748
|
+
* drawn in red, OY in green and OZ in blue.
|
|
749
|
+
*
|
|
750
|
+
* @param image Input/output image. It must have 1 or 3 channels. The number of channels is not
|
|
751
|
+
* altered.
|
|
752
|
+
*
|
|
753
|
+
* @param cameraMatrix Input 3x3 floating-point matrix of camera intrinsic parameters. $A =
|
|
754
|
+
* \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$
|
|
755
|
+
*
|
|
756
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6
|
|
757
|
+
* [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is empty,
|
|
758
|
+
* the zero distortion coefficients are assumed.
|
|
759
|
+
*
|
|
760
|
+
* @param rvec Rotation vector (see Rodrigues ) that, together with tvec, brings points from the model
|
|
761
|
+
* coordinate system to the camera coordinate system.
|
|
762
|
+
*
|
|
763
|
+
* @param tvec Translation vector.
|
|
764
|
+
*
|
|
765
|
+
* @param length Length of the painted axes in the same unit than tvec (usually in meters).
|
|
766
|
+
*
|
|
767
|
+
* @param thickness Line thickness of the painted axes.
|
|
768
|
+
*/
|
|
769
|
+
export declare function drawFrameAxes(
|
|
770
|
+
image: InputOutputArray,
|
|
771
|
+
cameraMatrix: InputArray,
|
|
772
|
+
distCoeffs: InputArray,
|
|
773
|
+
rvec: InputArray,
|
|
774
|
+
tvec: InputArray,
|
|
775
|
+
length: float,
|
|
776
|
+
thickness?: int,
|
|
777
|
+
): void;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* It computes `\\[ \\begin{bmatrix} x\\\\ y\\\\ \\end{bmatrix} = \\begin{bmatrix} a_{11} & a_{12}\\\\
|
|
781
|
+
* a_{21} & a_{22}\\\\ \\end{bmatrix} \\begin{bmatrix} X\\\\ Y\\\\ \\end{bmatrix} + \\begin{bmatrix}
|
|
782
|
+
* b_1\\\\ b_2\\\\ \\end{bmatrix} \\]`
|
|
783
|
+
*
|
|
784
|
+
* Output 2D affine transformation matrix `$2 \\times 3$` or empty matrix if transformation could not
|
|
785
|
+
* be estimated. The returned matrix has the following form: `\\[ \\begin{bmatrix} a_{11} & a_{12} &
|
|
786
|
+
* b_1\\\\ a_{21} & a_{22} & b_2\\\\ \\end{bmatrix} \\]`
|
|
787
|
+
* The function estimates an optimal 2D affine transformation between two 2D point sets using the
|
|
788
|
+
* selected robust algorithm.
|
|
789
|
+
*
|
|
790
|
+
* The computed transformation is then refined further (using only inliers) with the
|
|
791
|
+
* Levenberg-Marquardt method to reduce the re-projection error even more.
|
|
792
|
+
*
|
|
793
|
+
* The RANSAC method can handle practically any ratio of outliers but needs a threshold to distinguish
|
|
794
|
+
* inliers from outliers. The method LMeDS does not need any threshold but it works correctly only when
|
|
795
|
+
* there are more than 50% of inliers.
|
|
796
|
+
*
|
|
797
|
+
* [estimateAffinePartial2D], [getAffineTransform]
|
|
798
|
+
*
|
|
799
|
+
* @param from First input 2D point set containing $(X,Y)$.
|
|
800
|
+
*
|
|
801
|
+
* @param to Second input 2D point set containing $(x,y)$.
|
|
802
|
+
*
|
|
803
|
+
* @param inliers Output vector indicating which points are inliers (1-inlier, 0-outlier).
|
|
804
|
+
*
|
|
805
|
+
* @param method Robust method used to compute transformation. The following methods are possible:
|
|
806
|
+
* cv::RANSAC - RANSAC-based robust methodcv::LMEDS - Least-Median robust method RANSAC is the default
|
|
807
|
+
* method.
|
|
808
|
+
*
|
|
809
|
+
* @param ransacReprojThreshold Maximum reprojection error in the RANSAC algorithm to consider a point
|
|
810
|
+
* as an inlier. Applies only to RANSAC.
|
|
811
|
+
*
|
|
812
|
+
* @param maxIters The maximum number of robust method iterations.
|
|
813
|
+
*
|
|
814
|
+
* @param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything
|
|
815
|
+
* between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation
|
|
816
|
+
* significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.
|
|
817
|
+
*
|
|
818
|
+
* @param refineIters Maximum number of iterations of refining algorithm (Levenberg-Marquardt). Passing
|
|
819
|
+
* 0 will disable refining, so the output matrix will be output of robust method.
|
|
820
|
+
*/
|
|
821
|
+
export declare function estimateAffine2D(
|
|
822
|
+
from: InputArray,
|
|
823
|
+
to: InputArray,
|
|
824
|
+
inliers?: OutputArray,
|
|
825
|
+
method?: int,
|
|
826
|
+
ransacReprojThreshold?: double,
|
|
827
|
+
maxIters?: size_t,
|
|
828
|
+
confidence?: double,
|
|
829
|
+
refineIters?: size_t,
|
|
830
|
+
): any;
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* It computes `\\[ \\begin{bmatrix} x\\\\ y\\\\ z\\\\ \\end{bmatrix} = \\begin{bmatrix} a_{11} &
|
|
834
|
+
* a_{12} & a_{13}\\\\ a_{21} & a_{22} & a_{23}\\\\ a_{31} & a_{32} & a_{33}\\\\ \\end{bmatrix}
|
|
835
|
+
* \\begin{bmatrix} X\\\\ Y\\\\ Z\\\\ \\end{bmatrix} + \\begin{bmatrix} b_1\\\\ b_2\\\\ b_3\\\\
|
|
836
|
+
* \\end{bmatrix} \\]`
|
|
837
|
+
*
|
|
838
|
+
* The function estimates an optimal 3D affine transformation between two 3D point sets using the
|
|
839
|
+
* RANSAC algorithm.
|
|
840
|
+
*
|
|
841
|
+
* @param src First input 3D point set containing $(X,Y,Z)$.
|
|
842
|
+
*
|
|
843
|
+
* @param dst Second input 3D point set containing $(x,y,z)$.
|
|
844
|
+
*
|
|
845
|
+
* @param out Output 3D affine transformation matrix $3 \times 4$ of the form \[ \begin{bmatrix} a_{11}
|
|
846
|
+
* & a_{12} & a_{13} & b_1\\ a_{21} & a_{22} & a_{23} & b_2\\ a_{31} & a_{32} & a_{33} & b_3\\
|
|
847
|
+
* \end{bmatrix} \]
|
|
848
|
+
*
|
|
849
|
+
* @param inliers Output vector indicating which points are inliers (1-inlier, 0-outlier).
|
|
850
|
+
*
|
|
851
|
+
* @param ransacThreshold Maximum reprojection error in the RANSAC algorithm to consider a point as an
|
|
852
|
+
* inlier.
|
|
853
|
+
*
|
|
854
|
+
* @param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything
|
|
855
|
+
* between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation
|
|
856
|
+
* significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.
|
|
857
|
+
*/
|
|
858
|
+
export declare function estimateAffine3D(
|
|
859
|
+
src: InputArray,
|
|
860
|
+
dst: InputArray,
|
|
861
|
+
out: OutputArray,
|
|
862
|
+
inliers: OutputArray,
|
|
863
|
+
ransacThreshold?: double,
|
|
864
|
+
confidence?: double,
|
|
865
|
+
): int;
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Output 2D affine transformation (4 degrees of freedom) matrix `$2 \\times 3$` or empty matrix if
|
|
869
|
+
* transformation could not be estimated.
|
|
870
|
+
* The function estimates an optimal 2D affine transformation with 4 degrees of freedom limited to
|
|
871
|
+
* combinations of translation, rotation, and uniform scaling. Uses the selected algorithm for robust
|
|
872
|
+
* estimation.
|
|
873
|
+
*
|
|
874
|
+
* The computed transformation is then refined further (using only inliers) with the
|
|
875
|
+
* Levenberg-Marquardt method to reduce the re-projection error even more.
|
|
876
|
+
*
|
|
877
|
+
* Estimated transformation matrix is: `\\[ \\begin{bmatrix} \\cos(\\theta) \\cdot s & -\\sin(\\theta)
|
|
878
|
+
* \\cdot s & t_x \\\\ \\sin(\\theta) \\cdot s & \\cos(\\theta) \\cdot s & t_y \\end{bmatrix} \\]`
|
|
879
|
+
* Where `$ \\theta $` is the rotation angle, `$ s $` the scaling factor and `$ t_x, t_y $` are
|
|
880
|
+
* translations in `$ x, y $` axes respectively.
|
|
881
|
+
*
|
|
882
|
+
* The RANSAC method can handle practically any ratio of outliers but need a threshold to distinguish
|
|
883
|
+
* inliers from outliers. The method LMeDS does not need any threshold but it works correctly only when
|
|
884
|
+
* there are more than 50% of inliers.
|
|
885
|
+
*
|
|
886
|
+
* [estimateAffine2D], [getAffineTransform]
|
|
887
|
+
*
|
|
888
|
+
* @param from First input 2D point set.
|
|
889
|
+
*
|
|
890
|
+
* @param to Second input 2D point set.
|
|
891
|
+
*
|
|
892
|
+
* @param inliers Output vector indicating which points are inliers.
|
|
893
|
+
*
|
|
894
|
+
* @param method Robust method used to compute transformation. The following methods are possible:
|
|
895
|
+
* cv::RANSAC - RANSAC-based robust methodcv::LMEDS - Least-Median robust method RANSAC is the default
|
|
896
|
+
* method.
|
|
897
|
+
*
|
|
898
|
+
* @param ransacReprojThreshold Maximum reprojection error in the RANSAC algorithm to consider a point
|
|
899
|
+
* as an inlier. Applies only to RANSAC.
|
|
900
|
+
*
|
|
901
|
+
* @param maxIters The maximum number of robust method iterations.
|
|
902
|
+
*
|
|
903
|
+
* @param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything
|
|
904
|
+
* between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation
|
|
905
|
+
* significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.
|
|
906
|
+
*
|
|
907
|
+
* @param refineIters Maximum number of iterations of refining algorithm (Levenberg-Marquardt). Passing
|
|
908
|
+
* 0 will disable refining, so the output matrix will be output of robust method.
|
|
909
|
+
*/
|
|
910
|
+
export declare function estimateAffinePartial2D(
|
|
911
|
+
from: InputArray,
|
|
912
|
+
to: InputArray,
|
|
913
|
+
inliers?: OutputArray,
|
|
914
|
+
method?: int,
|
|
915
|
+
ransacReprojThreshold?: double,
|
|
916
|
+
maxIters?: size_t,
|
|
917
|
+
confidence?: double,
|
|
918
|
+
refineIters?: size_t,
|
|
919
|
+
): any;
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* This function is intended to filter the output of the decomposeHomographyMat based on additional
|
|
923
|
+
* information as described in Malis . The summary of the method: the decomposeHomographyMat function
|
|
924
|
+
* returns 2 unique solutions and their "opposites" for a total of 4 solutions. If we have access to
|
|
925
|
+
* the sets of points visible in the camera frame before and after the homography transformation is
|
|
926
|
+
* applied, we can determine which are the true potential solutions and which are the opposites by
|
|
927
|
+
* verifying which homographies are consistent with all visible reference points being in front of the
|
|
928
|
+
* camera. The inputs are left unchanged; the filtered solution set is returned as indices into the
|
|
929
|
+
* existing one.
|
|
930
|
+
*
|
|
931
|
+
* @param rotations Vector of rotation matrices.
|
|
932
|
+
*
|
|
933
|
+
* @param normals Vector of plane normal matrices.
|
|
934
|
+
*
|
|
935
|
+
* @param beforePoints Vector of (rectified) visible reference points before the homography is applied
|
|
936
|
+
*
|
|
937
|
+
* @param afterPoints Vector of (rectified) visible reference points after the homography is applied
|
|
938
|
+
*
|
|
939
|
+
* @param possibleSolutions Vector of int indices representing the viable solution set after filtering
|
|
940
|
+
*
|
|
941
|
+
* @param pointsMask optional Mat/Vector of 8u type representing the mask for the inliers as given by
|
|
942
|
+
* the findHomography function
|
|
943
|
+
*/
|
|
944
|
+
export declare function filterHomographyDecompByVisibleRefpoints(
|
|
945
|
+
rotations: InputArrayOfArrays,
|
|
946
|
+
normals: InputArrayOfArrays,
|
|
947
|
+
beforePoints: InputArray,
|
|
948
|
+
afterPoints: InputArray,
|
|
949
|
+
possibleSolutions: OutputArray,
|
|
950
|
+
pointsMask?: InputArray,
|
|
951
|
+
): void;
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* @param img The input 16-bit signed disparity image
|
|
955
|
+
*
|
|
956
|
+
* @param newVal The disparity value used to paint-off the speckles
|
|
957
|
+
*
|
|
958
|
+
* @param maxSpeckleSize The maximum speckle size to consider it a speckle. Larger blobs are not
|
|
959
|
+
* affected by the algorithm
|
|
960
|
+
*
|
|
961
|
+
* @param maxDiff Maximum difference between neighbor disparity pixels to put them into the same blob.
|
|
962
|
+
* Note that since StereoBM, StereoSGBM and may be other algorithms return a fixed-point disparity map,
|
|
963
|
+
* where disparity values are multiplied by 16, this scale factor should be taken into account when
|
|
964
|
+
* specifying this parameter value.
|
|
965
|
+
*
|
|
966
|
+
* @param buf The optional temporary buffer to avoid memory allocation within the function.
|
|
967
|
+
*/
|
|
968
|
+
export declare function filterSpeckles(
|
|
969
|
+
img: InputOutputArray,
|
|
970
|
+
newVal: double,
|
|
971
|
+
maxSpeckleSize: int,
|
|
972
|
+
maxDiff: double,
|
|
973
|
+
buf?: InputOutputArray,
|
|
974
|
+
): void;
|
|
975
|
+
|
|
976
|
+
export declare function find4QuadCornerSubpix(
|
|
977
|
+
img: InputArray,
|
|
978
|
+
corners: InputOutputArray,
|
|
979
|
+
region_size: Size,
|
|
980
|
+
): bool;
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* The function attempts to determine whether the input image is a view of the chessboard pattern and
|
|
984
|
+
* locate the internal chessboard corners. The function returns a non-zero value if all of the corners
|
|
985
|
+
* are found and they are placed in a certain order (row by row, left to right in every row).
|
|
986
|
+
* Otherwise, if the function fails to find all the corners or reorder them, it returns 0. For example,
|
|
987
|
+
* a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black
|
|
988
|
+
* squares touch each other. The detected coordinates are approximate, and to determine their positions
|
|
989
|
+
* more accurately, the function calls cornerSubPix. You also may use the function cornerSubPix with
|
|
990
|
+
* different parameters if returned coordinates are not accurate enough.
|
|
991
|
+
*
|
|
992
|
+
* Sample usage of detecting and drawing chessboard corners: :
|
|
993
|
+
*
|
|
994
|
+
* ```cpp
|
|
995
|
+
* Size patternsize(8,6); //interior number of corners
|
|
996
|
+
* Mat gray = ....; //source image
|
|
997
|
+
* vector<Point2f> corners; //this will be filled by the detected corners
|
|
998
|
+
*
|
|
999
|
+
* //CALIB_CB_FAST_CHECK saves a lot of time on images
|
|
1000
|
+
* //that do not contain any chessboard corners
|
|
1001
|
+
* bool patternfound = findChessboardCorners(gray, patternsize, corners,
|
|
1002
|
+
* CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE
|
|
1003
|
+
* + CALIB_CB_FAST_CHECK);
|
|
1004
|
+
*
|
|
1005
|
+
* if(patternfound)
|
|
1006
|
+
* cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
|
|
1007
|
+
* TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
|
|
1008
|
+
*
|
|
1009
|
+
* drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
|
|
1010
|
+
* ```
|
|
1011
|
+
*
|
|
1012
|
+
* The function requires white space (like a square-thick border, the wider the better) around the
|
|
1013
|
+
* board to make the detection more robust in various environments. Otherwise, if there is no border
|
|
1014
|
+
* and the background is dark, the outer black squares cannot be segmented properly and so the square
|
|
1015
|
+
* grouping and ordering algorithm fails.
|
|
1016
|
+
*
|
|
1017
|
+
* @param image Source chessboard view. It must be an 8-bit grayscale or color image.
|
|
1018
|
+
*
|
|
1019
|
+
* @param patternSize Number of inner corners per a chessboard row and column ( patternSize =
|
|
1020
|
+
* cv::Size(points_per_row,points_per_colum) = cv::Size(columns,rows) ).
|
|
1021
|
+
*
|
|
1022
|
+
* @param corners Output array of detected corners.
|
|
1023
|
+
*
|
|
1024
|
+
* @param flags Various operation flags that can be zero or a combination of the following values:
|
|
1025
|
+
* CALIB_CB_ADAPTIVE_THRESH Use adaptive thresholding to convert the image to black and white, rather
|
|
1026
|
+
* than a fixed threshold level (computed from the average image brightness).CALIB_CB_NORMALIZE_IMAGE
|
|
1027
|
+
* Normalize the image gamma with equalizeHist before applying fixed or adaptive
|
|
1028
|
+
* thresholding.CALIB_CB_FILTER_QUADS Use additional criteria (like contour area, perimeter,
|
|
1029
|
+
* square-like shape) to filter out false quads extracted at the contour retrieval
|
|
1030
|
+
* stage.CALIB_CB_FAST_CHECK Run a fast check on the image that looks for chessboard corners, and
|
|
1031
|
+
* shortcut the call if none is found. This can drastically speed up the call in the degenerate
|
|
1032
|
+
* condition when no chessboard is observed.
|
|
1033
|
+
*/
|
|
1034
|
+
export declare function findChessboardCorners(
|
|
1035
|
+
image: InputArray,
|
|
1036
|
+
patternSize: Size,
|
|
1037
|
+
corners: OutputArray,
|
|
1038
|
+
flags?: int,
|
|
1039
|
+
): bool;
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* The function is analog to findchessboardCorners but uses a localized radon transformation
|
|
1043
|
+
* approximated by box filters being more robust to all sort of noise, faster on larger images and is
|
|
1044
|
+
* able to directly return the sub-pixel position of the internal chessboard corners. The Method is
|
|
1045
|
+
* based on the paper duda2018 "Accurate Detection and Localization of Checkerboard Corners for
|
|
1046
|
+
* Calibration" demonstrating that the returned sub-pixel positions are more accurate than the one
|
|
1047
|
+
* returned by cornerSubPix allowing a precise camera calibration for demanding applications.
|
|
1048
|
+
*
|
|
1049
|
+
* The function requires a white boarder with roughly the same width as one of the checkerboard fields
|
|
1050
|
+
* around the whole board to improve the detection in various environments. In addition, because of the
|
|
1051
|
+
* localized radon transformation it is beneficial to use round corners for the field corners which are
|
|
1052
|
+
* located on the outside of the board. The following figure illustrates a sample checkerboard
|
|
1053
|
+
* optimized for the detection. However, any other checkerboard can be used as well.
|
|
1054
|
+
*
|
|
1055
|
+
* @param image Source chessboard view. It must be an 8-bit grayscale or color image.
|
|
1056
|
+
*
|
|
1057
|
+
* @param patternSize Number of inner corners per a chessboard row and column ( patternSize =
|
|
1058
|
+
* cv::Size(points_per_row,points_per_colum) = cv::Size(columns,rows) ).
|
|
1059
|
+
*
|
|
1060
|
+
* @param corners Output array of detected corners.
|
|
1061
|
+
*
|
|
1062
|
+
* @param flags Various operation flags that can be zero or a combination of the following values:
|
|
1063
|
+
* CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before
|
|
1064
|
+
* detection.CALIB_CB_EXHAUSTIVE Run an exhaustive search to improve detection rate.CALIB_CB_ACCURACY
|
|
1065
|
+
* Up sample input image to improve sub-pixel accuracy due to aliasing effects. This should be used if
|
|
1066
|
+
* an accurate camera calibration is required.
|
|
1067
|
+
*/
|
|
1068
|
+
export declare function findChessboardCornersSB(
|
|
1069
|
+
image: InputArray,
|
|
1070
|
+
patternSize: Size,
|
|
1071
|
+
corners: OutputArray,
|
|
1072
|
+
flags?: int,
|
|
1073
|
+
): bool;
|
|
1074
|
+
|
|
1075
|
+
/**
|
|
1076
|
+
* The function attempts to determine whether the input image contains a grid of circles. If it is, the
|
|
1077
|
+
* function locates centers of the circles. The function returns a non-zero value if all of the centers
|
|
1078
|
+
* have been found and they have been placed in a certain order (row by row, left to right in every
|
|
1079
|
+
* row). Otherwise, if the function fails to find all the corners or reorder them, it returns 0.
|
|
1080
|
+
*
|
|
1081
|
+
* Sample usage of detecting and drawing the centers of circles: :
|
|
1082
|
+
*
|
|
1083
|
+
* ```cpp
|
|
1084
|
+
* Size patternsize(7,7); //number of centers
|
|
1085
|
+
* Mat gray = ....; //source image
|
|
1086
|
+
* vector<Point2f> centers; //this will be filled by the detected centers
|
|
1087
|
+
*
|
|
1088
|
+
* bool patternfound = findCirclesGrid(gray, patternsize, centers);
|
|
1089
|
+
*
|
|
1090
|
+
* drawChessboardCorners(img, patternsize, Mat(centers), patternfound);
|
|
1091
|
+
* ```
|
|
1092
|
+
*
|
|
1093
|
+
* The function requires white space (like a square-thick border, the wider the better) around the
|
|
1094
|
+
* board to make the detection more robust in various environments.
|
|
1095
|
+
*
|
|
1096
|
+
* @param image grid view of input circles; it must be an 8-bit grayscale or color image.
|
|
1097
|
+
*
|
|
1098
|
+
* @param patternSize number of circles per row and column ( patternSize = Size(points_per_row,
|
|
1099
|
+
* points_per_colum) ).
|
|
1100
|
+
*
|
|
1101
|
+
* @param centers output array of detected centers.
|
|
1102
|
+
*
|
|
1103
|
+
* @param flags various operation flags that can be one of the following values:
|
|
1104
|
+
* CALIB_CB_SYMMETRIC_GRID uses symmetric pattern of circles.CALIB_CB_ASYMMETRIC_GRID uses asymmetric
|
|
1105
|
+
* pattern of circles.CALIB_CB_CLUSTERING uses a special algorithm for grid detection. It is more
|
|
1106
|
+
* robust to perspective distortions but much more sensitive to background clutter.
|
|
1107
|
+
*
|
|
1108
|
+
* @param blobDetector feature detector that finds blobs like dark circles on light background.
|
|
1109
|
+
*
|
|
1110
|
+
* @param parameters struct for finding circles in a grid pattern.
|
|
1111
|
+
*/
|
|
1112
|
+
export declare function findCirclesGrid(
|
|
1113
|
+
image: InputArray,
|
|
1114
|
+
patternSize: Size,
|
|
1115
|
+
centers: OutputArray,
|
|
1116
|
+
flags: int,
|
|
1117
|
+
blobDetector: any,
|
|
1118
|
+
parameters: any,
|
|
1119
|
+
): bool;
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* This is an overloaded member function, provided for convenience. It differs from the above function
|
|
1123
|
+
* only in what argument(s) it accepts.
|
|
1124
|
+
*/
|
|
1125
|
+
export declare function findCirclesGrid(
|
|
1126
|
+
image: InputArray,
|
|
1127
|
+
patternSize: Size,
|
|
1128
|
+
centers: OutputArray,
|
|
1129
|
+
flags?: int,
|
|
1130
|
+
blobDetector?: any,
|
|
1131
|
+
): bool;
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* This function estimates essential matrix based on the five-point algorithm solver in Nister03 .
|
|
1135
|
+
* SteweniusCFS is also a related. The epipolar geometry is described by the following equation:
|
|
1136
|
+
*
|
|
1137
|
+
* `\\[[p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\\]`
|
|
1138
|
+
*
|
|
1139
|
+
* where `$E$` is an essential matrix, `$p_1$` and `$p_2$` are corresponding points in the first and
|
|
1140
|
+
* the second images, respectively. The result of this function may be passed further to
|
|
1141
|
+
* decomposeEssentialMat or recoverPose to recover the relative pose between cameras.
|
|
1142
|
+
*
|
|
1143
|
+
* @param points1 Array of N (N >= 5) 2D points from the first image. The point coordinates should be
|
|
1144
|
+
* floating-point (single or double precision).
|
|
1145
|
+
*
|
|
1146
|
+
* @param points2 Array of the second image points of the same size and format as points1 .
|
|
1147
|
+
*
|
|
1148
|
+
* @param cameraMatrix Camera matrix $K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$ . Note
|
|
1149
|
+
* that this function assumes that points1 and points2 are feature points from cameras with the same
|
|
1150
|
+
* camera matrix.
|
|
1151
|
+
*
|
|
1152
|
+
* @param method Method for computing an essential matrix.
|
|
1153
|
+
* RANSAC for the RANSAC algorithm.LMEDS for the LMedS algorithm.
|
|
1154
|
+
*
|
|
1155
|
+
* @param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of
|
|
1156
|
+
* confidence (probability) that the estimated matrix is correct.
|
|
1157
|
+
*
|
|
1158
|
+
* @param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar
|
|
1159
|
+
* line in pixels, beyond which the point is considered an outlier and is not used for computing the
|
|
1160
|
+
* final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the
|
|
1161
|
+
* point localization, image resolution, and the image noise.
|
|
1162
|
+
*
|
|
1163
|
+
* @param mask Output array of N elements, every element of which is set to 0 for outliers and to 1 for
|
|
1164
|
+
* the other points. The array is computed only in the RANSAC and LMedS methods.
|
|
1165
|
+
*/
|
|
1166
|
+
export declare function findEssentialMat(
|
|
1167
|
+
points1: InputArray,
|
|
1168
|
+
points2: InputArray,
|
|
1169
|
+
cameraMatrix: InputArray,
|
|
1170
|
+
method?: int,
|
|
1171
|
+
prob?: double,
|
|
1172
|
+
threshold?: double,
|
|
1173
|
+
mask?: OutputArray,
|
|
1174
|
+
): Mat;
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* This is an overloaded member function, provided for convenience. It differs from the above function
|
|
1178
|
+
* only in what argument(s) it accepts.
|
|
1179
|
+
* This function differs from the one above that it computes camera matrix from focal length and
|
|
1180
|
+
* principal point:
|
|
1181
|
+
*
|
|
1182
|
+
* `\\[K = \\begin{bmatrix} f & 0 & x_{pp} \\\\ 0 & f & y_{pp} \\\\ 0 & 0 & 1 \\end{bmatrix}\\]`
|
|
1183
|
+
*
|
|
1184
|
+
* @param points1 Array of N (N >= 5) 2D points from the first image. The point coordinates should be
|
|
1185
|
+
* floating-point (single or double precision).
|
|
1186
|
+
*
|
|
1187
|
+
* @param points2 Array of the second image points of the same size and format as points1 .
|
|
1188
|
+
*
|
|
1189
|
+
* @param focal focal length of the camera. Note that this function assumes that points1 and points2
|
|
1190
|
+
* are feature points from cameras with same focal length and principal point.
|
|
1191
|
+
*
|
|
1192
|
+
* @param pp principal point of the camera.
|
|
1193
|
+
*
|
|
1194
|
+
* @param method Method for computing a fundamental matrix.
|
|
1195
|
+
* RANSAC for the RANSAC algorithm.LMEDS for the LMedS algorithm.
|
|
1196
|
+
*
|
|
1197
|
+
* @param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of
|
|
1198
|
+
* confidence (probability) that the estimated matrix is correct.
|
|
1199
|
+
*
|
|
1200
|
+
* @param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar
|
|
1201
|
+
* line in pixels, beyond which the point is considered an outlier and is not used for computing the
|
|
1202
|
+
* final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the
|
|
1203
|
+
* point localization, image resolution, and the image noise.
|
|
1204
|
+
*
|
|
1205
|
+
* @param mask Output array of N elements, every element of which is set to 0 for outliers and to 1 for
|
|
1206
|
+
* the other points. The array is computed only in the RANSAC and LMedS methods.
|
|
1207
|
+
*/
|
|
1208
|
+
export declare function findEssentialMat(
|
|
1209
|
+
points1: InputArray,
|
|
1210
|
+
points2: InputArray,
|
|
1211
|
+
focal?: double,
|
|
1212
|
+
pp?: Point2d,
|
|
1213
|
+
method?: int,
|
|
1214
|
+
prob?: double,
|
|
1215
|
+
threshold?: double,
|
|
1216
|
+
mask?: OutputArray,
|
|
1217
|
+
): Mat;
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* `\\[[p_2; 1]^T F [p_1; 1] = 0\\]`
|
|
1221
|
+
*
|
|
1222
|
+
* where `$F$` is a fundamental matrix, `$p_1$` and `$p_2$` are corresponding points in the first and
|
|
1223
|
+
* the second images, respectively.
|
|
1224
|
+
*
|
|
1225
|
+
* The function calculates the fundamental matrix using one of four methods listed above and returns
|
|
1226
|
+
* the found fundamental matrix. Normally just one matrix is found. But in case of the 7-point
|
|
1227
|
+
* algorithm, the function may return up to 3 solutions ( `$9 \\times 3$` matrix that stores all 3
|
|
1228
|
+
* matrices sequentially).
|
|
1229
|
+
*
|
|
1230
|
+
* The calculated fundamental matrix may be passed further to computeCorrespondEpilines that finds the
|
|
1231
|
+
* epipolar lines corresponding to the specified points. It can also be passed to
|
|
1232
|
+
* stereoRectifyUncalibrated to compute the rectification transformation. :
|
|
1233
|
+
*
|
|
1234
|
+
* ```cpp
|
|
1235
|
+
* // Example. Estimation of fundamental matrix using the RANSAC algorithm
|
|
1236
|
+
* int point_count = 100;
|
|
1237
|
+
* vector<Point2f> points1(point_count);
|
|
1238
|
+
* vector<Point2f> points2(point_count);
|
|
1239
|
+
*
|
|
1240
|
+
* // initialize the points here ...
|
|
1241
|
+
* for( int i = 0; i < point_count; i++ )
|
|
1242
|
+
* {
|
|
1243
|
+
* points1[i] = ...;
|
|
1244
|
+
* points2[i] = ...;
|
|
1245
|
+
* }
|
|
1246
|
+
*
|
|
1247
|
+
* Mat fundamental_matrix =
|
|
1248
|
+
* findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);
|
|
1249
|
+
* ```
|
|
1250
|
+
*
|
|
1251
|
+
* @param points1 Array of N points from the first image. The point coordinates should be
|
|
1252
|
+
* floating-point (single or double precision).
|
|
1253
|
+
*
|
|
1254
|
+
* @param points2 Array of the second image points of the same size and format as points1 .
|
|
1255
|
+
*
|
|
1256
|
+
* @param method Method for computing a fundamental matrix.
|
|
1257
|
+
* CV_FM_7POINT for a 7-point algorithm. $N = 7$CV_FM_8POINT for an 8-point algorithm. $N \ge
|
|
1258
|
+
* 8$CV_FM_RANSAC for the RANSAC algorithm. $N \ge 8$CV_FM_LMEDS for the LMedS algorithm. $N \ge 8$
|
|
1259
|
+
*
|
|
1260
|
+
* @param ransacReprojThreshold Parameter used only for RANSAC. It is the maximum distance from a point
|
|
1261
|
+
* to an epipolar line in pixels, beyond which the point is considered an outlier and is not used for
|
|
1262
|
+
* computing the final fundamental matrix. It can be set to something like 1-3, depending on the
|
|
1263
|
+
* accuracy of the point localization, image resolution, and the image noise.
|
|
1264
|
+
*
|
|
1265
|
+
* @param confidence Parameter used for the RANSAC and LMedS methods only. It specifies a desirable
|
|
1266
|
+
* level of confidence (probability) that the estimated matrix is correct.
|
|
1267
|
+
*
|
|
1268
|
+
* @param mask The epipolar geometry is described by the following equation:
|
|
1269
|
+
*/
|
|
1270
|
+
export declare function findFundamentalMat(
|
|
1271
|
+
points1: InputArray,
|
|
1272
|
+
points2: InputArray,
|
|
1273
|
+
method?: int,
|
|
1274
|
+
ransacReprojThreshold?: double,
|
|
1275
|
+
confidence?: double,
|
|
1276
|
+
mask?: OutputArray,
|
|
1277
|
+
): Mat;
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* This is an overloaded member function, provided for convenience. It differs from the above function
|
|
1281
|
+
* only in what argument(s) it accepts.
|
|
1282
|
+
*/
|
|
1283
|
+
export declare function findFundamentalMat(
|
|
1284
|
+
points1: InputArray,
|
|
1285
|
+
points2: InputArray,
|
|
1286
|
+
mask: OutputArray,
|
|
1287
|
+
method?: int,
|
|
1288
|
+
ransacReprojThreshold?: double,
|
|
1289
|
+
confidence?: double,
|
|
1290
|
+
): Mat;
|
|
1291
|
+
|
|
1292
|
+
/**
|
|
1293
|
+
* The function finds and returns the perspective transformation `$H$` between the source and the
|
|
1294
|
+
* destination planes:
|
|
1295
|
+
*
|
|
1296
|
+
* `\\[s_i \\vecthree{x'_i}{y'_i}{1} \\sim H \\vecthree{x_i}{y_i}{1}\\]`
|
|
1297
|
+
*
|
|
1298
|
+
* so that the back-projection error
|
|
1299
|
+
*
|
|
1300
|
+
* `\\[\\sum _i \\left ( x'_i- \\frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i +
|
|
1301
|
+
* h_{33}} \\right )^2+ \\left ( y'_i- \\frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i
|
|
1302
|
+
* + h_{33}} \\right )^2\\]`
|
|
1303
|
+
*
|
|
1304
|
+
* is minimized. If the parameter method is set to the default value 0, the function uses all the point
|
|
1305
|
+
* pairs to compute an initial homography estimate with a simple least-squares scheme.
|
|
1306
|
+
*
|
|
1307
|
+
* However, if not all of the point pairs ( `$srcPoints_i$`, `$dstPoints_i$` ) fit the rigid
|
|
1308
|
+
* perspective transformation (that is, there are some outliers), this initial estimate will be poor.
|
|
1309
|
+
* In this case, you can use one of the three robust methods. The methods RANSAC, LMeDS and RHO try
|
|
1310
|
+
* many different random subsets of the corresponding point pairs (of four pairs each, collinear pairs
|
|
1311
|
+
* are discarded), estimate the homography matrix using this subset and a simple least-squares
|
|
1312
|
+
* algorithm, and then compute the quality/goodness of the computed homography (which is the number of
|
|
1313
|
+
* inliers for RANSAC or the least median re-projection error for LMeDS). The best subset is then used
|
|
1314
|
+
* to produce the initial estimate of the homography matrix and the mask of inliers/outliers.
|
|
1315
|
+
*
|
|
1316
|
+
* Regardless of the method, robust or not, the computed homography matrix is refined further (using
|
|
1317
|
+
* inliers only in case of a robust method) with the Levenberg-Marquardt method to reduce the
|
|
1318
|
+
* re-projection error even more.
|
|
1319
|
+
*
|
|
1320
|
+
* The methods RANSAC and RHO can handle practically any ratio of outliers but need a threshold to
|
|
1321
|
+
* distinguish inliers from outliers. The method LMeDS does not need any threshold but it works
|
|
1322
|
+
* correctly only when there are more than 50% of inliers. Finally, if there are no outliers and the
|
|
1323
|
+
* noise is rather small, use the default method (method=0).
|
|
1324
|
+
*
|
|
1325
|
+
* The function is used to find initial intrinsic and extrinsic matrices. Homography matrix is
|
|
1326
|
+
* determined up to a scale. Thus, it is normalized so that `$h_{33}=1$`. Note that whenever an `$H$`
|
|
1327
|
+
* matrix cannot be estimated, an empty one will be returned.
|
|
1328
|
+
*
|
|
1329
|
+
* [getAffineTransform], [estimateAffine2D], [estimateAffinePartial2D], [getPerspectiveTransform],
|
|
1330
|
+
* [warpPerspective], [perspectiveTransform]
|
|
1331
|
+
*
|
|
1332
|
+
* @param srcPoints Coordinates of the points in the original plane, a matrix of the type CV_32FC2 or
|
|
1333
|
+
* vector<Point2f> .
|
|
1334
|
+
*
|
|
1335
|
+
* @param dstPoints Coordinates of the points in the target plane, a matrix of the type CV_32FC2 or a
|
|
1336
|
+
* vector<Point2f> .
|
|
1337
|
+
*
|
|
1338
|
+
* @param method Method used to compute a homography matrix. The following methods are possible:
|
|
1339
|
+
* 0 - a regular method using all the points, i.e., the least squares methodRANSAC - RANSAC-based
|
|
1340
|
+
* robust methodLMEDS - Least-Median robust methodRHO - PROSAC-based robust method
|
|
1341
|
+
*
|
|
1342
|
+
* @param ransacReprojThreshold Maximum allowed reprojection error to treat a point pair as an inlier
|
|
1343
|
+
* (used in the RANSAC and RHO methods only). That is, if \[\| \texttt{dstPoints} _i -
|
|
1344
|
+
* \texttt{convertPointsHomogeneous} ( \texttt{H} * \texttt{srcPoints} _i) \|_2 >
|
|
1345
|
+
* \texttt{ransacReprojThreshold}\] then the point $i$ is considered as an outlier. If srcPoints and
|
|
1346
|
+
* dstPoints are measured in pixels, it usually makes sense to set this parameter somewhere in the
|
|
1347
|
+
* range of 1 to 10.
|
|
1348
|
+
*
|
|
1349
|
+
* @param mask Optional output mask set by a robust method ( RANSAC or LMEDS ). Note that the input
|
|
1350
|
+
* mask values are ignored.
|
|
1351
|
+
*
|
|
1352
|
+
* @param maxIters The maximum number of RANSAC iterations.
|
|
1353
|
+
*
|
|
1354
|
+
* @param confidence Confidence level, between 0 and 1.
|
|
1355
|
+
*/
|
|
1356
|
+
export declare function findHomography(
|
|
1357
|
+
srcPoints: InputArray,
|
|
1358
|
+
dstPoints: InputArray,
|
|
1359
|
+
method?: int,
|
|
1360
|
+
ransacReprojThreshold?: double,
|
|
1361
|
+
mask?: OutputArray,
|
|
1362
|
+
maxIters?: any,
|
|
1363
|
+
confidence?: any,
|
|
1364
|
+
): Mat;
|
|
1365
|
+
|
|
1366
|
+
/**
|
|
1367
|
+
* This is an overloaded member function, provided for convenience. It differs from the above function
|
|
1368
|
+
* only in what argument(s) it accepts.
|
|
1369
|
+
*/
|
|
1370
|
+
export declare function findHomography(
|
|
1371
|
+
srcPoints: InputArray,
|
|
1372
|
+
dstPoints: InputArray,
|
|
1373
|
+
mask: OutputArray,
|
|
1374
|
+
method?: int,
|
|
1375
|
+
ransacReprojThreshold?: double,
|
|
1376
|
+
): Mat;
|
|
1377
|
+
|
|
1378
|
+
/**
|
|
1379
|
+
* The function returns the camera matrix that is either an exact copy of the input cameraMatrix (when
|
|
1380
|
+
* centerPrinicipalPoint=false ), or the modified one (when centerPrincipalPoint=true).
|
|
1381
|
+
*
|
|
1382
|
+
* In the latter case, the new camera matrix will be:
|
|
1383
|
+
*
|
|
1384
|
+
* `\\[\\begin{bmatrix} f_x && 0 && ( \\texttt{imgSize.width} -1)*0.5 \\\\ 0 && f_y && (
|
|
1385
|
+
* \\texttt{imgSize.height} -1)*0.5 \\\\ 0 && 0 && 1 \\end{bmatrix} ,\\]`
|
|
1386
|
+
*
|
|
1387
|
+
* where `$f_x$` and `$f_y$` are `$(0,0)$` and `$(1,1)$` elements of cameraMatrix, respectively.
|
|
1388
|
+
*
|
|
1389
|
+
* By default, the undistortion functions in OpenCV (see [initUndistortRectifyMap], [undistort]) do not
|
|
1390
|
+
* move the principal point. However, when you work with stereo, it is important to move the principal
|
|
1391
|
+
* points in both views to the same y-coordinate (which is required by most of stereo correspondence
|
|
1392
|
+
* algorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for
|
|
1393
|
+
* each view where the principal points are located at the center.
|
|
1394
|
+
*
|
|
1395
|
+
* @param cameraMatrix Input camera matrix.
|
|
1396
|
+
*
|
|
1397
|
+
* @param imgsize Camera view image size in pixels.
|
|
1398
|
+
*
|
|
1399
|
+
* @param centerPrincipalPoint Location of the principal point in the new camera matrix. The parameter
|
|
1400
|
+
* indicates whether this location should be at the image center or not.
|
|
1401
|
+
*/
|
|
1402
|
+
export declare function getDefaultNewCameraMatrix(
|
|
1403
|
+
cameraMatrix: InputArray,
|
|
1404
|
+
imgsize?: Size,
|
|
1405
|
+
centerPrincipalPoint?: bool,
|
|
1406
|
+
): Mat;
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* new_camera_matrix Output new camera matrix.
|
|
1410
|
+
* The function computes and returns the optimal new camera matrix based on the free scaling parameter.
|
|
1411
|
+
* By varying this parameter, you may retrieve only sensible pixels alpha=0 , keep all the original
|
|
1412
|
+
* image pixels if there is valuable information in the corners alpha=1 , or get something in between.
|
|
1413
|
+
* When alpha>0 , the undistorted result is likely to have some black pixels corresponding to "virtual"
|
|
1414
|
+
* pixels outside of the captured distorted image. The original camera matrix, distortion coefficients,
|
|
1415
|
+
* the computed new camera matrix, and newImageSize should be passed to initUndistortRectifyMap to
|
|
1416
|
+
* produce the maps for remap .
|
|
1417
|
+
*
|
|
1418
|
+
* @param cameraMatrix Input camera matrix.
|
|
1419
|
+
*
|
|
1420
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6
|
|
1421
|
+
* [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is
|
|
1422
|
+
* NULL/empty, the zero distortion coefficients are assumed.
|
|
1423
|
+
*
|
|
1424
|
+
* @param imageSize Original image size.
|
|
1425
|
+
*
|
|
1426
|
+
* @param alpha Free scaling parameter between 0 (when all the pixels in the undistorted image are
|
|
1427
|
+
* valid) and 1 (when all the source image pixels are retained in the undistorted image). See
|
|
1428
|
+
* stereoRectify for details.
|
|
1429
|
+
*
|
|
1430
|
+
* @param newImgSize Image size after rectification. By default, it is set to imageSize .
|
|
1431
|
+
*
|
|
1432
|
+
* @param validPixROI Optional output rectangle that outlines all-good-pixels region in the undistorted
|
|
1433
|
+
* image. See roi1, roi2 description in stereoRectify .
|
|
1434
|
+
*
|
|
1435
|
+
* @param centerPrincipalPoint Optional flag that indicates whether in the new camera matrix the
|
|
1436
|
+
* principal point should be at the image center or not. By default, the principal point is chosen to
|
|
1437
|
+
* best fit a subset of the source image (determined by alpha) to the corrected image.
|
|
1438
|
+
*/
|
|
1439
|
+
export declare function getOptimalNewCameraMatrix(
|
|
1440
|
+
cameraMatrix: InputArray,
|
|
1441
|
+
distCoeffs: InputArray,
|
|
1442
|
+
imageSize: Size,
|
|
1443
|
+
alpha: double,
|
|
1444
|
+
newImgSize?: Size,
|
|
1445
|
+
validPixROI?: any,
|
|
1446
|
+
centerPrincipalPoint?: bool,
|
|
1447
|
+
): Mat;
|
|
1448
|
+
|
|
1449
|
+
export declare function getValidDisparityROI(
|
|
1450
|
+
roi1: Rect,
|
|
1451
|
+
roi2: Rect,
|
|
1452
|
+
minDisparity: int,
|
|
1453
|
+
numberOfDisparities: int,
|
|
1454
|
+
SADWindowSize: int,
|
|
1455
|
+
): Rect;
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* The function estimates and returns an initial camera matrix for the camera calibration process.
|
|
1459
|
+
* Currently, the function only supports planar calibration patterns, which are patterns where each
|
|
1460
|
+
* object point has z-coordinate =0.
|
|
1461
|
+
*
|
|
1462
|
+
* @param objectPoints Vector of vectors of the calibration pattern points in the calibration pattern
|
|
1463
|
+
* coordinate space. In the old interface all the per-view vectors are concatenated. See
|
|
1464
|
+
* calibrateCamera for details.
|
|
1465
|
+
*
|
|
1466
|
+
* @param imagePoints Vector of vectors of the projections of the calibration pattern points. In the
|
|
1467
|
+
* old interface all the per-view vectors are concatenated.
|
|
1468
|
+
*
|
|
1469
|
+
* @param imageSize Image size in pixels used to initialize the principal point.
|
|
1470
|
+
*
|
|
1471
|
+
* @param aspectRatio If it is zero or negative, both $f_x$ and $f_y$ are estimated independently.
|
|
1472
|
+
* Otherwise, $f_x = f_y * \texttt{aspectRatio}$ .
|
|
1473
|
+
*/
|
|
1474
|
+
export declare function initCameraMatrix2D(
|
|
1475
|
+
objectPoints: InputArrayOfArrays,
|
|
1476
|
+
imagePoints: InputArrayOfArrays,
|
|
1477
|
+
imageSize: Size,
|
|
1478
|
+
aspectRatio?: double,
|
|
1479
|
+
): Mat;
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* The function computes the joint undistortion and rectification transformation and represents the
|
|
1483
|
+
* result in the form of maps for remap. The undistorted image looks like original, as if it is
|
|
1484
|
+
* captured with a camera using the camera matrix =newCameraMatrix and zero distortion. In case of a
|
|
1485
|
+
* monocular camera, newCameraMatrix is usually equal to cameraMatrix, or it can be computed by
|
|
1486
|
+
* [getOptimalNewCameraMatrix] for a better control over scaling. In case of a stereo camera,
|
|
1487
|
+
* newCameraMatrix is normally set to P1 or P2 computed by [stereoRectify] .
|
|
1488
|
+
*
|
|
1489
|
+
* Also, this new camera is oriented differently in the coordinate space, according to R. That, for
|
|
1490
|
+
* example, helps to align two heads of a stereo camera so that the epipolar lines on both images
|
|
1491
|
+
* become horizontal and have the same y- coordinate (in case of a horizontally aligned stereo camera).
|
|
1492
|
+
*
|
|
1493
|
+
* The function actually builds the maps for the inverse mapping algorithm that is used by remap. That
|
|
1494
|
+
* is, for each pixel `$(u, v)$` in the destination (corrected and rectified) image, the function
|
|
1495
|
+
* computes the corresponding coordinates in the source image (that is, in the original image from
|
|
1496
|
+
* camera). The following process is applied: `\\[ \\begin{array}{l} x \\leftarrow (u - {c'}_x)/{f'}_x
|
|
1497
|
+
* \\\\ y \\leftarrow (v - {c'}_y)/{f'}_y \\\\ {[X\\,Y\\,W]} ^T \\leftarrow R^{-1}*[x \\, y \\, 1]^T
|
|
1498
|
+
* \\\\ x' \\leftarrow X/W \\\\ y' \\leftarrow Y/W \\\\ r^2 \\leftarrow x'^2 + y'^2 \\\\ x''
|
|
1499
|
+
* \\leftarrow x' \\frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + 2p_1 x' y'
|
|
1500
|
+
* + p_2(r^2 + 2 x'^2) + s_1 r^2 + s_2 r^4\\\\ y'' \\leftarrow y' \\frac{1 + k_1 r^2 + k_2 r^4 + k_3
|
|
1501
|
+
* r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' + s_3 r^2 + s_4 r^4 \\\\
|
|
1502
|
+
* s\\vecthree{x'''}{y'''}{1} = \\vecthreethree{R_{33}(\\tau_x, \\tau_y)}{0}{-R_{13}((\\tau_x,
|
|
1503
|
+
* \\tau_y)} {0}{R_{33}(\\tau_x, \\tau_y)}{-R_{23}(\\tau_x, \\tau_y)} {0}{0}{1} R(\\tau_x, \\tau_y)
|
|
1504
|
+
* \\vecthree{x''}{y''}{1}\\\\ map_x(u,v) \\leftarrow x''' f_x + c_x \\\\ map_y(u,v) \\leftarrow y'''
|
|
1505
|
+
* f_y + c_y \\end{array} \\]` where `$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[,
|
|
1506
|
+
* \\tau_x, \\tau_y]]]])$` are the distortion coefficients.
|
|
1507
|
+
*
|
|
1508
|
+
* In case of a stereo camera, this function is called twice: once for each camera head, after
|
|
1509
|
+
* stereoRectify, which in its turn is called after [stereoCalibrate]. But if the stereo camera was not
|
|
1510
|
+
* calibrated, it is still possible to compute the rectification transformations directly from the
|
|
1511
|
+
* fundamental matrix using [stereoRectifyUncalibrated]. For each camera, the function computes
|
|
1512
|
+
* homography H as the rectification transformation in a pixel domain, not a rotation matrix R in 3D
|
|
1513
|
+
* space. R can be computed from H as `\\[\\texttt{R} = \\texttt{cameraMatrix} ^{-1} \\cdot \\texttt{H}
|
|
1514
|
+
* \\cdot \\texttt{cameraMatrix}\\]` where cameraMatrix can be chosen arbitrarily.
|
|
1515
|
+
*
|
|
1516
|
+
* @param cameraMatrix Input camera matrix $A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$ .
|
|
1517
|
+
*
|
|
1518
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5,
|
|
1519
|
+
* k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is
|
|
1520
|
+
* NULL/empty, the zero distortion coefficients are assumed.
|
|
1521
|
+
*
|
|
1522
|
+
* @param R Optional rectification transformation in the object space (3x3 matrix). R1 or R2 , computed
|
|
1523
|
+
* by stereoRectify can be passed here. If the matrix is empty, the identity transformation is assumed.
|
|
1524
|
+
* In cvInitUndistortMap R assumed to be an identity matrix.
|
|
1525
|
+
*
|
|
1526
|
+
* @param newCameraMatrix New camera matrix $A'=\vecthreethree{f_x'}{0}{c_x'}{0}{f_y'}{c_y'}{0}{0}{1}$.
|
|
1527
|
+
*
|
|
1528
|
+
* @param size Undistorted image size.
|
|
1529
|
+
*
|
|
1530
|
+
* @param m1type Type of the first output map that can be CV_32FC1, CV_32FC2 or CV_16SC2, see
|
|
1531
|
+
* convertMaps
|
|
1532
|
+
*
|
|
1533
|
+
* @param map1 The first output map.
|
|
1534
|
+
*
|
|
1535
|
+
* @param map2 The second output map.
|
|
1536
|
+
*/
|
|
1537
|
+
export declare function initUndistortRectifyMap(
|
|
1538
|
+
cameraMatrix: InputArray,
|
|
1539
|
+
distCoeffs: InputArray,
|
|
1540
|
+
R: InputArray,
|
|
1541
|
+
newCameraMatrix: InputArray,
|
|
1542
|
+
size: Size,
|
|
1543
|
+
m1type: int,
|
|
1544
|
+
map1: OutputArray,
|
|
1545
|
+
map2: OutputArray,
|
|
1546
|
+
): void;
|
|
1547
|
+
|
|
1548
|
+
export declare function initWideAngleProjMap(
|
|
1549
|
+
cameraMatrix: InputArray,
|
|
1550
|
+
distCoeffs: InputArray,
|
|
1551
|
+
imageSize: Size,
|
|
1552
|
+
destImageWidth: int,
|
|
1553
|
+
m1type: int,
|
|
1554
|
+
map1: OutputArray,
|
|
1555
|
+
map2: OutputArray,
|
|
1556
|
+
projType?: any,
|
|
1557
|
+
alpha?: double,
|
|
1558
|
+
): float;
|
|
1559
|
+
|
|
1560
|
+
export declare function initWideAngleProjMap(
|
|
1561
|
+
cameraMatrix: InputArray,
|
|
1562
|
+
distCoeffs: InputArray,
|
|
1563
|
+
imageSize: Size,
|
|
1564
|
+
destImageWidth: int,
|
|
1565
|
+
m1type: int,
|
|
1566
|
+
map1: OutputArray,
|
|
1567
|
+
map2: OutputArray,
|
|
1568
|
+
projType: int,
|
|
1569
|
+
alpha?: double,
|
|
1570
|
+
): float;
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* The function computes partial derivatives of the elements of the matrix product `$A*B$` with regard
|
|
1574
|
+
* to the elements of each of the two input matrices. The function is used to compute the Jacobian
|
|
1575
|
+
* matrices in stereoCalibrate but can also be used in any other similar optimization function.
|
|
1576
|
+
*
|
|
1577
|
+
* @param A First multiplied matrix.
|
|
1578
|
+
*
|
|
1579
|
+
* @param B Second multiplied matrix.
|
|
1580
|
+
*
|
|
1581
|
+
* @param dABdA First output derivative matrix d(A*B)/dA of size $\texttt{A.rows*B.cols} \times
|
|
1582
|
+
* {A.rows*A.cols}$ .
|
|
1583
|
+
*
|
|
1584
|
+
* @param dABdB Second output derivative matrix d(A*B)/dB of size $\texttt{A.rows*B.cols} \times
|
|
1585
|
+
* {B.rows*B.cols}$ .
|
|
1586
|
+
*/
|
|
1587
|
+
export declare function matMulDeriv(
|
|
1588
|
+
A: InputArray,
|
|
1589
|
+
B: InputArray,
|
|
1590
|
+
dABdA: OutputArray,
|
|
1591
|
+
dABdB: OutputArray,
|
|
1592
|
+
): void;
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* The function computes projections of 3D points to the image plane given intrinsic and extrinsic
|
|
1596
|
+
* camera parameters. Optionally, the function computes Jacobians - matrices of partial derivatives of
|
|
1597
|
+
* image points coordinates (as functions of all the input parameters) with respect to the particular
|
|
1598
|
+
* parameters, intrinsic and/or extrinsic. The Jacobians are used during the global optimization in
|
|
1599
|
+
* calibrateCamera, solvePnP, and stereoCalibrate . The function itself can also be used to compute a
|
|
1600
|
+
* re-projection error given the current intrinsic and extrinsic parameters.
|
|
1601
|
+
*
|
|
1602
|
+
* By setting rvec=tvec=(0,0,0) or by setting cameraMatrix to a 3x3 identity matrix, or by passing zero
|
|
1603
|
+
* distortion coefficients, you can get various useful partial cases of the function. This means that
|
|
1604
|
+
* you can compute the distorted coordinates for a sparse set of points or apply a perspective
|
|
1605
|
+
* transformation (and also compute the derivatives) in the ideal zero-distortion setup.
|
|
1606
|
+
*
|
|
1607
|
+
* @param objectPoints Array of object points, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel (or
|
|
1608
|
+
* vector<Point3f> ), where N is the number of points in the view.
|
|
1609
|
+
*
|
|
1610
|
+
* @param rvec Rotation vector. See Rodrigues for details.
|
|
1611
|
+
*
|
|
1612
|
+
* @param tvec Translation vector.
|
|
1613
|
+
*
|
|
1614
|
+
* @param cameraMatrix Camera matrix $A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}$ .
|
|
1615
|
+
*
|
|
1616
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6
|
|
1617
|
+
* [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is empty,
|
|
1618
|
+
* the zero distortion coefficients are assumed.
|
|
1619
|
+
*
|
|
1620
|
+
* @param imagePoints Output array of image points, 1xN/Nx1 2-channel, or vector<Point2f> .
|
|
1621
|
+
*
|
|
1622
|
+
* @param jacobian Optional output 2Nx(10+<numDistCoeffs>) jacobian matrix of derivatives of image
|
|
1623
|
+
* points with respect to components of the rotation vector, translation vector, focal lengths,
|
|
1624
|
+
* coordinates of the principal point and the distortion coefficients. In the old interface different
|
|
1625
|
+
* components of the jacobian are returned via different output parameters.
|
|
1626
|
+
*
|
|
1627
|
+
* @param aspectRatio Optional "fixed aspect ratio" parameter. If the parameter is not 0, the function
|
|
1628
|
+
* assumes that the aspect ratio (fx/fy) is fixed and correspondingly adjusts the jacobian matrix.
|
|
1629
|
+
*/
|
|
1630
|
+
export declare function projectPoints(
|
|
1631
|
+
objectPoints: InputArray,
|
|
1632
|
+
rvec: InputArray,
|
|
1633
|
+
tvec: InputArray,
|
|
1634
|
+
cameraMatrix: InputArray,
|
|
1635
|
+
distCoeffs: InputArray,
|
|
1636
|
+
imagePoints: OutputArray,
|
|
1637
|
+
jacobian?: OutputArray,
|
|
1638
|
+
aspectRatio?: double,
|
|
1639
|
+
): void;
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* This function can be used to process output E and mask from findEssentialMat. In this scenario,
|
|
1643
|
+
* points1 and points2 are the same input for findEssentialMat. :
|
|
1644
|
+
*
|
|
1645
|
+
* ```cpp
|
|
1646
|
+
* // Example. Estimation of fundamental matrix using the RANSAC algorithm
|
|
1647
|
+
* int point_count = 100;
|
|
1648
|
+
* vector<Point2f> points1(point_count);
|
|
1649
|
+
* vector<Point2f> points2(point_count);
|
|
1650
|
+
*
|
|
1651
|
+
* // initialize the points here ...
|
|
1652
|
+
* for( int i = 0; i < point_count; i++ )
|
|
1653
|
+
* {
|
|
1654
|
+
* points1[i] = ...;
|
|
1655
|
+
* points2[i] = ...;
|
|
1656
|
+
* }
|
|
1657
|
+
*
|
|
1658
|
+
* // cametra matrix with both focal lengths = 1, and principal point = (0, 0)
|
|
1659
|
+
* Mat cameraMatrix = Mat::eye(3, 3, CV_64F);
|
|
1660
|
+
*
|
|
1661
|
+
* Mat E, R, t, mask;
|
|
1662
|
+
*
|
|
1663
|
+
* E = findEssentialMat(points1, points2, cameraMatrix, RANSAC, 0.999, 1.0, mask);
|
|
1664
|
+
* recoverPose(E, points1, points2, cameraMatrix, R, t, mask);
|
|
1665
|
+
* ```
|
|
1666
|
+
*
|
|
1667
|
+
* @param E The input essential matrix.
|
|
1668
|
+
*
|
|
1669
|
+
* @param points1 Array of N 2D points from the first image. The point coordinates should be
|
|
1670
|
+
* floating-point (single or double precision).
|
|
1671
|
+
*
|
|
1672
|
+
* @param points2 Array of the second image points of the same size and format as points1 .
|
|
1673
|
+
*
|
|
1674
|
+
* @param cameraMatrix Camera matrix $K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$ . Note
|
|
1675
|
+
* that this function assumes that points1 and points2 are feature points from cameras with the same
|
|
1676
|
+
* camera matrix.
|
|
1677
|
+
*
|
|
1678
|
+
* @param R Recovered relative rotation.
|
|
1679
|
+
*
|
|
1680
|
+
* @param t Recovered relative translation.
|
|
1681
|
+
*
|
|
1682
|
+
* @param mask Input/output mask for inliers in points1 and points2. : If it is not empty, then it
|
|
1683
|
+
* marks inliers in points1 and points2 for then given essential matrix E. Only these inliers will be
|
|
1684
|
+
* used to recover pose. In the output mask only inliers which pass the cheirality check. This function
|
|
1685
|
+
* decomposes an essential matrix using decomposeEssentialMat and then verifies possible pose
|
|
1686
|
+
* hypotheses by doing cheirality check. The cheirality check basically means that the triangulated 3D
|
|
1687
|
+
* points should have positive depth. Some details can be found in Nister03 .
|
|
1688
|
+
*/
|
|
1689
|
+
export declare function recoverPose(
|
|
1690
|
+
E: InputArray,
|
|
1691
|
+
points1: InputArray,
|
|
1692
|
+
points2: InputArray,
|
|
1693
|
+
cameraMatrix: InputArray,
|
|
1694
|
+
R: OutputArray,
|
|
1695
|
+
t: OutputArray,
|
|
1696
|
+
mask?: InputOutputArray,
|
|
1697
|
+
): int;
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* This is an overloaded member function, provided for convenience. It differs from the above function
|
|
1701
|
+
* only in what argument(s) it accepts.
|
|
1702
|
+
* This function differs from the one above that it computes camera matrix from focal length and
|
|
1703
|
+
* principal point:
|
|
1704
|
+
*
|
|
1705
|
+
* `\\[K = \\begin{bmatrix} f & 0 & x_{pp} \\\\ 0 & f & y_{pp} \\\\ 0 & 0 & 1 \\end{bmatrix}\\]`
|
|
1706
|
+
*
|
|
1707
|
+
* @param E The input essential matrix.
|
|
1708
|
+
*
|
|
1709
|
+
* @param points1 Array of N 2D points from the first image. The point coordinates should be
|
|
1710
|
+
* floating-point (single or double precision).
|
|
1711
|
+
*
|
|
1712
|
+
* @param points2 Array of the second image points of the same size and format as points1 .
|
|
1713
|
+
*
|
|
1714
|
+
* @param R Recovered relative rotation.
|
|
1715
|
+
*
|
|
1716
|
+
* @param t Recovered relative translation.
|
|
1717
|
+
*
|
|
1718
|
+
* @param focal Focal length of the camera. Note that this function assumes that points1 and points2
|
|
1719
|
+
* are feature points from cameras with same focal length and principal point.
|
|
1720
|
+
*
|
|
1721
|
+
* @param pp principal point of the camera.
|
|
1722
|
+
*
|
|
1723
|
+
* @param mask Input/output mask for inliers in points1 and points2. : If it is not empty, then it
|
|
1724
|
+
* marks inliers in points1 and points2 for then given essential matrix E. Only these inliers will be
|
|
1725
|
+
* used to recover pose. In the output mask only inliers which pass the cheirality check.
|
|
1726
|
+
*/
|
|
1727
|
+
export declare function recoverPose(
|
|
1728
|
+
E: InputArray,
|
|
1729
|
+
points1: InputArray,
|
|
1730
|
+
points2: InputArray,
|
|
1731
|
+
R: OutputArray,
|
|
1732
|
+
t: OutputArray,
|
|
1733
|
+
focal?: double,
|
|
1734
|
+
pp?: Point2d,
|
|
1735
|
+
mask?: InputOutputArray,
|
|
1736
|
+
): int;
|
|
1737
|
+
|
|
1738
|
+
/**
|
|
1739
|
+
* This is an overloaded member function, provided for convenience. It differs from the above function
|
|
1740
|
+
* only in what argument(s) it accepts.
|
|
1741
|
+
*
|
|
1742
|
+
* @param E The input essential matrix.
|
|
1743
|
+
*
|
|
1744
|
+
* @param points1 Array of N 2D points from the first image. The point coordinates should be
|
|
1745
|
+
* floating-point (single or double precision).
|
|
1746
|
+
*
|
|
1747
|
+
* @param points2 Array of the second image points of the same size and format as points1.
|
|
1748
|
+
*
|
|
1749
|
+
* @param cameraMatrix Camera matrix $K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$ . Note
|
|
1750
|
+
* that this function assumes that points1 and points2 are feature points from cameras with the same
|
|
1751
|
+
* camera matrix.
|
|
1752
|
+
*
|
|
1753
|
+
* @param R Recovered relative rotation.
|
|
1754
|
+
*
|
|
1755
|
+
* @param t Recovered relative translation.
|
|
1756
|
+
*
|
|
1757
|
+
* @param distanceThresh threshold distance which is used to filter out far away points (i.e. infinite
|
|
1758
|
+
* points).
|
|
1759
|
+
*
|
|
1760
|
+
* @param mask Input/output mask for inliers in points1 and points2. : If it is not empty, then it
|
|
1761
|
+
* marks inliers in points1 and points2 for then given essential matrix E. Only these inliers will be
|
|
1762
|
+
* used to recover pose. In the output mask only inliers which pass the cheirality check.
|
|
1763
|
+
*
|
|
1764
|
+
* @param triangulatedPoints 3d points which were reconstructed by triangulation.
|
|
1765
|
+
*/
|
|
1766
|
+
export declare function recoverPose(
|
|
1767
|
+
E: InputArray,
|
|
1768
|
+
points1: InputArray,
|
|
1769
|
+
points2: InputArray,
|
|
1770
|
+
cameraMatrix: InputArray,
|
|
1771
|
+
R: OutputArray,
|
|
1772
|
+
t: OutputArray,
|
|
1773
|
+
distanceThresh: double,
|
|
1774
|
+
mask?: InputOutputArray,
|
|
1775
|
+
triangulatedPoints?: OutputArray,
|
|
1776
|
+
): int;
|
|
1777
|
+
|
|
1778
|
+
export declare function rectify3Collinear(
|
|
1779
|
+
cameraMatrix1: InputArray,
|
|
1780
|
+
distCoeffs1: InputArray,
|
|
1781
|
+
cameraMatrix2: InputArray,
|
|
1782
|
+
distCoeffs2: InputArray,
|
|
1783
|
+
cameraMatrix3: InputArray,
|
|
1784
|
+
distCoeffs3: InputArray,
|
|
1785
|
+
imgpt1: InputArrayOfArrays,
|
|
1786
|
+
imgpt3: InputArrayOfArrays,
|
|
1787
|
+
imageSize: Size,
|
|
1788
|
+
R12: InputArray,
|
|
1789
|
+
T12: InputArray,
|
|
1790
|
+
R13: InputArray,
|
|
1791
|
+
T13: InputArray,
|
|
1792
|
+
R1: OutputArray,
|
|
1793
|
+
R2: OutputArray,
|
|
1794
|
+
R3: OutputArray,
|
|
1795
|
+
P1: OutputArray,
|
|
1796
|
+
P2: OutputArray,
|
|
1797
|
+
P3: OutputArray,
|
|
1798
|
+
Q: OutputArray,
|
|
1799
|
+
alpha: double,
|
|
1800
|
+
newImgSize: Size,
|
|
1801
|
+
roi1: any,
|
|
1802
|
+
roi2: any,
|
|
1803
|
+
flags: int,
|
|
1804
|
+
): float;
|
|
1805
|
+
|
|
1806
|
+
/**
|
|
1807
|
+
* The function transforms a single-channel disparity map to a 3-channel image representing a 3D
|
|
1808
|
+
* surface. That is, for each pixel (x,y) and the corresponding disparity d=disparity(x,y) , it
|
|
1809
|
+
* computes:
|
|
1810
|
+
*
|
|
1811
|
+
* `\\[\\begin{array}{l} [X \\; Y \\; Z \\; W]^T = \\texttt{Q} *[x \\; y \\; \\texttt{disparity} (x,y)
|
|
1812
|
+
* \\; 1]^T \\\\ \\texttt{\\_3dImage} (x,y) = (X/W, \\; Y/W, \\; Z/W) \\end{array}\\]`
|
|
1813
|
+
*
|
|
1814
|
+
* The matrix Q can be an arbitrary `$4 \\times 4$` matrix (for example, the one computed by
|
|
1815
|
+
* stereoRectify). To reproject a sparse set of points {(x,y,d),...} to 3D space, use
|
|
1816
|
+
* perspectiveTransform .
|
|
1817
|
+
*
|
|
1818
|
+
* @param disparity Input single-channel 8-bit unsigned, 16-bit signed, 32-bit signed or 32-bit
|
|
1819
|
+
* floating-point disparity image. If 16-bit signed format is used, the values are assumed to have no
|
|
1820
|
+
* fractional bits.
|
|
1821
|
+
*
|
|
1822
|
+
* @param _3dImage Output 3-channel floating-point image of the same size as disparity . Each element
|
|
1823
|
+
* of _3dImage(x,y) contains 3D coordinates of the point (x,y) computed from the disparity map.
|
|
1824
|
+
*
|
|
1825
|
+
* @param Q $4 \times 4$ perspective transformation matrix that can be obtained with stereoRectify.
|
|
1826
|
+
*
|
|
1827
|
+
* @param handleMissingValues Indicates, whether the function should handle missing values (i.e. points
|
|
1828
|
+
* where the disparity was not computed). If handleMissingValues=true, then pixels with the minimal
|
|
1829
|
+
* disparity that corresponds to the outliers (see StereoMatcher::compute ) are transformed to 3D
|
|
1830
|
+
* points with a very large Z value (currently set to 10000).
|
|
1831
|
+
*
|
|
1832
|
+
* @param ddepth The optional output array depth. If it is -1, the output image will have CV_32F depth.
|
|
1833
|
+
* ddepth can also be set to CV_16S, CV_32S or CV_32F.
|
|
1834
|
+
*/
|
|
1835
|
+
export declare function reprojectImageTo3D(
|
|
1836
|
+
disparity: InputArray,
|
|
1837
|
+
_3dImage: OutputArray,
|
|
1838
|
+
Q: InputArray,
|
|
1839
|
+
handleMissingValues?: bool,
|
|
1840
|
+
ddepth?: int,
|
|
1841
|
+
): void;
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* `\\[\\begin{array}{l} \\theta \\leftarrow norm(r) \\\\ r \\leftarrow r/ \\theta \\\\ R =
|
|
1845
|
+
* \\cos{\\theta} I + (1- \\cos{\\theta} ) r r^T + \\sin{\\theta}
|
|
1846
|
+
* \\vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} \\end{array}\\]`
|
|
1847
|
+
*
|
|
1848
|
+
* Inverse transformation can be also done easily, since
|
|
1849
|
+
*
|
|
1850
|
+
* `\\[\\sin ( \\theta ) \\vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} = \\frac{R -
|
|
1851
|
+
* R^T}{2}\\]`
|
|
1852
|
+
*
|
|
1853
|
+
* A rotation vector is a convenient and most compact representation of a rotation matrix (since any
|
|
1854
|
+
* rotation matrix has just 3 degrees of freedom). The representation is used in the global 3D geometry
|
|
1855
|
+
* optimization procedures like calibrateCamera, stereoCalibrate, or solvePnP .
|
|
1856
|
+
*
|
|
1857
|
+
* @param src Input rotation vector (3x1 or 1x3) or rotation matrix (3x3).
|
|
1858
|
+
*
|
|
1859
|
+
* @param dst Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively.
|
|
1860
|
+
*
|
|
1861
|
+
* @param jacobian Optional output Jacobian matrix, 3x9 or 9x3, which is a matrix of partial
|
|
1862
|
+
* derivatives of the output array components with respect to the input array components.
|
|
1863
|
+
*/
|
|
1864
|
+
export declare function Rodrigues(
|
|
1865
|
+
src: InputArray,
|
|
1866
|
+
dst: OutputArray,
|
|
1867
|
+
jacobian?: OutputArray,
|
|
1868
|
+
): void;
|
|
1869
|
+
|
|
1870
|
+
/**
|
|
1871
|
+
* The function computes a RQ decomposition using the given rotations. This function is used in
|
|
1872
|
+
* decomposeProjectionMatrix to decompose the left 3x3 submatrix of a projection matrix into a camera
|
|
1873
|
+
* and a rotation matrix.
|
|
1874
|
+
*
|
|
1875
|
+
* It optionally returns three rotation matrices, one for each axis, and the three Euler angles in
|
|
1876
|
+
* degrees (as the return value) that could be used in OpenGL. Note, there is always more than one
|
|
1877
|
+
* sequence of rotations about the three principal axes that results in the same orientation of an
|
|
1878
|
+
* object, e.g. see Slabaugh . Returned tree rotation matrices and corresponding three Euler angles are
|
|
1879
|
+
* only one of the possible solutions.
|
|
1880
|
+
*
|
|
1881
|
+
* @param src 3x3 input matrix.
|
|
1882
|
+
*
|
|
1883
|
+
* @param mtxR Output 3x3 upper-triangular matrix.
|
|
1884
|
+
*
|
|
1885
|
+
* @param mtxQ Output 3x3 orthogonal matrix.
|
|
1886
|
+
*
|
|
1887
|
+
* @param Qx Optional output 3x3 rotation matrix around x-axis.
|
|
1888
|
+
*
|
|
1889
|
+
* @param Qy Optional output 3x3 rotation matrix around y-axis.
|
|
1890
|
+
*
|
|
1891
|
+
* @param Qz Optional output 3x3 rotation matrix around z-axis.
|
|
1892
|
+
*/
|
|
1893
|
+
export declare function RQDecomp3x3(
|
|
1894
|
+
src: InputArray,
|
|
1895
|
+
mtxR: OutputArray,
|
|
1896
|
+
mtxQ: OutputArray,
|
|
1897
|
+
Qx?: OutputArray,
|
|
1898
|
+
Qy?: OutputArray,
|
|
1899
|
+
Qz?: OutputArray,
|
|
1900
|
+
): Vec3d;
|
|
1901
|
+
|
|
1902
|
+
/**
|
|
1903
|
+
* The function [cv::sampsonDistance] calculates and returns the first order approximation of the
|
|
1904
|
+
* geometric error as: `\\[ sd( \\texttt{pt1} , \\texttt{pt2} )= \\frac{(\\texttt{pt2}^t \\cdot
|
|
1905
|
+
* \\texttt{F} \\cdot \\texttt{pt1})^2} {((\\texttt{F} \\cdot \\texttt{pt1})(0))^2 + ((\\texttt{F}
|
|
1906
|
+
* \\cdot \\texttt{pt1})(1))^2 + ((\\texttt{F}^t \\cdot \\texttt{pt2})(0))^2 + ((\\texttt{F}^t \\cdot
|
|
1907
|
+
* \\texttt{pt2})(1))^2} \\]` The fundamental matrix may be calculated using the
|
|
1908
|
+
* [cv::findFundamentalMat] function. See HartleyZ00 11.4.3 for details.
|
|
1909
|
+
*
|
|
1910
|
+
* The computed Sampson distance.
|
|
1911
|
+
*
|
|
1912
|
+
* @param pt1 first homogeneous 2d point
|
|
1913
|
+
*
|
|
1914
|
+
* @param pt2 second homogeneous 2d point
|
|
1915
|
+
*
|
|
1916
|
+
* @param F fundamental matrix
|
|
1917
|
+
*/
|
|
1918
|
+
export declare function sampsonDistance(
|
|
1919
|
+
pt1: InputArray,
|
|
1920
|
+
pt2: InputArray,
|
|
1921
|
+
F: InputArray,
|
|
1922
|
+
): double;
|
|
1923
|
+
|
|
1924
|
+
/**
|
|
1925
|
+
* The function estimates the object pose given 3 object points, their corresponding image projections,
|
|
1926
|
+
* as well as the camera matrix and the distortion coefficients.
|
|
1927
|
+
*
|
|
1928
|
+
* The solutions are sorted by reprojection errors (lowest to highest).
|
|
1929
|
+
*
|
|
1930
|
+
* @param objectPoints Array of object points in the object coordinate space, 3x3 1-channel or 1x3/3x1
|
|
1931
|
+
* 3-channel. vector<Point3f> can be also passed here.
|
|
1932
|
+
*
|
|
1933
|
+
* @param imagePoints Array of corresponding image points, 3x2 1-channel or 1x3/3x1 2-channel.
|
|
1934
|
+
* vector<Point2f> can be also passed here.
|
|
1935
|
+
*
|
|
1936
|
+
* @param cameraMatrix Input camera matrix $A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}$ .
|
|
1937
|
+
*
|
|
1938
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6
|
|
1939
|
+
* [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is
|
|
1940
|
+
* NULL/empty, the zero distortion coefficients are assumed.
|
|
1941
|
+
*
|
|
1942
|
+
* @param rvecs Output rotation vectors (see Rodrigues ) that, together with tvecs, brings points from
|
|
1943
|
+
* the model coordinate system to the camera coordinate system. A P3P problem has up to 4 solutions.
|
|
1944
|
+
*
|
|
1945
|
+
* @param tvecs Output translation vectors.
|
|
1946
|
+
*
|
|
1947
|
+
* @param flags Method for solving a P3P problem:
|
|
1948
|
+
* SOLVEPNP_P3P Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang "Complete
|
|
1949
|
+
* Solution Classification for the Perspective-Three-Point Problem" (gao2003complete).SOLVEPNP_AP3P
|
|
1950
|
+
* Method is based on the paper of T. Ke and S. Roumeliotis. "An Efficient Algebraic Solution to the
|
|
1951
|
+
* Perspective-Three-Point Problem" (Ke17).
|
|
1952
|
+
*/
|
|
1953
|
+
export declare function solveP3P(
|
|
1954
|
+
objectPoints: InputArray,
|
|
1955
|
+
imagePoints: InputArray,
|
|
1956
|
+
cameraMatrix: InputArray,
|
|
1957
|
+
distCoeffs: InputArray,
|
|
1958
|
+
rvecs: OutputArrayOfArrays,
|
|
1959
|
+
tvecs: OutputArrayOfArrays,
|
|
1960
|
+
flags: int,
|
|
1961
|
+
): int;
|
|
1962
|
+
|
|
1963
|
+
/**
|
|
1964
|
+
* P3P methods ([SOLVEPNP_P3P], [SOLVEPNP_AP3P]): need 4 input points to return a unique solution.
|
|
1965
|
+
* [SOLVEPNP_IPPE] Input points must be >= 4 and object points must be coplanar.
|
|
1966
|
+
* [SOLVEPNP_IPPE_SQUARE] Special case suitable for marker pose estimation. Number of input points must
|
|
1967
|
+
* be 4. Object points must be defined in the following order:
|
|
1968
|
+
*
|
|
1969
|
+
* point 0: [-squareLength / 2, squareLength / 2, 0]
|
|
1970
|
+
* point 1: [ squareLength / 2, squareLength / 2, 0]
|
|
1971
|
+
* point 2: [ squareLength / 2, -squareLength / 2, 0]
|
|
1972
|
+
* point 3: [-squareLength / 2, -squareLength / 2, 0]
|
|
1973
|
+
*
|
|
1974
|
+
* for all the other flags, number of input points must be >= 4 and object points can be in any
|
|
1975
|
+
* configuration.
|
|
1976
|
+
*
|
|
1977
|
+
* The function estimates the object pose given a set of object points, their corresponding image
|
|
1978
|
+
* projections, as well as the camera matrix and the distortion coefficients, see the figure below
|
|
1979
|
+
* (more precisely, the X-axis of the camera frame is pointing to the right, the Y-axis downward and
|
|
1980
|
+
* the Z-axis forward).
|
|
1981
|
+
*
|
|
1982
|
+
* Points expressed in the world frame `$ \\bf{X}_w $` are projected into the image plane `$ \\left[ u,
|
|
1983
|
+
* v \\right] $` using the perspective projection model `$ \\Pi $` and the camera intrinsic parameters
|
|
1984
|
+
* matrix `$ \\bf{A} $`:
|
|
1985
|
+
*
|
|
1986
|
+
* `\\[ \\begin{align*} \\begin{bmatrix} u \\\\ v \\\\ 1 \\end{bmatrix} &= \\bf{A} \\hspace{0.1em} \\Pi
|
|
1987
|
+
* \\hspace{0.2em} ^{c}\\bf{M}_w \\begin{bmatrix} X_{w} \\\\ Y_{w} \\\\ Z_{w} \\\\ 1 \\end{bmatrix}
|
|
1988
|
+
* \\\\ \\begin{bmatrix} u \\\\ v \\\\ 1 \\end{bmatrix} &= \\begin{bmatrix} f_x & 0 & c_x \\\\ 0 & f_y
|
|
1989
|
+
* & c_y \\\\ 0 & 0 & 1 \\end{bmatrix} \\begin{bmatrix} 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\\\ 0 & 0 & 1
|
|
1990
|
+
* & 0 \\end{bmatrix} \\begin{bmatrix} r_{11} & r_{12} & r_{13} & t_x \\\\ r_{21} & r_{22} & r_{23} &
|
|
1991
|
+
* t_y \\\\ r_{31} & r_{32} & r_{33} & t_z \\\\ 0 & 0 & 0 & 1 \\end{bmatrix} \\begin{bmatrix} X_{w}
|
|
1992
|
+
* \\\\ Y_{w} \\\\ Z_{w} \\\\ 1 \\end{bmatrix} \\end{align*} \\]`
|
|
1993
|
+
*
|
|
1994
|
+
* The estimated pose is thus the rotation (`rvec`) and the translation (`tvec`) vectors that allow
|
|
1995
|
+
* transforming a 3D point expressed in the world frame into the camera frame:
|
|
1996
|
+
*
|
|
1997
|
+
* `\\[ \\begin{align*} \\begin{bmatrix} X_c \\\\ Y_c \\\\ Z_c \\\\ 1 \\end{bmatrix} &= \\hspace{0.2em}
|
|
1998
|
+
* ^{c}\\bf{M}_w \\begin{bmatrix} X_{w} \\\\ Y_{w} \\\\ Z_{w} \\\\ 1 \\end{bmatrix} \\\\
|
|
1999
|
+
* \\begin{bmatrix} X_c \\\\ Y_c \\\\ Z_c \\\\ 1 \\end{bmatrix} &= \\begin{bmatrix} r_{11} & r_{12} &
|
|
2000
|
+
* r_{13} & t_x \\\\ r_{21} & r_{22} & r_{23} & t_y \\\\ r_{31} & r_{32} & r_{33} & t_z \\\\ 0 & 0 & 0
|
|
2001
|
+
* & 1 \\end{bmatrix} \\begin{bmatrix} X_{w} \\\\ Y_{w} \\\\ Z_{w} \\\\ 1 \\end{bmatrix} \\end{align*}
|
|
2002
|
+
* \\]`
|
|
2003
|
+
*
|
|
2004
|
+
* An example of how to use solvePnP for planar augmented reality can be found at
|
|
2005
|
+
* opencv_source_code/samples/python/plane_ar.py
|
|
2006
|
+
* If you are using Python:
|
|
2007
|
+
*
|
|
2008
|
+
* Numpy array slices won't work as input because solvePnP requires contiguous arrays (enforced by the
|
|
2009
|
+
* assertion using [cv::Mat::checkVector()] around line 55 of modules/calib3d/src/solvepnp.cpp version
|
|
2010
|
+
* 2.4.9)
|
|
2011
|
+
* The P3P algorithm requires image points to be in an array of shape (N,1,2) due to its calling of
|
|
2012
|
+
* [cv::undistortPoints] (around line 75 of modules/calib3d/src/solvepnp.cpp version 2.4.9) which
|
|
2013
|
+
* requires 2-channel information.
|
|
2014
|
+
* Thus, given some data D = np.array(...) where D.shape = (N,M), in order to use a subset of it as,
|
|
2015
|
+
* e.g., imagePoints, one must effectively copy it into a new array: imagePoints =
|
|
2016
|
+
* np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
|
|
2017
|
+
*
|
|
2018
|
+
* The methods **SOLVEPNP_DLS** and **SOLVEPNP_UPNP** cannot be used as the current implementations are
|
|
2019
|
+
* unstable and sometimes give completely wrong results. If you pass one of these two flags,
|
|
2020
|
+
* **SOLVEPNP_EPNP** method will be used instead.
|
|
2021
|
+
* The minimum number of points is 4 in the general case. In the case of **SOLVEPNP_P3P** and
|
|
2022
|
+
* **SOLVEPNP_AP3P** methods, it is required to use exactly 4 points (the first 3 points are used to
|
|
2023
|
+
* estimate all the solutions of the P3P problem, the last one is used to retain the best solution that
|
|
2024
|
+
* minimizes the reprojection error).
|
|
2025
|
+
* With **SOLVEPNP_ITERATIVE** method and `useExtrinsicGuess=true`, the minimum number of points is 3
|
|
2026
|
+
* (3 points are sufficient to compute a pose but there are up to 4 solutions). The initial solution
|
|
2027
|
+
* should be close to the global solution to converge.
|
|
2028
|
+
* With **SOLVEPNP_IPPE** input points must be >= 4 and object points must be coplanar.
|
|
2029
|
+
* With **SOLVEPNP_IPPE_SQUARE** this is a special case suitable for marker pose estimation. Number of
|
|
2030
|
+
* input points must be 4. Object points must be defined in the following order:
|
|
2031
|
+
*
|
|
2032
|
+
* point 0: [-squareLength / 2, squareLength / 2, 0]
|
|
2033
|
+
* point 1: [ squareLength / 2, squareLength / 2, 0]
|
|
2034
|
+
* point 2: [ squareLength / 2, -squareLength / 2, 0]
|
|
2035
|
+
* point 3: [-squareLength / 2, -squareLength / 2, 0]
|
|
2036
|
+
*
|
|
2037
|
+
* @param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or 1xN/Nx1
|
|
2038
|
+
* 3-channel, where N is the number of points. vector<Point3f> can be also passed here.
|
|
2039
|
+
*
|
|
2040
|
+
* @param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel, where N
|
|
2041
|
+
* is the number of points. vector<Point2f> can be also passed here.
|
|
2042
|
+
*
|
|
2043
|
+
* @param cameraMatrix Input camera matrix $A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}$ .
|
|
2044
|
+
*
|
|
2045
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6
|
|
2046
|
+
* [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is
|
|
2047
|
+
* NULL/empty, the zero distortion coefficients are assumed.
|
|
2048
|
+
*
|
|
2049
|
+
* @param rvec Output rotation vector (see Rodrigues ) that, together with tvec, brings points from the
|
|
2050
|
+
* model coordinate system to the camera coordinate system.
|
|
2051
|
+
*
|
|
2052
|
+
* @param tvec Output translation vector.
|
|
2053
|
+
*
|
|
2054
|
+
* @param useExtrinsicGuess Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses the
|
|
2055
|
+
* provided rvec and tvec values as initial approximations of the rotation and translation vectors,
|
|
2056
|
+
* respectively, and further optimizes them.
|
|
2057
|
+
*
|
|
2058
|
+
* @param flags Method for solving a PnP problem:
|
|
2059
|
+
* SOLVEPNP_ITERATIVE Iterative method is based on a Levenberg-Marquardt optimization. In this case the
|
|
2060
|
+
* function finds such a pose that minimizes reprojection error, that is the sum of squared distances
|
|
2061
|
+
* between the observed projections imagePoints and the projected (using projectPoints ) objectPoints
|
|
2062
|
+
* .SOLVEPNP_P3P Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang "Complete
|
|
2063
|
+
* Solution Classification for the Perspective-Three-Point Problem" (gao2003complete). In this case the
|
|
2064
|
+
* function requires exactly four object and image points.SOLVEPNP_AP3P Method is based on the paper of
|
|
2065
|
+
* T. Ke, S. Roumeliotis "An Efficient Algebraic Solution to the Perspective-Three-Point Problem"
|
|
2066
|
+
* (Ke17). In this case the function requires exactly four object and image points.SOLVEPNP_EPNP Method
|
|
2067
|
+
* has been introduced by F. Moreno-Noguer, V. Lepetit and P. Fua in the paper "EPnP: Efficient
|
|
2068
|
+
* Perspective-n-Point Camera Pose Estimation" (lepetit2009epnp).SOLVEPNP_DLS Method is based on the
|
|
2069
|
+
* paper of J. Hesch and S. Roumeliotis. "A Direct Least-Squares (DLS) Method for PnP"
|
|
2070
|
+
* (hesch2011direct).SOLVEPNP_UPNP Method is based on the paper of A. Penate-Sanchez, J. Andrade-Cetto,
|
|
2071
|
+
* F. Moreno-Noguer. "Exhaustive Linearization for Robust Camera Pose and Focal Length
|
|
2072
|
+
* Estimation" (penate2013exhaustive). In this case the function also estimates the parameters $f_x$
|
|
2073
|
+
* and $f_y$ assuming that both have the same value. Then the cameraMatrix is updated with the
|
|
2074
|
+
* estimated focal length.SOLVEPNP_IPPE Method is based on the paper of T. Collins and A. Bartoli.
|
|
2075
|
+
* "Infinitesimal Plane-Based Pose Estimation" (Collins14). This method requires coplanar object
|
|
2076
|
+
* points.SOLVEPNP_IPPE_SQUARE Method is based on the paper of Toby Collins and Adrien Bartoli.
|
|
2077
|
+
* "Infinitesimal Plane-Based Pose Estimation" (Collins14). This method is suitable for marker pose
|
|
2078
|
+
* estimation. It requires 4 coplanar object points defined in the following order:
|
|
2079
|
+
* point 0: [-squareLength / 2, squareLength / 2, 0]point 1: [ squareLength / 2, squareLength / 2,
|
|
2080
|
+
* 0]point 2: [ squareLength / 2, -squareLength / 2, 0]point 3: [-squareLength / 2, -squareLength / 2,
|
|
2081
|
+
* 0]
|
|
2082
|
+
*/
|
|
2083
|
+
export declare function solvePnP(
|
|
2084
|
+
objectPoints: InputArray,
|
|
2085
|
+
imagePoints: InputArray,
|
|
2086
|
+
cameraMatrix: InputArray,
|
|
2087
|
+
distCoeffs: InputArray,
|
|
2088
|
+
rvec: OutputArray,
|
|
2089
|
+
tvec: OutputArray,
|
|
2090
|
+
useExtrinsicGuess?: bool,
|
|
2091
|
+
flags?: int,
|
|
2092
|
+
): bool;
|
|
2093
|
+
|
|
2094
|
+
/**
|
|
2095
|
+
* P3P methods ([SOLVEPNP_P3P], [SOLVEPNP_AP3P]): 3 or 4 input points. Number of returned solutions can
|
|
2096
|
+
* be between 0 and 4 with 3 input points.
|
|
2097
|
+
* [SOLVEPNP_IPPE] Input points must be >= 4 and object points must be coplanar. Returns 2 solutions.
|
|
2098
|
+
* [SOLVEPNP_IPPE_SQUARE] Special case suitable for marker pose estimation. Number of input points must
|
|
2099
|
+
* be 4 and 2 solutions are returned. Object points must be defined in the following order:
|
|
2100
|
+
*
|
|
2101
|
+
* point 0: [-squareLength / 2, squareLength / 2, 0]
|
|
2102
|
+
* point 1: [ squareLength / 2, squareLength / 2, 0]
|
|
2103
|
+
* point 2: [ squareLength / 2, -squareLength / 2, 0]
|
|
2104
|
+
* point 3: [-squareLength / 2, -squareLength / 2, 0]
|
|
2105
|
+
*
|
|
2106
|
+
* for all the other flags, number of input points must be >= 4 and object points can be in any
|
|
2107
|
+
* configuration. Only 1 solution is returned.
|
|
2108
|
+
*
|
|
2109
|
+
* The function estimates the object pose given a set of object points, their corresponding image
|
|
2110
|
+
* projections, as well as the camera matrix and the distortion coefficients, see the figure below
|
|
2111
|
+
* (more precisely, the X-axis of the camera frame is pointing to the right, the Y-axis downward and
|
|
2112
|
+
* the Z-axis forward).
|
|
2113
|
+
*
|
|
2114
|
+
* Points expressed in the world frame `$ \\bf{X}_w $` are projected into the image plane `$ \\left[ u,
|
|
2115
|
+
* v \\right] $` using the perspective projection model `$ \\Pi $` and the camera intrinsic parameters
|
|
2116
|
+
* matrix `$ \\bf{A} $`:
|
|
2117
|
+
*
|
|
2118
|
+
* `\\[ \\begin{align*} \\begin{bmatrix} u \\\\ v \\\\ 1 \\end{bmatrix} &= \\bf{A} \\hspace{0.1em} \\Pi
|
|
2119
|
+
* \\hspace{0.2em} ^{c}\\bf{M}_w \\begin{bmatrix} X_{w} \\\\ Y_{w} \\\\ Z_{w} \\\\ 1 \\end{bmatrix}
|
|
2120
|
+
* \\\\ \\begin{bmatrix} u \\\\ v \\\\ 1 \\end{bmatrix} &= \\begin{bmatrix} f_x & 0 & c_x \\\\ 0 & f_y
|
|
2121
|
+
* & c_y \\\\ 0 & 0 & 1 \\end{bmatrix} \\begin{bmatrix} 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\\\ 0 & 0 & 1
|
|
2122
|
+
* & 0 \\end{bmatrix} \\begin{bmatrix} r_{11} & r_{12} & r_{13} & t_x \\\\ r_{21} & r_{22} & r_{23} &
|
|
2123
|
+
* t_y \\\\ r_{31} & r_{32} & r_{33} & t_z \\\\ 0 & 0 & 0 & 1 \\end{bmatrix} \\begin{bmatrix} X_{w}
|
|
2124
|
+
* \\\\ Y_{w} \\\\ Z_{w} \\\\ 1 \\end{bmatrix} \\end{align*} \\]`
|
|
2125
|
+
*
|
|
2126
|
+
* The estimated pose is thus the rotation (`rvec`) and the translation (`tvec`) vectors that allow
|
|
2127
|
+
* transforming a 3D point expressed in the world frame into the camera frame:
|
|
2128
|
+
*
|
|
2129
|
+
* `\\[ \\begin{align*} \\begin{bmatrix} X_c \\\\ Y_c \\\\ Z_c \\\\ 1 \\end{bmatrix} &= \\hspace{0.2em}
|
|
2130
|
+
* ^{c}\\bf{M}_w \\begin{bmatrix} X_{w} \\\\ Y_{w} \\\\ Z_{w} \\\\ 1 \\end{bmatrix} \\\\
|
|
2131
|
+
* \\begin{bmatrix} X_c \\\\ Y_c \\\\ Z_c \\\\ 1 \\end{bmatrix} &= \\begin{bmatrix} r_{11} & r_{12} &
|
|
2132
|
+
* r_{13} & t_x \\\\ r_{21} & r_{22} & r_{23} & t_y \\\\ r_{31} & r_{32} & r_{33} & t_z \\\\ 0 & 0 & 0
|
|
2133
|
+
* & 1 \\end{bmatrix} \\begin{bmatrix} X_{w} \\\\ Y_{w} \\\\ Z_{w} \\\\ 1 \\end{bmatrix} \\end{align*}
|
|
2134
|
+
* \\]`
|
|
2135
|
+
*
|
|
2136
|
+
* An example of how to use solvePnP for planar augmented reality can be found at
|
|
2137
|
+
* opencv_source_code/samples/python/plane_ar.py
|
|
2138
|
+
* If you are using Python:
|
|
2139
|
+
*
|
|
2140
|
+
* Numpy array slices won't work as input because solvePnP requires contiguous arrays (enforced by the
|
|
2141
|
+
* assertion using [cv::Mat::checkVector()] around line 55 of modules/calib3d/src/solvepnp.cpp version
|
|
2142
|
+
* 2.4.9)
|
|
2143
|
+
* The P3P algorithm requires image points to be in an array of shape (N,1,2) due to its calling of
|
|
2144
|
+
* [cv::undistortPoints] (around line 75 of modules/calib3d/src/solvepnp.cpp version 2.4.9) which
|
|
2145
|
+
* requires 2-channel information.
|
|
2146
|
+
* Thus, given some data D = np.array(...) where D.shape = (N,M), in order to use a subset of it as,
|
|
2147
|
+
* e.g., imagePoints, one must effectively copy it into a new array: imagePoints =
|
|
2148
|
+
* np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
|
|
2149
|
+
*
|
|
2150
|
+
* The methods **SOLVEPNP_DLS** and **SOLVEPNP_UPNP** cannot be used as the current implementations are
|
|
2151
|
+
* unstable and sometimes give completely wrong results. If you pass one of these two flags,
|
|
2152
|
+
* **SOLVEPNP_EPNP** method will be used instead.
|
|
2153
|
+
* The minimum number of points is 4 in the general case. In the case of **SOLVEPNP_P3P** and
|
|
2154
|
+
* **SOLVEPNP_AP3P** methods, it is required to use exactly 4 points (the first 3 points are used to
|
|
2155
|
+
* estimate all the solutions of the P3P problem, the last one is used to retain the best solution that
|
|
2156
|
+
* minimizes the reprojection error).
|
|
2157
|
+
* With **SOLVEPNP_ITERATIVE** method and `useExtrinsicGuess=true`, the minimum number of points is 3
|
|
2158
|
+
* (3 points are sufficient to compute a pose but there are up to 4 solutions). The initial solution
|
|
2159
|
+
* should be close to the global solution to converge.
|
|
2160
|
+
* With **SOLVEPNP_IPPE** input points must be >= 4 and object points must be coplanar.
|
|
2161
|
+
* With **SOLVEPNP_IPPE_SQUARE** this is a special case suitable for marker pose estimation. Number of
|
|
2162
|
+
* input points must be 4. Object points must be defined in the following order:
|
|
2163
|
+
*
|
|
2164
|
+
* point 0: [-squareLength / 2, squareLength / 2, 0]
|
|
2165
|
+
* point 1: [ squareLength / 2, squareLength / 2, 0]
|
|
2166
|
+
* point 2: [ squareLength / 2, -squareLength / 2, 0]
|
|
2167
|
+
* point 3: [-squareLength / 2, -squareLength / 2, 0]
|
|
2168
|
+
*
|
|
2169
|
+
* @param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or 1xN/Nx1
|
|
2170
|
+
* 3-channel, where N is the number of points. vector<Point3f> can be also passed here.
|
|
2171
|
+
*
|
|
2172
|
+
* @param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel, where N
|
|
2173
|
+
* is the number of points. vector<Point2f> can be also passed here.
|
|
2174
|
+
*
|
|
2175
|
+
* @param cameraMatrix Input camera matrix $A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}$ .
|
|
2176
|
+
*
|
|
2177
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6
|
|
2178
|
+
* [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is
|
|
2179
|
+
* NULL/empty, the zero distortion coefficients are assumed.
|
|
2180
|
+
*
|
|
2181
|
+
* @param rvecs Vector of output rotation vectors (see Rodrigues ) that, together with tvecs, brings
|
|
2182
|
+
* points from the model coordinate system to the camera coordinate system.
|
|
2183
|
+
*
|
|
2184
|
+
* @param tvecs Vector of output translation vectors.
|
|
2185
|
+
*
|
|
2186
|
+
* @param useExtrinsicGuess Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses the
|
|
2187
|
+
* provided rvec and tvec values as initial approximations of the rotation and translation vectors,
|
|
2188
|
+
* respectively, and further optimizes them.
|
|
2189
|
+
*
|
|
2190
|
+
* @param flags Method for solving a PnP problem:
|
|
2191
|
+
* SOLVEPNP_ITERATIVE Iterative method is based on a Levenberg-Marquardt optimization. In this case the
|
|
2192
|
+
* function finds such a pose that minimizes reprojection error, that is the sum of squared distances
|
|
2193
|
+
* between the observed projections imagePoints and the projected (using projectPoints ) objectPoints
|
|
2194
|
+
* .SOLVEPNP_P3P Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang "Complete
|
|
2195
|
+
* Solution Classification for the Perspective-Three-Point Problem" (gao2003complete). In this case the
|
|
2196
|
+
* function requires exactly four object and image points.SOLVEPNP_AP3P Method is based on the paper of
|
|
2197
|
+
* T. Ke, S. Roumeliotis "An Efficient Algebraic Solution to the Perspective-Three-Point Problem"
|
|
2198
|
+
* (Ke17). In this case the function requires exactly four object and image points.SOLVEPNP_EPNP Method
|
|
2199
|
+
* has been introduced by F.Moreno-Noguer, V.Lepetit and P.Fua in the paper "EPnP: Efficient
|
|
2200
|
+
* Perspective-n-Point Camera Pose Estimation" (lepetit2009epnp).SOLVEPNP_DLS Method is based on the
|
|
2201
|
+
* paper of Joel A. Hesch and Stergios I. Roumeliotis. "A Direct Least-Squares (DLS) Method for PnP"
|
|
2202
|
+
* (hesch2011direct).SOLVEPNP_UPNP Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto,
|
|
2203
|
+
* F.Moreno-Noguer. "Exhaustive Linearization for Robust Camera Pose and Focal Length
|
|
2204
|
+
* Estimation" (penate2013exhaustive). In this case the function also estimates the parameters $f_x$
|
|
2205
|
+
* and $f_y$ assuming that both have the same value. Then the cameraMatrix is updated with the
|
|
2206
|
+
* estimated focal length.SOLVEPNP_IPPE Method is based on the paper of T. Collins and A. Bartoli.
|
|
2207
|
+
* "Infinitesimal Plane-Based Pose Estimation" (Collins14). This method requires coplanar object
|
|
2208
|
+
* points.SOLVEPNP_IPPE_SQUARE Method is based on the paper of Toby Collins and Adrien Bartoli.
|
|
2209
|
+
* "Infinitesimal Plane-Based Pose Estimation" (Collins14). This method is suitable for marker pose
|
|
2210
|
+
* estimation. It requires 4 coplanar object points defined in the following order:
|
|
2211
|
+
* point 0: [-squareLength / 2, squareLength / 2, 0]point 1: [ squareLength / 2, squareLength / 2,
|
|
2212
|
+
* 0]point 2: [ squareLength / 2, -squareLength / 2, 0]point 3: [-squareLength / 2, -squareLength / 2,
|
|
2213
|
+
* 0]
|
|
2214
|
+
*
|
|
2215
|
+
* @param rvec Rotation vector used to initialize an iterative PnP refinement algorithm, when flag is
|
|
2216
|
+
* SOLVEPNP_ITERATIVE and useExtrinsicGuess is set to true.
|
|
2217
|
+
*
|
|
2218
|
+
* @param tvec Translation vector used to initialize an iterative PnP refinement algorithm, when flag
|
|
2219
|
+
* is SOLVEPNP_ITERATIVE and useExtrinsicGuess is set to true.
|
|
2220
|
+
*
|
|
2221
|
+
* @param reprojectionError Optional vector of reprojection error, that is the RMS error ( $
|
|
2222
|
+
* \text{RMSE} = \sqrt{\frac{\sum_{i}^{N} \left ( \hat{y_i} - y_i \right )^2}{N}} $) between the input
|
|
2223
|
+
* image points and the 3D object points projected with the estimated pose.
|
|
2224
|
+
*/
|
|
2225
|
+
export declare function solvePnPGeneric(
|
|
2226
|
+
objectPoints: InputArray,
|
|
2227
|
+
imagePoints: InputArray,
|
|
2228
|
+
cameraMatrix: InputArray,
|
|
2229
|
+
distCoeffs: InputArray,
|
|
2230
|
+
rvecs: OutputArrayOfArrays,
|
|
2231
|
+
tvecs: OutputArrayOfArrays,
|
|
2232
|
+
useExtrinsicGuess?: bool,
|
|
2233
|
+
flags?: SolvePnPMethod,
|
|
2234
|
+
rvec?: InputArray,
|
|
2235
|
+
tvec?: InputArray,
|
|
2236
|
+
reprojectionError?: OutputArray,
|
|
2237
|
+
): int;
|
|
2238
|
+
|
|
2239
|
+
/**
|
|
2240
|
+
* The function estimates an object pose given a set of object points, their corresponding image
|
|
2241
|
+
* projections, as well as the camera matrix and the distortion coefficients. This function finds such
|
|
2242
|
+
* a pose that minimizes reprojection error, that is, the sum of squared distances between the observed
|
|
2243
|
+
* projections imagePoints and the projected (using [projectPoints] ) objectPoints. The use of RANSAC
|
|
2244
|
+
* makes the function resistant to outliers.
|
|
2245
|
+
*
|
|
2246
|
+
* An example of how to use solvePNPRansac for object detection can be found at
|
|
2247
|
+
* opencv_source_code/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/
|
|
2248
|
+
* The default method used to estimate the camera pose for the Minimal Sample Sets step is
|
|
2249
|
+
* [SOLVEPNP_EPNP]. Exceptions are:
|
|
2250
|
+
*
|
|
2251
|
+
* if you choose [SOLVEPNP_P3P] or [SOLVEPNP_AP3P], these methods will be used.
|
|
2252
|
+
* if the number of input points is equal to 4, [SOLVEPNP_P3P] is used.
|
|
2253
|
+
*
|
|
2254
|
+
* The method used to estimate the camera pose using all the inliers is defined by the flags parameters
|
|
2255
|
+
* unless it is equal to [SOLVEPNP_P3P] or [SOLVEPNP_AP3P]. In this case, the method [SOLVEPNP_EPNP]
|
|
2256
|
+
* will be used instead.
|
|
2257
|
+
*
|
|
2258
|
+
* @param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or 1xN/Nx1
|
|
2259
|
+
* 3-channel, where N is the number of points. vector<Point3f> can be also passed here.
|
|
2260
|
+
*
|
|
2261
|
+
* @param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel, where N
|
|
2262
|
+
* is the number of points. vector<Point2f> can be also passed here.
|
|
2263
|
+
*
|
|
2264
|
+
* @param cameraMatrix Input camera matrix $A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}$ .
|
|
2265
|
+
*
|
|
2266
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6
|
|
2267
|
+
* [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is
|
|
2268
|
+
* NULL/empty, the zero distortion coefficients are assumed.
|
|
2269
|
+
*
|
|
2270
|
+
* @param rvec Output rotation vector (see Rodrigues ) that, together with tvec, brings points from the
|
|
2271
|
+
* model coordinate system to the camera coordinate system.
|
|
2272
|
+
*
|
|
2273
|
+
* @param tvec Output translation vector.
|
|
2274
|
+
*
|
|
2275
|
+
* @param useExtrinsicGuess Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses the
|
|
2276
|
+
* provided rvec and tvec values as initial approximations of the rotation and translation vectors,
|
|
2277
|
+
* respectively, and further optimizes them.
|
|
2278
|
+
*
|
|
2279
|
+
* @param iterationsCount Number of iterations.
|
|
2280
|
+
*
|
|
2281
|
+
* @param reprojectionError Inlier threshold value used by the RANSAC procedure. The parameter value is
|
|
2282
|
+
* the maximum allowed distance between the observed and computed point projections to consider it an
|
|
2283
|
+
* inlier.
|
|
2284
|
+
*
|
|
2285
|
+
* @param confidence The probability that the algorithm produces a useful result.
|
|
2286
|
+
*
|
|
2287
|
+
* @param inliers Output vector that contains indices of inliers in objectPoints and imagePoints .
|
|
2288
|
+
*
|
|
2289
|
+
* @param flags Method for solving a PnP problem (see solvePnP ).
|
|
2290
|
+
*/
|
|
2291
|
+
export declare function solvePnPRansac(
|
|
2292
|
+
objectPoints: InputArray,
|
|
2293
|
+
imagePoints: InputArray,
|
|
2294
|
+
cameraMatrix: InputArray,
|
|
2295
|
+
distCoeffs: InputArray,
|
|
2296
|
+
rvec: OutputArray,
|
|
2297
|
+
tvec: OutputArray,
|
|
2298
|
+
useExtrinsicGuess?: bool,
|
|
2299
|
+
iterationsCount?: int,
|
|
2300
|
+
reprojectionError?: float,
|
|
2301
|
+
confidence?: double,
|
|
2302
|
+
inliers?: OutputArray,
|
|
2303
|
+
flags?: int,
|
|
2304
|
+
): bool;
|
|
2305
|
+
|
|
2306
|
+
/**
|
|
2307
|
+
* The function refines the object pose given at least 3 object points, their corresponding image
|
|
2308
|
+
* projections, an initial solution for the rotation and translation vector, as well as the camera
|
|
2309
|
+
* matrix and the distortion coefficients. The function minimizes the projection error with respect to
|
|
2310
|
+
* the rotation and the translation vectors, according to a Levenberg-Marquardt iterative minimization
|
|
2311
|
+
* Madsen04 Eade13 process.
|
|
2312
|
+
*
|
|
2313
|
+
* @param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or 1xN/Nx1
|
|
2314
|
+
* 3-channel, where N is the number of points. vector<Point3f> can also be passed here.
|
|
2315
|
+
*
|
|
2316
|
+
* @param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel, where N
|
|
2317
|
+
* is the number of points. vector<Point2f> can also be passed here.
|
|
2318
|
+
*
|
|
2319
|
+
* @param cameraMatrix Input camera matrix $A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}$ .
|
|
2320
|
+
*
|
|
2321
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6
|
|
2322
|
+
* [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is
|
|
2323
|
+
* NULL/empty, the zero distortion coefficients are assumed.
|
|
2324
|
+
*
|
|
2325
|
+
* @param rvec Input/Output rotation vector (see Rodrigues ) that, together with tvec, brings points
|
|
2326
|
+
* from the model coordinate system to the camera coordinate system. Input values are used as an
|
|
2327
|
+
* initial solution.
|
|
2328
|
+
*
|
|
2329
|
+
* @param tvec Input/Output translation vector. Input values are used as an initial solution.
|
|
2330
|
+
*
|
|
2331
|
+
* @param criteria Criteria when to stop the Levenberg-Marquard iterative algorithm.
|
|
2332
|
+
*/
|
|
2333
|
+
export declare function solvePnPRefineLM(
|
|
2334
|
+
objectPoints: InputArray,
|
|
2335
|
+
imagePoints: InputArray,
|
|
2336
|
+
cameraMatrix: InputArray,
|
|
2337
|
+
distCoeffs: InputArray,
|
|
2338
|
+
rvec: InputOutputArray,
|
|
2339
|
+
tvec: InputOutputArray,
|
|
2340
|
+
criteria?: TermCriteria,
|
|
2341
|
+
): void;
|
|
2342
|
+
|
|
2343
|
+
/**
|
|
2344
|
+
* The function refines the object pose given at least 3 object points, their corresponding image
|
|
2345
|
+
* projections, an initial solution for the rotation and translation vector, as well as the camera
|
|
2346
|
+
* matrix and the distortion coefficients. The function minimizes the projection error with respect to
|
|
2347
|
+
* the rotation and the translation vectors, using a virtual visual servoing (VVS) Chaumette06
|
|
2348
|
+
* Marchand16 scheme.
|
|
2349
|
+
*
|
|
2350
|
+
* @param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or 1xN/Nx1
|
|
2351
|
+
* 3-channel, where N is the number of points. vector<Point3f> can also be passed here.
|
|
2352
|
+
*
|
|
2353
|
+
* @param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel, where N
|
|
2354
|
+
* is the number of points. vector<Point2f> can also be passed here.
|
|
2355
|
+
*
|
|
2356
|
+
* @param cameraMatrix Input camera matrix $A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}$ .
|
|
2357
|
+
*
|
|
2358
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6
|
|
2359
|
+
* [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is
|
|
2360
|
+
* NULL/empty, the zero distortion coefficients are assumed.
|
|
2361
|
+
*
|
|
2362
|
+
* @param rvec Input/Output rotation vector (see Rodrigues ) that, together with tvec, brings points
|
|
2363
|
+
* from the model coordinate system to the camera coordinate system. Input values are used as an
|
|
2364
|
+
* initial solution.
|
|
2365
|
+
*
|
|
2366
|
+
* @param tvec Input/Output translation vector. Input values are used as an initial solution.
|
|
2367
|
+
*
|
|
2368
|
+
* @param criteria Criteria when to stop the Levenberg-Marquard iterative algorithm.
|
|
2369
|
+
*
|
|
2370
|
+
* @param VVSlambda Gain for the virtual visual servoing control law, equivalent to the $\alpha$ gain
|
|
2371
|
+
* in the Damped Gauss-Newton formulation.
|
|
2372
|
+
*/
|
|
2373
|
+
export declare function solvePnPRefineVVS(
|
|
2374
|
+
objectPoints: InputArray,
|
|
2375
|
+
imagePoints: InputArray,
|
|
2376
|
+
cameraMatrix: InputArray,
|
|
2377
|
+
distCoeffs: InputArray,
|
|
2378
|
+
rvec: InputOutputArray,
|
|
2379
|
+
tvec: InputOutputArray,
|
|
2380
|
+
criteria?: TermCriteria,
|
|
2381
|
+
VVSlambda?: double,
|
|
2382
|
+
): void;
|
|
2383
|
+
|
|
2384
|
+
/**
|
|
2385
|
+
* The function estimates transformation between two cameras making a stereo pair. If you have a stereo
|
|
2386
|
+
* camera where the relative position and orientation of two cameras is fixed, and if you computed
|
|
2387
|
+
* poses of an object relative to the first camera and to the second camera, (R1, T1) and (R2, T2),
|
|
2388
|
+
* respectively (this can be done with solvePnP ), then those poses definitely relate to each other.
|
|
2389
|
+
* This means that, given ( `$R_1$`, `$T_1$` ), it should be possible to compute ( `$R_2$`, `$T_2$` ).
|
|
2390
|
+
* You only need to know the position and orientation of the second camera relative to the first
|
|
2391
|
+
* camera. This is what the described function does. It computes ( `$R$`, `$T$` ) so that:
|
|
2392
|
+
*
|
|
2393
|
+
* `\\[R_2=R*R_1\\]` `\\[T_2=R*T_1 + T,\\]`
|
|
2394
|
+
*
|
|
2395
|
+
* Optionally, it computes the essential matrix E:
|
|
2396
|
+
*
|
|
2397
|
+
* `\\[E= \\vecthreethree{0}{-T_2}{T_1}{T_2}{0}{-T_0}{-T_1}{T_0}{0} *R\\]`
|
|
2398
|
+
*
|
|
2399
|
+
* where `$T_i$` are components of the translation vector `$T$` : `$T=[T_0, T_1, T_2]^T$` . And the
|
|
2400
|
+
* function can also compute the fundamental matrix F:
|
|
2401
|
+
*
|
|
2402
|
+
* `\\[F = cameraMatrix2^{-T} E cameraMatrix1^{-1}\\]`
|
|
2403
|
+
*
|
|
2404
|
+
* Besides the stereo-related information, the function can also perform a full calibration of each of
|
|
2405
|
+
* two cameras. However, due to the high dimensionality of the parameter space and noise in the input
|
|
2406
|
+
* data, the function can diverge from the correct solution. If the intrinsic parameters can be
|
|
2407
|
+
* estimated with high accuracy for each of the cameras individually (for example, using
|
|
2408
|
+
* calibrateCamera ), you are recommended to do so and then pass CALIB_FIX_INTRINSIC flag to the
|
|
2409
|
+
* function along with the computed intrinsic parameters. Otherwise, if all the parameters are
|
|
2410
|
+
* estimated at once, it makes sense to restrict some parameters, for example, pass
|
|
2411
|
+
* CALIB_SAME_FOCAL_LENGTH and CALIB_ZERO_TANGENT_DIST flags, which is usually a reasonable assumption.
|
|
2412
|
+
*
|
|
2413
|
+
* Similarly to calibrateCamera , the function minimizes the total re-projection error for all the
|
|
2414
|
+
* points in all the available views from both cameras. The function returns the final value of the
|
|
2415
|
+
* re-projection error.
|
|
2416
|
+
*
|
|
2417
|
+
* @param objectPoints Vector of vectors of the calibration pattern points.
|
|
2418
|
+
*
|
|
2419
|
+
* @param imagePoints1 Vector of vectors of the projections of the calibration pattern points, observed
|
|
2420
|
+
* by the first camera.
|
|
2421
|
+
*
|
|
2422
|
+
* @param imagePoints2 Vector of vectors of the projections of the calibration pattern points, observed
|
|
2423
|
+
* by the second camera.
|
|
2424
|
+
*
|
|
2425
|
+
* @param cameraMatrix1 Input/output first camera matrix:
|
|
2426
|
+
* $\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}$ , $j = 0,\, 1$ . If any
|
|
2427
|
+
* of CALIB_USE_INTRINSIC_GUESS , CALIB_FIX_ASPECT_RATIO , CALIB_FIX_INTRINSIC , or
|
|
2428
|
+
* CALIB_FIX_FOCAL_LENGTH are specified, some or all of the matrix components must be initialized. See
|
|
2429
|
+
* the flags description for details.
|
|
2430
|
+
*
|
|
2431
|
+
* @param distCoeffs1 Input/output vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4,
|
|
2432
|
+
* k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. The output
|
|
2433
|
+
* vector length depends on the flags.
|
|
2434
|
+
*
|
|
2435
|
+
* @param cameraMatrix2 Input/output second camera matrix. The parameter is similar to cameraMatrix1
|
|
2436
|
+
*
|
|
2437
|
+
* @param distCoeffs2 Input/output lens distortion coefficients for the second camera. The parameter is
|
|
2438
|
+
* similar to distCoeffs1 .
|
|
2439
|
+
*
|
|
2440
|
+
* @param imageSize Size of the image used only to initialize intrinsic camera matrix.
|
|
2441
|
+
*
|
|
2442
|
+
* @param R Output rotation matrix between the 1st and the 2nd camera coordinate systems.
|
|
2443
|
+
*
|
|
2444
|
+
* @param T Output translation vector between the coordinate systems of the cameras.
|
|
2445
|
+
*
|
|
2446
|
+
* @param E Output essential matrix.
|
|
2447
|
+
*
|
|
2448
|
+
* @param F Output fundamental matrix.
|
|
2449
|
+
*
|
|
2450
|
+
* @param perViewErrors Output vector of the RMS re-projection error estimated for each pattern view.
|
|
2451
|
+
*
|
|
2452
|
+
* @param flags Different flags that may be zero or a combination of the following values:
|
|
2453
|
+
* CALIB_FIX_INTRINSIC Fix cameraMatrix? and distCoeffs? so that only R, T, E , and F matrices are
|
|
2454
|
+
* estimated.CALIB_USE_INTRINSIC_GUESS Optimize some or all of the intrinsic parameters according to
|
|
2455
|
+
* the specified flags. Initial values are provided by the user.CALIB_USE_EXTRINSIC_GUESS R, T contain
|
|
2456
|
+
* valid initial values that are optimized further. Otherwise R, T are initialized to the median value
|
|
2457
|
+
* of the pattern views (each dimension separately).CALIB_FIX_PRINCIPAL_POINT Fix the principal points
|
|
2458
|
+
* during the optimization.CALIB_FIX_FOCAL_LENGTH Fix $f^{(j)}_x$ and $f^{(j)}_y$
|
|
2459
|
+
* .CALIB_FIX_ASPECT_RATIO Optimize $f^{(j)}_y$ . Fix the ratio $f^{(j)}_x/f^{(j)}_y$
|
|
2460
|
+
*
|
|
2461
|
+
* CALIB_SAME_FOCAL_LENGTH Enforce $f^{(0)}_x=f^{(1)}_x$ and $f^{(0)}_y=f^{(1)}_y$
|
|
2462
|
+
* .CALIB_ZERO_TANGENT_DIST Set tangential distortion coefficients for each camera to zeros and fix
|
|
2463
|
+
* there.CALIB_FIX_K1,...,CALIB_FIX_K6 Do not change the corresponding radial distortion coefficient
|
|
2464
|
+
* during the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the supplied
|
|
2465
|
+
* distCoeffs matrix is used. Otherwise, it is set to 0.CALIB_RATIONAL_MODEL Enable coefficients k4,
|
|
2466
|
+
* k5, and k6. To provide the backward compatibility, this extra flag should be explicitly specified to
|
|
2467
|
+
* make the calibration function use the rational model and return 8 coefficients. If the flag is not
|
|
2468
|
+
* set, the function computes and returns only 5 distortion coefficients.CALIB_THIN_PRISM_MODEL
|
|
2469
|
+
* Coefficients s1, s2, s3 and s4 are enabled. To provide the backward compatibility, this extra flag
|
|
2470
|
+
* should be explicitly specified to make the calibration function use the thin prism model and return
|
|
2471
|
+
* 12 coefficients. If the flag is not set, the function computes and returns only 5 distortion
|
|
2472
|
+
* coefficients.CALIB_FIX_S1_S2_S3_S4 The thin prism distortion coefficients are not changed during the
|
|
2473
|
+
* optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the supplied distCoeffs
|
|
2474
|
+
* matrix is used. Otherwise, it is set to 0.CALIB_TILTED_MODEL Coefficients tauX and tauY are enabled.
|
|
2475
|
+
* To provide the backward compatibility, this extra flag should be explicitly specified to make the
|
|
2476
|
+
* calibration function use the tilted sensor model and return 14 coefficients. If the flag is not set,
|
|
2477
|
+
* the function computes and returns only 5 distortion coefficients.CALIB_FIX_TAUX_TAUY The
|
|
2478
|
+
* coefficients of the tilted sensor model are not changed during the optimization. If
|
|
2479
|
+
* CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the supplied distCoeffs matrix is used.
|
|
2480
|
+
* Otherwise, it is set to 0.
|
|
2481
|
+
*
|
|
2482
|
+
* @param criteria Termination criteria for the iterative optimization algorithm.
|
|
2483
|
+
*/
|
|
2484
|
+
export declare function stereoCalibrate(
|
|
2485
|
+
objectPoints: InputArrayOfArrays,
|
|
2486
|
+
imagePoints1: InputArrayOfArrays,
|
|
2487
|
+
imagePoints2: InputArrayOfArrays,
|
|
2488
|
+
cameraMatrix1: InputOutputArray,
|
|
2489
|
+
distCoeffs1: InputOutputArray,
|
|
2490
|
+
cameraMatrix2: InputOutputArray,
|
|
2491
|
+
distCoeffs2: InputOutputArray,
|
|
2492
|
+
imageSize: Size,
|
|
2493
|
+
R: InputOutputArray,
|
|
2494
|
+
T: InputOutputArray,
|
|
2495
|
+
E: OutputArray,
|
|
2496
|
+
F: OutputArray,
|
|
2497
|
+
perViewErrors: OutputArray,
|
|
2498
|
+
flags?: int,
|
|
2499
|
+
criteria?: TermCriteria,
|
|
2500
|
+
): double;
|
|
2501
|
+
|
|
2502
|
+
/**
|
|
2503
|
+
* This is an overloaded member function, provided for convenience. It differs from the above function
|
|
2504
|
+
* only in what argument(s) it accepts.
|
|
2505
|
+
*/
|
|
2506
|
+
export declare function stereoCalibrate(
|
|
2507
|
+
objectPoints: InputArrayOfArrays,
|
|
2508
|
+
imagePoints1: InputArrayOfArrays,
|
|
2509
|
+
imagePoints2: InputArrayOfArrays,
|
|
2510
|
+
cameraMatrix1: InputOutputArray,
|
|
2511
|
+
distCoeffs1: InputOutputArray,
|
|
2512
|
+
cameraMatrix2: InputOutputArray,
|
|
2513
|
+
distCoeffs2: InputOutputArray,
|
|
2514
|
+
imageSize: Size,
|
|
2515
|
+
R: OutputArray,
|
|
2516
|
+
T: OutputArray,
|
|
2517
|
+
E: OutputArray,
|
|
2518
|
+
F: OutputArray,
|
|
2519
|
+
flags?: int,
|
|
2520
|
+
criteria?: TermCriteria,
|
|
2521
|
+
): double;
|
|
2522
|
+
|
|
2523
|
+
/**
|
|
2524
|
+
* The function computes the rotation matrices for each camera that (virtually) make both camera image
|
|
2525
|
+
* planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies
|
|
2526
|
+
* the dense stereo correspondence problem. The function takes the matrices computed by stereoCalibrate
|
|
2527
|
+
* as input. As output, it provides two rotation matrices and also two projection matrices in the new
|
|
2528
|
+
* coordinates. The function distinguishes the following two cases:
|
|
2529
|
+
*
|
|
2530
|
+
* **Horizontal stereo**: the first and the second camera views are shifted relative to each other
|
|
2531
|
+
* mainly along the x axis (with possible small vertical shift). In the rectified images, the
|
|
2532
|
+
* corresponding epipolar lines in the left and right cameras are horizontal and have the same
|
|
2533
|
+
* y-coordinate. P1 and P2 look like:`\\[\\texttt{P1} = \\begin{bmatrix} f & 0 & cx_1 & 0 \\\\ 0 & f &
|
|
2534
|
+
* cy & 0 \\\\ 0 & 0 & 1 & 0 \\end{bmatrix}\\]``\\[\\texttt{P2} = \\begin{bmatrix} f & 0 & cx_2 & T_x*f
|
|
2535
|
+
* \\\\ 0 & f & cy & 0 \\\\ 0 & 0 & 1 & 0 \\end{bmatrix} ,\\]`where `$T_x$` is a horizontal shift
|
|
2536
|
+
* between the cameras and `$cx_1=cx_2$` if CALIB_ZERO_DISPARITY is set.
|
|
2537
|
+
* **Vertical stereo**: the first and the second camera views are shifted relative to each other mainly
|
|
2538
|
+
* in vertical direction (and probably a bit in the horizontal direction too). The epipolar lines in
|
|
2539
|
+
* the rectified images are vertical and have the same x-coordinate. P1 and P2 look
|
|
2540
|
+
* like:`\\[\\texttt{P1} = \\begin{bmatrix} f & 0 & cx & 0 \\\\ 0 & f & cy_1 & 0 \\\\ 0 & 0 & 1 & 0
|
|
2541
|
+
* \\end{bmatrix}\\]``\\[\\texttt{P2} = \\begin{bmatrix} f & 0 & cx & 0 \\\\ 0 & f & cy_2 & T_y*f \\\\
|
|
2542
|
+
* 0 & 0 & 1 & 0 \\end{bmatrix} ,\\]`where `$T_y$` is a vertical shift between the cameras and
|
|
2543
|
+
* `$cy_1=cy_2$` if CALIB_ZERO_DISPARITY is set.
|
|
2544
|
+
*
|
|
2545
|
+
* As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera
|
|
2546
|
+
* matrices. The matrices, together with R1 and R2 , can then be passed to initUndistortRectifyMap to
|
|
2547
|
+
* initialize the rectification map for each camera.
|
|
2548
|
+
*
|
|
2549
|
+
* See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through
|
|
2550
|
+
* the corresponding image regions. This means that the images are well rectified, which is what most
|
|
2551
|
+
* stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that
|
|
2552
|
+
* their interiors are all valid pixels.
|
|
2553
|
+
*
|
|
2554
|
+
* @param cameraMatrix1 First camera matrix.
|
|
2555
|
+
*
|
|
2556
|
+
* @param distCoeffs1 First camera distortion parameters.
|
|
2557
|
+
*
|
|
2558
|
+
* @param cameraMatrix2 Second camera matrix.
|
|
2559
|
+
*
|
|
2560
|
+
* @param distCoeffs2 Second camera distortion parameters.
|
|
2561
|
+
*
|
|
2562
|
+
* @param imageSize Size of the image used for stereo calibration.
|
|
2563
|
+
*
|
|
2564
|
+
* @param R Rotation matrix between the coordinate systems of the first and the second cameras.
|
|
2565
|
+
*
|
|
2566
|
+
* @param T Translation vector between coordinate systems of the cameras.
|
|
2567
|
+
*
|
|
2568
|
+
* @param R1 Output 3x3 rectification transform (rotation matrix) for the first camera.
|
|
2569
|
+
*
|
|
2570
|
+
* @param R2 Output 3x3 rectification transform (rotation matrix) for the second camera.
|
|
2571
|
+
*
|
|
2572
|
+
* @param P1 Output 3x4 projection matrix in the new (rectified) coordinate systems for the first
|
|
2573
|
+
* camera.
|
|
2574
|
+
*
|
|
2575
|
+
* @param P2 Output 3x4 projection matrix in the new (rectified) coordinate systems for the second
|
|
2576
|
+
* camera.
|
|
2577
|
+
*
|
|
2578
|
+
* @param Q Output $4 \times 4$ disparity-to-depth mapping matrix (see reprojectImageTo3D ).
|
|
2579
|
+
*
|
|
2580
|
+
* @param flags Operation flags that may be zero or CALIB_ZERO_DISPARITY . If the flag is set, the
|
|
2581
|
+
* function makes the principal points of each camera have the same pixel coordinates in the rectified
|
|
2582
|
+
* views. And if the flag is not set, the function may still shift the images in the horizontal or
|
|
2583
|
+
* vertical direction (depending on the orientation of epipolar lines) to maximize the useful image
|
|
2584
|
+
* area.
|
|
2585
|
+
*
|
|
2586
|
+
* @param alpha Free scaling parameter. If it is -1 or absent, the function performs the default
|
|
2587
|
+
* scaling. Otherwise, the parameter should be between 0 and 1. alpha=0 means that the rectified images
|
|
2588
|
+
* are zoomed and shifted so that only valid pixels are visible (no black areas after rectification).
|
|
2589
|
+
* alpha=1 means that the rectified image is decimated and shifted so that all the pixels from the
|
|
2590
|
+
* original images from the cameras are retained in the rectified images (no source image pixels are
|
|
2591
|
+
* lost). Obviously, any intermediate value yields an intermediate result between those two extreme
|
|
2592
|
+
* cases.
|
|
2593
|
+
*
|
|
2594
|
+
* @param newImageSize New image resolution after rectification. The same size should be passed to
|
|
2595
|
+
* initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0) is
|
|
2596
|
+
* passed (default), it is set to the original imageSize . Setting it to larger value can help you
|
|
2597
|
+
* preserve details in the original image, especially when there is a big radial distortion.
|
|
2598
|
+
*
|
|
2599
|
+
* @param validPixROI1 Optional output rectangles inside the rectified images where all the pixels are
|
|
2600
|
+
* valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see
|
|
2601
|
+
* the picture below).
|
|
2602
|
+
*
|
|
2603
|
+
* @param validPixROI2 Optional output rectangles inside the rectified images where all the pixels are
|
|
2604
|
+
* valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller (see
|
|
2605
|
+
* the picture below).
|
|
2606
|
+
*/
|
|
2607
|
+
export declare function stereoRectify(
|
|
2608
|
+
cameraMatrix1: InputArray,
|
|
2609
|
+
distCoeffs1: InputArray,
|
|
2610
|
+
cameraMatrix2: InputArray,
|
|
2611
|
+
distCoeffs2: InputArray,
|
|
2612
|
+
imageSize: Size,
|
|
2613
|
+
R: InputArray,
|
|
2614
|
+
T: InputArray,
|
|
2615
|
+
R1: OutputArray,
|
|
2616
|
+
R2: OutputArray,
|
|
2617
|
+
P1: OutputArray,
|
|
2618
|
+
P2: OutputArray,
|
|
2619
|
+
Q: OutputArray,
|
|
2620
|
+
flags?: int,
|
|
2621
|
+
alpha?: double,
|
|
2622
|
+
newImageSize?: Size,
|
|
2623
|
+
validPixROI1?: any,
|
|
2624
|
+
validPixROI2?: any,
|
|
2625
|
+
): void;
|
|
2626
|
+
|
|
2627
|
+
/**
|
|
2628
|
+
* The function computes the rectification transformations without knowing intrinsic parameters of the
|
|
2629
|
+
* cameras and their relative position in the space, which explains the suffix "uncalibrated". Another
|
|
2630
|
+
* related difference from stereoRectify is that the function outputs not the rectification
|
|
2631
|
+
* transformations in the object (3D) space, but the planar perspective transformations encoded by the
|
|
2632
|
+
* homography matrices H1 and H2 . The function implements the algorithm Hartley99 .
|
|
2633
|
+
*
|
|
2634
|
+
* While the algorithm does not need to know the intrinsic parameters of the cameras, it heavily
|
|
2635
|
+
* depends on the epipolar geometry. Therefore, if the camera lenses have a significant distortion, it
|
|
2636
|
+
* would be better to correct it before computing the fundamental matrix and calling this function. For
|
|
2637
|
+
* example, distortion coefficients can be estimated for each head of stereo camera separately by using
|
|
2638
|
+
* calibrateCamera . Then, the images can be corrected using undistort , or just the point coordinates
|
|
2639
|
+
* can be corrected with undistortPoints .
|
|
2640
|
+
*
|
|
2641
|
+
* @param points1 Array of feature points in the first image.
|
|
2642
|
+
*
|
|
2643
|
+
* @param points2 The corresponding points in the second image. The same formats as in
|
|
2644
|
+
* findFundamentalMat are supported.
|
|
2645
|
+
*
|
|
2646
|
+
* @param F Input fundamental matrix. It can be computed from the same set of point pairs using
|
|
2647
|
+
* findFundamentalMat .
|
|
2648
|
+
*
|
|
2649
|
+
* @param imgSize Size of the image.
|
|
2650
|
+
*
|
|
2651
|
+
* @param H1 Output rectification homography matrix for the first image.
|
|
2652
|
+
*
|
|
2653
|
+
* @param H2 Output rectification homography matrix for the second image.
|
|
2654
|
+
*
|
|
2655
|
+
* @param threshold Optional threshold used to filter out the outliers. If the parameter is greater
|
|
2656
|
+
* than zero, all the point pairs that do not comply with the epipolar geometry (that is, the points
|
|
2657
|
+
* for which $|\texttt{points2[i]}^T*\texttt{F}*\texttt{points1[i]}|>\texttt{threshold}$ ) are rejected
|
|
2658
|
+
* prior to computing the homographies. Otherwise, all the points are considered inliers.
|
|
2659
|
+
*/
|
|
2660
|
+
export declare function stereoRectifyUncalibrated(
|
|
2661
|
+
points1: InputArray,
|
|
2662
|
+
points2: InputArray,
|
|
2663
|
+
F: InputArray,
|
|
2664
|
+
imgSize: Size,
|
|
2665
|
+
H1: OutputArray,
|
|
2666
|
+
H2: OutputArray,
|
|
2667
|
+
threshold?: double,
|
|
2668
|
+
): bool;
|
|
2669
|
+
|
|
2670
|
+
/**
|
|
2671
|
+
* The function reconstructs 3-dimensional points (in homogeneous coordinates) by using their
|
|
2672
|
+
* observations with a stereo camera. Projections matrices can be obtained from stereoRectify.
|
|
2673
|
+
*
|
|
2674
|
+
* Keep in mind that all input data should be of float type in order for this function to work.
|
|
2675
|
+
*
|
|
2676
|
+
* [reprojectImageTo3D]
|
|
2677
|
+
*
|
|
2678
|
+
* @param projMatr1 3x4 projection matrix of the first camera.
|
|
2679
|
+
*
|
|
2680
|
+
* @param projMatr2 3x4 projection matrix of the second camera.
|
|
2681
|
+
*
|
|
2682
|
+
* @param projPoints1 2xN array of feature points in the first image. In case of c++ version it can be
|
|
2683
|
+
* also a vector of feature points or two-channel matrix of size 1xN or Nx1.
|
|
2684
|
+
*
|
|
2685
|
+
* @param projPoints2 2xN array of corresponding points in the second image. In case of c++ version it
|
|
2686
|
+
* can be also a vector of feature points or two-channel matrix of size 1xN or Nx1.
|
|
2687
|
+
*
|
|
2688
|
+
* @param points4D 4xN array of reconstructed points in homogeneous coordinates.
|
|
2689
|
+
*/
|
|
2690
|
+
export declare function triangulatePoints(
|
|
2691
|
+
projMatr1: InputArray,
|
|
2692
|
+
projMatr2: InputArray,
|
|
2693
|
+
projPoints1: InputArray,
|
|
2694
|
+
projPoints2: InputArray,
|
|
2695
|
+
points4D: OutputArray,
|
|
2696
|
+
): void;
|
|
2697
|
+
|
|
2698
|
+
/**
|
|
2699
|
+
* The function transforms an image to compensate radial and tangential lens distortion.
|
|
2700
|
+
*
|
|
2701
|
+
* The function is simply a combination of [initUndistortRectifyMap] (with unity R ) and [remap] (with
|
|
2702
|
+
* bilinear interpolation). See the former function for details of the transformation being performed.
|
|
2703
|
+
*
|
|
2704
|
+
* Those pixels in the destination image, for which there is no correspondent pixels in the source
|
|
2705
|
+
* image, are filled with zeros (black color).
|
|
2706
|
+
*
|
|
2707
|
+
* A particular subset of the source image that will be visible in the corrected image can be regulated
|
|
2708
|
+
* by newCameraMatrix. You can use [getOptimalNewCameraMatrix] to compute the appropriate
|
|
2709
|
+
* newCameraMatrix depending on your requirements.
|
|
2710
|
+
*
|
|
2711
|
+
* The camera matrix and the distortion parameters can be determined using [calibrateCamera]. If the
|
|
2712
|
+
* resolution of images is different from the resolution used at the calibration stage, `$f_x, f_y,
|
|
2713
|
+
* c_x$` and `$c_y$` need to be scaled accordingly, while the distortion coefficients remain the same.
|
|
2714
|
+
*
|
|
2715
|
+
* @param src Input (distorted) image.
|
|
2716
|
+
*
|
|
2717
|
+
* @param dst Output (corrected) image that has the same size and type as src .
|
|
2718
|
+
*
|
|
2719
|
+
* @param cameraMatrix Input camera matrix $A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$ .
|
|
2720
|
+
*
|
|
2721
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5,
|
|
2722
|
+
* k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is
|
|
2723
|
+
* NULL/empty, the zero distortion coefficients are assumed.
|
|
2724
|
+
*
|
|
2725
|
+
* @param newCameraMatrix Camera matrix of the distorted image. By default, it is the same as
|
|
2726
|
+
* cameraMatrix but you may additionally scale and shift the result by using a different matrix.
|
|
2727
|
+
*/
|
|
2728
|
+
export declare function undistort(
|
|
2729
|
+
src: InputArray,
|
|
2730
|
+
dst: OutputArray,
|
|
2731
|
+
cameraMatrix: InputArray,
|
|
2732
|
+
distCoeffs: InputArray,
|
|
2733
|
+
newCameraMatrix?: InputArray,
|
|
2734
|
+
): void;
|
|
2735
|
+
|
|
2736
|
+
/**
|
|
2737
|
+
* The function is similar to [undistort] and [initUndistortRectifyMap] but it operates on a sparse set
|
|
2738
|
+
* of points instead of a raster image. Also the function performs a reverse transformation to
|
|
2739
|
+
* projectPoints. In case of a 3D object, it does not reconstruct its 3D coordinates, but for a planar
|
|
2740
|
+
* object, it does, up to a translation vector, if the proper R is specified.
|
|
2741
|
+
*
|
|
2742
|
+
* For each observed point coordinate `$(u, v)$` the function computes: `\\[ \\begin{array}{l} x^{"}
|
|
2743
|
+
* \\leftarrow (u - c_x)/f_x \\\\ y^{"} \\leftarrow (v - c_y)/f_y \\\\ (x',y') = undistort(x^{"},y^{"},
|
|
2744
|
+
* \\texttt{distCoeffs}) \\\\ {[X\\,Y\\,W]} ^T \\leftarrow R*[x' \\, y' \\, 1]^T \\\\ x \\leftarrow X/W
|
|
2745
|
+
* \\\\ y \\leftarrow Y/W \\\\ \\text{only performed if P is specified:} \\\\ u' \\leftarrow x {f'}_x +
|
|
2746
|
+
* {c'}_x \\\\ v' \\leftarrow y {f'}_y + {c'}_y \\end{array} \\]`
|
|
2747
|
+
*
|
|
2748
|
+
* where *undistort* is an approximate iterative algorithm that estimates the normalized original point
|
|
2749
|
+
* coordinates out of the normalized distorted point coordinates ("normalized" means that the
|
|
2750
|
+
* coordinates do not depend on the camera matrix).
|
|
2751
|
+
*
|
|
2752
|
+
* The function can be used for both a stereo camera head or a monocular camera (when R is empty).
|
|
2753
|
+
*
|
|
2754
|
+
* @param src Observed point coordinates, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel (CV_32FC2 or CV_64FC2)
|
|
2755
|
+
* (or vector<Point2f> ).
|
|
2756
|
+
*
|
|
2757
|
+
* @param dst Output ideal point coordinates (1xN/Nx1 2-channel or vector<Point2f> ) after undistortion
|
|
2758
|
+
* and reverse perspective transformation. If matrix P is identity or omitted, dst will contain
|
|
2759
|
+
* normalized point coordinates.
|
|
2760
|
+
*
|
|
2761
|
+
* @param cameraMatrix Camera matrix $\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$ .
|
|
2762
|
+
*
|
|
2763
|
+
* @param distCoeffs Input vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5,
|
|
2764
|
+
* k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])$ of 4, 5, 8, 12 or 14 elements. If the vector is
|
|
2765
|
+
* NULL/empty, the zero distortion coefficients are assumed.
|
|
2766
|
+
*
|
|
2767
|
+
* @param R Rectification transformation in the object space (3x3 matrix). R1 or R2 computed by
|
|
2768
|
+
* stereoRectify can be passed here. If the matrix is empty, the identity transformation is used.
|
|
2769
|
+
*
|
|
2770
|
+
* @param P New camera matrix (3x3) or new projection matrix (3x4) $\begin{bmatrix} {f'}_x & 0 & {c'}_x
|
|
2771
|
+
* & t_x \\ 0 & {f'}_y & {c'}_y & t_y \\ 0 & 0 & 1 & t_z \end{bmatrix}$. P1 or P2 computed by
|
|
2772
|
+
* stereoRectify can be passed here. If the matrix is empty, the identity new camera matrix is used.
|
|
2773
|
+
*/
|
|
2774
|
+
export declare function undistortPoints(
|
|
2775
|
+
src: InputArray,
|
|
2776
|
+
dst: OutputArray,
|
|
2777
|
+
cameraMatrix: InputArray,
|
|
2778
|
+
distCoeffs: InputArray,
|
|
2779
|
+
R?: InputArray,
|
|
2780
|
+
P?: InputArray,
|
|
2781
|
+
): void;
|
|
2782
|
+
|
|
2783
|
+
/**
|
|
2784
|
+
* This is an overloaded member function, provided for convenience. It differs from the above function
|
|
2785
|
+
* only in what argument(s) it accepts.
|
|
2786
|
+
*
|
|
2787
|
+
* Default version of [undistortPoints] does 5 iterations to compute undistorted points.
|
|
2788
|
+
*/
|
|
2789
|
+
export declare function undistortPoints(
|
|
2790
|
+
src: InputArray,
|
|
2791
|
+
dst: OutputArray,
|
|
2792
|
+
cameraMatrix: InputArray,
|
|
2793
|
+
distCoeffs: InputArray,
|
|
2794
|
+
R: InputArray,
|
|
2795
|
+
P: InputArray,
|
|
2796
|
+
criteria: TermCriteria,
|
|
2797
|
+
): void;
|
|
2798
|
+
|
|
2799
|
+
export declare function validateDisparity(
|
|
2800
|
+
disparity: InputOutputArray,
|
|
2801
|
+
cost: InputArray,
|
|
2802
|
+
minDisparity: int,
|
|
2803
|
+
numberOfDisparities: int,
|
|
2804
|
+
disp12MaxDisp?: int,
|
|
2805
|
+
): void;
|
|
2806
|
+
|
|
2807
|
+
export declare const LMEDS: any; // initializer: = 4
|
|
2808
|
+
|
|
2809
|
+
export declare const RANSAC: any; // initializer: = 8
|
|
2810
|
+
|
|
2811
|
+
export declare const RHO: any; // initializer: = 16
|
|
2812
|
+
|
|
2813
|
+
export declare const CALIB_CB_ADAPTIVE_THRESH: any; // initializer: = 1
|
|
2814
|
+
|
|
2815
|
+
export declare const CALIB_CB_NORMALIZE_IMAGE: any; // initializer: = 2
|
|
2816
|
+
|
|
2817
|
+
export declare const CALIB_CB_FILTER_QUADS: any; // initializer: = 4
|
|
2818
|
+
|
|
2819
|
+
export declare const CALIB_CB_FAST_CHECK: any; // initializer: = 8
|
|
2820
|
+
|
|
2821
|
+
export declare const CALIB_CB_EXHAUSTIVE: any; // initializer: = 16
|
|
2822
|
+
|
|
2823
|
+
export declare const CALIB_CB_ACCURACY: any; // initializer: = 32
|
|
2824
|
+
|
|
2825
|
+
export declare const CALIB_CB_SYMMETRIC_GRID: any; // initializer: = 1
|
|
2826
|
+
|
|
2827
|
+
export declare const CALIB_CB_ASYMMETRIC_GRID: any; // initializer: = 2
|
|
2828
|
+
|
|
2829
|
+
export declare const CALIB_CB_CLUSTERING: any; // initializer: = 4
|
|
2830
|
+
|
|
2831
|
+
export declare const CALIB_NINTRINSIC: any; // initializer: = 18
|
|
2832
|
+
|
|
2833
|
+
export declare const CALIB_USE_INTRINSIC_GUESS: any; // initializer: = 0x00001
|
|
2834
|
+
|
|
2835
|
+
export declare const CALIB_FIX_ASPECT_RATIO: any; // initializer: = 0x00002
|
|
2836
|
+
|
|
2837
|
+
export declare const CALIB_FIX_PRINCIPAL_POINT: any; // initializer: = 0x00004
|
|
2838
|
+
|
|
2839
|
+
export declare const CALIB_ZERO_TANGENT_DIST: any; // initializer: = 0x00008
|
|
2840
|
+
|
|
2841
|
+
export declare const CALIB_FIX_FOCAL_LENGTH: any; // initializer: = 0x00010
|
|
2842
|
+
|
|
2843
|
+
export declare const CALIB_FIX_K1: any; // initializer: = 0x00020
|
|
2844
|
+
|
|
2845
|
+
export declare const CALIB_FIX_K2: any; // initializer: = 0x00040
|
|
2846
|
+
|
|
2847
|
+
export declare const CALIB_FIX_K3: any; // initializer: = 0x00080
|
|
2848
|
+
|
|
2849
|
+
export declare const CALIB_FIX_K4: any; // initializer: = 0x00800
|
|
2850
|
+
|
|
2851
|
+
export declare const CALIB_FIX_K5: any; // initializer: = 0x01000
|
|
2852
|
+
|
|
2853
|
+
export declare const CALIB_FIX_K6: any; // initializer: = 0x02000
|
|
2854
|
+
|
|
2855
|
+
export declare const CALIB_RATIONAL_MODEL: any; // initializer: = 0x04000
|
|
2856
|
+
|
|
2857
|
+
export declare const CALIB_THIN_PRISM_MODEL: any; // initializer: = 0x08000
|
|
2858
|
+
|
|
2859
|
+
export declare const CALIB_FIX_S1_S2_S3_S4: any; // initializer: = 0x10000
|
|
2860
|
+
|
|
2861
|
+
export declare const CALIB_TILTED_MODEL: any; // initializer: = 0x40000
|
|
2862
|
+
|
|
2863
|
+
export declare const CALIB_FIX_TAUX_TAUY: any; // initializer: = 0x80000
|
|
2864
|
+
|
|
2865
|
+
export declare const CALIB_USE_QR: any; // initializer: = 0x100000
|
|
2866
|
+
|
|
2867
|
+
export declare const CALIB_FIX_TANGENT_DIST: any; // initializer: = 0x200000
|
|
2868
|
+
|
|
2869
|
+
export declare const CALIB_FIX_INTRINSIC: any; // initializer: = 0x00100
|
|
2870
|
+
|
|
2871
|
+
export declare const CALIB_SAME_FOCAL_LENGTH: any; // initializer: = 0x00200
|
|
2872
|
+
|
|
2873
|
+
export declare const CALIB_ZERO_DISPARITY: any; // initializer: = 0x00400
|
|
2874
|
+
|
|
2875
|
+
export declare const CALIB_USE_LU: any; // initializer: = (1 << 17)
|
|
2876
|
+
|
|
2877
|
+
export declare const CALIB_USE_EXTRINSIC_GUESS: any; // initializer: = (1 << 22)
|
|
2878
|
+
|
|
2879
|
+
export declare const FM_7POINT: any; // initializer: = 1
|
|
2880
|
+
|
|
2881
|
+
export declare const FM_8POINT: any; // initializer: = 2
|
|
2882
|
+
|
|
2883
|
+
export declare const FM_LMEDS: any; // initializer: = 4
|
|
2884
|
+
|
|
2885
|
+
export declare const FM_RANSAC: any; // initializer: = 8
|
|
2886
|
+
|
|
2887
|
+
export declare const CALIB_HAND_EYE_TSAI: HandEyeCalibrationMethod; // initializer: = 0
|
|
2888
|
+
|
|
2889
|
+
export declare const CALIB_HAND_EYE_PARK: HandEyeCalibrationMethod; // initializer: = 1
|
|
2890
|
+
|
|
2891
|
+
export declare const CALIB_HAND_EYE_HORAUD: HandEyeCalibrationMethod; // initializer: = 2
|
|
2892
|
+
|
|
2893
|
+
export declare const CALIB_HAND_EYE_ANDREFF: HandEyeCalibrationMethod; // initializer: = 3
|
|
2894
|
+
|
|
2895
|
+
export declare const CALIB_HAND_EYE_DANIILIDIS: HandEyeCalibrationMethod; // initializer: = 4
|
|
2896
|
+
|
|
2897
|
+
export declare const SOLVEPNP_ITERATIVE: SolvePnPMethod; // initializer: = 0
|
|
2898
|
+
|
|
2899
|
+
export declare const SOLVEPNP_EPNP: SolvePnPMethod; // initializer: = 1
|
|
2900
|
+
|
|
2901
|
+
export declare const SOLVEPNP_P3P: SolvePnPMethod; // initializer: = 2
|
|
2902
|
+
|
|
2903
|
+
export declare const SOLVEPNP_DLS: SolvePnPMethod; // initializer: = 3
|
|
2904
|
+
|
|
2905
|
+
export declare const SOLVEPNP_UPNP: SolvePnPMethod; // initializer: = 4
|
|
2906
|
+
|
|
2907
|
+
export declare const SOLVEPNP_AP3P: SolvePnPMethod; // initializer: = 5
|
|
2908
|
+
|
|
2909
|
+
/**
|
|
2910
|
+
* Infinitesimal Plane-Based Pose Estimation Collins14
|
|
2911
|
+
* Object points must be coplanar.
|
|
2912
|
+
*
|
|
2913
|
+
*/
|
|
2914
|
+
export declare const SOLVEPNP_IPPE: SolvePnPMethod; // initializer: = 6
|
|
2915
|
+
|
|
2916
|
+
/**
|
|
2917
|
+
* Infinitesimal Plane-Based Pose Estimation Collins14
|
|
2918
|
+
* This is a special case suitable for marker pose estimation.
|
|
2919
|
+
* 4 coplanar object points must be defined in the following order:
|
|
2920
|
+
*
|
|
2921
|
+
* point 0: [-squareLength / 2, squareLength / 2, 0]
|
|
2922
|
+
* point 1: [ squareLength / 2, squareLength / 2, 0]
|
|
2923
|
+
* point 2: [ squareLength / 2, -squareLength / 2, 0]
|
|
2924
|
+
* point 3: [-squareLength / 2, -squareLength / 2, 0]
|
|
2925
|
+
*
|
|
2926
|
+
*/
|
|
2927
|
+
export declare const SOLVEPNP_IPPE_SQUARE: SolvePnPMethod; // initializer: = 7
|
|
2928
|
+
|
|
2929
|
+
export declare const PROJ_SPHERICAL_ORTHO: UndistortTypes; // initializer: = 0
|
|
2930
|
+
|
|
2931
|
+
export declare const PROJ_SPHERICAL_EQRECT: UndistortTypes; // initializer: = 1
|
|
2932
|
+
|
|
2933
|
+
export type HandEyeCalibrationMethod = any;
|
|
2934
|
+
|
|
2935
|
+
export type SolvePnPMethod = any;
|
|
2936
|
+
|
|
2937
|
+
export type UndistortTypes = any;
|