@techstark/opencv-js 4.8.0-release.8 → 4.9.0-release.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +9 -2
  2. package/dist/opencv.js +1 -1
  3. package/dist/src/types/opencv/BFMatcher.d.ts +2 -2
  4. package/dist/src/types/opencv/BFMatcher.js +1 -0
  5. package/dist/src/types/opencv/BFMatcher.js.map +1 -1
  6. package/dist/src/types/opencv/DescriptorMatcher.d.ts +2 -9
  7. package/dist/src/types/opencv/DescriptorMatcher.js +1 -0
  8. package/dist/src/types/opencv/DescriptorMatcher.js.map +1 -1
  9. package/dist/src/types/opencv/Feature2D.d.ts +1 -1
  10. package/dist/src/types/opencv/FlannBasedMatcher.d.ts +2 -2
  11. package/dist/src/types/opencv/FlannBasedMatcher.js +1 -0
  12. package/dist/src/types/opencv/FlannBasedMatcher.js.map +1 -1
  13. package/dist/src/types/opencv/Mat.d.ts +2 -2
  14. package/dist/src/types/opencv/Mat.js +1 -0
  15. package/dist/src/types/opencv/Mat.js.map +1 -1
  16. package/dist/src/types/opencv/ORB.d.ts +1 -1
  17. package/dist/src/types/opencv/Tracker.d.ts +2 -0
  18. package/dist/src/types/opencv/Tracker.js +3 -0
  19. package/dist/src/types/opencv/Tracker.js.map +1 -0
  20. package/dist/src/types/opencv/TrackerMIL.d.ts +3 -0
  21. package/dist/src/types/opencv/TrackerMIL.js +4 -0
  22. package/dist/src/types/opencv/TrackerMIL.js.map +1 -0
  23. package/dist/src/types/opencv/_hacks.d.ts +11 -8
  24. package/dist/src/types/opencv/_hacks.js +4 -9
  25. package/dist/src/types/opencv/_hacks.js.map +1 -1
  26. package/dist/src/types/opencv/_types.d.ts +2 -0
  27. package/dist/src/types/opencv/_types.js +2 -0
  28. package/dist/src/types/opencv/_types.js.map +1 -1
  29. package/dist/src/types/opencv/index.d.ts +2 -3
  30. package/dist/src/types/opencv/index.js +0 -1
  31. package/dist/src/types/opencv/index.js.map +1 -1
  32. package/package.json +8 -3
  33. package/src/types/opencv/BFMatcher.ts +2 -2
  34. package/src/types/opencv/DescriptorMatcher.ts +2 -10
  35. package/src/types/opencv/Feature2D.ts +1 -1
  36. package/src/types/opencv/FlannBasedMatcher.ts +2 -2
  37. package/src/types/opencv/Mat.ts +2 -1
  38. package/src/types/opencv/ORB.ts +1 -1
  39. package/src/types/opencv/Tracker.ts +1 -0
  40. package/src/types/opencv/TrackerMIL.ts +3 -0
  41. package/src/types/opencv/_hacks.ts +14 -15
  42. package/src/types/opencv/_types.ts +2 -0
  43. package/src/types/opencv/index.ts +3 -3
@@ -1,4 +1,4 @@
1
- import { bool, int, Ptr } from "./_types";
1
+ import { bool, DescriptorMatcher, int, Ptr } from "./_types";
2
2
  /**
3
3
  * For each descriptor in the first set, this matcher finds the closest descriptor in the second set by
4
4
  * trying each one. This descriptor matcher supports masking permissible matches of descriptor sets.
@@ -7,7 +7,7 @@ import { bool, int, Ptr } from "./_types";
7
7
  * [opencv2/features2d.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/features2d.hpp#L1140).
8
8
  *
9
9
  */
10
- export declare class BFMatcher {
10
+ export declare class BFMatcher extends DescriptorMatcher {
11
11
  constructor(normType?: int, crossCheck?: bool);
12
12
  /**
13
13
  * @param emptyTrainData If emptyTrainData is false, the method creates a deep copy of the object,
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _types_1 = require("./_types");
3
4
  //# sourceMappingURL=BFMatcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BFMatcher.js","sourceRoot":"","sources":["../../../../src/types/opencv/BFMatcher.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"BFMatcher.js","sourceRoot":"","sources":["../../../../src/types/opencv/BFMatcher.ts"],"names":[],"mappings":";;AAAA,qCAA6D"}
@@ -1,4 +1,4 @@
1
- import { bool, FileNode, FileStorage, float, InputArray, InputArrayOfArrays, int, Mat, Ptr } from "./_types";
1
+ import { Algorithm, bool, FileNode, FileStorage, float, InputArray, InputArrayOfArrays, int, Mat, Ptr } from "./_types";
2
2
  /**
3
3
  * It has two groups of match methods: for matching descriptors of an image with another image or with
4
4
  * an image set.
@@ -7,7 +7,7 @@ import { bool, FileNode, FileStorage, float, InputArray, InputArrayOfArrays, int
7
7
  * [opencv2/features2d.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/features2d.hpp#L860).
8
8
  *
9
9
  */
10
- export declare class DescriptorMatcher {
10
+ export declare class DescriptorMatcher extends Algorithm {
11
11
  /**
12
12
  * If the collection is not empty, the new descriptors are added to existing train descriptors.
13
13
  *
@@ -155,13 +155,6 @@ export declare class DescriptorMatcher {
155
155
  write(fileName: String): String;
156
156
  write(fs: FileStorage): FileStorage;
157
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
158
  }
166
159
  export declare const FLANNBASED: MatcherType;
167
160
  export declare const BRUTEFORCE: MatcherType;
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _types_1 = require("./_types");
3
4
  //# sourceMappingURL=DescriptorMatcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DescriptorMatcher.js","sourceRoot":"","sources":["../../../../src/types/opencv/DescriptorMatcher.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"DescriptorMatcher.js","sourceRoot":"","sources":["../../../../src/types/opencv/DescriptorMatcher.ts"],"names":[],"mappings":";;AAAA,qCAWkB"}
@@ -1,6 +1,6 @@
1
1
  import { Algorithm, KeyPointVector, Mat, OutputArray } from "./_types";
2
2
  /**
3
- * https://docs.opencv.org/4.8.0/d0/d13/classcv_1_1Feature2D.html
3
+ * https://docs.opencv.org/4.9.0/d0/d13/classcv_1_1Feature2D.html
4
4
  */
5
5
  export declare class Feature2D extends Algorithm {
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { bool, FileNode, FileStorage, InputArrayOfArrays, Ptr } from "./_types";
1
+ import { bool, DescriptorMatcher, FileNode, FileStorage, InputArrayOfArrays, Ptr } from "./_types";
2
2
  /**
3
3
  * This matcher trains [cv::flann::Index](#d1/db2/classcv_1_1flann_1_1Index}) on a train descriptor
4
4
  * collection and calls its nearest search methods to find the best matches. So, this matcher may be
@@ -11,7 +11,7 @@ import { bool, FileNode, FileStorage, InputArrayOfArrays, Ptr } from "./_types";
11
11
  * [opencv2/features2d.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/features2d.hpp#L1187).
12
12
  *
13
13
  */
14
- export declare class FlannBasedMatcher {
14
+ export declare class FlannBasedMatcher extends DescriptorMatcher {
15
15
  constructor(indexParams?: Ptr, searchParams?: Ptr);
16
16
  /**
17
17
  * If the collection is not empty, the new descriptors are added to existing train descriptors.
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _types_1 = require("./_types");
3
4
  //# sourceMappingURL=FlannBasedMatcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlannBasedMatcher.js","sourceRoot":"","sources":["../../../../src/types/opencv/FlannBasedMatcher.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"FlannBasedMatcher.js","sourceRoot":"","sources":["../../../../src/types/opencv/FlannBasedMatcher.ts"],"names":[],"mappings":";;AAAA,qCAAmG"}
@@ -1,4 +1,4 @@
1
- import { AccessFlag, bool, double, InputArray, int, MatAllocator, MatCommaInitializer_, MatConstIterator_, MatExpr, MatIterator_, MatSize, MatStep, Matx, OutputArray, Point, Point3_, Point_, Rect, Scalar, Size, size_t, typename, uchar, UMat, UMatData, UMatUsageFlags, Vec } from "./_types";
1
+ import { AccessFlag, bool, double, EmscriptenEmbindInstance, InputArray, int, MatAllocator, MatCommaInitializer_, MatConstIterator_, MatExpr, MatIterator_, MatSize, MatStep, Matx, OutputArray, Point, Point3_, Point_, Rect, Scalar, Size, size_t, typename, uchar, UMat, UMatData, UMatUsageFlags, Vec } from "./_types";
2
2
  /**
3
3
  * <a name="d3/d63/classcv_1_1Mat_1CVMat_Details"></a> The class [Mat](#d3/d63/classcv_1_1Mat})
4
4
  * represents an n-dimensional dense numerical single-channel or multi-channel array. It can be used to
@@ -218,7 +218,7 @@ import { AccessFlag, bool, double, InputArray, int, MatAllocator, MatCommaInitia
218
218
  * [opencv2/core/mat.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/core/mat.hpp#L2073).
219
219
  *
220
220
  */
221
- export declare class Mat {
221
+ export declare class Mat extends EmscriptenEmbindInstance {
222
222
  allocator: MatAllocator;
223
223
  cols: int;
224
224
  data: Uint8Array;
@@ -1,3 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _types_1 = require("./_types");
3
4
  //# sourceMappingURL=Mat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Mat.js","sourceRoot":"","sources":["../../../../src/types/opencv/Mat.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"Mat.js","sourceRoot":"","sources":["../../../../src/types/opencv/Mat.ts"],"names":[],"mappings":";;AAAA,qCA6BkB"}
@@ -1,6 +1,6 @@
1
1
  import { Feature2D, float, int } from "./_types";
2
2
  /**
3
- * https://docs.opencv.org/4.8.0/db/d95/classcv_1_1ORB.html
3
+ * https://docs.opencv.org/4.9.0/db/d95/classcv_1_1ORB.html
4
4
  */
5
5
  export declare class ORB extends Feature2D {
6
6
  constructor(nfeatures?: int, scaleFactor?: float, nlevels?: int, edgeThreshold?: int, firstLevel?: int, WTA_K?: int, scoreType?: ORBScoreType, patchSize?: int, fastThreshold?: int);
@@ -0,0 +1,2 @@
1
+ export declare class Tracker {
2
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Tracker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tracker.js","sourceRoot":"","sources":["../../../../src/types/opencv/Tracker.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { Tracker } from "./_types";
2
+ export declare class TrackerMIL extends Tracker {
3
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _types_1 = require("./_types");
4
+ //# sourceMappingURL=TrackerMIL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrackerMIL.js","sourceRoot":"","sources":["../../../../src/types/opencv/TrackerMIL.ts"],"names":[],"mappings":";;AAAA,qCAAmC"}
@@ -6,7 +6,12 @@ export declare class Range {
6
6
  export declare class Scalar extends Array<number> {
7
7
  static all(...v: number[]): Scalar;
8
8
  }
9
- export { Mat as InputArray, Mat as InputArrayOfArrays, Mat as InputOutputArray, Mat as InputOutputArrayOfArrays, Mat as OutputArray, Mat as OutputArrayOfArrays, } from "./Mat";
9
+ export { Mat as InputArray };
10
+ export { Mat as InputOutputArray };
11
+ export { Mat as OutputArray };
12
+ export { MatVector as InputArrayOfArrays };
13
+ export { MatVector as InputOutputArrayOfArrays };
14
+ export { MatVector as OutputArrayOfArrays };
10
15
  export { Scalar as GScalar };
11
16
  export { Point as Point2f };
12
17
  export { Point as KeyPoint };
@@ -97,11 +102,11 @@ export declare function getLiveInheritedInstances(...a: any[]): any;
97
102
  export declare function flushPendingDeletes(...a: any[]): any;
98
103
  export declare function setDelayFunction(...a: any[]): any;
99
104
  export declare class EmscriptenEmbindInstance {
100
- isAliasOf(...a: any[]): any;
101
- clone(...a: any[]): any;
102
- delete(...a: any[]): any;
103
- isDeleted(...a: any[]): any;
104
- deleteLater(...a: any[]): any;
105
+ isAliasOf(other: any): bool;
106
+ clone(): any;
107
+ delete(): any;
108
+ isDeleted(): boolean;
109
+ deleteLater(): any;
105
110
  }
106
111
  export declare class InternalError extends Error {
107
112
  }
@@ -112,7 +117,6 @@ export declare class UnboundTypeError extends Error {
112
117
  export declare class PureVirtualError extends Error {
113
118
  }
114
119
  export declare class Vector<T> extends EmscriptenEmbindInstance {
115
- delete(): void;
116
120
  get(i: number): T;
117
121
  get(i: number, j: number, data: any): T;
118
122
  set(i: number, t: T): void;
@@ -120,7 +124,6 @@ export declare class Vector<T> extends EmscriptenEmbindInstance {
120
124
  size(): number;
121
125
  push_back(n: T): any;
122
126
  resize(count: number, value?: T): void;
123
- delete(): void;
124
127
  }
125
128
  export declare class Vec3d extends Vector<any> {
126
129
  }
@@ -1,15 +1,10 @@
1
1
  "use strict";
2
2
  // Scalar, Point, Rect, etc are defined by opencv.js (helpers.js) and we need to declare them manually:
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Rect_ = exports.Size2l = exports.Size2f = exports.Size2d = exports.Point2d = exports.Point2l = exports.KeyPoint = exports.Point2f = exports.GScalar = exports.OutputArrayOfArrays = exports.OutputArray = exports.InputOutputArrayOfArrays = exports.InputOutputArray = exports.InputArrayOfArrays = exports.InputArray = void 0;
5
- // Hack: expose Mat super classes like Mat_, InputArray, Vector, OutputArray we make them alias of Mat to simplify and make it work
6
- var Mat_1 = require("./Mat");
7
- Object.defineProperty(exports, "InputArray", { enumerable: true, get: function () { return Mat_1.Mat; } });
8
- Object.defineProperty(exports, "InputArrayOfArrays", { enumerable: true, get: function () { return Mat_1.Mat; } });
9
- Object.defineProperty(exports, "InputOutputArray", { enumerable: true, get: function () { return Mat_1.Mat; } });
10
- Object.defineProperty(exports, "InputOutputArrayOfArrays", { enumerable: true, get: function () { return Mat_1.Mat; } });
11
- Object.defineProperty(exports, "OutputArray", { enumerable: true, get: function () { return Mat_1.Mat; } });
12
- Object.defineProperty(exports, "OutputArrayOfArrays", { enumerable: true, get: function () { return Mat_1.Mat; } });
4
+ exports.Rect_ = exports.Size2l = exports.Size2f = exports.Size2d = exports.Point2d = exports.Point2l = exports.KeyPoint = exports.Point2f = exports.GScalar = exports.OutputArrayOfArrays = exports.InputOutputArrayOfArrays = exports.InputArrayOfArrays = exports.OutputArray = exports.InputOutputArray = exports.InputArray = void 0;
13
5
  const _1 = require(".");
6
+ Object.defineProperty(exports, "InputArray", { enumerable: true, get: function () { return _1.Mat; } });
7
+ Object.defineProperty(exports, "InputOutputArray", { enumerable: true, get: function () { return _1.Mat; } });
8
+ Object.defineProperty(exports, "OutputArray", { enumerable: true, get: function () { return _1.Mat; } });
14
9
  require("../_cv");
15
10
  //# sourceMappingURL=_hacks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_hacks.js","sourceRoot":"","sources":["../../../../src/types/opencv/_hacks.ts"],"names":[],"mappings":";AAAA,uGAAuG;;;AAWvG,mIAAmI;AACnI,6BAOe;AANb,iGAAA,GAAG,OAAc;AACjB,yGAAA,GAAG,OAAsB;AACzB,uGAAA,GAAG,OAAoB;AACvB,+GAAA,GAAG,OAA4B;AAC/B,kGAAA,GAAG,OAAe;AAClB,0GAAA,GAAG,OAAuB;AAwE5B,wBAAsE;AACtE,kBAAgB"}
1
+ {"version":3,"file":"_hacks.js","sourceRoot":"","sources":["../../../../src/types/opencv/_hacks.ts"],"names":[],"mappings":";AAAA,uGAAuG;;;AAwFvG,wBAAsE;AA5EtD,2FA4Ee,MAAG,OA5ER;AACV,iGA2Ee,MAAG,OA3EF;AAChB,4FA0Ee,MAAG,OA1EP;AA2E3B,kBAAgB"}
@@ -42,3 +42,5 @@ export * from "./softdouble";
42
42
  export * from "./softfloat";
43
43
  export * from "./video_track";
44
44
  export * from "./_hacks";
45
+ export * from "./Tracker";
46
+ export * from "./TrackerMIL";
@@ -58,4 +58,6 @@ __exportStar(require("./softdouble"), exports);
58
58
  __exportStar(require("./softfloat"), exports);
59
59
  __exportStar(require("./video_track"), exports);
60
60
  __exportStar(require("./_hacks"), exports);
61
+ __exportStar(require("./Tracker"), exports);
62
+ __exportStar(require("./TrackerMIL"), exports);
61
63
  //# sourceMappingURL=_types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../src/types/opencv/_types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B;AAC7B,4CAA0B;AAC1B,sDAAoC;AACpC,+CAA6B;AAC7B,iDAA+B;AAC/B,uDAAqC;AACrC,+CAA6B;AAC7B,sDAAoC;AACpC,wCAAsB;AACtB,kDAAgC;AAChC,8CAA4B;AAC5B,8CAA4B;AAC5B,oDAAkC;AAClC,sDAAoC;AACpC,kDAAgC;AAChC,8DAA4C;AAC5C,iDAA+B;AAC/B,oDAAkC;AAClC,mDAAiC;AACjC,iDAA+B;AAC/B,iDAA+B;AAC/B,mDAAiC;AACjC,kDAAgC;AAChC,sDAAoC;AACpC,2CAAyB;AACzB,6CAA2B;AAC3B,wCAAsB;AACtB,4CAA0B;AAC1B,0CAAwB;AACxB,yCAAuB;AACvB,yCAAuB;AACvB,8CAA4B;AAC5B,wCAAsB;AACtB,wCAAsB;AACtB,kDAAgC;AAChC,gDAA8B;AAC9B,+CAA6B;AAC7B,8CAA4B;AAC5B,gDAA8B;AAC9B,2CAAyB"}
1
+ {"version":3,"file":"_types.js","sourceRoot":"","sources":["../../../../src/types/opencv/_types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B;AAC7B,4CAA0B;AAC1B,sDAAoC;AACpC,+CAA6B;AAC7B,iDAA+B;AAC/B,uDAAqC;AACrC,+CAA6B;AAC7B,sDAAoC;AACpC,wCAAsB;AACtB,kDAAgC;AAChC,8CAA4B;AAC5B,8CAA4B;AAC5B,oDAAkC;AAClC,sDAAoC;AACpC,kDAAgC;AAChC,8DAA4C;AAC5C,iDAA+B;AAC/B,oDAAkC;AAClC,mDAAiC;AACjC,iDAA+B;AAC/B,iDAA+B;AAC/B,mDAAiC;AACjC,kDAAgC;AAChC,sDAAoC;AACpC,2CAAyB;AACzB,6CAA2B;AAC3B,wCAAsB;AACtB,4CAA0B;AAC1B,0CAAwB;AACxB,yCAAuB;AACvB,yCAAuB;AACvB,8CAA4B;AAC5B,wCAAsB;AACtB,wCAAsB;AACtB,kDAAgC;AAChC,gDAA8B;AAC9B,+CAA6B;AAC7B,8CAA4B;AAC5B,gDAA8B;AAC9B,2CAAyB;AACzB,4CAA0B;AAC1B,+CAA6B"}
@@ -1,4 +1,3 @@
1
- import * as _CV from "./_types";
2
- export type CV = typeof _CV;
3
- export * from "./_hacks";
1
+ import * as _cv from "./_types";
2
+ export type CV = typeof _cv;
4
3
  export * from "./_types";
@@ -14,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./_hacks"), exports);
18
17
  __exportStar(require("./_types"), exports);
19
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/opencv/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,2CAAyB;AACzB,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/opencv/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,2CAAyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techstark/opencv-js",
3
- "version": "4.8.0-release.8",
3
+ "version": "4.9.0-release.1",
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",
@@ -11,7 +11,8 @@
11
11
  "scripts": {
12
12
  "build": "tsc",
13
13
  "prepack": "npm run build",
14
- "format": "prettier --write \"src/**/*.ts\""
14
+ "format": "prettier --write \"src/**/*.ts\"",
15
+ "test": "jest"
15
16
  },
16
17
  "repository": {
17
18
  "type": "git",
@@ -29,7 +30,11 @@
29
30
  },
30
31
  "homepage": "https://github.com/TechStark/opencv-js#readme",
31
32
  "devDependencies": {
33
+ "@types/jest": "^29.5.6",
34
+ "jest": "^29.7.0",
35
+ "jimp": "^0.22.10",
32
36
  "prettier": "^3.0.3",
37
+ "ts-jest": "^29.1.1",
33
38
  "typescript": "^5.1.6"
34
39
  }
35
- }
40
+ }
@@ -1,4 +1,4 @@
1
- import { bool, int, Ptr } from "./_types";
1
+ import { bool, DescriptorMatcher, int, Ptr } from "./_types";
2
2
 
3
3
  /**
4
4
  * For each descriptor in the first set, this matcher finds the closest descriptor in the second set by
@@ -8,7 +8,7 @@ import { bool, int, Ptr } from "./_types";
8
8
  * [opencv2/features2d.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/features2d.hpp#L1140).
9
9
  *
10
10
  */
11
- export declare class BFMatcher {
11
+ export declare class BFMatcher extends DescriptorMatcher {
12
12
  public constructor(normType?: int, crossCheck?: bool);
13
13
 
14
14
  /**
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Algorithm,
2
3
  bool,
3
4
  FileNode,
4
5
  FileStorage,
@@ -18,7 +19,7 @@ import {
18
19
  * [opencv2/features2d.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/features2d.hpp#L860).
19
20
  *
20
21
  */
21
- export declare class DescriptorMatcher {
22
+ export declare class DescriptorMatcher extends Algorithm {
22
23
  /**
23
24
  * If the collection is not empty, the new descriptors are added to existing train descriptors.
24
25
  *
@@ -218,15 +219,6 @@ export declare class DescriptorMatcher {
218
219
  public write(fs: FileStorage): FileStorage;
219
220
 
220
221
  public write(fs: Ptr, name?: String): Ptr;
221
-
222
- /**
223
- * @param descriptorMatcherType Descriptor matcher type. Now the following matcher types are
224
- * supported:
225
- * BruteForce (it uses L2 )BruteForce-L1BruteForce-HammingBruteForce-Hamming(2)FlannBased
226
- */
227
- public static create(descriptorMatcherType: String): Ptr;
228
-
229
- public static create(matcherType: any): Ptr;
230
222
  }
231
223
 
232
224
  export declare const FLANNBASED: MatcherType; // initializer: = 1
@@ -1,7 +1,7 @@
1
1
  import { Algorithm, KeyPointVector, Mat, OutputArray } from "./_types";
2
2
 
3
3
  /**
4
- * https://docs.opencv.org/4.8.0/d0/d13/classcv_1_1Feature2D.html
4
+ * https://docs.opencv.org/4.9.0/d0/d13/classcv_1_1Feature2D.html
5
5
  */
6
6
  export declare class Feature2D extends Algorithm {
7
7
  /**
@@ -1,4 +1,4 @@
1
- import { bool, FileNode, FileStorage, InputArrayOfArrays, Ptr } from "./_types";
1
+ import { bool, DescriptorMatcher, FileNode, FileStorage, InputArrayOfArrays, Ptr } from "./_types";
2
2
 
3
3
  /**
4
4
  * This matcher trains [cv::flann::Index](#d1/db2/classcv_1_1flann_1_1Index}) on a train descriptor
@@ -12,7 +12,7 @@ import { bool, FileNode, FileStorage, InputArrayOfArrays, Ptr } from "./_types";
12
12
  * [opencv2/features2d.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/features2d.hpp#L1187).
13
13
  *
14
14
  */
15
- export declare class FlannBasedMatcher {
15
+ export declare class FlannBasedMatcher extends DescriptorMatcher {
16
16
  public constructor(indexParams?: Ptr, searchParams?: Ptr);
17
17
 
18
18
  /**
@@ -2,6 +2,7 @@ import {
2
2
  AccessFlag,
3
3
  bool,
4
4
  double,
5
+ EmscriptenEmbindInstance,
5
6
  InputArray,
6
7
  int,
7
8
  MatAllocator,
@@ -247,7 +248,7 @@ import {
247
248
  * [opencv2/core/mat.hpp](https://github.com/opencv/opencv/tree/master/modules/core/include/opencv2/core/mat.hpp#L2073).
248
249
  *
249
250
  */
250
- export declare class Mat {
251
+ export declare class Mat extends EmscriptenEmbindInstance {
251
252
  public allocator: MatAllocator;
252
253
 
253
254
  public cols: int;
@@ -1,7 +1,7 @@
1
1
  import { Feature2D, float, int } from "./_types";
2
2
 
3
3
  /**
4
- * https://docs.opencv.org/4.8.0/db/d95/classcv_1_1ORB.html
4
+ * https://docs.opencv.org/4.9.0/db/d95/classcv_1_1ORB.html
5
5
  */
6
6
  export declare class ORB extends Feature2D {
7
7
  public constructor(
@@ -0,0 +1 @@
1
+ export declare class Tracker {}
@@ -0,0 +1,3 @@
1
+ import { Tracker } from "./_types";
2
+
3
+ export declare class TrackerMIL extends Tracker {}
@@ -10,14 +10,12 @@ export declare class Scalar extends Array<number> {
10
10
  public static all(...v: number[]): Scalar;
11
11
  }
12
12
  // Hack: expose Mat super classes like Mat_, InputArray, Vector, OutputArray we make them alias of Mat to simplify and make it work
13
- export {
14
- Mat as InputArray,
15
- Mat as InputArrayOfArrays,
16
- Mat as InputOutputArray,
17
- Mat as InputOutputArrayOfArrays,
18
- Mat as OutputArray,
19
- Mat as OutputArrayOfArrays,
20
- } from "./Mat";
13
+ export { Mat as InputArray };
14
+ export { Mat as InputOutputArray };
15
+ export { Mat as OutputArray };
16
+ export { MatVector as InputArrayOfArrays };
17
+ export { MatVector as InputOutputArrayOfArrays };
18
+ export { MatVector as OutputArrayOfArrays };
21
19
  export { Scalar as GScalar };
22
20
  export { Point as Point2f };
23
21
  export { Point as KeyPoint };
@@ -131,19 +129,21 @@ export declare function getInheritedInstanceCount(...a: any[]): any;
131
129
  export declare function getLiveInheritedInstances(...a: any[]): any;
132
130
  export declare function flushPendingDeletes(...a: any[]): any;
133
131
  export declare function setDelayFunction(...a: any[]): any;
132
+
134
133
  export declare class EmscriptenEmbindInstance {
135
- isAliasOf(...a: any[]): any;
136
- clone(...a: any[]): any;
137
- delete(...a: any[]): any;
138
- isDeleted(...a: any[]): any;
139
- deleteLater(...a: any[]): any;
134
+ isAliasOf(other: any): bool;
135
+ clone(): any;
136
+ delete(): any;
137
+ isDeleted(): boolean;
138
+ deleteLater(): any;
140
139
  }
140
+
141
141
  export declare class InternalError extends Error {}
142
142
  export declare class BindingError extends Error {}
143
143
  export declare class UnboundTypeError extends Error {}
144
144
  export declare class PureVirtualError extends Error {}
145
+
145
146
  export declare class Vector<T> extends EmscriptenEmbindInstance {
146
- delete(): void;
147
147
  get(i: number): T;
148
148
  get(i: number, j: number, data: any): T;
149
149
  set(i: number, t: T): void;
@@ -151,7 +151,6 @@ export declare class Vector<T> extends EmscriptenEmbindInstance {
151
151
  size(): number;
152
152
  push_back(n: T): any;
153
153
  resize(count: number, value?: T): void;
154
- delete(): void;
155
154
  }
156
155
 
157
156
  export declare class Vec3d extends Vector<any> {}
@@ -42,3 +42,5 @@ export * from "./softdouble";
42
42
  export * from "./softfloat";
43
43
  export * from "./video_track";
44
44
  export * from "./_hacks";
45
+ export * from "./Tracker";
46
+ export * from "./TrackerMIL";
@@ -1,4 +1,4 @@
1
- import * as _CV from "./_types";
2
- export type CV = typeof _CV;
3
- export * from "./_hacks";
1
+ import * as _cv from "./_types";
2
+ export type CV = typeof _cv;
3
+
4
4
  export * from "./_types";