@techstark/opencv-js 4.8.0-release.7 → 4.8.0-release.8

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 (197) hide show
  1. package/dist/src/index.d.ts +1 -0
  2. package/dist/src/index.js +18 -0
  3. package/dist/src/index.js.map +1 -0
  4. package/dist/src/types/_cv.d.ts +7 -0
  5. package/dist/src/types/_cv.js +3 -0
  6. package/dist/src/types/_cv.js.map +1 -0
  7. package/dist/src/types/emscripten.d.ts +166 -0
  8. package/dist/src/types/emscripten.js +4 -0
  9. package/dist/src/types/emscripten.js.map +1 -0
  10. package/dist/src/types/opencv/Affine3.d.ts +183 -0
  11. package/dist/src/types/opencv/Affine3.js +3 -0
  12. package/dist/src/types/opencv/Affine3.js.map +1 -0
  13. package/dist/src/types/opencv/Algorithm.d.ts +105 -0
  14. package/dist/src/types/opencv/Algorithm.js +4 -0
  15. package/dist/src/types/opencv/Algorithm.js.map +1 -0
  16. package/dist/src/types/opencv/AutoBuffer.d.ts +41 -0
  17. package/dist/src/types/opencv/AutoBuffer.js +3 -0
  18. package/dist/src/types/opencv/AutoBuffer.js.map +1 -0
  19. package/dist/src/types/opencv/BFMatcher.d.ts +33 -0
  20. package/dist/src/types/opencv/BFMatcher.js +3 -0
  21. package/dist/src/types/opencv/BFMatcher.js.map +1 -0
  22. package/dist/src/types/opencv/BOWTrainer.d.ts +36 -0
  23. package/dist/src/types/opencv/BOWTrainer.js +3 -0
  24. package/dist/src/types/opencv/BOWTrainer.js.map +1 -0
  25. package/dist/src/types/opencv/CascadeClassifier.d.ts +100 -0
  26. package/dist/src/types/opencv/CascadeClassifier.js +4 -0
  27. package/dist/src/types/opencv/CascadeClassifier.js.map +1 -0
  28. package/dist/src/types/opencv/DescriptorMatcher.d.ts +172 -0
  29. package/dist/src/types/opencv/DescriptorMatcher.js +3 -0
  30. package/dist/src/types/opencv/DescriptorMatcher.js.map +1 -0
  31. package/dist/src/types/opencv/DynamicBitset.d.ts +57 -0
  32. package/dist/src/types/opencv/DynamicBitset.js +3 -0
  33. package/dist/src/types/opencv/DynamicBitset.js.map +1 -0
  34. package/dist/src/types/opencv/Exception.d.ts +38 -0
  35. package/dist/src/types/opencv/Exception.js +3 -0
  36. package/dist/src/types/opencv/Exception.js.map +1 -0
  37. package/dist/src/types/opencv/Feature2D.d.ts +14 -0
  38. package/dist/src/types/opencv/Feature2D.js +4 -0
  39. package/dist/src/types/opencv/Feature2D.js.map +1 -0
  40. package/dist/src/types/opencv/FlannBasedMatcher.d.ts +41 -0
  41. package/dist/src/types/opencv/FlannBasedMatcher.js +3 -0
  42. package/dist/src/types/opencv/FlannBasedMatcher.js.map +1 -0
  43. package/dist/src/types/opencv/HOGDescriptor.d.ts +265 -0
  44. package/dist/src/types/opencv/HOGDescriptor.js +3 -0
  45. package/dist/src/types/opencv/HOGDescriptor.js.map +1 -0
  46. package/dist/src/types/opencv/Logger.d.ts +27 -0
  47. package/dist/src/types/opencv/Logger.js +3 -0
  48. package/dist/src/types/opencv/Logger.js.map +1 -0
  49. package/dist/src/types/opencv/LshTable.d.ts +67 -0
  50. package/dist/src/types/opencv/LshTable.js +3 -0
  51. package/dist/src/types/opencv/LshTable.js.map +1 -0
  52. package/dist/src/types/opencv/Mat.d.ts +1589 -0
  53. package/dist/src/types/opencv/Mat.js +3 -0
  54. package/dist/src/types/opencv/Mat.js.map +1 -0
  55. package/dist/src/types/opencv/MatExpr.d.ts +78 -0
  56. package/dist/src/types/opencv/MatExpr.js +4 -0
  57. package/dist/src/types/opencv/MatExpr.js.map +1 -0
  58. package/dist/src/types/opencv/MatOp.d.ts +29 -0
  59. package/dist/src/types/opencv/MatOp.js +3 -0
  60. package/dist/src/types/opencv/MatOp.js.map +1 -0
  61. package/dist/src/types/opencv/Matx.d.ts +84 -0
  62. package/dist/src/types/opencv/Matx.js +3 -0
  63. package/dist/src/types/opencv/Matx.js.map +1 -0
  64. package/dist/src/types/opencv/Node.d.ts +25 -0
  65. package/dist/src/types/opencv/Node.js +3 -0
  66. package/dist/src/types/opencv/Node.js.map +1 -0
  67. package/dist/src/types/opencv/ORB.d.ts +11 -0
  68. package/dist/src/types/opencv/ORB.js +4 -0
  69. package/dist/src/types/opencv/ORB.js.map +1 -0
  70. package/dist/src/types/opencv/PCA.d.ts +170 -0
  71. package/dist/src/types/opencv/PCA.js +3 -0
  72. package/dist/src/types/opencv/PCA.js.map +1 -0
  73. package/dist/src/types/opencv/RotatedRect.d.ts +63 -0
  74. package/dist/src/types/opencv/RotatedRect.js +3 -0
  75. package/dist/src/types/opencv/RotatedRect.js.map +1 -0
  76. package/dist/src/types/opencv/_hacks.d.ts +267 -0
  77. package/dist/src/types/opencv/_hacks.js +15 -0
  78. package/dist/src/types/opencv/_hacks.js.map +1 -0
  79. package/dist/src/types/opencv/_types.d.ts +44 -0
  80. package/dist/src/types/opencv/_types.js +61 -0
  81. package/dist/src/types/opencv/_types.js.map +1 -0
  82. package/dist/src/types/opencv/calib3d.d.ts +2180 -0
  83. package/dist/src/types/opencv/calib3d.js +3 -0
  84. package/dist/src/types/opencv/calib3d.js.map +1 -0
  85. package/dist/src/types/opencv/core_array.d.ts +2513 -0
  86. package/dist/src/types/opencv/core_array.js +3 -0
  87. package/dist/src/types/opencv/core_array.js.map +1 -0
  88. package/dist/src/types/opencv/core_cluster.d.ts +54 -0
  89. package/dist/src/types/opencv/core_cluster.js +3 -0
  90. package/dist/src/types/opencv/core_cluster.js.map +1 -0
  91. package/dist/src/types/opencv/core_hal_interface.d.ts +92 -0
  92. package/dist/src/types/opencv/core_hal_interface.js +3 -0
  93. package/dist/src/types/opencv/core_hal_interface.js.map +1 -0
  94. package/dist/src/types/opencv/core_utils.d.ts +510 -0
  95. package/dist/src/types/opencv/core_utils.js +3 -0
  96. package/dist/src/types/opencv/core_utils.js.map +1 -0
  97. package/dist/src/types/opencv/dnn.d.ts +336 -0
  98. package/dist/src/types/opencv/dnn.js +3 -0
  99. package/dist/src/types/opencv/dnn.js.map +1 -0
  100. package/dist/src/types/opencv/features2d_draw.d.ts +75 -0
  101. package/dist/src/types/opencv/features2d_draw.js +3 -0
  102. package/dist/src/types/opencv/features2d_draw.js.map +1 -0
  103. package/dist/src/types/opencv/imgproc_color_conversions.d.ts +299 -0
  104. package/dist/src/types/opencv/imgproc_color_conversions.js +3 -0
  105. package/dist/src/types/opencv/imgproc_color_conversions.js.map +1 -0
  106. package/dist/src/types/opencv/imgproc_draw.d.ts +502 -0
  107. package/dist/src/types/opencv/imgproc_draw.js +3 -0
  108. package/dist/src/types/opencv/imgproc_draw.js.map +1 -0
  109. package/dist/src/types/opencv/imgproc_feature.d.ts +533 -0
  110. package/dist/src/types/opencv/imgproc_feature.js +3 -0
  111. package/dist/src/types/opencv/imgproc_feature.js.map +1 -0
  112. package/dist/src/types/opencv/imgproc_filter.d.ts +689 -0
  113. package/dist/src/types/opencv/imgproc_filter.js +3 -0
  114. package/dist/src/types/opencv/imgproc_filter.js.map +1 -0
  115. package/dist/src/types/opencv/imgproc_hist.d.ts +291 -0
  116. package/dist/src/types/opencv/imgproc_hist.js +3 -0
  117. package/dist/src/types/opencv/imgproc_hist.js.map +1 -0
  118. package/dist/src/types/opencv/imgproc_misc.d.ts +473 -0
  119. package/dist/src/types/opencv/imgproc_misc.js +3 -0
  120. package/dist/src/types/opencv/imgproc_misc.js.map +1 -0
  121. package/dist/src/types/opencv/imgproc_object.d.ts +41 -0
  122. package/dist/src/types/opencv/imgproc_object.js +3 -0
  123. package/dist/src/types/opencv/imgproc_object.js.map +1 -0
  124. package/dist/src/types/opencv/imgproc_shape.d.ts +570 -0
  125. package/dist/src/types/opencv/imgproc_shape.js +3 -0
  126. package/dist/src/types/opencv/imgproc_shape.js.map +1 -0
  127. package/dist/src/types/opencv/imgproc_transform.d.ts +430 -0
  128. package/dist/src/types/opencv/imgproc_transform.js +3 -0
  129. package/dist/src/types/opencv/imgproc_transform.js.map +1 -0
  130. package/dist/src/types/opencv/index.d.ts +4 -0
  131. package/dist/src/types/opencv/index.js +19 -0
  132. package/dist/src/types/opencv/index.js.map +1 -0
  133. package/dist/src/types/opencv/objdetect.d.ts +43 -0
  134. package/dist/src/types/opencv/objdetect.js +3 -0
  135. package/dist/src/types/opencv/objdetect.js.map +1 -0
  136. package/dist/src/types/opencv/photo_inpaint.d.ts +25 -0
  137. package/dist/src/types/opencv/photo_inpaint.js +3 -0
  138. package/dist/src/types/opencv/photo_inpaint.js.map +1 -0
  139. package/dist/src/types/opencv/softdouble.d.ts +38 -0
  140. package/dist/src/types/opencv/softdouble.js +3 -0
  141. package/dist/src/types/opencv/softdouble.js.map +1 -0
  142. package/dist/src/types/opencv/softfloat.d.ts +38 -0
  143. package/dist/src/types/opencv/softfloat.js +3 -0
  144. package/dist/src/types/opencv/softfloat.js.map +1 -0
  145. package/dist/src/types/opencv/video_track.d.ts +276 -0
  146. package/dist/src/types/opencv/video_track.js +3 -0
  147. package/dist/src/types/opencv/video_track.js.map +1 -0
  148. package/package.json +5 -3
  149. package/src/index.ts +1 -0
  150. package/src/types/_cv.ts +6 -0
  151. package/src/types/emscripten.ts +286 -0
  152. package/src/types/opencv/Affine3.ts +206 -0
  153. package/src/types/opencv/Algorithm.ts +126 -0
  154. package/src/types/opencv/AutoBuffer.ts +50 -0
  155. package/src/types/opencv/BFMatcher.ts +37 -0
  156. package/src/types/opencv/BOWTrainer.ts +43 -0
  157. package/src/types/opencv/CascadeClassifier.ts +153 -0
  158. package/src/types/opencv/DescriptorMatcher.ts +244 -0
  159. package/src/types/opencv/DynamicBitset.ts +68 -0
  160. package/src/types/opencv/Exception.ts +54 -0
  161. package/src/types/opencv/Feature2D.ts +20 -0
  162. package/src/types/opencv/FlannBasedMatcher.ts +50 -0
  163. package/src/types/opencv/HOGDescriptor.ts +401 -0
  164. package/src/types/opencv/Logger.ts +34 -0
  165. package/src/types/opencv/LshTable.ts +81 -0
  166. package/src/types/opencv/Mat.ts +1764 -0
  167. package/src/types/opencv/MatExpr.ts +107 -0
  168. package/src/types/opencv/MatOp.ts +70 -0
  169. package/src/types/opencv/Matx.ts +228 -0
  170. package/src/types/opencv/Node.ts +33 -0
  171. package/src/types/opencv/ORB.ts +22 -0
  172. package/src/types/opencv/PCA.ts +204 -0
  173. package/src/types/opencv/RotatedRect.ts +72 -0
  174. package/src/types/opencv/_hacks.ts +322 -0
  175. package/src/types/opencv/_types.ts +44 -0
  176. package/src/types/opencv/calib3d.ts +2937 -0
  177. package/src/types/opencv/core_array.ts +3102 -0
  178. package/src/types/opencv/core_cluster.ts +81 -0
  179. package/src/types/opencv/core_hal_interface.ts +159 -0
  180. package/src/types/opencv/core_utils.ts +748 -0
  181. package/src/types/opencv/dnn.ts +505 -0
  182. package/src/types/opencv/features2d_draw.ts +114 -0
  183. package/src/types/opencv/imgproc_color_conversions.ts +527 -0
  184. package/src/types/opencv/imgproc_draw.ts +733 -0
  185. package/src/types/opencv/imgproc_feature.ts +681 -0
  186. package/src/types/opencv/imgproc_filter.ts +918 -0
  187. package/src/types/opencv/imgproc_hist.ts +399 -0
  188. package/src/types/opencv/imgproc_misc.ts +616 -0
  189. package/src/types/opencv/imgproc_object.ts +58 -0
  190. package/src/types/opencv/imgproc_shape.ts +734 -0
  191. package/src/types/opencv/imgproc_transform.ts +574 -0
  192. package/src/types/opencv/index.ts +4 -0
  193. package/src/types/opencv/objdetect.ts +103 -0
  194. package/src/types/opencv/photo_inpaint.ts +37 -0
  195. package/src/types/opencv/softdouble.ts +64 -0
  196. package/src/types/opencv/softfloat.ts +64 -0
  197. package/src/types/opencv/video_track.ts +372 -0
@@ -0,0 +1,276 @@
1
+ import { bool, double, InputArray, InputOutputArray, int, Mat, OutputArray, OutputArrayOfArrays, RotatedRect, Size, TermCriteria } from "./_types";
2
+ /**
3
+ * number of levels in constructed pyramid. Can be less than maxLevel.
4
+ *
5
+ * @param img 8-bit input image.
6
+ *
7
+ * @param pyramid output pyramid.
8
+ *
9
+ * @param winSize window size of optical flow algorithm. Must be not less than winSize argument of
10
+ * calcOpticalFlowPyrLK. It is needed to calculate required padding for pyramid levels.
11
+ *
12
+ * @param maxLevel 0-based maximal pyramid level number.
13
+ *
14
+ * @param withDerivatives set to precompute gradients for the every pyramid level. If pyramid is
15
+ * constructed without the gradients then calcOpticalFlowPyrLK will calculate them internally.
16
+ *
17
+ * @param pyrBorder the border mode for pyramid layers.
18
+ *
19
+ * @param derivBorder the border mode for gradients.
20
+ *
21
+ * @param tryReuseInputImage put ROI of input image into the pyramid if possible. You can pass false to
22
+ * force data copying.
23
+ */
24
+ export declare function buildOpticalFlowPyramid(img: InputArray, pyramid: OutputArrayOfArrays, winSize: Size, maxLevel: int, withDerivatives?: bool, pyrBorder?: int, derivBorder?: int, tryReuseInputImage?: bool): int;
25
+ /**
26
+ * The function finds an optical flow for each prev pixel using the Farneback2003 algorithm so that
27
+ *
28
+ * `\\[\\texttt{prev} (y,x) \\sim \\texttt{next} ( y + \\texttt{flow} (y,x)[1], x + \\texttt{flow}
29
+ * (y,x)[0])\\]`
30
+ *
31
+ * An example using the optical flow algorithm described by Gunnar Farneback can be found at
32
+ * opencv_source_code/samples/cpp/fback.cpp
33
+ * (Python) An example using the optical flow algorithm described by Gunnar Farneback can be found at
34
+ * opencv_source_code/samples/python/opt_flow.py
35
+ *
36
+ * @param prev first 8-bit single-channel input image.
37
+ *
38
+ * @param next second input image of the same size and the same type as prev.
39
+ *
40
+ * @param flow computed flow image that has the same size as prev and type CV_32FC2.
41
+ *
42
+ * @param pyr_scale parameter, specifying the image scale (<1) to build pyramids for each image;
43
+ * pyr_scale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous
44
+ * one.
45
+ *
46
+ * @param levels number of pyramid layers including the initial image; levels=1 means that no extra
47
+ * layers are created and only the original images are used.
48
+ *
49
+ * @param winsize averaging window size; larger values increase the algorithm robustness to image noise
50
+ * and give more chances for fast motion detection, but yield more blurred motion field.
51
+ *
52
+ * @param iterations number of iterations the algorithm does at each pyramid level.
53
+ *
54
+ * @param poly_n size of the pixel neighborhood used to find polynomial expansion in each pixel; larger
55
+ * values mean that the image will be approximated with smoother surfaces, yielding more robust
56
+ * algorithm and more blurred motion field, typically poly_n =5 or 7.
57
+ *
58
+ * @param poly_sigma standard deviation of the Gaussian that is used to smooth derivatives used as a
59
+ * basis for the polynomial expansion; for poly_n=5, you can set poly_sigma=1.1, for poly_n=7, a good
60
+ * value would be poly_sigma=1.5.
61
+ *
62
+ * @param flags operation flags that can be a combination of the following:
63
+ * OPTFLOW_USE_INITIAL_FLOW uses the input flow as an initial flow
64
+ * approximation.OPTFLOW_FARNEBACK_GAUSSIAN uses the Gaussian $\texttt{winsize}\times\texttt{winsize}$
65
+ * filter instead of a box filter of the same size for optical flow estimation; usually, this option
66
+ * gives z more accurate flow than with a box filter, at the cost of lower speed; normally, winsize for
67
+ * a Gaussian window should be set to a larger value to achieve the same level of robustness.
68
+ */
69
+ export declare function calcOpticalFlowFarneback(prev: InputArray, next: InputArray, flow: InputOutputArray, pyr_scale: double, levels: int, winsize: int, iterations: int, poly_n: int, poly_sigma: double, flags: int): void;
70
+ /**
71
+ * The function implements a sparse iterative version of the Lucas-Kanade optical flow in pyramids. See
72
+ * Bouguet00 . The function is parallelized with the TBB library.
73
+ *
74
+ * An example using the Lucas-Kanade optical flow algorithm can be found at
75
+ * opencv_source_code/samples/cpp/lkdemo.cpp
76
+ * (Python) An example using the Lucas-Kanade optical flow algorithm can be found at
77
+ * opencv_source_code/samples/python/lk_track.py
78
+ * (Python) An example using the Lucas-Kanade tracker for homography matching can be found at
79
+ * opencv_source_code/samples/python/lk_homography.py
80
+ *
81
+ * @param prevImg first 8-bit input image or pyramid constructed by buildOpticalFlowPyramid.
82
+ *
83
+ * @param nextImg second input image or pyramid of the same size and the same type as prevImg.
84
+ *
85
+ * @param prevPts vector of 2D points for which the flow needs to be found; point coordinates must be
86
+ * single-precision floating-point numbers.
87
+ *
88
+ * @param nextPts output vector of 2D points (with single-precision floating-point coordinates)
89
+ * containing the calculated new positions of input features in the second image; when
90
+ * OPTFLOW_USE_INITIAL_FLOW flag is passed, the vector must have the same size as in the input.
91
+ *
92
+ * @param status output status vector (of unsigned chars); each element of the vector is set to 1 if
93
+ * the flow for the corresponding features has been found, otherwise, it is set to 0.
94
+ *
95
+ * @param err output vector of errors; each element of the vector is set to an error for the
96
+ * corresponding feature, type of the error measure can be set in flags parameter; if the flow wasn't
97
+ * found then the error is not defined (use the status parameter to find such cases).
98
+ *
99
+ * @param winSize size of the search window at each pyramid level.
100
+ *
101
+ * @param maxLevel 0-based maximal pyramid level number; if set to 0, pyramids are not used (single
102
+ * level), if set to 1, two levels are used, and so on; if pyramids are passed to input then algorithm
103
+ * will use as many levels as pyramids have but no more than maxLevel.
104
+ *
105
+ * @param criteria parameter, specifying the termination criteria of the iterative search algorithm
106
+ * (after the specified maximum number of iterations criteria.maxCount or when the search window moves
107
+ * by less than criteria.epsilon.
108
+ *
109
+ * @param flags operation flags:
110
+ * OPTFLOW_USE_INITIAL_FLOW uses initial estimations, stored in nextPts; if the flag is not set, then
111
+ * prevPts is copied to nextPts and is considered the initial estimate.OPTFLOW_LK_GET_MIN_EIGENVALS use
112
+ * minimum eigen values as an error measure (see minEigThreshold description); if the flag is not set,
113
+ * then L1 distance between patches around the original and a moved point, divided by number of pixels
114
+ * in a window, is used as a error measure.
115
+ *
116
+ * @param minEigThreshold the algorithm calculates the minimum eigen value of a 2x2 normal matrix of
117
+ * optical flow equations (this matrix is called a spatial gradient matrix in Bouguet00), divided by
118
+ * number of pixels in a window; if this value is less than minEigThreshold, then a corresponding
119
+ * feature is filtered out and its flow is not processed, so it allows to remove bad points and get a
120
+ * performance boost.
121
+ */
122
+ export declare function calcOpticalFlowPyrLK(prevImg: InputArray, nextImg: InputArray, prevPts: InputArray, nextPts: InputOutputArray, status: OutputArray, err: OutputArray, winSize?: Size, maxLevel?: int, criteria?: TermCriteria, flags?: int, minEigThreshold?: double): void;
123
+ /**
124
+ * See the OpenCV sample camshiftdemo.c that tracks colored objects.
125
+ *
126
+ * (Python) A sample explaining the camshift tracking algorithm can be found at
127
+ * opencv_source_code/samples/python/camshift.py
128
+ *
129
+ * @param probImage Back projection of the object histogram. See calcBackProject.
130
+ *
131
+ * @param window Initial search window.
132
+ *
133
+ * @param criteria Stop criteria for the underlying meanShift. returns (in old interfaces) Number of
134
+ * iterations CAMSHIFT took to converge The function implements the CAMSHIFT object tracking algorithm
135
+ * Bradski98 . First, it finds an object center using meanShift and then adjusts the window size and
136
+ * finds the optimal rotation. The function returns the rotated rectangle structure that includes the
137
+ * object position, size, and orientation. The next position of the search window can be obtained with
138
+ * RotatedRect::boundingRect()
139
+ */
140
+ export declare function CamShift(probImage: InputArray, window: any, criteria: TermCriteria): RotatedRect;
141
+ /**
142
+ * [findTransformECC]
143
+ *
144
+ * @param templateImage single-channel template image; CV_8U or CV_32F array.
145
+ *
146
+ * @param inputImage single-channel input image to be warped to provide an image similar to
147
+ * templateImage, same type as templateImage.
148
+ *
149
+ * @param inputMask An optional mask to indicate valid values of inputImage.
150
+ */
151
+ export declare function computeECC(templateImage: InputArray, inputImage: InputArray, inputMask?: InputArray): double;
152
+ /**
153
+ * The function finds an optimal affine transform *[A|b]* (a 2 x 3 floating-point matrix) that
154
+ * approximates best the affine transformation between: In case of point sets, the problem is
155
+ * formulated as follows: you need to find a 2x2 matrix *A* and 2x1 vector *b* so that:
156
+ *
157
+ * `\\[[A^*|b^*] = arg \\min _{[A|b]} \\sum _i \\| \\texttt{dst}[i] - A { \\texttt{src}[i]}^T - b \\|
158
+ * ^2\\]` where src[i] and dst[i] are the i-th points in src and dst, respectively `$[A|b]$` can be
159
+ * either arbitrary (when fullAffine=true ) or have a form of `\\[\\begin{bmatrix} a_{11} & a_{12} &
160
+ * b_1 \\\\ -a_{12} & a_{11} & b_2 \\end{bmatrix}\\]` when fullAffine=false.
161
+ *
162
+ * [estimateAffine2D], [estimateAffinePartial2D], [getAffineTransform], [getPerspectiveTransform],
163
+ * [findHomography]
164
+ *
165
+ * @param src First input 2D point set stored in std::vector or Mat, or an image stored in Mat.
166
+ *
167
+ * @param dst Second input 2D point set of the same size and the same type as A, or another image.
168
+ *
169
+ * @param fullAffine If true, the function finds an optimal affine transformation with no additional
170
+ * restrictions (6 degrees of freedom). Otherwise, the class of transformations to choose from is
171
+ * limited to combinations of translation, rotation, and uniform scaling (4 degrees of freedom).
172
+ */
173
+ export declare function estimateRigidTransform(src: InputArray, dst: InputArray, fullAffine: bool): Mat;
174
+ /**
175
+ * The function estimates the optimum transformation (warpMatrix) with respect to ECC criterion (EP08),
176
+ * that is
177
+ *
178
+ * `\\[\\texttt{warpMatrix} = \\texttt{warpMatrix} = \\arg\\max_{W}
179
+ * \\texttt{ECC}(\\texttt{templateImage}(x,y),\\texttt{inputImage}(x',y'))\\]`
180
+ *
181
+ * where
182
+ *
183
+ * `\\[\\begin{bmatrix} x' \\\\ y' \\end{bmatrix} = W \\cdot \\begin{bmatrix} x \\\\ y \\\\ 1
184
+ * \\end{bmatrix}\\]`
185
+ *
186
+ * (the equation holds with homogeneous coordinates for homography). It returns the final enhanced
187
+ * correlation coefficient, that is the correlation coefficient between the template image and the
188
+ * final warped input image. When a `$3\\times 3$` matrix is given with motionType =0, 1 or 2, the
189
+ * third row is ignored.
190
+ *
191
+ * Unlike findHomography and estimateRigidTransform, the function findTransformECC implements an
192
+ * area-based alignment that builds on intensity similarities. In essence, the function updates the
193
+ * initial transformation that roughly aligns the images. If this information is missing, the identity
194
+ * warp (unity matrix) is used as an initialization. Note that if images undergo strong
195
+ * displacements/rotations, an initial transformation that roughly aligns the images is necessary
196
+ * (e.g., a simple euclidean/similarity transform that allows for the images showing the same image
197
+ * content approximately). Use inverse warping in the second image to take an image close to the first
198
+ * one, i.e. use the flag WARP_INVERSE_MAP with warpAffine or warpPerspective. See also the OpenCV
199
+ * sample image_alignment.cpp that demonstrates the use of the function. Note that the function throws
200
+ * an exception if algorithm does not converges.
201
+ *
202
+ * [computeECC], [estimateAffine2D], [estimateAffinePartial2D], [findHomography]
203
+ *
204
+ * @param templateImage single-channel template image; CV_8U or CV_32F array.
205
+ *
206
+ * @param inputImage single-channel input image which should be warped with the final warpMatrix in
207
+ * order to provide an image similar to templateImage, same type as templateImage.
208
+ *
209
+ * @param warpMatrix floating-point $2\times 3$ or $3\times 3$ mapping matrix (warp).
210
+ *
211
+ * @param motionType parameter, specifying the type of motion:
212
+ * MOTION_TRANSLATION sets a translational motion model; warpMatrix is $2\times 3$ with the first
213
+ * $2\times 2$ part being the unity matrix and the rest two parameters being estimated.MOTION_EUCLIDEAN
214
+ * sets a Euclidean (rigid) transformation as motion model; three parameters are estimated; warpMatrix
215
+ * is $2\times 3$.MOTION_AFFINE sets an affine motion model (DEFAULT); six parameters are estimated;
216
+ * warpMatrix is $2\times 3$.MOTION_HOMOGRAPHY sets a homography as a motion model; eight parameters
217
+ * are estimated;`warpMatrix` is $3\times 3$.
218
+ *
219
+ * @param criteria parameter, specifying the termination criteria of the ECC algorithm;
220
+ * criteria.epsilon defines the threshold of the increment in the correlation coefficient between two
221
+ * iterations (a negative criteria.epsilon makes criteria.maxcount the only termination criterion).
222
+ * Default values are shown in the declaration above.
223
+ *
224
+ * @param inputMask An optional mask to indicate valid values of inputImage.
225
+ *
226
+ * @param gaussFiltSize An optional value indicating size of gaussian blur filter; (DEFAULT: 5)
227
+ */
228
+ export declare function findTransformECC(templateImage: InputArray, inputImage: InputArray, warpMatrix: InputOutputArray, motionType: int, criteria: TermCriteria, inputMask: InputArray, gaussFiltSize: int): double;
229
+ /**
230
+ * This is an overloaded member function, provided for convenience. It differs from the above function
231
+ * only in what argument(s) it accepts.
232
+ */
233
+ export declare function findTransformECC(templateImage: InputArray, inputImage: InputArray, warpMatrix: InputOutputArray, motionType?: int, criteria?: TermCriteria, inputMask?: InputArray): double;
234
+ /**
235
+ * @param probImage Back projection of the object histogram. See calcBackProject for details.
236
+ *
237
+ * @param window Initial search window.
238
+ *
239
+ * @param criteria Stop criteria for the iterative search algorithm. returns : Number of iterations
240
+ * CAMSHIFT took to converge. The function implements the iterative object search algorithm. It takes
241
+ * the input back projection of an object and the initial position. The mass center in window of the
242
+ * back projection image is computed and the search window center shifts to the mass center. The
243
+ * procedure is repeated until the specified number of iterations criteria.maxCount is done or until
244
+ * the window center shifts by less than criteria.epsilon. The algorithm is used inside CamShift and,
245
+ * unlike CamShift , the search window size or orientation do not change during the search. You can
246
+ * simply pass the output of calcBackProject to this function. But better results can be obtained if
247
+ * you pre-filter the back projection and remove the noise. For example, you can do this by retrieving
248
+ * connected components with findContours , throwing away contours with small area ( contourArea ), and
249
+ * rendering the remaining contours with drawContours.
250
+ */
251
+ export declare function meanShift(probImage: InputArray, window: any, criteria: TermCriteria): int;
252
+ /**
253
+ * The function readOpticalFlow loads a flow field from a file and returns it as a single matrix.
254
+ * Resulting [Mat] has a type CV_32FC2 - floating-point, 2-channel. First channel corresponds to the
255
+ * flow in the horizontal direction (u), second - vertical (v).
256
+ *
257
+ * @param path Path to the file to be loaded
258
+ */
259
+ export declare function readOpticalFlow(path: any): Mat;
260
+ /**
261
+ * The function stores a flow field in a file, returns true on success, false otherwise. The flow field
262
+ * must be a 2-channel, floating-point matrix (CV_32FC2). First channel corresponds to the flow in the
263
+ * horizontal direction (u), second - vertical (v).
264
+ *
265
+ * @param path Path to the file to be written
266
+ *
267
+ * @param flow Flow field to be stored
268
+ */
269
+ export declare function writeOpticalFlow(path: any, flow: InputArray): bool;
270
+ export declare const OPTFLOW_USE_INITIAL_FLOW: any;
271
+ export declare const OPTFLOW_LK_GET_MIN_EIGENVALS: any;
272
+ export declare const OPTFLOW_FARNEBACK_GAUSSIAN: any;
273
+ export declare const MOTION_TRANSLATION: any;
274
+ export declare const MOTION_EUCLIDEAN: any;
275
+ export declare const MOTION_AFFINE: any;
276
+ export declare const MOTION_HOMOGRAPHY: any;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=video_track.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video_track.js","sourceRoot":"","sources":["../../../../src/types/opencv/video_track.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "@techstark/opencv-js",
3
- "version": "4.8.0-release.7",
3
+ "version": "4.8.0-release.8",
4
4
  "description": "OpenCV JavaScript version for node.js or browser",
5
5
  "main": "dist/opencv.js",
6
6
  "types": "dist/src/index.d.ts",
7
7
  "files": [
8
- "dist/"
8
+ "dist/",
9
+ "src/"
9
10
  ],
10
11
  "scripts": {
11
12
  "build": "tsc",
13
+ "prepack": "npm run build",
12
14
  "format": "prettier --write \"src/**/*.ts\""
13
15
  },
14
16
  "repository": {
@@ -30,4 +32,4 @@
30
32
  "prettier": "^3.0.3",
31
33
  "typescript": "^5.1.6"
32
34
  }
33
- }
35
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./types/opencv";
@@ -0,0 +1,6 @@
1
+ import { FS } from "./emscripten";
2
+ import { CV } from "./opencv";
3
+
4
+ declare global {
5
+ var cv: CV & { FS: FS };
6
+ }
@@ -0,0 +1,286 @@
1
+ interface Lookup {
2
+ path: string;
3
+ node: FSNode;
4
+ }
5
+ interface FSStream {}
6
+ interface FSNode {}
7
+
8
+ export interface FS {
9
+ lookupPath(path: string, opts: any): Lookup;
10
+ getPath(node: FSNode): string;
11
+
12
+ isFile(mode: number): boolean;
13
+ isDir(mode: number): boolean;
14
+ isLink(mode: number): boolean;
15
+ isChrdev(mode: number): boolean;
16
+ isBlkdev(mode: number): boolean;
17
+ isFIFO(mode: number): boolean;
18
+ isSocket(mode: number): boolean;
19
+
20
+ major(dev: number): number;
21
+ minor(dev: number): number;
22
+ makedev(ma: number, mi: number): number;
23
+ registerDevice(dev: number, ops: any): void;
24
+
25
+ syncfs(populate: boolean, callback: (e: any) => any): void;
26
+ syncfs(callback: (e: any) => any, populate?: boolean): void;
27
+ mount(type: any, opts: any, mountpoint: string): any;
28
+ unmount(mountpoint: string): void;
29
+
30
+ mkdir(path: string, mode?: number): any;
31
+ mkdev(path: string, mode?: number, dev?: number): any;
32
+ symlink(oldpath: string, newpath: string): any;
33
+ rename(old_path: string, new_path: string): void;
34
+ rmdir(path: string): void;
35
+ readdir(path: string): string[];
36
+ unlink(path: string): void;
37
+ readlink(path: string): string;
38
+ stat(path: string, dontFollow?: boolean): any;
39
+ lstat(path: string): any;
40
+ chmod(path: string, mode: number, dontFollow?: boolean): void;
41
+ lchmod(path: string, mode: number): void;
42
+ fchmod(fd: number, mode: number): void;
43
+ chown(path: string, uid: number, gid: number, dontFollow?: boolean): void;
44
+ lchown(path: string, uid: number, gid: number): void;
45
+ fchown(fd: number, uid: number, gid: number): void;
46
+ truncate(path: string, len: number): void;
47
+ ftruncate(fd: number, len: number): void;
48
+ utime(path: string, atime: number, mtime: number): void;
49
+ open(
50
+ path: string,
51
+ flags: string,
52
+ mode?: number,
53
+ fd_start?: number,
54
+ fd_end?: number,
55
+ ): FSStream;
56
+ close(stream: FSStream): void;
57
+ llseek(stream: FSStream, offset: number, whence: number): any;
58
+ read(
59
+ stream: FSStream,
60
+ buffer: ArrayBufferView,
61
+ offset: number,
62
+ length: number,
63
+ position?: number,
64
+ ): number;
65
+ write(
66
+ stream: FSStream,
67
+ buffer: ArrayBufferView,
68
+ offset: number,
69
+ length: number,
70
+ position?: number,
71
+ canOwn?: boolean,
72
+ ): number;
73
+ allocate(stream: FSStream, offset: number, length: number): void;
74
+ mmap(
75
+ stream: FSStream,
76
+ buffer: ArrayBufferView,
77
+ offset: number,
78
+ length: number,
79
+ position: number,
80
+ prot: number,
81
+ flags: number,
82
+ ): any;
83
+ ioctl(stream: FSStream, cmd: any, arg: any): any;
84
+ readFile(
85
+ path: string,
86
+ opts?: { encoding: string; flags: string },
87
+ ): ArrayBufferView;
88
+ writeFile(
89
+ path: string,
90
+ data: ArrayBufferView,
91
+ opts?: { encoding: string; flags: string },
92
+ ): void;
93
+ writeFile(
94
+ path: string,
95
+ data: string,
96
+ opts?: { encoding: string; flags: string },
97
+ ): void;
98
+ analyzePath(p: string): any;
99
+ cwd(): string;
100
+ chdir(path: string): void;
101
+ init(
102
+ input: () => number,
103
+ output: (c: number) => any,
104
+ error: (c: number) => any,
105
+ ): void;
106
+
107
+ createLazyFile(
108
+ parent: string,
109
+ name: string,
110
+ url: string,
111
+ canRead: boolean,
112
+ canWrite: boolean,
113
+ ): FSNode;
114
+ createLazyFile(
115
+ parent: FSNode,
116
+ name: string,
117
+ url: string,
118
+ canRead: boolean,
119
+ canWrite: boolean,
120
+ ): FSNode;
121
+
122
+ createPreloadedFile(
123
+ parent: string,
124
+ name: string,
125
+ url: string,
126
+ canRead: boolean,
127
+ canWrite: boolean,
128
+ onload?: () => void,
129
+ onerror?: () => void,
130
+ dontCreateFile?: boolean,
131
+ canOwn?: boolean,
132
+ ): void;
133
+ createPreloadedFile(
134
+ parent: FSNode,
135
+ name: string,
136
+ url: string,
137
+ canRead: boolean,
138
+ canWrite: boolean,
139
+ onload?: () => void,
140
+ onerror?: () => void,
141
+ dontCreateFile?: boolean,
142
+ canOwn?: boolean,
143
+ ): void;
144
+
145
+ createDataFile(
146
+ parent: string,
147
+ name: string,
148
+ data: ArrayBufferView,
149
+ canRead: boolean,
150
+ canWrite: boolean,
151
+ canOwn: boolean,
152
+ ): void;
153
+ }
154
+
155
+ export interface EmscriptenModule {
156
+ print(str: string): void;
157
+ printErr(str: string): void;
158
+ arguments: string[];
159
+ environment: EnvironmentType;
160
+ preInit: Array<{ (): void }>;
161
+ preRun: Array<{ (): void }>;
162
+ postRun: Array<{ (): void }>;
163
+ onAbort: { (what: any): void };
164
+ onRuntimeInitialized: { (): void };
165
+ preinitializedWebGLContext: WebGLRenderingContext;
166
+ noInitialRun: boolean;
167
+ noExitRuntime: boolean;
168
+ logReadFiles: boolean;
169
+ filePackagePrefixURL: string;
170
+ wasmBinary: ArrayBuffer;
171
+
172
+ destroy(object: object): void;
173
+ getPreloadedPackage(
174
+ remotePackageName: string,
175
+ remotePackageSize: number,
176
+ ): ArrayBuffer;
177
+ instantiateWasm(
178
+ imports: WebAssemblyImports,
179
+ successCallback: (module: WebAssemblyModule) => void,
180
+ ): WebAssemblyExports;
181
+ locateFile(url: string): string;
182
+ onCustomMessage(event: MessageEvent): void;
183
+
184
+ Runtime: any;
185
+
186
+ ccall(
187
+ ident: string,
188
+ returnType: ValueType | null,
189
+ argTypes: ValueType[],
190
+ args: TypeCompatibleWithC[],
191
+ opts?: CCallOpts,
192
+ ): any;
193
+ cwrap(
194
+ ident: string,
195
+ returnType: ValueType | null,
196
+ argTypes: ValueType[],
197
+ opts?: CCallOpts,
198
+ ): (...args: any[]) => any;
199
+
200
+ setValue(ptr: number, value: any, type: string, noSafe?: boolean): void;
201
+ getValue(ptr: number, type: string, noSafe?: boolean): number;
202
+
203
+ ALLOC_NORMAL: number;
204
+ ALLOC_STACK: number;
205
+ ALLOC_STATIC: number;
206
+ ALLOC_DYNAMIC: number;
207
+ ALLOC_NONE: number;
208
+
209
+ allocate(
210
+ slab: any,
211
+ types: string | string[],
212
+ allocator: number,
213
+ ptr: number,
214
+ ): number;
215
+
216
+ // USE_TYPED_ARRAYS == 1
217
+ HEAP: Int32Array;
218
+ IHEAP: Int32Array;
219
+ FHEAP: Float64Array;
220
+
221
+ // USE_TYPED_ARRAYS == 2
222
+ HEAP8: Int8Array;
223
+ HEAP16: Int16Array;
224
+ HEAP32: Int32Array;
225
+ HEAPU8: Uint8Array;
226
+ HEAPU16: Uint16Array;
227
+ HEAPU32: Uint32Array;
228
+ HEAPF32: Float32Array;
229
+ HEAPF64: Float64Array;
230
+
231
+ TOTAL_STACK: number;
232
+ TOTAL_MEMORY: number;
233
+ FAST_MEMORY: number;
234
+
235
+ addOnPreRun(cb: () => any): void;
236
+ addOnInit(cb: () => any): void;
237
+ addOnPreMain(cb: () => any): void;
238
+ addOnExit(cb: () => any): void;
239
+ addOnPostRun(cb: () => any): void;
240
+
241
+ // Tools
242
+ intArrayFromString(
243
+ stringy: string,
244
+ dontAddNull?: boolean,
245
+ length?: number,
246
+ ): number[];
247
+ intArrayToString(array: number[]): string;
248
+ writeStringToMemory(str: string, buffer: number, dontAddNull: boolean): void;
249
+ writeArrayToMemory(array: number[], buffer: number): void;
250
+ writeAsciiToMemory(str: string, buffer: number, dontAddNull: boolean): void;
251
+
252
+ addRunDependency(id: any): void;
253
+ removeRunDependency(id: any): void;
254
+
255
+ preloadedImages: any;
256
+ preloadedAudios: any;
257
+
258
+ _malloc(size: number): number;
259
+ _free(ptr: number): void;
260
+ }
261
+
262
+ // declare namespace Emscripten {
263
+ interface FileSystemType {}
264
+ type EnvironmentType = "WEB" | "NODE" | "SHELL" | "WORKER";
265
+ type ValueType = "number" | "string" | "array" | "boolean";
266
+ type TypeCompatibleWithC = number | string | any[] | boolean;
267
+
268
+ type WebAssemblyImports = Array<{
269
+ name: string;
270
+ kind: string;
271
+ }>;
272
+
273
+ type WebAssemblyExports = Array<{
274
+ module: string;
275
+ name: string;
276
+ kind: string;
277
+ }>;
278
+
279
+ interface CCallOpts {
280
+ async?: boolean;
281
+ }
282
+ // }
283
+
284
+ // declare namespace WebAssembly {
285
+ interface WebAssemblyModule {}
286
+ // }