open-organism-observer/opencv-js-4.10.0
2025-01-16 03:28:15 +01:00
..
.github/workflows add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
dist add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
doc add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
src add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
test add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
.gitignore add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
.prettierrc.json add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
_config.yml add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
jest.config.js add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
LICENSE add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
opencv.ico add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
package-lock.json add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
package.json add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
README.md add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00
tsconfig.json add opencv for automated bacteria counting (hopefully - one day :)) 2025-01-16 03:28:15 +01:00

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

Live Demo

Using in react.js project

Using in Angular project

Real-time face detection

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 in tsconfig.json
  • 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.

Star History

Star History Chart