@techstark/opencv-js 4.8.0-release.6 → 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 (198) hide show
  1. package/README.md +127 -0
  2. package/dist/src/index.d.ts +1 -0
  3. package/dist/src/index.js +18 -0
  4. package/dist/src/index.js.map +1 -0
  5. package/dist/src/types/_cv.d.ts +7 -0
  6. package/dist/src/types/_cv.js +3 -0
  7. package/dist/src/types/_cv.js.map +1 -0
  8. package/dist/src/types/emscripten.d.ts +166 -0
  9. package/dist/src/types/emscripten.js +4 -0
  10. package/dist/src/types/emscripten.js.map +1 -0
  11. package/dist/src/types/opencv/Affine3.d.ts +183 -0
  12. package/dist/src/types/opencv/Affine3.js +3 -0
  13. package/dist/src/types/opencv/Affine3.js.map +1 -0
  14. package/dist/src/types/opencv/Algorithm.d.ts +105 -0
  15. package/dist/src/types/opencv/Algorithm.js +4 -0
  16. package/dist/src/types/opencv/Algorithm.js.map +1 -0
  17. package/dist/src/types/opencv/AutoBuffer.d.ts +41 -0
  18. package/dist/src/types/opencv/AutoBuffer.js +3 -0
  19. package/dist/src/types/opencv/AutoBuffer.js.map +1 -0
  20. package/dist/src/types/opencv/BFMatcher.d.ts +33 -0
  21. package/dist/src/types/opencv/BFMatcher.js +3 -0
  22. package/dist/src/types/opencv/BFMatcher.js.map +1 -0
  23. package/dist/src/types/opencv/BOWTrainer.d.ts +36 -0
  24. package/dist/src/types/opencv/BOWTrainer.js +3 -0
  25. package/dist/src/types/opencv/BOWTrainer.js.map +1 -0
  26. package/dist/src/types/opencv/CascadeClassifier.d.ts +100 -0
  27. package/dist/src/types/opencv/CascadeClassifier.js +4 -0
  28. package/dist/src/types/opencv/CascadeClassifier.js.map +1 -0
  29. package/dist/src/types/opencv/DescriptorMatcher.d.ts +172 -0
  30. package/dist/src/types/opencv/DescriptorMatcher.js +3 -0
  31. package/dist/src/types/opencv/DescriptorMatcher.js.map +1 -0
  32. package/dist/src/types/opencv/DynamicBitset.d.ts +57 -0
  33. package/dist/src/types/opencv/DynamicBitset.js +3 -0
  34. package/dist/src/types/opencv/DynamicBitset.js.map +1 -0
  35. package/dist/src/types/opencv/Exception.d.ts +38 -0
  36. package/dist/src/types/opencv/Exception.js +3 -0
  37. package/dist/src/types/opencv/Exception.js.map +1 -0
  38. package/dist/src/types/opencv/Feature2D.d.ts +14 -0
  39. package/dist/src/types/opencv/Feature2D.js +4 -0
  40. package/dist/src/types/opencv/Feature2D.js.map +1 -0
  41. package/dist/src/types/opencv/FlannBasedMatcher.d.ts +41 -0
  42. package/dist/src/types/opencv/FlannBasedMatcher.js +3 -0
  43. package/dist/src/types/opencv/FlannBasedMatcher.js.map +1 -0
  44. package/dist/src/types/opencv/HOGDescriptor.d.ts +265 -0
  45. package/dist/src/types/opencv/HOGDescriptor.js +3 -0
  46. package/dist/src/types/opencv/HOGDescriptor.js.map +1 -0
  47. package/dist/src/types/opencv/Logger.d.ts +27 -0
  48. package/dist/src/types/opencv/Logger.js +3 -0
  49. package/dist/src/types/opencv/Logger.js.map +1 -0
  50. package/dist/src/types/opencv/LshTable.d.ts +67 -0
  51. package/dist/src/types/opencv/LshTable.js +3 -0
  52. package/dist/src/types/opencv/LshTable.js.map +1 -0
  53. package/dist/src/types/opencv/Mat.d.ts +1589 -0
  54. package/dist/src/types/opencv/Mat.js +3 -0
  55. package/dist/src/types/opencv/Mat.js.map +1 -0
  56. package/dist/src/types/opencv/MatExpr.d.ts +78 -0
  57. package/dist/src/types/opencv/MatExpr.js +4 -0
  58. package/dist/src/types/opencv/MatExpr.js.map +1 -0
  59. package/dist/src/types/opencv/MatOp.d.ts +29 -0
  60. package/dist/src/types/opencv/MatOp.js +3 -0
  61. package/dist/src/types/opencv/MatOp.js.map +1 -0
  62. package/dist/src/types/opencv/Matx.d.ts +84 -0
  63. package/dist/src/types/opencv/Matx.js +3 -0
  64. package/dist/src/types/opencv/Matx.js.map +1 -0
  65. package/dist/src/types/opencv/Node.d.ts +25 -0
  66. package/dist/src/types/opencv/Node.js +3 -0
  67. package/dist/src/types/opencv/Node.js.map +1 -0
  68. package/dist/src/types/opencv/ORB.d.ts +11 -0
  69. package/dist/src/types/opencv/ORB.js +4 -0
  70. package/dist/src/types/opencv/ORB.js.map +1 -0
  71. package/dist/src/types/opencv/PCA.d.ts +170 -0
  72. package/dist/src/types/opencv/PCA.js +3 -0
  73. package/dist/src/types/opencv/PCA.js.map +1 -0
  74. package/dist/src/types/opencv/RotatedRect.d.ts +63 -0
  75. package/dist/src/types/opencv/RotatedRect.js +3 -0
  76. package/dist/src/types/opencv/RotatedRect.js.map +1 -0
  77. package/dist/src/types/opencv/_hacks.d.ts +267 -0
  78. package/dist/src/types/opencv/_hacks.js +15 -0
  79. package/dist/src/types/opencv/_hacks.js.map +1 -0
  80. package/dist/src/types/opencv/_types.d.ts +44 -0
  81. package/dist/src/types/opencv/_types.js +61 -0
  82. package/dist/src/types/opencv/_types.js.map +1 -0
  83. package/dist/src/types/opencv/calib3d.d.ts +2180 -0
  84. package/dist/src/types/opencv/calib3d.js +3 -0
  85. package/dist/src/types/opencv/calib3d.js.map +1 -0
  86. package/dist/src/types/opencv/core_array.d.ts +2513 -0
  87. package/dist/src/types/opencv/core_array.js +3 -0
  88. package/dist/src/types/opencv/core_array.js.map +1 -0
  89. package/dist/src/types/opencv/core_cluster.d.ts +54 -0
  90. package/dist/src/types/opencv/core_cluster.js +3 -0
  91. package/dist/src/types/opencv/core_cluster.js.map +1 -0
  92. package/dist/src/types/opencv/core_hal_interface.d.ts +92 -0
  93. package/dist/src/types/opencv/core_hal_interface.js +3 -0
  94. package/dist/src/types/opencv/core_hal_interface.js.map +1 -0
  95. package/dist/src/types/opencv/core_utils.d.ts +510 -0
  96. package/dist/src/types/opencv/core_utils.js +3 -0
  97. package/dist/src/types/opencv/core_utils.js.map +1 -0
  98. package/dist/src/types/opencv/dnn.d.ts +336 -0
  99. package/dist/src/types/opencv/dnn.js +3 -0
  100. package/dist/src/types/opencv/dnn.js.map +1 -0
  101. package/dist/src/types/opencv/features2d_draw.d.ts +75 -0
  102. package/dist/src/types/opencv/features2d_draw.js +3 -0
  103. package/dist/src/types/opencv/features2d_draw.js.map +1 -0
  104. package/dist/src/types/opencv/imgproc_color_conversions.d.ts +299 -0
  105. package/dist/src/types/opencv/imgproc_color_conversions.js +3 -0
  106. package/dist/src/types/opencv/imgproc_color_conversions.js.map +1 -0
  107. package/dist/src/types/opencv/imgproc_draw.d.ts +502 -0
  108. package/dist/src/types/opencv/imgproc_draw.js +3 -0
  109. package/dist/src/types/opencv/imgproc_draw.js.map +1 -0
  110. package/dist/src/types/opencv/imgproc_feature.d.ts +533 -0
  111. package/dist/src/types/opencv/imgproc_feature.js +3 -0
  112. package/dist/src/types/opencv/imgproc_feature.js.map +1 -0
  113. package/dist/src/types/opencv/imgproc_filter.d.ts +689 -0
  114. package/dist/src/types/opencv/imgproc_filter.js +3 -0
  115. package/dist/src/types/opencv/imgproc_filter.js.map +1 -0
  116. package/dist/src/types/opencv/imgproc_hist.d.ts +291 -0
  117. package/dist/src/types/opencv/imgproc_hist.js +3 -0
  118. package/dist/src/types/opencv/imgproc_hist.js.map +1 -0
  119. package/dist/src/types/opencv/imgproc_misc.d.ts +473 -0
  120. package/dist/src/types/opencv/imgproc_misc.js +3 -0
  121. package/dist/src/types/opencv/imgproc_misc.js.map +1 -0
  122. package/dist/src/types/opencv/imgproc_object.d.ts +41 -0
  123. package/dist/src/types/opencv/imgproc_object.js +3 -0
  124. package/dist/src/types/opencv/imgproc_object.js.map +1 -0
  125. package/dist/src/types/opencv/imgproc_shape.d.ts +570 -0
  126. package/dist/src/types/opencv/imgproc_shape.js +3 -0
  127. package/dist/src/types/opencv/imgproc_shape.js.map +1 -0
  128. package/dist/src/types/opencv/imgproc_transform.d.ts +430 -0
  129. package/dist/src/types/opencv/imgproc_transform.js +3 -0
  130. package/dist/src/types/opencv/imgproc_transform.js.map +1 -0
  131. package/dist/src/types/opencv/index.d.ts +4 -0
  132. package/dist/src/types/opencv/index.js +19 -0
  133. package/dist/src/types/opencv/index.js.map +1 -0
  134. package/dist/src/types/opencv/objdetect.d.ts +43 -0
  135. package/dist/src/types/opencv/objdetect.js +3 -0
  136. package/dist/src/types/opencv/objdetect.js.map +1 -0
  137. package/dist/src/types/opencv/photo_inpaint.d.ts +25 -0
  138. package/dist/src/types/opencv/photo_inpaint.js +3 -0
  139. package/dist/src/types/opencv/photo_inpaint.js.map +1 -0
  140. package/dist/src/types/opencv/softdouble.d.ts +38 -0
  141. package/dist/src/types/opencv/softdouble.js +3 -0
  142. package/dist/src/types/opencv/softdouble.js.map +1 -0
  143. package/dist/src/types/opencv/softfloat.d.ts +38 -0
  144. package/dist/src/types/opencv/softfloat.js +3 -0
  145. package/dist/src/types/opencv/softfloat.js.map +1 -0
  146. package/dist/src/types/opencv/video_track.d.ts +276 -0
  147. package/dist/src/types/opencv/video_track.js +3 -0
  148. package/dist/src/types/opencv/video_track.js.map +1 -0
  149. package/package.json +5 -3
  150. package/src/index.ts +1 -0
  151. package/src/types/_cv.ts +6 -0
  152. package/src/types/emscripten.ts +286 -0
  153. package/src/types/opencv/Affine3.ts +206 -0
  154. package/src/types/opencv/Algorithm.ts +126 -0
  155. package/src/types/opencv/AutoBuffer.ts +50 -0
  156. package/src/types/opencv/BFMatcher.ts +37 -0
  157. package/src/types/opencv/BOWTrainer.ts +43 -0
  158. package/src/types/opencv/CascadeClassifier.ts +153 -0
  159. package/src/types/opencv/DescriptorMatcher.ts +244 -0
  160. package/src/types/opencv/DynamicBitset.ts +68 -0
  161. package/src/types/opencv/Exception.ts +54 -0
  162. package/src/types/opencv/Feature2D.ts +20 -0
  163. package/src/types/opencv/FlannBasedMatcher.ts +50 -0
  164. package/src/types/opencv/HOGDescriptor.ts +401 -0
  165. package/src/types/opencv/Logger.ts +34 -0
  166. package/src/types/opencv/LshTable.ts +81 -0
  167. package/src/types/opencv/Mat.ts +1764 -0
  168. package/src/types/opencv/MatExpr.ts +107 -0
  169. package/src/types/opencv/MatOp.ts +70 -0
  170. package/src/types/opencv/Matx.ts +228 -0
  171. package/src/types/opencv/Node.ts +33 -0
  172. package/src/types/opencv/ORB.ts +22 -0
  173. package/src/types/opencv/PCA.ts +204 -0
  174. package/src/types/opencv/RotatedRect.ts +72 -0
  175. package/src/types/opencv/_hacks.ts +322 -0
  176. package/src/types/opencv/_types.ts +44 -0
  177. package/src/types/opencv/calib3d.ts +2937 -0
  178. package/src/types/opencv/core_array.ts +3102 -0
  179. package/src/types/opencv/core_cluster.ts +81 -0
  180. package/src/types/opencv/core_hal_interface.ts +159 -0
  181. package/src/types/opencv/core_utils.ts +748 -0
  182. package/src/types/opencv/dnn.ts +505 -0
  183. package/src/types/opencv/features2d_draw.ts +114 -0
  184. package/src/types/opencv/imgproc_color_conversions.ts +527 -0
  185. package/src/types/opencv/imgproc_draw.ts +733 -0
  186. package/src/types/opencv/imgproc_feature.ts +681 -0
  187. package/src/types/opencv/imgproc_filter.ts +918 -0
  188. package/src/types/opencv/imgproc_hist.ts +399 -0
  189. package/src/types/opencv/imgproc_misc.ts +616 -0
  190. package/src/types/opencv/imgproc_object.ts +58 -0
  191. package/src/types/opencv/imgproc_shape.ts +734 -0
  192. package/src/types/opencv/imgproc_transform.ts +574 -0
  193. package/src/types/opencv/index.ts +4 -0
  194. package/src/types/opencv/objdetect.ts +103 -0
  195. package/src/types/opencv/photo_inpaint.ts +37 -0
  196. package/src/types/opencv/softdouble.ts +64 -0
  197. package/src/types/opencv/softfloat.ts +64 -0
  198. package/src/types/opencv/video_track.ts +372 -0
@@ -0,0 +1,105 @@
1
+ import { bool, EmscriptenEmbindInstance, FileNode, FileStorage, Ptr } from "./_types";
2
+ /**
3
+ * especially for classes of algorithms, for which there can be multiple implementations. The examples
4
+ * are stereo correspondence (for which there are algorithms like block matching, semi-global block
5
+ * matching, graph-cut etc.), background subtraction (which can be done using mixture-of-gaussians
6
+ * models, codebook-based algorithm etc.), optical flow (block matching, Lucas-Kanade, Horn-Schunck
7
+ * etc.).
8
+ *
9
+ * Here is example of [SimpleBlobDetector](#d0/d7a/classcv_1_1SimpleBlobDetector}) use in your
10
+ * application via [Algorithm](#d3/d46/classcv_1_1Algorithm}) interface:
11
+ *
12
+ * ```cpp
13
+ * Ptr<Feature2D> sbd = SimpleBlobDetector::create();
14
+ * FileStorage fs_read("SimpleBlobDetector_params.xml", FileStorage::READ);
15
+ *
16
+ * if (fs_read.isOpened()) // if we have file with parameters, read them
17
+ * {
18
+ * sbd->read(fs_read.root());
19
+ * fs_read.release();
20
+ * }
21
+ * else // else modify the parameters and store them; user can later edit the file to use different
22
+ * parameters
23
+ * {
24
+ * fs_read.release();
25
+ * FileStorage fs_write("SimpleBlobDetector_params.xml", FileStorage::WRITE);
26
+ * sbd->write(fs_write);
27
+ * fs_write.release();
28
+ * }
29
+ *
30
+ * Mat result, image = imread("../data/detect_blob.png", IMREAD_COLOR);
31
+ * vector<KeyPoint> keypoints;
32
+ * sbd->detect(image, keypoints, Mat());
33
+ *
34
+ * drawKeypoints(image, keypoints, result);
35
+ * for (vector<KeyPoint>::iterator k = keypoints.begin(); k != keypoints.end(); ++k)
36
+ * circle(result, k->pt, (int)k->size, Scalar(0, 0, 255), 2);
37
+ *
38
+ * imshow("result", result);
39
+ * waitKey(0);
40
+ * ```
41
+ *
42
+ * Source:
43
+ * [opencv2/core.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/core.hpp#L3077).
44
+ *
45
+ */
46
+ export declare class Algorithm extends EmscriptenEmbindInstance {
47
+ constructor();
48
+ clear(): void;
49
+ empty(): bool;
50
+ /**
51
+ * Returns the algorithm string identifier. This string is used as top level xml/yml node tag when
52
+ * the object is saved to a file or string.
53
+ */
54
+ getDefaultName(): String;
55
+ read(fn: FileNode): FileNode;
56
+ /**
57
+ * Saves the algorithm to a file. In order to make this method work, the derived class must implement
58
+ * Algorithm::write(FileStorage& fs).
59
+ */
60
+ save(filename: String): String;
61
+ write(fs: FileStorage): FileStorage;
62
+ write(fs: Ptr, name?: String): Ptr;
63
+ /**
64
+ * This is static template method of [Algorithm]. It's usage is following (in the case of SVM):
65
+ *
66
+ * ```cpp
67
+ * Ptr<SVM> svm = Algorithm::load<SVM>("my_svm_model.xml");
68
+ * ```
69
+ *
70
+ * In order to make this method work, the derived class must overwrite [Algorithm::read](const
71
+ * [FileNode]& fn).
72
+ *
73
+ * @param filename Name of the file to read.
74
+ *
75
+ * @param objname The optional name of the node to read (if empty, the first top-level node will be
76
+ * used)
77
+ */
78
+ static load(arg0: any, filename: String, objname?: String): Ptr;
79
+ /**
80
+ * This is static template method of [Algorithm]. It's usage is following (in the case of SVM):
81
+ *
82
+ * ```cpp
83
+ * Ptr<SVM> svm = Algorithm::loadFromString<SVM>(myStringModel);
84
+ * ```
85
+ *
86
+ * @param strModel The string variable containing the model you want to load.
87
+ *
88
+ * @param objname The optional name of the node to read (if empty, the first top-level node will be
89
+ * used)
90
+ */
91
+ static loadFromString(arg1: any, strModel: String, objname?: String): Ptr;
92
+ /**
93
+ * This is static template method of [Algorithm]. It's usage is following (in the case of SVM):
94
+ *
95
+ * ```cpp
96
+ * cv::FileStorage fsRead("example.xml", FileStorage::READ);
97
+ * Ptr<SVM> svm = Algorithm::read<SVM>(fsRead.root());
98
+ * ```
99
+ *
100
+ * In order to make this method work, the derived class must overwrite [Algorithm::read](const
101
+ * [FileNode]& fn) and also have static create() method without parameters (or with all the optional
102
+ * parameters)
103
+ */
104
+ static read(arg2: any, fn: FileNode): Ptr;
105
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _types_1 = require("./_types");
4
+ //# sourceMappingURL=Algorithm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Algorithm.js","sourceRoot":"","sources":["../../../../src/types/opencv/Algorithm.ts"],"names":[],"mappings":";;AAAA,qCAMkB"}
@@ -0,0 +1,41 @@
1
+ import { size_t } from "./_types";
2
+ /**
3
+ * The class is used for temporary buffers in functions and methods. If a temporary buffer is usually
4
+ * small (a few K's of memory), but its size depends on the parameters, it makes sense to create a
5
+ * small fixed-size array on stack and use it if it's large enough. If the required buffer size is
6
+ * larger than the fixed size, another buffer of sufficient size is allocated dynamically and released
7
+ * after the processing. Therefore, in typical cases, when the buffer size is small, there is no
8
+ * overhead associated with malloc()/free(). At the same time, there is no limit on the size of
9
+ * processed data.
10
+ *
11
+ * This is what [AutoBuffer](#d8/dd0/classcv_1_1AutoBuffer}) does. The template takes 2 parameters -
12
+ * type of the buffer elements and the number of stack-allocated elements. Here is how the class is
13
+ * used:
14
+ *
15
+ * ```cpp
16
+ * void my_func(const cv::Mat& m)
17
+ * {
18
+ * cv::AutoBuffer<float> buf(1000); // create automatic buffer containing 1000 floats
19
+ *
20
+ * buf.allocate(m.rows); // if m.rows <= 1000, the pre-allocated buffer is used,
21
+ * // otherwise the buffer of "m.rows" floats will be allocated
22
+ * // dynamically and deallocated in cv::AutoBuffer destructor
23
+ * ...
24
+ * }
25
+ * ```
26
+ *
27
+ * Source:
28
+ * [opencv2/core/utility.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/core/utility.hpp#L128).
29
+ *
30
+ */
31
+ export declare class AutoBuffer {
32
+ constructor();
33
+ constructor(_size: size_t);
34
+ constructor(buf: AutoBuffer);
35
+ allocate(_size: size_t): void;
36
+ data(): any;
37
+ data(): any;
38
+ deallocate(): void;
39
+ resize(_size: size_t): void;
40
+ size(): size_t;
41
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=AutoBuffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoBuffer.js","sourceRoot":"","sources":["../../../../src/types/opencv/AutoBuffer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ import { bool, int, Ptr } from "./_types";
2
+ /**
3
+ * For each descriptor in the first set, this matcher finds the closest descriptor in the second set by
4
+ * trying each one. This descriptor matcher supports masking permissible matches of descriptor sets.
5
+ *
6
+ * Source:
7
+ * [opencv2/features2d.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/features2d.hpp#L1140).
8
+ *
9
+ */
10
+ export declare class BFMatcher {
11
+ constructor(normType?: int, crossCheck?: bool);
12
+ /**
13
+ * @param emptyTrainData If emptyTrainData is false, the method creates a deep copy of the object,
14
+ * that is, copies both parameters and train data. If emptyTrainData is true, the method creates an
15
+ * object copy with the current parameters but with empty train data.
16
+ */
17
+ clone(emptyTrainData?: bool): Ptr;
18
+ isMaskSupported(): bool;
19
+ /**
20
+ * @param normType One of NORM_L1, NORM_L2, NORM_HAMMING, NORM_HAMMING2. L1 and L2 norms are
21
+ * preferable choices for SIFT and SURF descriptors, NORM_HAMMING should be used with ORB, BRISK and
22
+ * BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor
23
+ * description).
24
+ *
25
+ * @param crossCheck If it is false, this is will be default BFMatcher behaviour when it finds the k
26
+ * nearest neighbors for each query descriptor. If crossCheck==true, then the knnMatch() method with
27
+ * k=1 will only return pairs (i,j) such that for i-th query descriptor the j-th descriptor in the
28
+ * matcher's collection is the nearest and vice versa, i.e. the BFMatcher will only return consistent
29
+ * pairs. Such technique usually produces best results with minimal number of outliers when there are
30
+ * enough matches. This is alternative to the ratio test, used by D. Lowe in SIFT paper.
31
+ */
32
+ static create(normType?: int, crossCheck?: bool): Ptr;
33
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BFMatcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BFMatcher.js","sourceRoot":"","sources":["../../../../src/types/opencv/BFMatcher.ts"],"names":[],"mappings":""}
@@ -0,0 +1,36 @@
1
+ import { int, Mat } from "./_types";
2
+ /**
3
+ * For details, see, for example, *Visual Categorization with Bags of Keypoints* by Gabriella Csurka,
4
+ * Christopher R. Dance, Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. :
5
+ *
6
+ * Source:
7
+ * [opencv2/features2d.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/features2d.hpp#L1339).
8
+ *
9
+ */
10
+ export declare class BOWTrainer {
11
+ constructor();
12
+ /**
13
+ * The training set is clustered using clustermethod to construct the vocabulary.
14
+ *
15
+ * @param descriptors Descriptors to add to a training set. Each row of the descriptors matrix is a
16
+ * descriptor.
17
+ */
18
+ add(descriptors: Mat): Mat;
19
+ clear(): void;
20
+ /**
21
+ * This is an overloaded member function, provided for convenience. It differs from the above
22
+ * function only in what argument(s) it accepts.
23
+ */
24
+ cluster(): Mat;
25
+ /**
26
+ * The vocabulary consists of cluster centers. So, this method returns the vocabulary. In the first
27
+ * variant of the method, train descriptors stored in the object are clustered. In the second variant,
28
+ * input descriptors are clustered.
29
+ *
30
+ * @param descriptors Descriptors to cluster. Each row of the descriptors matrix is a descriptor.
31
+ * Descriptors are not added to the inner train descriptor set.
32
+ */
33
+ cluster(descriptors: Mat): Mat;
34
+ descriptorsCount(): int;
35
+ getDescriptors(): Mat;
36
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BOWTrainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BOWTrainer.js","sourceRoot":"","sources":["../../../../src/types/opencv/BOWTrainer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,100 @@
1
+ import { bool, double, FileNode, InputArray, int, Mat, Ptr, Size } from "./_types";
2
+ export declare class CascadeClassifier extends Mat {
3
+ cc: Ptr;
4
+ constructor();
5
+ /**
6
+ * @param filename Name of the file from which the classifier is loaded.
7
+ */
8
+ constructor(filename: String);
9
+ /**
10
+ * The function is parallelized with the TBB library.
11
+ *
12
+ * (Python) A face detection example using cascade classifiers can be found at
13
+ * opencv_source_code/samples/python/facedetect.py
14
+ *
15
+ * @param image Matrix of the type CV_8U containing an image where objects are detected.
16
+ *
17
+ * @param objects Vector of rectangles where each rectangle contains the detected object, the
18
+ * rectangles may be partially outside the original image.
19
+ *
20
+ * @param scaleFactor Parameter specifying how much the image size is reduced at each image scale.
21
+ *
22
+ * @param minNeighbors Parameter specifying how many neighbors each candidate rectangle should have
23
+ * to retain it.
24
+ *
25
+ * @param flags Parameter with the same meaning for an old cascade as in the function
26
+ * cvHaarDetectObjects. It is not used for a new cascade.
27
+ *
28
+ * @param minSize Minimum possible object size. Objects smaller than that are ignored.
29
+ *
30
+ * @param maxSize Maximum possible object size. Objects larger than that are ignored. If maxSize ==
31
+ * minSize model is evaluated on single scale.
32
+ */
33
+ detectMultiScale(image: InputArray, objects: any, scaleFactor?: double, minNeighbors?: int, flags?: int, minSize?: Size, maxSize?: Size): InputArray;
34
+ /**
35
+ * This is an overloaded member function, provided for convenience. It differs from the above
36
+ * function only in what argument(s) it accepts.
37
+ *
38
+ * @param image Matrix of the type CV_8U containing an image where objects are detected.
39
+ *
40
+ * @param objects Vector of rectangles where each rectangle contains the detected object, the
41
+ * rectangles may be partially outside the original image.
42
+ *
43
+ * @param numDetections Vector of detection numbers for the corresponding objects. An object's number
44
+ * of detections is the number of neighboring positively classified rectangles that were joined
45
+ * together to form the object.
46
+ *
47
+ * @param scaleFactor Parameter specifying how much the image size is reduced at each image scale.
48
+ *
49
+ * @param minNeighbors Parameter specifying how many neighbors each candidate rectangle should have
50
+ * to retain it.
51
+ *
52
+ * @param flags Parameter with the same meaning for an old cascade as in the function
53
+ * cvHaarDetectObjects. It is not used for a new cascade.
54
+ *
55
+ * @param minSize Minimum possible object size. Objects smaller than that are ignored.
56
+ *
57
+ * @param maxSize Maximum possible object size. Objects larger than that are ignored. If maxSize ==
58
+ * minSize model is evaluated on single scale.
59
+ */
60
+ detectMultiScale(image: InputArray, objects: any, numDetections: any, scaleFactor?: double, minNeighbors?: int, flags?: int, minSize?: Size, maxSize?: Size): InputArray;
61
+ /**
62
+ * This is an overloaded member function, provided for convenience. It differs from the above
63
+ * function only in what argument(s) it accepts. This function allows you to retrieve the final stage
64
+ * decision certainty of classification. For this, one needs to set `outputRejectLevels` on true and
65
+ * provide the `rejectLevels` and `levelWeights` parameter. For each resulting detection,
66
+ * `levelWeights` will then contain the certainty of classification at the final stage. This value can
67
+ * then be used to separate strong from weaker classifications.
68
+ *
69
+ * A code sample on how to use it efficiently can be found below:
70
+ *
71
+ * ```cpp
72
+ * Mat img;
73
+ * vector<double> weights;
74
+ * vector<int> levels;
75
+ * vector<Rect> detections;
76
+ * CascadeClassifier model("/path/to/your/model.xml");
77
+ * model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true);
78
+ * cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;
79
+ * ```
80
+ */
81
+ detectMultiScale(image: InputArray, objects: any, rejectLevels: any, levelWeights: any, scaleFactor?: double, minNeighbors?: int, flags?: int, minSize?: Size, maxSize?: Size, outputRejectLevels?: bool): InputArray;
82
+ empty(): bool;
83
+ getFeatureType(): int;
84
+ getMaskGenerator(): Ptr;
85
+ getOldCascade(): any;
86
+ getOriginalWindowSize(): Size;
87
+ isOldFormatCascade(): bool;
88
+ /**
89
+ * @param filename Name of the file from which the classifier is loaded. The file may contain an old
90
+ * HAAR classifier trained by the haartraining application or a new cascade classifier trained by the
91
+ * traincascade application.
92
+ */
93
+ load(filename: String): String;
94
+ /**
95
+ * The file may contain a new cascade classifier (trained traincascade application) only.
96
+ */
97
+ read(node: FileNode): FileNode;
98
+ setMaskGenerator(maskGenerator: Ptr): Ptr;
99
+ static convert(oldcascade: String, newcascade: String): String;
100
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _types_1 = require("./_types");
4
+ //# sourceMappingURL=CascadeClassifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CascadeClassifier.js","sourceRoot":"","sources":["../../../../src/types/opencv/CascadeClassifier.ts"],"names":[],"mappings":";;AAAA,qCASkB"}
@@ -0,0 +1,172 @@
1
+ import { bool, FileNode, FileStorage, float, InputArray, InputArrayOfArrays, int, Mat, Ptr } from "./_types";
2
+ /**
3
+ * It has two groups of match methods: for matching descriptors of an image with another image or with
4
+ * an image set.
5
+ *
6
+ * Source:
7
+ * [opencv2/features2d.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/features2d.hpp#L860).
8
+ *
9
+ */
10
+ export declare class DescriptorMatcher {
11
+ /**
12
+ * If the collection is not empty, the new descriptors are added to existing train descriptors.
13
+ *
14
+ * @param descriptors Descriptors to add. Each descriptors[i] is a set of descriptors from the same
15
+ * train image.
16
+ */
17
+ add(descriptors: InputArrayOfArrays): InputArrayOfArrays;
18
+ clear(): void;
19
+ /**
20
+ * @param emptyTrainData If emptyTrainData is false, the method creates a deep copy of the object,
21
+ * that is, copies both parameters and train data. If emptyTrainData is true, the method creates an
22
+ * object copy with the current parameters but with empty train data.
23
+ */
24
+ clone(emptyTrainData?: bool): Ptr;
25
+ empty(): bool;
26
+ getTrainDescriptors(): Mat;
27
+ isMaskSupported(): bool;
28
+ /**
29
+ * These extended variants of [DescriptorMatcher::match] methods find several best matches for each
30
+ * query descriptor. The matches are returned in the distance increasing order. See
31
+ * [DescriptorMatcher::match] for the details about query and train descriptors.
32
+ *
33
+ * @param queryDescriptors Query set of descriptors.
34
+ *
35
+ * @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
36
+ * collection stored in the class object.
37
+ *
38
+ * @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
39
+ *
40
+ * @param k Count of best matches found per each query descriptor or less if a query descriptor has
41
+ * less than k possible matches in total.
42
+ *
43
+ * @param mask Mask specifying permissible matches between an input query and train matrices of
44
+ * descriptors.
45
+ *
46
+ * @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
47
+ * false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the
48
+ * matches vector does not contain matches for fully masked-out query descriptors.
49
+ */
50
+ knnMatch(queryDescriptors: InputArray, trainDescriptors: InputArray, matches: any, k: int, mask?: InputArray, compactResult?: bool): InputArray;
51
+ /**
52
+ * This is an overloaded member function, provided for convenience. It differs from the above
53
+ * function only in what argument(s) it accepts.
54
+ *
55
+ * @param queryDescriptors Query set of descriptors.
56
+ *
57
+ * @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
58
+ *
59
+ * @param k Count of best matches found per each query descriptor or less if a query descriptor has
60
+ * less than k possible matches in total.
61
+ *
62
+ * @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
63
+ * descriptors and stored train descriptors from the i-th image trainDescCollection[i].
64
+ *
65
+ * @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
66
+ * false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the
67
+ * matches vector does not contain matches for fully masked-out query descriptors.
68
+ */
69
+ knnMatch(queryDescriptors: InputArray, matches: any, k: int, masks?: InputArrayOfArrays, compactResult?: bool): InputArray;
70
+ /**
71
+ * In the first variant of this method, the train descriptors are passed as an input argument. In the
72
+ * second variant of the method, train descriptors collection that was set by [DescriptorMatcher::add]
73
+ * is used. Optional mask (or masks) can be passed to specify which query and training descriptors can
74
+ * be matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if
75
+ * mask.at<uchar>(i,j) is non-zero.
76
+ *
77
+ * @param queryDescriptors Query set of descriptors.
78
+ *
79
+ * @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
80
+ * collection stored in the class object.
81
+ *
82
+ * @param matches Matches. If a query descriptor is masked out in mask , no match is added for this
83
+ * descriptor. So, matches size may be smaller than the query descriptors count.
84
+ *
85
+ * @param mask Mask specifying permissible matches between an input query and train matrices of
86
+ * descriptors.
87
+ */
88
+ match(queryDescriptors: InputArray, trainDescriptors: InputArray, matches: any, mask?: InputArray): InputArray;
89
+ /**
90
+ * This is an overloaded member function, provided for convenience. It differs from the above
91
+ * function only in what argument(s) it accepts.
92
+ *
93
+ * @param queryDescriptors Query set of descriptors.
94
+ *
95
+ * @param matches Matches. If a query descriptor is masked out in mask , no match is added for this
96
+ * descriptor. So, matches size may be smaller than the query descriptors count.
97
+ *
98
+ * @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
99
+ * descriptors and stored train descriptors from the i-th image trainDescCollection[i].
100
+ */
101
+ match(queryDescriptors: InputArray, matches: any, masks?: InputArrayOfArrays): InputArray;
102
+ /**
103
+ * For each query descriptor, the methods find such training descriptors that the distance between
104
+ * the query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches
105
+ * are returned in the distance increasing order.
106
+ *
107
+ * @param queryDescriptors Query set of descriptors.
108
+ *
109
+ * @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors
110
+ * collection stored in the class object.
111
+ *
112
+ * @param matches Found matches.
113
+ *
114
+ * @param maxDistance Threshold for the distance between matched descriptors. Distance means here
115
+ * metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in
116
+ * Pixels)!
117
+ *
118
+ * @param mask Mask specifying permissible matches between an input query and train matrices of
119
+ * descriptors.
120
+ *
121
+ * @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
122
+ * false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the
123
+ * matches vector does not contain matches for fully masked-out query descriptors.
124
+ */
125
+ radiusMatch(queryDescriptors: InputArray, trainDescriptors: InputArray, matches: any, maxDistance: float, mask?: InputArray, compactResult?: bool): InputArray;
126
+ /**
127
+ * This is an overloaded member function, provided for convenience. It differs from the above
128
+ * function only in what argument(s) it accepts.
129
+ *
130
+ * @param queryDescriptors Query set of descriptors.
131
+ *
132
+ * @param matches Found matches.
133
+ *
134
+ * @param maxDistance Threshold for the distance between matched descriptors. Distance means here
135
+ * metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in
136
+ * Pixels)!
137
+ *
138
+ * @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
139
+ * descriptors and stored train descriptors from the i-th image trainDescCollection[i].
140
+ *
141
+ * @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
142
+ * false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the
143
+ * matches vector does not contain matches for fully masked-out query descriptors.
144
+ */
145
+ radiusMatch(queryDescriptors: InputArray, matches: any, maxDistance: float, masks?: InputArrayOfArrays, compactResult?: bool): InputArray;
146
+ read(fileName: String): String;
147
+ read(fn: FileNode): FileNode;
148
+ /**
149
+ * Trains a descriptor matcher (for example, the flann index). In all methods to match, the method
150
+ * [train()] is run every time before matching. Some descriptor matchers (for example,
151
+ * BruteForceMatcher) have an empty implementation of this method. Other matchers really train their
152
+ * inner structures (for example, [FlannBasedMatcher] trains [flann::Index] ).
153
+ */
154
+ train(): void;
155
+ write(fileName: String): String;
156
+ write(fs: FileStorage): FileStorage;
157
+ write(fs: Ptr, name?: String): Ptr;
158
+ /**
159
+ * @param descriptorMatcherType Descriptor matcher type. Now the following matcher types are
160
+ * supported:
161
+ * BruteForce (it uses L2 )BruteForce-L1BruteForce-HammingBruteForce-Hamming(2)FlannBased
162
+ */
163
+ static create(descriptorMatcherType: String): Ptr;
164
+ static create(matcherType: any): Ptr;
165
+ }
166
+ export declare const FLANNBASED: MatcherType;
167
+ export declare const BRUTEFORCE: MatcherType;
168
+ export declare const BRUTEFORCE_L1: MatcherType;
169
+ export declare const BRUTEFORCE_HAMMING: MatcherType;
170
+ export declare const BRUTEFORCE_HAMMINGLUT: MatcherType;
171
+ export declare const BRUTEFORCE_SL2: MatcherType;
172
+ export type MatcherType = any;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DescriptorMatcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DescriptorMatcher.js","sourceRoot":"","sources":["../../../../src/types/opencv/DescriptorMatcher.ts"],"names":[],"mappings":""}
@@ -0,0 +1,57 @@
1
+ import { bool, size_t } from "./_types";
2
+ /**
3
+ * Class re-implementing the boost version of it This helps not depending on boost, it also does not do
4
+ * the bound checks and has a way to reset a block for speed
5
+ *
6
+ * Source:
7
+ * [opencv2/flann/dynamic_bitset.h](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/flann/dynamic_bitset.h#L150).
8
+ *
9
+ */
10
+ export declare class DynamicBitset {
11
+ /**
12
+ * default constructor
13
+ */
14
+ constructor();
15
+ /**
16
+ * only constructor we use in our code
17
+ *
18
+ * @param sz the size of the bitset (in bits)
19
+ */
20
+ constructor(sz: size_t);
21
+ /**
22
+ * Sets all the bits to 0
23
+ */
24
+ clear(): void;
25
+ /**
26
+ * true if the bitset is empty
27
+ */
28
+ empty(): bool;
29
+ /**
30
+ * set all the bits to 0
31
+ */
32
+ reset(): void;
33
+ reset(index: size_t): void;
34
+ reset_block(index: size_t): void;
35
+ /**
36
+ * resize the bitset so that it contains at least sz bits
37
+ */
38
+ resize(sz: size_t): void;
39
+ /**
40
+ * set a bit to true
41
+ *
42
+ * @param index the index of the bit to set to 1
43
+ */
44
+ set(index: size_t): void;
45
+ /**
46
+ * gives the number of contained bits
47
+ */
48
+ size(): size_t;
49
+ /**
50
+ * check if a bit is set
51
+ *
52
+ * true if the bit is set
53
+ *
54
+ * @param index the index of the bit to check
55
+ */
56
+ test(index: size_t): bool;
57
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DynamicBitset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DynamicBitset.js","sourceRoot":"","sources":["../../../../src/types/opencv/DynamicBitset.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ import { int } from "./_types";
2
+ /**
3
+ * This class encapsulates all or almost all necessary information about the error happened in the
4
+ * program. The exception is usually constructed and thrown implicitly via CV_Error and CV_Error_
5
+ * macros.
6
+ *
7
+ * [error](#db/de0/group__core__utils_1gacbd081fdb20423a63cf731569ba70b2b})
8
+ *
9
+ * Source:
10
+ * [opencv2/core.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/core.hpp#L135).
11
+ *
12
+ */
13
+ export declare class Exception {
14
+ /**
15
+ * CVStatus
16
+ *
17
+ */
18
+ code: int;
19
+ err: String;
20
+ file: String;
21
+ func: String;
22
+ line: int;
23
+ msg: String;
24
+ /**
25
+ * Default constructor
26
+ */
27
+ constructor();
28
+ /**
29
+ * Full constructor. Normally the constructor is not called explicitly. Instead, the macros
30
+ * [CV_Error()], [CV_Error_()] and [CV_Assert()] are used.
31
+ */
32
+ constructor(_code: int, _err: String, _func: String, _file: String, _line: int);
33
+ formatMessage(): void;
34
+ /**
35
+ * the error description and the context as a text string.
36
+ */
37
+ what(): any;
38
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../../src/types/opencv/Exception.ts"],"names":[],"mappings":""}