@techstark/opencv-js 4.8.0-release.1 → 4.8.0-release.10

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