Socket
Book a DemoInstallSign in
Socket

@techstark/opencv-js

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@techstark/opencv-js

OpenCV JavaScript version for node.js or browser

4.11.0-release.1
latest
Source
npmnpm
Version published
Weekly downloads
18K
3.31%
Maintainers
1
Weekly downloads
 
Created
Source

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.11.0/opencv.js

TypeScript is supported (thanks to mirada).

Basic Usage

>=4.11

import cvReadyPromise from "@techstark/opencv-js";

async function main() {
  const cv = await cvReadyPromise;
  console.log("OpenCV.js is ready!");
  // You can now use OpenCV functions here
  console.log(cv.getBuildInformation());
}

<=4.10

import cv from "@techstark/opencv-js";

cv.onRuntimeInitialized = () => {
  console.log("OpenCV.js is ready!");
  // You can now use OpenCV functions here
  console.log(cv.getBuildInformation());
};

Code Examples

  • See code examples (React, Angular, Node.js) in opencv-js-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

Keywords

opencv

FAQs

Package last updated on 04 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.