@techstark/opencv-js
v4.10.0-release.1
Published
OpenCV JavaScript version for node.js or browser
Downloads
50,801
Maintainers
Readme
opencv-js
OpenCV JavaScript version (NPM package) for node.js or browser. Get started guide OpenCV.js Tutorials.
The file opencv.js
was downloaded from https://docs.opencv.org/4.10.0/opencv.js
TypeScript is supported (thanks to mirada
).
Code Examples
- See code examples (React, Angular) in opencv-js-examples
Live Demo
Using in react.js project
- See live demo and code here
- Get the test image from here Lenna.png
Using in Angular project
- See code here
Real-time face detection
How to Use
npm install @techstark/opencv-js
- or
yarn add @techstark/opencv-js
import cv from "@techstark/opencv-js"
- for TypeScript, set
"esModuleInterop": true
intsconfig.json
- for TypeScript, set
- or
import * as cv from "@techstark/opencv-js"
Webpack Configuration (for browser usage)
If you use this package for browsers, you need to set some polyfills. In the file "webpack.config.js", set
module.exports = {
resolve: {
modules: [...],
fallback: {
fs: false,
path: false,
crypto: false
}
}
};
What methods and properties are available
The TypeScript type declarations may not be up to date with the latest OpenCV.js. Refer to cvKeys.json to check the available methods and properties at runtime.