@techstark/opencv-js 4.11.0-release.1 → 4.12.0-release.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -17
- package/dist/opencv.js +12 -11
- package/dist/src/types/opencv/Feature2D.d.ts +1 -1
- package/dist/src/types/opencv/Mat.d.ts +1 -1
- package/dist/src/types/opencv/ORB.d.ts +1 -1
- package/dist/src/types/opencv/QRCodeDetector.d.ts +76 -0
- package/dist/src/types/opencv/QRCodeDetector.js +3 -0
- package/dist/src/types/opencv/QRCodeDetector.js.map +1 -0
- package/dist/src/types/opencv/QRCodeDetectorAruco.d.ts +101 -0
- package/dist/src/types/opencv/QRCodeDetectorAruco.js +3 -0
- package/dist/src/types/opencv/QRCodeDetectorAruco.js.map +1 -0
- package/dist/src/types/opencv/_types.d.ts +1 -0
- package/dist/src/types/opencv/_types.js +1 -0
- package/dist/src/types/opencv/_types.js.map +1 -1
- package/dist/src/types/opencv/imgproc_colormap.d.ts +43 -0
- package/dist/src/types/opencv/imgproc_colormap.js +3 -0
- package/dist/src/types/opencv/imgproc_colormap.js.map +1 -0
- package/dist/src/types/opencv/imgproc_shape.d.ts +2 -2
- package/dist/src/types/opencv/objdetect.d.ts +2 -0
- package/dist/src/types/opencv/objdetect.js +6 -0
- package/dist/src/types/opencv/objdetect.js.map +1 -1
- package/package.json +1 -1
- package/src/types/opencv/Feature2D.ts +1 -1
- package/src/types/opencv/FlannBasedMatcher.ts +8 -1
- package/src/types/opencv/Mat.ts +1 -1
- package/src/types/opencv/ORB.ts +1 -1
- package/src/types/opencv/QRCodeDetector.ts +111 -0
- package/src/types/opencv/QRCodeDetectorAruco.ts +139 -0
- package/src/types/opencv/_types.ts +1 -0
- package/src/types/opencv/imgproc_colormap.ts +60 -0
- package/src/types/opencv/imgproc_shape.ts +3 -5
- package/src/types/opencv/objdetect.ts +6 -0
package/README.md
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
# opencv-js
|
|
2
2
|
|
|
3
|
-
OpenCV JavaScript version (NPM package) for node.js or browser. Get started guide [OpenCV.js Tutorials](https://docs.opencv.org/4.
|
|
3
|
+
OpenCV JavaScript version (NPM package) for node.js or browser. Get started guide [OpenCV.js Tutorials](https://docs.opencv.org/4.12.0/#:~:text=OpenCV%2DPython%20Tutorials-,OpenCV.js%20Tutorials,-Tutorials%20for%20contrib).
|
|
4
4
|
|
|
5
|
-
The file `opencv.js` was downloaded from https://docs.opencv.org/4.
|
|
5
|
+
The file `opencv.js` was downloaded from https://docs.opencv.org/4.12.0/opencv.js
|
|
6
6
|
|
|
7
7
|
TypeScript is supported (thanks to `mirada`).
|
|
8
8
|
|
|
9
9
|
# Basic Usage
|
|
10
10
|
|
|
11
|
-
## >=4.11
|
|
12
|
-
|
|
13
11
|
```js
|
|
14
|
-
import
|
|
12
|
+
import cvModule from "@techstark/opencv-js";
|
|
13
|
+
|
|
14
|
+
async function getOpenCv() {
|
|
15
|
+
let cv;
|
|
16
|
+
if (cvModule instanceof Promise) {
|
|
17
|
+
cv = await cvModule;
|
|
18
|
+
} else {
|
|
19
|
+
await new Promise((resolve) => {
|
|
20
|
+
cvModule.onRuntimeInitialized = () => resolve();
|
|
21
|
+
});
|
|
22
|
+
cv = cvModule;
|
|
23
|
+
}
|
|
24
|
+
return { cv };
|
|
25
|
+
}
|
|
15
26
|
|
|
16
27
|
async function main() {
|
|
17
|
-
const cv = await
|
|
28
|
+
const { cv } = await getOpenCv();
|
|
18
29
|
console.log("OpenCV.js is ready!");
|
|
19
30
|
// You can now use OpenCV functions here
|
|
20
31
|
console.log(cv.getBuildInformation());
|
|
21
32
|
}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## <=4.10
|
|
25
33
|
|
|
26
|
-
|
|
27
|
-
import cv from "@techstark/opencv-js";
|
|
28
|
-
|
|
29
|
-
cv.onRuntimeInitialized = () => {
|
|
30
|
-
console.log("OpenCV.js is ready!");
|
|
31
|
-
// You can now use OpenCV functions here
|
|
32
|
-
console.log(cv.getBuildInformation());
|
|
33
|
-
};
|
|
34
|
+
main();
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
# Code Examples
|